From 6ac3e0c6362d48c40c7170f4ffcccc6937a3b284 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sun, 9 Oct 2022 13:09:21 +0200 Subject: [PATCH] Change the way allocations are handled --- src/dumpulator/dumpulator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dumpulator/dumpulator.py b/src/dumpulator/dumpulator.py index 381d346..1e7857e 100644 --- a/src/dumpulator/dumpulator.py +++ b/src/dumpulator/dumpulator.py @@ -183,8 +183,6 @@ def _setup_emulator(self, thread): info = region[0] emu_addr = info.BaseAddress & self.addr_mask if info.State == minidump.MemoryState.MEM_FREE: - if emu_addr > 0x10000 and info.RegionSize >= self._allocate_size: - self._allocate_base = emu_addr continue reserve_protect = MemoryProtect(info.AllocationProtect) reserve_type = MemoryType(info.Type.value) @@ -438,6 +436,7 @@ def call(self, addr, args: List[int] = [], regs: dict = {}, count=0): def allocate(self, size, page_align=False): if not self._allocate_ptr: + self._allocate_base = self.memory.find_free(self._allocate_size) self.memory.reserve(self._allocate_base, self._allocate_size, MemoryProtect.PAGE_EXECUTE_READWRITE) self._allocate_ptr = self._allocate_base