mirror of
https://codeberg.org/KeybadeBlox/JSRF-Decompilation.git
synced 2026-02-20 10:17:03 +03:00
Better handle undefined types in mangling script
This commit is contained in:
parent
e9b0c3c6bc
commit
55046bf009
1 changed files with 4 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ import ghidra.program.model.data.StringDataInstance;
|
||||||
import ghidra.program.model.data.Structure;
|
import ghidra.program.model.data.Structure;
|
||||||
import ghidra.program.model.data.TerminatedUnicodeDataType;
|
import ghidra.program.model.data.TerminatedUnicodeDataType;
|
||||||
import ghidra.program.model.data.TypeDef;
|
import ghidra.program.model.data.TypeDef;
|
||||||
|
import ghidra.program.model.data.Undefined;
|
||||||
import ghidra.program.model.data.Union;
|
import ghidra.program.model.data.Union;
|
||||||
import ghidra.program.model.data.UnsignedCharDataType;
|
import ghidra.program.model.data.UnsignedCharDataType;
|
||||||
import ghidra.program.model.data.UnsignedIntegerDataType;
|
import ghidra.program.model.data.UnsignedIntegerDataType;
|
||||||
|
|
@ -305,7 +306,7 @@ public class MSVC7Mangle extends GhidraScript{
|
||||||
*/
|
*/
|
||||||
if (t == null) throw new Exception (
|
if (t == null) throw new Exception (
|
||||||
"A data type was reported as null. Ensure that all " +
|
"A data type was reported as null. Ensure that all " +
|
||||||
"data types in the demangled code/data have been " +
|
"data types in the code/data to mangle have been " +
|
||||||
"defined."
|
"defined."
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -336,7 +337,8 @@ public class MSVC7Mangle extends GhidraScript{
|
||||||
case Array a -> "PA" + mangleArrDims(a) + mangleType(arrType(a), dict);
|
case Array a -> "PA" + mangleArrDims(a) + mangleType(arrType(a), dict);
|
||||||
case FunctionSignature f -> mangleFnType(f, dict);
|
case FunctionSignature f -> mangleFnType(f, dict);
|
||||||
case TypeDef d -> mangleType(d.getBaseDataType(), dict);
|
case TypeDef d -> mangleType(d.getBaseDataType(), dict);
|
||||||
case DefaultDataType _ -> throw new Exception ("Encountered data marked \"undefined\". All data types must be defined.");
|
case DefaultDataType _ -> throw new Exception ("Encountered data marked \"undefined\". Ensure that all data types in the code/data to mangle have been defined.");
|
||||||
|
case Undefined _ -> throw new Exception ("Encountered data marked \"undefined\". Ensure that all data types in the code/data to mangle have been defined.");
|
||||||
default -> throw new Exception ("Unknown type \"" + t.getClass().getName() + "\"");
|
default -> throw new Exception ("Unknown type \"" + t.getClass().getName() + "\"");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue