JSON: Output symbol data

This commit is contained in:
Katy Coe
2020-08-09 00:30:31 +02:00
parent 00c2e8ad44
commit 47de0ff56f

View File

@@ -39,6 +39,7 @@ namespace Il2CppInspector.Outputs
writeFunctions(); writeFunctions();
writeMetadata(); writeMetadata();
writeExports(); writeExports();
writeSymbols();
}, },
"Address map of methods, internal functions, type pointers and string literals in the binary file" "Address map of methods, internal functions, type pointers and string literals in the binary file"
); );
@@ -185,6 +186,20 @@ namespace Il2CppInspector.Outputs
}, "Exports"); }, "Exports");
} }
private void writeSymbols() {
var symbols = model.Package.BinaryImage.GetSymbolTable().Values;
writeArray("symbols", () => {
foreach (var symbol in symbols) {
writeObject(() => {
writeName(symbol.VirtualAddress, symbol.Name);
writer.WriteString("demangledName", symbol.DemangledName);
writer.WriteString("type", symbol.Type.ToString());
});
}
}, "Symbol table");
}
private void writeObject(Action objectWriter) => writeObject(null, objectWriter); private void writeObject(Action objectWriter) => writeObject(null, objectWriter);
private void writeObject(string name, Action objectWriter, string description = null) { private void writeObject(string name, Action objectWriter, string description = null) {