Add support for Mach-O files

This commit is contained in:
Katy Coe
2017-10-22 02:24:10 +02:00
parent 16ae3ed108
commit 58968c237a
5 changed files with 286 additions and 5 deletions

View File

@@ -33,7 +33,10 @@ namespace Il2CppInspector
// Load the il2cpp code file (try ELF and PE)
var memoryStream = new MemoryStream(File.ReadAllBytes(codeFile));
IFileFormatReader stream = (IFileFormatReader) ElfReader.Load(memoryStream) ?? PEReader.Load(memoryStream);
IFileFormatReader stream =
((IFileFormatReader) ElfReader.Load(memoryStream) ??
PEReader.Load(memoryStream)) ??
MachOReader.Load(memoryStream);
if (stream == null) {
Console.Error.WriteLine("Unsupported executable file format");
return null;