Closed dennis-tseng99 closed 12 months ago
context->RelocDir->Size should minus one when calling ImageAddress(). Otherwise RelocBaseEnd will get NULL address after running ImageAddress() in which address=size.
context->RelocDir->Size
ImageAddress()
address=size
ImageAddress (void *image, uint64_t size, uint64_t address) { uintptr_t img_addr; /* ensure our local pointer isn't bigger than our size */ if (address >= size) <---- address=size return NULL; ........ }
RelocBaseEnd = ImageAddress(orig, size, Section->PointerToRawData + context->RelocDir->Size);
I've force pushed fd43edacfe1eaa64d1c7b37ba23dae74e05d1a04 over this to make the commit message more informative.
context->RelocDir->Size
should minus one when callingImageAddress()
. Otherwise RelocBaseEnd will get NULL address after running ImageAddress() in whichaddress=size
.RelocBaseEnd = ImageAddress(orig, size, Section->PointerToRawData + context->RelocDir->Size);