This commit is contained in:
Perfare 2023-02-14 18:50:07 +08:00
parent 23285b5636
commit e51751ec81

View file

@ -271,13 +271,15 @@ namespace Il2CppDumper
public override ulong ReadUIntPtr() public override ulong ReadUIntPtr()
{ {
var pointer = ReadUInt64(); var pointer = ReadUInt64();
if (pointer > 0xFFFFFFFF) if (pointer > vmaddr + 0xFFFFFFFF)
{ {
var addr = Position; var addr = Position;
var section = sections.First(x => addr >= x.offset && addr <= x.offset + x.size); var section = sections.First(x => addr >= x.offset && addr <= x.offset + x.size);
if (section.sectname == "__const" || section.sectname == "__data") if (section.sectname == "__const" || section.sectname == "__data")
{ {
pointer &= 0xFFFFFFFF; var rva = pointer - vmaddr;
rva &= 0xFFFFFFFF;
pointer = rva + vmaddr;
} }
} }
return pointer; return pointer;