Why does someone want to save something inside an executable file. If you plan to sign the executable file for the distribution, changing the executable file would somehow violate the signing and saving something in the binary file to the executable file, this will not prevent someone from extracting the value from the executable file.
The best you can do is save the serial number in a file, registry, or other place, and then encrypt it so that it cannot be changed without breaking it. I use the library that comes with the Licensed Safe from a fairly new company called SpearmanTech. You can use your library to store encrypted values ββin the .NET machine.config file in encrypted form, so it cannot be faked. This way you can extract information from the .config file at application startup.
You are writing a .NET application in C ++ or native C ++, and in any case, you must be able to communicate with the .NET platform for this solution to work.
I would look at their product at http://www.spearmantech.com . Hope this works for you.
Csharprules
source share