Object-oriented PE file parser.
Heavily inspired and based off the amazing work by mrd0x and NUL0x4C.
Coming from a background in OOP as well as low-level, I thought that the Pe Parsing could be a great C "class".
See the provided main.c in the project for a typical use case.
Copy PeParser.c and PeParser.h in your project.
You can also use the provided .sln to see an example.
See HOWTO below for typical uses.
T_PE_PARSER PeParser;
PeParserInitialize(&PeParser);
PeParserLoadFile(&PeParser, sFileName); // where sFileName is your targeted PE file name (with full path)
PeParserPrintAll(&PeParser); // To print all headers / sections / directories
PeParserUnloadFile(&PeParser);
PeParserClean(&PeParser);
T_PE_PARSER PeParser;
PeParserInitialize(&PeParser);
PeParserLoadModule(&PeParser, hModule); // where hModule is your targeted PE module pre-loaded handle
PeParserPrintFileHeader(&PeParser); // To print file header
PeParserPrintSections(&PeParser); // To print pe sections
PeParserUnloadModule(&PeParser);
PeParserClean(&PeParser);