Exe checksum after every recompilation

So, I am trying to figure out how to get my exe to have the same hash / checksum when it is recompiled. I use FastSum to create a checksum. Currently, no code changes are made, I just rebuild the project in VS, and the checksum is different. The code is written in C ++.

I am not familiar with the use of hash codes and / or checksums in this way, but I did some research and read something about the need for a consistent GUID. But I have no idea how this relates to the checksum generation program ...

OK, I will leave it, thanks in advance.

+2
source share
3 answers

Have you learned the differences between exes? I suspect that the compiler / linker inserts a date or time into the binary, and as a result, each binary will be different from the other. Or it can be worse, sometimes compilers / linkers create static tables in their own system memory and then copy them to a binary file, say that you have 9 bytes of something and for alignment that the compiler decides to use 12 bytes in binary format, I saw compilers / linkers take all 3 bytes to the system memory of this computer and copy them to a file. Ideally, you would like the tools to reset the memory they use for such a thing to get duplicate results.

, , .

+3

, , EXE , exe, , .

0

? GUID, , , .

, "link/dump/all [filename]" "link/dump/disasm [filename]". /all , ascii, /disasm , , , .

0

Source: https://habr.com/ru/post/1540027/


All Articles