so I am currently attempting to locally map my suspended thread when I pop my program into CFF explorer it says that the value of PIMAGE_NT_HEADERS is 00004550:
however while attempting to map it by myself my value comes out to be 00400080:
typedef struct pe {
PIMAGE_DOS_HEADER peDH;
PIMAGE_NT_HEADERS peNH;
} pe;
PE.peDH = (PIMAGE_DOS_HEADER)imgBase;
PE.peNH = (PIMAGE_NT_HEADERS)((u_char*)PE.peDH + PE.peDH->e_lfanew);
printf("[?] - NT Headers section is located at: 0x%x\n", PE.peNH);
No, it doesn't. Look at it again more carefully. It actually says the
Signature
field of theIMAGE_NT_HEADERS
struct is00004550
. But you are not printing theSignature
, you are printing thePIMAGE_NT_HEADERS
pointer itself. Not the same thing.Change your print to this instead: