mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-19 19:53:56 +00:00
Fix relocation handling
This commit is contained in:
@@ -85,12 +85,13 @@ namespace
|
||||
}
|
||||
|
||||
auto relocation_offset = directory->VirtualAddress;
|
||||
const auto relocation_end = relocation_offset + directory->Size;
|
||||
|
||||
while (relocation_offset < directory->Size)
|
||||
while (relocation_offset < relocation_end)
|
||||
{
|
||||
const auto relocation = buffer.as<IMAGE_BASE_RELOCATION>(relocation_offset).get();
|
||||
|
||||
if (relocation.VirtualAddress <= 0 || relocation.SizeOfBlock <= 0)
|
||||
if (relocation.VirtualAddress <= 0 || relocation.SizeOfBlock <= sizeof(IMAGE_BASE_RELOCATION))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user