Formats: Allow LoadOptions to be null
This commit is contained in:
@@ -203,13 +203,13 @@ namespace Il2CppInspector
|
||||
|
||||
// Dumped images must be rebased
|
||||
if (isMemoryImage) {
|
||||
if (LoadOptions.ImageBase == 0)
|
||||
if (LoadOptions == null || LoadOptions.ImageBase == 0)
|
||||
throw new InvalidOperationException("To load a dumped ELF image, you must specify the image base virtual address");
|
||||
}
|
||||
|
||||
// Rebase if requested (whether dumped or not) and treat it as a memory image,
|
||||
// disabling processing of relocations, symbols and decryption
|
||||
if (LoadOptions.ImageBase != 0) {
|
||||
if (LoadOptions?.ImageBase != 0) {
|
||||
isMemoryImage = true;
|
||||
rebase(conv.FromULong(LoadOptions.ImageBase));
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Il2CppInspector
|
||||
|
||||
// Get file path
|
||||
// This error should never occur with the bundled CLI and GUI; only when used as a library by a 3rd party tool
|
||||
if (!(LoadOptions.BinaryFilePath is string dllPath))
|
||||
if (LoadOptions == null || !(LoadOptions.BinaryFilePath is string dllPath))
|
||||
throw new InvalidOperationException("To load a packed PE file, you must specify the DLL file path in LoadOptions");
|
||||
|
||||
// Attempt to load DLL and run startup functions
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Il2CppInspector
|
||||
|
||||
// Get file path
|
||||
// This error should never occur with the bundled CLI and GUI; only when used as a library by a 3rd party tool
|
||||
if (!(LoadOptions.BinaryFilePath is string mapsPath))
|
||||
if (LoadOptions == null || !(LoadOptions.BinaryFilePath is string mapsPath))
|
||||
throw new InvalidOperationException("To load a Linux process map, you must specify the maps file path in LoadOptions");
|
||||
|
||||
if (!mapsPath.ToLower().EndsWith("-maps.txt"))
|
||||
|
||||
Reference in New Issue
Block a user