MachO: Accept file types other than MH_EXECUTE (#67)

This commit is contained in:
Katy Coe
2020-09-12 13:20:23 +02:00
parent 4261b5b2d1
commit 98bd12e76d
2 changed files with 5 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
Copyright 2017-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
*/
@@ -19,7 +19,8 @@ namespace Il2CppInspector
MH_MAGIC_64 = 0xfeedfacf,
MH_CIGAM_64 = 0xcffaedfe,
MH_EXECUTE = 0x2,
MH_MIN_FILETYPE = 0x1,
MH_MAX_FILETYPE = 0xB,
LC_SEGMENT = 0x1,
LC_SYMTAB = 0x2,

View File

@@ -102,8 +102,8 @@ namespace Il2CppInspector
header = ReadObject<MachOHeader<TWord>>(0);
// Must be executable file
if ((MachO)header.FileType != MachO.MH_EXECUTE)
// Must be of a known file type
if ((MachO)header.FileType < MachO.MH_MIN_FILETYPE || (MachO)header.FileType > MachO.MH_MAX_FILETYPE)
return false;
// Process load commands