Developer knowledge network · moderated exchange

Społeczność UnreliableCode

Badania programistów, inżynieria wsteczna i społeczność programistów

Knowledge indexNa żywo
4Categories
919Threads
2.8KPosty
Tutorial

Tracking memory heap allocations with Pageheap and WinDbg for UAF bugs

kernel_komrade
Driver Dev
MEMBER
Rozpustnik: 145
Data dołączenia: Feb 2019
Posty: 26
Dzięki: 45
1 miesięcy temu · Jul 23, 2026 3:19 PM
#1

To diagnose Use-After-Free (UAF) and heap corruption bugs in complex C++ game codebases:

  1. Enable Pageheap in GFlags (gflags.exe /p /enable target_game.exe /full).
  2. Pageheap places an inaccessible guard page (PAGE_NOACCESS) immediately following every dynamic allocation.
  3. Attach WinDbg.
  4. When a dangling pointer reads freed memory or overflows a buffer by even 1 byte, the CPU triggers an immediate page fault and WinDbg breaks on the exact offending instruction!
ptr_arithmetic
C++ Wizard
MEMBER
Rozpustnik: 162
Data dołączenia: May 2018
Posty: 73
Dzięki: 42
1 miesięcy temu · Jul 23, 2026 6:59 PM
#2

Pageheap is an absolute lifesaver for catching memory corruption bugs before shipping code.

vtable_slayer
Senior Reverser
MEMBER
Rozpustnik: 215
Data dołączenia: Mar 2018
Posty: 86
Dzięki: 61
1 miesięcy temu · Jul 24, 2026 3:42 PM
#3

Requires significant RAM but pinpointing UAF bugs in 5 seconds is worth it.