Right, I am talking about license validation code in a desktop application, e.g. a method bool ValidateLicense(string licenseCode)
. Of course, any protection scheme can be reverse engineered by a skilled and determined cracker. However, I'd like to prevent that anyone with some basic programming knowledge can use Reflector to build a keygen in a couple of minutes.
Possible approaches
Obfuscate. My understanding is that obfuscating causes a performance overhead and may hinder (legitimate) debugging. So are there tools that allow obfuscating only selected methods?
Move method to ngen'ed assembly or unmanaged DLL. But isn't this an invitation to simply replace the DLL? Any ideas how to prevent this (read: make it a bit harder for an attacker)?
Other?
PS: Question is obviously related to Protect .NET code from reverse engineering? trying to put thoughts from there to practice
UPDATE
To 1. A first obfuscation step would surely be to rename the validation method. (Thanks, Jonathan)
To 2. Assuming the application uses Win32 API methods one could re-route the calls through an unmanaged DLL thereby making it an integral part of the application. Fiddling with the method signatures (e.g. change name, swap parameters) would make this less obvious. Do you think the innate drawbacks are justified?
To 3. Don't distribute validation method belongs here. Keep it on your server and call remotely, i.e. use online validation (Thanks, David Hedlund)