Embed identifier into executable for download
Is it possible to automatically "embed" a unique identifier into a executable and read it ? And how to do it ?
For example, John log into my site, and press "Download my software", it will receive a speciali开发者_JS百科zed crafted executable with his info. Is it possible ? And how to accomplish ?
Sure it's possible, just create a const string in your source code
const char* UniqueID = "HEYHEREISTHEKEY";
Then open up the exe as a binary file and replace the known value with the info. However, I doubt that this will help you accomplish something useful, especially if your goal is to prevent piracy. What is your scenario where you want to do this?
Yes. It of course depends on how your executable is built. Let's assume a Windows PE executable. It has a resource section, which can be updated fairly easily (doesn't require reompile). One of the possible resource types is a string table. That means you can change any string fairly easily. From within the executable, you can access this table via LoadString
精彩评论