Question

Yes,I was wondering what information does the program contain regarding the compiler that compiled it. Information like compiler name,version.This is usually mentioned in about box of help(program like Vlc) menu,but my question is does compiler write any thing to .exe.

The reason i am asking this is to get information regarding the compiler by disassembling the program in any disassembler(IDA,OLLY).

Était-ce utile?

La solution

Since you specifically mentioned VLC, the player is doing it in the following way: In line 50935 (at least on my VLC source package, which is 2.1.4) in the configure script there is the following statement:

cat >>confdefs.h <<_ACEOF
#define VLC_COMPILER "`$CC -v 2>&1 | tail -n 1 | sed -e 's/ *$//'`"
_ACEOF

which as you can see updates the confdefs.h file with the version of the compiler. Indeed, if you execute the statement:

$ gcc -v 2>&1 | tail -n 1 | sed -e 's/ *$//'
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)

later this confdefs.h is "injected" in config.h and the line there will be 683 (for me and my compilation only, this might be different for you but you need to look after VLC_COMPILER)

/* compiler */
#define VLC_COMPILER "gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)"

And when VLC wants to print out the compiler it simply prints this string (in version.c there is the VLC_Compiler() method defined which returns this.

And to finally answer your question: I sort of remember that some (older) versions of Borland compilers (Turbo C) injected a copyright information, however I did not experience this in any recent compilers, however this does not mean that they do not. This is compiler specific, and there is nothing that makes them or stops them doing this. In the worst case you always can look at the binary via a (hex) viewer to see anything funny...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top