src: pefile: add checkMachine()

This commit is contained in:
Markus F.X.J. Oberhumer
2023-02-21 20:33:40 +01:00
parent e1edc5f50a
commit 3d691645a4
7 changed files with 44 additions and 6 deletions
+4 -2
View File
@@ -66,8 +66,10 @@ Linker *PackW64PeAmd64::newLinker() const { return new ElfLinkerAMD64; }
**************************************************************************/
bool PackW64PeAmd64::canPack() {
// just check if machine type is 0x8664
if (!readFileHeader() || ih.cpu != IMAGE_FILE_MACHINE_AMD64)
if (!readFileHeader())
return false;
checkMachine(ih.cpu);
if (ih.cpu != IMAGE_FILE_MACHINE_AMD64)
return false;
return true;
}