0cchext is a practical extension pack for WinDbg and cdb. It adds script-friendly assembly, memory and process inspection, PE/symbol tooling, workflow helpers, and an optional Lua runtime to the debugger.
Keywords: WinDbg extension, cdb extension, Windows debugging, reverse engineering, x64 assembler, PE inspection, Lua automation.
The repository produces two debugger extensions and an optional MCP sidecar:
0cchext.dll— the main extensionluadbg.dll— an optional Lua 5.4 extension0cchext-agent.exe— a DbgEng MCP server for AI agents
- Script-friendly assembly:
!aand!a64assemble a single instruction without entering WinDbg's interactive assembly mode. - Modern instruction support: the default backend uses Intel XED 2026, including AVX-512 and
lockencodings. - Focused commands: inspect memory, stacks, threads, PE images, import/export tables, handles, errors, and WMI data.
- Workflow helpers: run command queues, import Visual Studio breakpoints, log commands, search output, and create trace events.
- Lua automation: load reusable scripts with
luadbg.dlland keep script state isolated from the main extension. - Agent-ready access:
0cchext-agent.exeexposes structured MCP tools for AI-assisted debugging workflows. - Reproducible builds: pinned dependencies, static CRT, CMake presets, unit tests, and cdb smoke tests.
- Download the latest release from GitHub Releases. The release provides a small runtime package and a separate symbols/PDB package.
- Choose the directory matching the debugger architecture:
x64for the 64-bit WinDbg orcdbx86for the 32-bit WinDbg orcdb
- Load the extension in the debugger:
.load "C:\path\to\0cchext\x64\0cchext.dll"
!0cchext.version
!0cchext.diag
!0cchext.help
The debugger architecture and extension architecture must match. To use Lua:
.load "C:\path\to\0cchext\x64\luadbg.dll"
!luadbg.lua C:\debug\hello.lua
!luadbg.lualist
0:000> !a @rsp push rbp
0:000> !a @rsp mov rax, rbx
!a64 is the interactive 64-bit assembler mode:
0:000> !a64 @rsp
00000000`0012ff00 vaddps zmm0, zmm1, zmm2
= 62 f1 74 48 58 c2
!carray @rsp 64
!stackstat
!memstat
!threadname
!0cchext.diag
!pe_export <module-base>
!pe_import <module-base>
!filepath <handle>
!listsymbol
!listmodule
!wql "SELECT Name, ProcessId FROM Win32_Process"
!grep -i "!analyze -v" ".+Exception.+"
!url https://learn.microsoft.com/windows-hardware/drivers/debugger/
Use !0cchext.help <command> for command-specific syntax. The full command index and examples are in docs/COMMANDS.md.
| Area | Commands |
|---|---|
| Assembly and data | !a, !a64, !carray, !dpx, !du8, !rr, !accessmask, !dtx |
| Diagnostics and state | !diag, !version, !memstat, !stackstat, !threadname, !filepath, !hwnd, !wql |
| PE and symbols | !pe_export, !pe_import, !addmodule, !listmodule, !addsymbol, !listsymbol, !dlsym |
| Workflow | !agent, !autocmd, !favcmd, !grep, !logcmd, !gt, !tracecreate, !traceclose, !tracedisplay |
| Utilities | !url, !google, !bing, !setvprot, !err, !dttoc, !rawpcap_start, !rawpcap_stop |
| Lua | !luadbg.lua, !luadbg.luacmd, !luadbg.luaload, !luadbg.lualist, !luadbg.luaunload, !luadbg.luado |
luadbg.dll provides:
!luadbg.lua <file>— execute a Lua script!luadbg.luacmd— enter interactive Lua command mode (quit()exits)!luadbg.luaload <file>— load and retain a script state!luadbg.lualist— list retained scripts!luadbg.luaunload <name>— unload a retained script!luadbg.luado <script-name>!<code>— execute code inside a retained script state
luadbg is intentionally a separate DLL from 0cchext.dll, so Lua failures and state do not destabilize the main extension.
See extensions/luadbg/README.md for the standalone extension notes.
Requirements: Visual Studio 2022, CMake 3.25+, Windows SDK, and Python 3 for the default XED 2026 source build.
cmake --preset vs2022-x64
cmake --build --preset vs2022-x64-relwithdebinfo --parallel 4
ctest --preset vs2022-x64-release-tests --output-on-failureFor x86:
cmake --preset vs2022-x86
cmake --build --preset vs2022-x86-relwithdebinfo --parallel 4
ctest --preset vs2022-x86-release-tests --output-on-failureSee docs/BUILD.md for local build modes, dependency pinning, compatibility fallbacks, and CI simulation.
- Pull requests and manual dispatches run CI.
- Ordinary branch pushes do not run a workflow.
- Pushing a dotted numeric tag runs the release workflow, builds and tests both architectures, runs a cdb smoke test, and publishes a GitHub Release.
VERSIONis the local default version. A three-part tag such asv1.20.3automatically selects the next fourth component; a four-part tag is an exact override.
See docs/TESTING.md for the test matrix and manual smoke test.
0cchext/ Main WinDbg extension sources
extensions/luadbg Optional Lua extension
agent/ MCP stdio server and JSON protocol implementation
compat/windbg/ EngExtCpp compatibility sources for CI
cmake/ Build integration and dependency pinning
docs/ User, build, command, and test documentation
tests/ Unit and cdb integration tests
scripts/ Release/version helpers
.agents/skills/ Agent debugging skill and references
Issues and pull requests are welcome. Please include:
- the WinDbg/cdb architecture and version
- the command and exact output
- a minimal reproducer when possible
- test results for changes to commands or the assembler
If this project saves you debugging time, a star helps other reverse engineers find it.
- Command Reference
- Agent Integration
- WinDbg Agent Skill
- Build Guide
- Testing Guide
- Chinese introduction
- 0CCh website
GPL-3.0. See LICENSE for details.