December 2nd, 2009, 12:41 PM
COFF and ELF
I am trying to get info out of the .exe or the .obj files that I am not sure is actually in the output file produced by dumpBin. I am looking at .exe and .obj files produced by Microsoft C++ right now to try to get familiar with COFF, but here is what I really need: I am going to get an .exe or .obj from another group, and those files are being created by the Greenhills Multi C compiler. I'm still trying to find out exactly what it's going to give me, I believe its default format is ELF, but there is an ELF-to-COFF utility (still investigating that). So, I will be using Microsoft Visual Studio 2008 -- either C++ or C# to write a program that extracts "symbols" out of the Greenhills' ELF or COFF file. Maybe I'm not using the right terminology when I say "symbols", because I am not interested in seeing functions, what I need to pull out is actually types. For example, if the user in the Greenhills code has defined a type:
typedef struct my_own_type
I need to yank that info out of COFF file. I need to parse the file to determine if this thing is a typedef, then I will need to collect information about it. I need to be able to collect information about this type, so when I later see an object declared of this type, I will be able to relate it to this type, and know what that object's makeup is.
Another way to do this would be to parse all the header files and implementation files to do this same thing, but that seems like it would be more tedious.
Perhaps there is a commercially available tool that already does this?
Thanks to anyone who can shed some light on this.
December 3rd, 2009, 02:47 PM
Re: COFF and ELF
I don't believe that is possible. All "type" information is usually optimized away. Actually, I take that back, if there is some kind of RTTI (Run-Time Type Information) available you might be able to do this, however I'm not familiar with the Greenhills Multi C compiler.
December 3rd, 2009, 03:41 PM
Re: COFF and ELF
Thank you Mr. Viggy ... I'll continue to search for a solution.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.