mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-04-29 19:44:52 +02:00
validate nt-header signature
This commit is contained in:
parent
6fbc37630b
commit
47d48829a9
1 changed files with 6 additions and 1 deletions
|
@ -28,7 +28,12 @@ PIMAGE_NT_HEADERS pe_helpers::get_nt_header(HMODULE hModule)
|
|||
return nullptr;
|
||||
}
|
||||
LONG newExeHeaderOffset = dosHeader->e_lfanew;
|
||||
return (PIMAGE_NT_HEADERS)((char*)hModule + newExeHeaderOffset);
|
||||
PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)((char*)hModule + newExeHeaderOffset);
|
||||
if (!ntHeader || ntHeader->Signature != 0x00004550) { // "PE\0\0"
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ntHeader;
|
||||
}
|
||||
|
||||
PIMAGE_FILE_HEADER pe_helpers::get_file_header(HMODULE hModule)
|
||||
|
|
Loading…
Add table
Reference in a new issue