Show HN: Treasure Map – a Ghidra-based firmware map for coding agents A developer released Treasure Map, a Ghidra-based static analysis tool that maps dangerous call sites in unpacked firmware and serves those facts to coding agents over MCP, with no model or API key of its own. The tool flags four categories of call sites — command execution, memory copies, format strings and file paths — recording argument provenance, controllability and reachability for each, and marks undetermined facts as UNKNOWN rather than scoring them. Treasure Map also runs Ghidra, BinExport and BinDiff in parallel across two firmware versions to produce a function-level patch diff, and it flags changed length constants at copy and format calls that BinDiff can miss, such as a buffer length moving from 0x40 to 0x3f while similarity still reports 1.0. English | 中文 https://github.com/JoeyZzZzZz/treasure-map/blob/main/README.zh.md Website https://tmap.tools/ · Showcase https://tmap.tools/showcase/ · Blog https://tmap.tools/blog/ · Quick start Treasure Map runs a full static analysis of an unpacked firmware and finds four kinds of dangerous call sites: command execution, memory copies, format strings and file paths. For each call site it records facts such as where the arguments come from, how controllable they are and how the call is reached, and it marks explicitly what it could not determine. Given two firmware versions, it produces a function-level patch diff. Your agent queries these facts over MCP and decides its own path through the analysis. The tool runs no model, needs no API key and gives no vulnerability verdicts: the tool supplies the facts, and the model makes the judgment. Agents read a single function well. Given a whole root filesystem a hundred binaries, tens of thousands of functions , they tend to stop after the first few candidates and report "nothing found" for code they never read. Some questions can't be answered by looking at one binary: - Who writes the value? A setting one program reads, such as an nvram key, is often written by another program. The map lists which programs write and read each nvram key, and whether it can be set from the web interface. - Who starts the program? Web servers hand work to helper programs, and init scripts decide which daemons run. The map records which binaries and scripts launch each program, with symlinks such as /bin/sh → busybox resolved. - What hasn't been read? Progress is counted against every candidate in the firmware, and each function or binary that could not be fully analyzed is named, so "nothing found" and "never read" stay apart. - What did the update change? Given two firmware versions, the map finds every binary and file that changed, scripts, configs and web pages included, and the binaries that exist in only one version. A patch spread across several files is seen in full. The agent does the reading and judging. Treasure Map tracks what has been read and judged, and the conclusions carry over to the next session. tmap scan decompiles every binary with Ghidra and marks each of those calls. Every candidate gets the same layers: where its data comes from, how much of it an attacker controls, who wrote the value, how the call is reached, whether anything filters it, and whether the function was fully analyzed. Each layer is YES , NO or UNKNOWN , and an UNKNOWN says what is missing and why. There is no score. By default, the highest-impact calls that nothing has proven safe come first. Your agent can sort or filter by any layer; the candidate set stays the same. Only a fact proving a call safe can move it down. An UNKNOWN never does. Command-execution, buffer-copy and format-string calls include in-function argument provenance. Path and file calls are detected and ranked, but their controllability comes from a text-level reading and is labeled that way. tmap diff compares, in parallel, every binary whose content changed between the two versions. Ghidra, BinExport and BinDiff run automatically from start to finish, you never touch an intermediate file, and the result is a function-level patch diff. Changed function pairs are grouped by what changed around those calls, so your agent reads the few changes that matter instead of thousands of functions. For each one it answers: is this a security fix, which weakness in the old version does it close, is the fix complete, and does the same call remain elsewhere? - BinDiff can report similarity=1.0 when a buffer length changed from 0x40 to 0x3f . Treasure Map also compares address-normalized pseudocode and flags changed length constants at copy and format calls. - The server picks the must-read changes, hands them out in work units and counts how many have been judged. An unread change is reported as unread, not as "nothing found", and the review is not complete until every must-read item is judged. - Scripts and config files are compared by path, and each one can be judged. Judgments are stored in an annotation layer on top of the read-only facts, so an audit can continue across sessions, models and agents. When the facts under a judgment change, the judgment is flagged for review. In 2021 ipTIME patched CVE-2021-26614, a debug backdoor in its C200 IP camera firmware 1.058 → 1.060 . We gave that patch to DeepSeek-V4.1-Flash, a low-cost general-purpose model, along with Treasure Map and the diff prompt from Quick start. It judged every must-read item and found three changes that look like security fixes. None of them is complete: - The backdoor was unlinked, not removed. Its handler, hardcoded token and command execution are still in the latest firmware, 1.094 June 2026 . - The buffer got bigger, not safer. The copy into it still uses a length the client chooses. - Validation was added only in the browser. The server-side CGI is byte-identical in both versions. 4 of 110 binaries changed · 144 of 144 must-read items judged · US$0.5–1 per run Developer preview. Commands, config, the atlas database and MCP tool fields may change incompatibly between versions. See Upgrading upgrading . 1. Install. This installs tmap and then runs tmap init , which sets up the toolchain, registers the MCP server with the agents you choose, and installs the diff-review skill for agents that read skills. Restart your agent when it finishes. curl -LsSf https://github.com/JoeyZzZzZz/treasure-map/releases/latest/download/install.sh | sh 2. Map a firmware. The input is an already-extracted filesystem; unpack the image with any tool, or have your agent do it. -w gives it a name. tmap scan ./firmware.extracted -w my-fw Then ask your agent: Audit firmware my-fw with Treasure Map. End with the candidates worth following up, each with its evidence ref and why. 3. Diff two versions. tmap scan ./fw v1.extracted -w fw-v1 tmap scan ./fw v2.extracted -w fw-v2 tmap diff --before fw-v1 --after fw-v2 Then ask your agent: Review the firmware diff fw-v1 → fw-v2 with Treasure Map: find the security fixes, judge whether each one is complete, and check whether the new code adds attack surface. The prompts only say what you want. The MCP server's instructions and the diff-review skill tell the agent how to work: what to read, how to record each judgment, and when the review may stop. A firmware pair often takes more than one agent session; a new session picks up where the last one stopped. scan is the slow step: one Ghidra pass per binary, with progress shown. Re-run with the same -w to resume. Everything you scan and diff goes into one atlas ~/.treasure-map/atlas.db , and your agent chooses which firmware or diff to work on. | Command | What it does | |---|---| | tmap scan DIR -w NAME | Map one extracted firmware run again to resume | | tmap diff --before A --after B | Diff two scanned versions --binary NAME for one binary | | tmap runs | List scanned firmware, and which runs are out of date | | tmap rescan NAME ... | Re-scan runs left out of date by an upgrade --dry-run lists them | | tmap doctor | Check the toolchain, config and agent registrations changes nothing | | tmap update | Install the newest version, then run its tmap init | | tmap uninstall | Remove what tmap init installed; your data stays | | Platform | Status | |---|---| | Linux x86 64, including WSL2 | ✅ Supported | | macOS on Apple Silicon | ✅ Supported | | macOS on Intel | ❔ Same toolchain, not acceptance-tested | | Linux arm64, native Windows | ❌ Not supported: no Ghidra decompiler or BinDiff build. On Windows, use WSL2 | tmap init installs these into ~/.treasure-map/toolchain/ , or reuses your own copies if they pass its checks. | Tool | Used for | |---|---| | JDK 21 | Running Ghidra. It must be a JDK, not a JRE; Ghidra 11.4.3 fails to launch on JDK 11/17 | | Ghidra 11.4.3 | Decompiling every binary, headless | | BinExport for Ghidra 11.4.3 | Exporting binaries for tmap diff | | BinDiff 8 | Matching functions between two versions | - Downloads come from pinned URLs and are checked against a pinned size and sha256 before anything is unpacked. - tmap init shows what it found and what it will download, and changes nothing until you confirm. --dry-run only prints the plan. tmap init registers the MCP server with the agents you choose Claude Code, Codex, Cursor, Claude Desktop, dsh; the ones it detects are pre-selected and installs the diff-review skill for agents that load skills from disk. Restart the agent afterwards. Claude Desktop only accepts skills as uploads: save the output of tmap review skill as tmap-diff-review/SKILL.md , zip the folder, and upload it under Customize Skills code execution must be on . Registering the MCP server by hand The command is always