Output an error when an unsupported CPU architecture is detected
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Il2CppInspector
|
|||||||
// Get type from image architecture
|
// Get type from image architecture
|
||||||
var type = Assembly.GetExecutingAssembly().GetType("Il2CppInspector.Il2CppBinary" + stream.Arch.ToUpper());
|
var type = Assembly.GetExecutingAssembly().GetType("Il2CppInspector.Il2CppBinary" + stream.Arch.ToUpper());
|
||||||
if (type == null)
|
if (type == null)
|
||||||
return null;
|
throw new InvalidOperationException("Unsupported architecture: " + stream.Arch);
|
||||||
|
|
||||||
var inst = (Il2CppBinary) Activator.CreateInstance(type, stream);
|
var inst = (Il2CppBinary) Activator.CreateInstance(type, stream);
|
||||||
|
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ namespace Il2CppInspector
|
|||||||
Console.WriteLine("Instruction set: " + image.Arch);
|
Console.WriteLine("Instruction set: " + image.Arch);
|
||||||
|
|
||||||
// Architecture-agnostic load attempt
|
// Architecture-agnostic load attempt
|
||||||
|
try {
|
||||||
if (Il2CppBinary.Load(image, metadata.Version) is Il2CppBinary binary) {
|
if (Il2CppBinary.Load(image, metadata.Version) is Il2CppBinary binary) {
|
||||||
processors.Add(new Il2CppInspector(binary, metadata));
|
processors.Add(new Il2CppInspector(binary, metadata));
|
||||||
}
|
}
|
||||||
@@ -181,6 +182,10 @@ namespace Il2CppInspector
|
|||||||
Console.Error.WriteLine("Could not process IL2CPP image");
|
Console.Error.WriteLine("Could not process IL2CPP image");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (InvalidOperationException ex) {
|
||||||
|
Console.Error.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
return processors;
|
return processors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user