make sure the PE is 32-bit and not 64-bit (PE32+)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4873 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-01-24 11:37:18 +00:00
parent 344f759bd5
commit 3e66b3771a

View file

@ -50,6 +50,10 @@ PIMAGE_NT_HEADERS CResourceEditor::GetNTHeaders(BYTE* pbPE) {
if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
throw runtime_error("PE file missing NT signature");
// Make sure this is a 32-bit PE
if (ntHeaders->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC)
throw runtime_error("Unsupported PE format");
return ntHeaders;
}