30.07.2014 Views

Attacking the Vista Heap - 2008

Attacking the Vista Heap - 2008

Attacking the Vista Heap - 2008

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Large Chunk Allocation<br />

RtlpAllocate<strong>Heap</strong> (large chunk):<br />

1<br />

2<br />

3<br />

dwSize += BASE_STRUCT_SIZE;<br />

…<br />

NtAllocateVirtualMemory(INVALID_HANDLE_VALUE, &baseAddr, 0,<br />

&dwSize, MEM_COMMIT, rwProt);<br />

…<br />

h<strong>Heap</strong>->largeTotal += dwSize;<br />

…<br />

chunk = (LPVOID) baseAddr + BASE_STRUCT_SIZE + HEAP_ENTRY_SIZE;<br />

…<br />

return chunk;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!