
Notice that it encrypts only the code, if you want to encrypt the data too you should change the range of encryption (be careful don't replace the checksum and related structures). Notice that the MSB of the checksum field determines if a module has been encrypted.Īfter encryption none cracker can restore code without the license file, because all data is encrypted.

Checksum is calculated by the original module data. I decide to choose the VBHeader.pProjectInfo->dwNull field to store the checksum. The checksum is saved to unused field in the VB-project structure. The encryption procedure just XORs the encryption region with the license data (circularly) and saves data to file. If you passed the valid key file the main function checks if a module has already been encrypted, if that is not so it tries to encrypt the module. Obfuscate the validation so it's not a single line that's easily jumped over in assembler, and cracking is already difficult enough you'd have to be fairly high volume in sales to attract the small set of people who'd be able to crack it. Personally I don't think anything more than a well-implemented serial number system is worthwhile in almost all circumstances. so only a small percent of programmers even have the skills to make a crack. When using ollydbg and similar tools, you can only see the code as assembly instructions.

You don't want the pirated edition to be a better experience. Offline-only solutions are just an arms race, and by the time you get to where cracks take weeks or months, you're going to be breaking things on legit users' systems. Lots of games are doing this, and it's aweful to find your purchased software no longer works because the company folded or didn't want to pay for a server to run anymore when the app should be entirely local. Personally I think it's unethical to do because apart from not being able to use it when you're not connected, once those servers are taken offline you're basically stealing back something you sold people. But adding an online-only requirement infuriates the geeks, who make the recommendations to the masses. There's really no good solution besides having some of the code run on a server.
