toothpick
Allows scaffolding mods for native C++ shared libraries, including generating C++ MinHook DLL projects.
Provides tools for scaffolding, packaging, and emitting diff patches for Lua mods, including Steam Workshop targets.
Provides tools for scaffolding, packaging, and emitting diff patches for Steam Workshop mods, particularly Lua-based mods.
Provides tools for scaffolding and building Unity IL2CPP mods via BepInEx/Harmony C# plugins.
Provides tools for generating Unreal Engine UE4SS Lua/C++ mods.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@toothpicktriage target.exe and show the callers of 0x140001000"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Toothpick turns binary executables, game containers, JVM archives, and profiler captures into a single queryable SQLite WAL graph (toothpick.db). It unpacks runtime stubs, lifts instructions across five CPU architectures (x86, x86_64, ARM64, PowerPC, MIPS), computes control-flow edges and reaching-definitions SSA facts, solves branch reachability with Z3, records verified runtime register/memory receipts, rebases hooks across version updates, and scaffolds mods for Unity IL2CPP, Unreal Engine, Godot, native C++ shared libraries, and Lua/Steam Workshop targets.
All query, scan, and Model Context Protocol (MCP) endpoints enforce strict top-K and line-count caps so AI coding agents can inspect large binaries without blowing out their context window.
Quick start
Prerequisites
OS: Windows 10/11 (x64) or Linux (x86_64)
Python: 3.11+ with
uvOptional host tools:
.NET SDK 8.0+— only required when compiling generated C# BepInEx plugins (toothpick build --compile)Ghidra 11+(GHIDRA_INSTALL_DIR) — only required when requesting PyGhidra decompilation (toothpick static --prefer-ghidra)cdb.exe(Windows Debugging Tools) — only required for live WinDbg/cdb commands (toothpick cdb)
Installation
git clone https://github.com/walkthestars/toothpick.git
cd toothpick
uv sync --lockedCore workflow in 60 seconds
# 1. Triage container format, architecture, game engine, and packer signatures
uv run toothpick triage target.exe
# 2. Unpack simple protection stubs (UPX NRV2B/D/E, XOR loaders) if flagged
uv run toothpick unpack packed_target.exe --out target.exe
# 3. Lift functions, basic blocks, CFG edges, and SSA facts into toothpick.db
uv run toothpick static target.exe --db toothpick.db
# 4. Query the call graph and SSA def-use chains under bounded budgets
uv run toothpick query --db toothpick.db callers 0x140001000 --limit 50
uv run toothpick query --db toothpick.db def_use 0x140001000 --var rax
uv run toothpick query --db toothpick.db slice 0x140001000 --target rax --direction backward
# 5. Solve branch reachability constraints to a target basic block via Z3
uv run toothpick solve 0x140001000 --target-block 0x140001080 --db toothpick.db
# 6. Ground live via Frida (--pid) or scaffold offline with --allow-unverified
uv run toothpick ground 0x140001000 --static-only --db toothpick.db
uv run toothpick hook build --target 0x140001000 --db toothpick.db --out ./my_hook --name SpeedHook --allow-unverifiedRelated MCP server: styx-mcp
Pipeline overview
Target Binary / Container / JAR / Dump / IDA Extract / Profiler Capture
│
├──► triage & unpack Format/engine/packer detection, UPX & Unicorn OEP unpack
├──► static / jvm ingest Capstone CFG + SSA lifting or JVM class/JAR call graph
├──► ingest-ida Schema-v1 IDA Pro JSON import + name-conflict arbitration
├──► rtti / struct MSVC & Itanium C++ RTTI/vtable recovery + ReClass export
├──► profile import Windows ETW/WPR & JVM JFR/async-profiler hot-function ranking
│
▼
┌─────────────────────────────────────────────────────────────────────┐
│ toothpick.db (SQLite WAL) │
│ funcs · edges · ssa_facts · types · receipts · versions · profiles │
└─────────────────────────────────────────────────────────────────────┘
│
├──► query / show / mcp Top-K bounded callers, callees, def-use, slicing, stdio MCP
├──► solve / taint Z3 BitVec path reachability & dynamic taint tracking
├──► ground / scan / cdb Frida, CEServer, WinDbg/cdb & DBI runtime receipts
├──► rebase Multi-pass structural graph diffing across binary updates
└──► build / hook / lua Epistemic-gated Unity, Unreal, Godot, C++ & Lua mod buildersCLI reference
Run uv run toothpick <command> --help for full option lists, or see docs/CLI.md for the complete reference.
Command | Purpose |
| Identify container ( |
| Decompress UPX/XOR stubs, trace packer entry points to the Original Entry Point (OEP) via Unicorn micro-emulation, hunt compiler prologues ( |
| Lift instructions (x86, x86_64, ARM64, PPC, MIPS), partition basic blocks, compute CFG edges and reaching-definitions SSA facts, and upsert into |
| Bounded graph queries: |
| Translate basic-block paths into Z3 |
| Capture runtime register/argument receipts via Frida ( |
| Bounded memory and pointer scanner over live PIDs, raw dumps ( |
| Parse Unity IL2CPP |
| Ingest versioned |
| Generate Unity IL2CPP BepInEx/Harmony C# plugins, Unreal Engine UE4SS Lua/C++ mods ( |
| Emit a self-contained CMake C++ MinHook DLL project ( |
| Scaffold ( |
| Inspect and safely extract Godot |
| Diff a new binary update against |
| Recover MSVC ( |
| Synthesize struct layouts from memory dumps ( |
| Parse JVM |
| Import VTune/ETW/perf CSVs or JVM JFR/async-profiler captures ( |
| Run headless WinDbg/ |
| Run Unicorn dynamic binary instrumentation traces ( |
| Run register/memory taint analysis ( |
| Execute timed command benchmarks and evaluate regression gates across runs. |
| Display the unified function inspection view (metadata, CFG edges, SSA facts, grounding receipts, and trace events). |
| Inspect token and monetary cost accounting across agent sessions ( |
| Start the stdio Model Context Protocol server ( |
MCP server
Run toothpick mcp --db toothpick.db to expose 9 phase-constrained reverse-engineering tools over stdio JSON-RPC 2.0:
{
"mcpServers": {
"toothpick": {
"command": "uv",
"args": [
"--directory",
"/path/to/toothpick",
"run",
"toothpick",
"mcp",
"--db",
"/path/to/toothpick.db"
]
}
}
}Exposed MCP tools
Tool | Description |
| Call-graph predecessors of |
| Call-graph successors called by |
| SSA reaching-definition chains inside |
| Backward or forward intra-function program slice from |
| Single function record (signature, basic-block count, IR/decompiled text bounded by |
| Port an address from |
| Full inspection card for |
| Token and cost accounting breakdown across model classes ( |
| Top-N hottest functions from imported ETW/JFR performance profiles joined against |
Full request/response schemas and client examples are documented in docs/MCP.md.
Epistemic Grounding Gate
Mod generators (toothpick build, toothpick hook build, toothpick lua build) refuse to emit patches targeting unverified addresses by default. A target function must hold a dynamic GROUNDED receipt in toothpick.db (recorded via toothpick ground --pid <PID> or --backend ceserver) before code generation proceeds.
Dynamic grounding path: Run
toothpick ground <func_addr> --pid <PID> --db toothpick.db(or--backend ceserver), then runtoothpick buildortoothpick hook build.Static-only / offline path:
toothpick ground --static-onlyrecords aSTATIC_FALLBACK(UNGROUNDED) receipt. To generate a mod scaffold without a live process receipt, pass--allow-unverified; generated source files and READMEs are stamped with an explicitUNVERIFIEDbanner.IDA imports: Functions imported via
toothpick ingest-idacarryUNGROUNDEDprovenance until verified by livetoothpick ground, preventing decompiler heuristics from silently masquerading as runtime truth.
Development
uv sync --locked --dev
uv run python scripts/ci.py # runs all 5 CI gates (ruff, uv build, pytest, coverage, license audit)
uv run pytest -p no:faulthandler # run the test suite directly
uv run ruff check . # run the linterSecurity & known limitations
Untrusted binaries: Static commands (
triage,static,query,solve,rtti,jvm ingest,ingest-ida) never execute the target binary on the host OS. Dynamic commands (groundwithout--static-only,scan --pid,cdb --pid,dbi) attach to live processes and should only be used against untrusted targets inside an isolated VM. See SECURITY.md.VM-protected binaries: Commercial virtualizing protectors (Denuvo, VMProtect, Themida) trigger an immediate
PACKED_ABORT(VM_PROTECTED)(exit code2) duringtriageandunpack. Usetoothpick unpack --detect-vmfor non-aborting forensic section/entropy inspection, or dump the process from memory at runtime and pass--reconstruct-pe --oep <hex>.Intra-procedural slicing:
toothpick query sliceoperates over intra-function SSA facts; cross-function dataflow should be combined withcallers/calleestraversal.
Contributing
Contributions are welcome — see CONTRIBUTING.md. Two things are asked of contributors: a Signed-off-by line on every commit (the Developer Certificate of Origin, git commit -s; CI checks it), and a one-time acceptance of the Contributor License Agreement on a contributor's first pull request.
License
AGPL-3.0-only, with commercial/enterprise dual licensing available. See LICENSE, COPYRIGHT, and CLA.md.
Running unmodified Toothpick locally places no obligations on your own code or analysis artifacts. Modifying Toothpick, distributing modified versions, or operating a modified Toothpick over a network triggers the AGPL-3.0 copyleft/network provisions — offer those modifications under the same license, or contact the Project Owner (walkthestars) for a commercial enterprise license.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Context and control for any AI. Agent identity, scoped access, and proof across tools.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides 85 tools for binary analysis including static analysis, disassembly, decompilation, ESIL emulation, live debugging, vulnerability scanning, and exploit development through structured JSON responses over the Model Context Protocol.852-
- AlicenseNot gradedqualityDmaintenanceProvides 7 reverse-engineering tools (hexdump, disasm, strings, xref, Ghidra decompilation, angr symbolic execution, OLLVM deobfuscation) for LLM agents like hermes-agent and Claude Desktop.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to inspect, reverse engineer, decompile, and operate on binaries through IDA Pro, including headless and GUI sessions, over stdio or Streamable HTTP.29 npmMIT
- AlicenseNot gradedqualityCmaintenanceExposes read-only local analysis tools for source auditing, web traffic review, binary reverse engineering, exploit scaffolding, OSINT, and reporting via JSON-RPC over stdio, enabling LLMs to orchestrate evidence-based security workflows without executing targets or sending network requests.1MIT