ELF: Ignore relocations into memory addresses not mapped from the image (part of #14)

This commit is contained in:
Katy Coe
2020-01-06 08:22:39 +01:00
parent 2b32d2535e
commit a3fd260afc

View File

@@ -193,8 +193,15 @@ namespace Il2CppInspector
foreach (var rel in rels) {
var symValue = ReadObject<TSym>(conv.Long(rel.SymbolTable) + conv.Long(rel.SymbolIndex) * relsz).st_value; // S
// Ignore relocations into memory addresses not mapped from the image
try {
Position = MapVATR(conv.ULong(rel.Offset));
}
catch (InvalidOperationException) {
continue;
}
// The addend is specified in the struct for rela, and comes from the target location for rel
Position = MapVATR(conv.ULong(rel.Offset));
var addend = rel.Addend ?? ReadObject<TWord>(); // A
// Only handle relocation types we understand, skip the rest