Let me explain what I'm trying to accomplish. I want to know from inside my Windows executable file if it was tampered with after it was built. For that I decided to calculate the CRC value on its own file from within and compare it with a predefined value. But what I'm encountering is that once the executable is built the CRC remains the same, but only until I re-build it again (without any changes done to the source code). That's when the CRC changes. What is the magic here? Does the compiler add some arbitrary bytes to the exe file?
PS. I'm using Microsoft Visual Studio C++ 2008 and run my tests on Windows 7 Ultimate.