I wish to parse a PE file and read the Optional Headers from it, and some other data which enables me to know if it is a 32bit PE or a 64 bit. I know that imagehlp and dbghlp header files give me structures such as IMAGE_OPTIONAL_HEADER. But I am not sure how to parse my file to yield these. I can use the documentation and write my own parser using offsets, but if anyone knows the correct API to parse the PE?
My objective : 1) determine if the file is x64 or x86 executable. Probably in Header?? 2) Check for ASLR, DEP and SAFESEH. the first two I think will be in PE Optional Headers.
So is there any API to parse my PE and return me these structures?