Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same simple source code, different binaries on Windows

I have a question about the source-code binary on Windows.

#include <stdio.h>

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

    return 0;
}

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

cl new.cpp

Can you guys tell me why, and how to avoid that?

like image 654
Peter Lee Avatar asked Jul 08 '10 16:07

Peter Lee


2 Answers

The timestamp is part of PE format. You'll always get different values regardless if compiling as release or not.

like image 180
josuegomes Avatar answered Sep 17 '22 01:09

josuegomes


Did you compile as release? Debug has timestamps built in which can change your exe per compile

like image 39
Michael Dorgan Avatar answered Sep 19 '22 01:09

Michael Dorgan