Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Tutorial

Tracking memory heap allocations with Pageheap and WinDbg for UAF bugs [v2.4 Technical Discussion]

kernel_komrade
Driver Dev
MEMBER
прадстаўнік: 145
Дата далучэння: Feb 2019
Паведамленні: 26
Дзякуй: 45
4 тыдняў таму · Jul 26, 2026 7:06 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
прадстаўнік: 162
Дата далучэння: May 2018
Паведамленні: 73
Дзякуй: 42
4 тыдняў таму · Jul 27, 2026 12:08 AM
#2

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

vtable_slayer
Senior Reverser
MEMBER
прадстаўнік: 215
Дата далучэння: Mar 2018
Паведамленні: 86
Дзякуй: 61
3 тыдняў таму · Jul 27, 2026 7:39 PM
#3

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