Force VirtualAlloc allocations to fall below the 2GB mark (#36)

Co-authored-by: ConorBobbleHat <c.github@firstpartners.net>
This commit is contained in:
ConorB
2023-06-02 20:30:45 +01:00
committed by GitHub
parent e83af50b10
commit 3e2d84fa69
2 changed files with 42 additions and 0 deletions

View File

@@ -1171,6 +1171,10 @@ namespace kernel32 {
void *mem = 0;
posix_memalign(&mem, 0x1000, dwSize);
memset(mem, 0, dwSize);
// Windows only fences off the lower 2GB of the 32-bit address space for the private use of processes.
assert(mem < (void*)0x80000000);
DEBUG_LOG("-> %p\n", mem);
return mem;
} else {