Unify symbol table format and implement for Elf and Mach-O

This commit is contained in:
Katy Coe
2020-08-09 00:30:18 +02:00
parent e536a3b1eb
commit 00c2e8ad44
7 changed files with 127 additions and 21 deletions

View File

@@ -148,20 +148,20 @@ namespace Il2CppInspector
// Try searching the symbol table
var symbols = Image.GetSymbolTable();
if (symbols?.Any() ?? false) {
if (symbols.Any()) {
Console.WriteLine($"Symbol table(s) found with {symbols.Count} entries");
symbols.TryGetValue("g_CodeRegistration", out var code);
symbols.TryGetValue("g_MetadataRegistration", out var metadata);
if (code == 0)
if (code == null)
symbols.TryGetValue("_g_CodeRegistration", out code);
if (metadata == 0)
if (metadata == null)
symbols.TryGetValue("_g_MetadataRegistration", out metadata);
if (code != 0 && metadata != 0) {
if (code != null && metadata != null) {
Console.WriteLine("Required structures acquired from symbol lookup");
Configure(code, metadata);
Configure(code.VirtualAddress, metadata.VirtualAddress);
return true;
}
else {