Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine which compiler has been used to compile an executable?

From a compiled file, can I see which compiler has been used to generate the file?

like image 986
monkeyking Avatar asked Dec 29 '10 13:12

monkeyking


People also ask

How do I find the compiler of a .EXE file?

If you can find a way to examine the first dozen or so bytes of the EXE file, in a hex dump with corresponding ASCII characters displayed, they will usually indicate the compiler used.

How do I know what compiler I have?

Open command prompt (Type “cmd” in search box). 8. Type “gcc –version” in command prompt to check whether C compiler is installed in your machine. Type “g++ –version” in command prompt to check whether C++ compiler is installed in your machine.

How do I find gcc version so?

Use objdump and add --section to specify section name. For example, if your compiled a program named foo in the source dir, you can run the following commands to get GCC's version info: $ objdump -s --section . comment foo sizeof: file format elf32-i386 Contents of section .

Does a compiler make an executable file?

The compiler (or more specifically, the linker) creates the executable. The format of the file generally vary depending on the operating system.


1 Answers

There's also the good old 'strings' utility. Dumps all ascii-ish looking strings it finds in the binary. Different compilers embed different amounts of information in the binaries they produce, but many will actually include obviously identifying strings.

like image 171
JustJeff Avatar answered Sep 21 '22 17:09

JustJeff