Detect x64 and AArch64 ISAs in all binary formats

This commit is contained in:
Katy Coe
2019-10-21 14:31:09 +02:00
parent e46cca08e0
commit fde19c8972
3 changed files with 25 additions and 39 deletions

View File

@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using NoisyCowStudios.Bin2Object;
@@ -25,20 +26,13 @@ namespace Il2CppInspector
public override string Format => "Mach-O";
public override string Arch {
get {
switch ((MachO)header.CPUType) {
case MachO.CPU_TYPE_ARM:
case MachO.CPU_TYPE_ARM64:
return "ARM";
case MachO.CPU_TYPE_X86:
case MachO.CPU_TYPE_X86_64:
return "x86";
default:
return "Unsupported";
}
}
}
public override string Arch => (MachO)header.CPUType switch {
MachO.CPU_TYPE_ARM => "ARM",
MachO.CPU_TYPE_ARM64 => "ARM64",
MachO.CPU_TYPE_X86 => "x86",
MachO.CPU_TYPE_X86_64 => "x64",
_ => "Unsupported"
};
public override int Bits => is64 ? 64 : 32;