Output an error when an unsupported CPU architecture is detected

This commit is contained in:
Katy Coe
2019-10-22 16:23:58 +02:00
parent 6075358dfe
commit 9ab6d16dd0
2 changed files with 10 additions and 5 deletions

View File

@@ -174,11 +174,16 @@ namespace Il2CppInspector
Console.WriteLine("Instruction set: " + image.Arch);
// Architecture-agnostic load attempt
if (Il2CppBinary.Load(image, metadata.Version) is Il2CppBinary binary) {
processors.Add(new Il2CppInspector(binary, metadata));
try {
if (Il2CppBinary.Load(image, metadata.Version) is Il2CppBinary binary) {
processors.Add(new Il2CppInspector(binary, metadata));
}
else {
Console.Error.WriteLine("Could not process IL2CPP image");
}
}
else {
Console.Error.WriteLine("Could not process IL2CPP image");
catch (InvalidOperationException ex) {
Console.Error.WriteLine(ex.Message);
}
}
return processors;