I was just using genpeimg code to try to investigte the .idata section
(for investigating https://github.com/msys2/MINGW-packages/issues/9363),
and I noticed

https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-tools/genpeimg/src/img_pe.c#l136
> pe->section_list_sz = ((size_t) pe->pe_filehdr.numsecs) * (4 * 9);

and
https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-tools/genpeimg/src/img.h#l69
> size_t section_list_sz; /* Each section entry has 36 bytes size.  */

This does not agree with
https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers
which says:
> Each section header (section table entry) has the following format, for
> a total of 40 bytes per entry.

Trying to walk through the section table, it is in fact 40 bytes, not 36,
per entry.  They consist of 7 x 4 byte entries, 2 x 2 byte entries, and 1
x 8 byte entries (not sure where 4 * 9 came from).


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to