I have read the PE and COFF specification, Matt Pietrek's "Peering Inside the PE: A Tour of the Win32 Portable Executable File Format" and "An In-Depth Look into the Win32 Portable Executable File Format" and also several other sources about the subject.
I was able to read out the COFF section table and also the COFF symbol table from an object file generated by MinGW GCC 4.7 (I was compiling a static library in debug mode).
My ultimate goal is to access all functions defined in a given object file (COFF) and read out all bytes that make up their machine code.
Question 1: How do I calculate the start address of a single function inside the COFF file? I presume I have to somehow use the symbol record's "Value" field as an offset into the section specified by "SectionNumber".
Question 2: How do I find out the length of any given function (how many bytes I would have to read)?
Question 3: According to Microsoft's PE & COFF specification there should be an auxiliary symbol table record after each symbol record that defines a function. Why is it that in my object file (extracted from an .a file which was compiled in debug mode) of three defined functions only one has such an auxiliary record? And that is also completely filled with zeroes?