diff options
| author | MoonEyes <ducoinbenjamin@yahoo.fr> | 2026-11-28 14:26:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-28 14:26:09 +0100 |
| commit | 7ce011205869b2e881a663e390d8317be5f562f3 (patch) | |
| tree | 6efdaed9954921baaf970fdff867214dda75c67f /scripts/windows-boot/README.md | |
| parent | 1a0e77ecb72bd538327fb631009dea5426b7c80a (diff) | |
| parent | 056e6823217b5f2a1fd9b2556ba71fd41a757877 (diff) | |
Merge pull request #1772 from sodove/feat/windows-boot-mapped-image-stack
windows-boot: recover private stacks for manually mapped images
Diffstat (limited to 'scripts/windows-boot/README.md')
| -rw-r--r-- | scripts/windows-boot/README.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/windows-boot/README.md b/scripts/windows-boot/README.md index ac76ecdaa..1ace54184 100644 --- a/scripts/windows-boot/README.md +++ b/scripts/windows-boot/README.md | |||
| @@ -99,3 +99,33 @@ game processes on one GPU make both runs meaningless and can take the driver dow | |||
| 99 | | `minidump.py PID OUT.dmp` | a minidump through dbghelp's `MiniDumpWriteDump`. Do not use `rundll32 comsvcs.dll MiniDump`: Defender flags it. A dump holds game memory: local only | | 99 | | `minidump.py PID OUT.dmp` | a minidump through dbghelp's `MiniDumpWriteDump`. Do not use `rundll32 comsvcs.dll MiniDump`: Defender flags it. A dump holds game memory: local only | |
| 100 | 100 | ||
| 101 | Each prints its usage with `-h` (Python) or `Get-Help` (PowerShell). | 101 | Each prints its usage with `-h` (Python) or `Get-Help` (PowerShell). |
| 102 | |||
| 103 | ## Recover a stack from a manually mapped image | ||
| 104 | |||
| 105 | When the exception stack stops inside the mapped executable, run `mapped_stack.py` on the existing | ||
| 106 | private dump. Supply the exact PE from the crashing build and an x64 CDB from Debugging Tools for | ||
| 107 | Windows. If CDB is on your PATH, omit `--cdb`. The optional `--symbols` takes one local directory | ||
| 108 | containing the matching runtime images and PDBs. | ||
| 109 | |||
| 110 | ```powershell | ||
| 111 | py -3 -I scripts\windows-boot\mapped_stack.py D:\runs\fault\crash.dmp D:\package\title.exe --symbols D:\build\RelWithDebInfo --cdb "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe" | ||
| 112 | ``` | ||
| 113 | |||
| 114 | The command derives the mapping base, including a relocated base, by locating a unique captured | ||
| 115 | instruction window in an executable section of the supplied PE. It checks for a file-backed x64 | ||
| 116 | unwind entry at the exception RIP and compares captured bytes from the first header page and that | ||
| 117 | function's unwind metadata when available. | ||
| 118 | A small dump can establish a local code match only. Use the original image even if another build | ||
| 119 | has the same function. Exit-only snapshots, faults outside the supplied image, leaf functions | ||
| 120 | without unwind entries, and missing, patched or ambiguous instruction windows cannot establish | ||
| 121 | this stack. | ||
| 122 | |||
| 123 | CDB reads the exception context and uses the disk image's unwind data to recover callers. The | ||
| 124 | script makes a temporary copy of the PE beside the dump under the debugger alias `leonida_mapped`. | ||
| 125 | It disables network symbols and writes private frame rows to a new `mapped-stack.txt` beside the | ||
| 126 | dump. Use `--output` for a different new file. A successful walk recovers at least one caller and | ||
| 127 | can stop when later stack memory or module information is missing. Keep dumps and reports outside | ||
| 128 | the checkout and share only the outcome and frame count. | ||
| 129 | |||
| 130 | Run the synthetic regression tests with `py -3 -I tests\test_mapped_stack.py`. To include the | ||
| 131 | native CDB walk, put x64 CDB on PATH or set `LEONIDA_TEST_CDB` to its full path. | ||