Same simple source code, different binaries in Windows

I have a question about binary source code on Windows.

#include <stdio.h>

int main()
{
    printf("Hello, world!\n");

    return 0;
}

The same source code that I compiled twice on Windows (VS 2008 Cmmand Prompt: "CL"), but I have different binaries.

cl new.cpp

Can you guys tell me why and how to avoid this?

+5
source share
3 answers

The timestamp is part of the PE format. You will always get different values, whether it compiles as a release or not.

+4
source

Have you compiled as a release? Debug has built-in timestamps that your exe can modify to compile

+1

googled :

DUMPBIN  /RAWDATA  MyApp.EXE > first.txt
DUMPBIN  /RAWDATA  MyApp.EXE > second.txt

http://support.microsoft.com/kb/164151 How to compare binary images of the same project projects

+1
source

All Articles