Skip to content

Commit

Permalink
Better image information
Browse files Browse the repository at this point in the history
  • Loading branch information
momo5502 committed Sep 9, 2024
1 parent e054702 commit fad1721
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/windows_emulator/syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,19 +490,19 @@ namespace
return STATUS_BUFFER_OVERFLOW;
}

if (!is_within_start_and_length(base_address, c.proc.ntdll->image_base, c.proc.ntdll->size_of_image))
const auto mod = c.proc.module_manager.find_by_address(base_address);
if(!mod)
{
puts("Bad image request");
c.emu.stop();
return STATUS_NOT_SUPPORTED;
printf("Bad address for memory image request: %llX\n", base_address);
return STATUS_INVALID_ADDRESS;
}

const emulator_object<MEMORY_IMAGE_INFORMATION> info{c.emu, memory_information};

info.access([&](MEMORY_IMAGE_INFORMATION& image_info)
{
image_info.ImageBase = reinterpret_cast<void*>(c.proc.ntdll->image_base);
image_info.SizeOfImage = c.proc.ntdll->size_of_image;
image_info.ImageBase = reinterpret_cast<void*>(mod->image_base);
image_info.SizeOfImage = mod->size_of_image;
});

return STATUS_SUCCESS;
Expand Down

0 comments on commit fad1721

Please sign in to comment.