The MASM Forum

General => The Campus => Topic started by: Zen on April 29, 2015, 08:52:55 AM

Title: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: Zen on April 29, 2015, 08:52:55 AM
I'm writing an experimental MASM32 application, and I'm wondering if you can reliably determine what compiler was used to compile a Portable Executable EXE or DLL. I've never seen a field like this in the PE headers.
I can't even imagine how this might be done,...
The most informative reference I've found is this from StackOverFlow: Determining Which Compiler Built a Win32 PE (http://stackoverflow.com/questions/764329/determining-which-compiler-built-a-win32-pe)

Google search: Signatures are used to determine the compiler used for the executable
https://www.google.com/?gws_rd=ssl#q=Signatures+are+used+to+determine+the+compiler+used+for+the+executable (https://www.google.com/?gws_rd=ssl#q=Signatures+are+used+to+determine+the+compiler+used+for+the+executable)
Title: Re: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: TWell on April 29, 2015, 09:06:52 AM
Check PEID application.
Title: Re: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: Zen on April 29, 2015, 09:15:37 AM
TWELL,
Thanks,...I'd never heard of PEID so I googled it. Lots of info,...
The reason I asked is that I'd like to be able to do it programmatically,...if it doesn't require an IQ greater than Spock's,...
Title: Re: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: hutch-- on April 29, 2015, 10:22:14 AM
There is no really reliable way of doing this. Some specialised tools can try and match binary characteristics to certain compilers but the 32 bit portable executable standard does not have a field to specify which compiler was used.
Title: Re: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: dedndave on April 29, 2015, 09:44:40 PM
many compilers place strings in the .CONST section that identify them
but - assemblers/linkers don't normally do that   :P
Title: Re: Can You Determine the Compiler Type by Examining PE File Headers ?
Post by: Zen on April 30, 2015, 03:26:24 AM
Quote from: HUTCHThere is no really reliable way of doing this. Some specialised tools can try and match binary characteristics to certain compilers but the 32 bit portable executable standard does not have a field to specify which compiler was used.
...Thanks, HUTCH,...that's kinda what I thought,...