问题
I want to add a variable length userdata to my exe. For example I don't want to change the build version everytime i hand a quick test for someone to look at. I'd like to add the git/mercurial branch info and maybe build options if i don't have build options stored/available in the exe. This way i can put the exe in a util and get data i need.
Would adding extra data to the end of an exe be ok? It would be a windows C++ exe build with visual studios or gcc or it may be a .NET application
回答1:
Some virus checkers will probably trigger on this sort of thing (either on your own machine if you have one, or possibly on the target machine).
Another approach is to keep a (manual or automatic) log of the SHA1 of executables that you send people. Then, you can see what exact version somebody is running by calculating the SHA1 of their executable and comparing it to the entries in your log.
来源:https://stackoverflow.com/questions/11977518/is-it-safe-to-add-extra-data-to-end-of-exe