I'm afraid I don't understand.
The exe should not change as you run it, so the hash is going to remain the same. So this:
So the goal was to write a program where a MD5 hash was taken from the .exe (of that .cpp file) was taken at the beginning of runtime, and then again at the end, and compared |
Those two hashes will always be identical, because running an exe does not modify its binary (assuming you are hashing the binary).
Going in and manually modifying the binary by adding newlines or 00's to the end of it or whatever just to get a different hash is completely pointless.
Furthermore, the hash of an exe has absolutely nothing to do with whether or not the code you wrote is polymorphic.
And lastly, compilers tend to watermark generated exes, so even if you change
absolutely nothing in the source between two separate builds, it's very possible that the two generated exes will have different hashes.