2

I have something like this in my code that checks for user's license:

// C# code:

#if DEBUG
    MakeLicenseValidForever();
#else
    CheckLicense();
#endif

Now, I need to know if these directives get saved in my released binary or not. If they do get saved, then a user can make #if DEBUG return true and bypass the checks. I need to know if #if DEBUG is safe.

1 Answer 1

2

best to put the code inside the MakeLicenseValidForever into #if DEBUG,too. those #if things get processed at compile time and only the code of the taken path exists. Functions don't get stripped if not referenced thats why its best to empty out the function that should not exist in the release binary. They are similar to the C #ifdefs for preprocessor based stripping

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.