Treasure Map

v0.2.1
io.github.JoeyZzZzZz/treasure-map Checked 16 hours ago Published 7 days ago

Firmware attack-surface map and patch diff for AI agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_candidates

Required: run_id. One firmware's map of recall candidates, each with a three-state annotation on every dimension layer — there is NO collapsed score. The default lens spines on sink-impact and sinks only provably-safe candidates; a '?' never sinks. Switch the lens with sort_by, view (presets, listed in available_views), filters ("dim=value,...": matches float, the corpus is never reduced), only (prune to a sink_class / sink_impact sweep) and impact_order; overlay=true re-ranks by your own annotations. Paged by limit / offset and by response size (next_offset resumes). Rows are compact: A dim…

ParameterTypeDescription
filters
fingerprint
impact_order
limitinteger
offsetinteger
only
overlayboolean
run_id
sink
sink_class
sort_by
status
verboseboolean
view

list_runs

Required: none. Every firmware run (scan) in this atlas with its lineage: scan_status, build_hash, scanned_at, counts and resolved. A differing build_hash for the same firmware means a STALE scan. Pick a run_id for the fact tools here. Full reference: get_tool_reference(name="list_runs").

explain_candidate

Required: evidence_ref. One candidate in full: every dimension layer's three-state annotation, the lens caveats, the claim bounds and where to verify — no score. sink_arg_provenance_summary says where each sink argument's value comes from. A ref no instance carries returns a not-found record (no fabrication). Echoes resolved_run + run_lineage, and coverage says whether a conclusion has been recorded. Full reference: get_tool_reference(name="explain_candidate").

ParameterTypeDescription
evidence_ref *string

get_sink_provenance

Required: evidence_ref. The full sink-argument def-use record behind explain_candidate's summary: per sink the writer set (dominating first, nearest_dominating_writer), each writer's format string and vararg sources, getter const_args, plus a source_origin companion. Omit sink_idx for every sink of the function, pass one for one sink; dominating_only keeps only the dominating writers. A Ghidra def-use FACT — never a verdict, and an unreachable origin is stated (resolved: false), never dropped. Full reference: get_tool_reference(name="get_sink_provenance").

ParameterTypeDescription
evidence_ref *string
dominating_onlyboolean
limitinteger
offsetinteger
sink_idx

get_nvram_key_flow

Required: key. Who WRITES and who READS one nvram key across binaries: writers / readers are exact constant-key matches (a writer carries value_source), template_matches the parametric templates the key satisfies (e.g. wl%d_ssid) — a possible match, never an exact connection. completeness is may_be_incomplete when unresolved-key operations exist: never read an empty result as "unused". run_id narrows to one firmware; without it every scanned firmware is spanned and each row names its run. Full reference: get_tool_reference(name="get_nvram_key_flow").

ParameterTypeDescription
key *string
limitinteger
offsetinteger
run_id

get_string_keyed_edges

Required: none. String-keyed dispatch edges: a string key that gates or dispatches to a callee (a same-variable strcmp ladder, or a {string, func_ptr} table) — "what does key X reach?", "is function Y reached through one?". Filter by key, callee, from_function, binary, run_id; each edge carries the callee anchor, ladder_size / table_addr and a completeness. These are ENUMERATED FACTS, NOT a reachability verdict. Empty is NOT proof of unreachability. A row with pairing.basis 'undetermined' is a candidate, not a dispatch. Full reference: get_tool_reference(name="get_string_keyed_edges").

ParameterTypeDescription
binary
callee
from_function
key
limitinteger
offsetinteger
run_id

launched_by

Required: target. Which binaries' code launches target (a binary's short name, or a script path under the firmware root) — the cross-binary "A execs B" edge. Each edge carries the launcher (binary + function + address), the API, whether a shell wraps it and the command template; target_layer says exec_image or shell_command. run_id stays inside one firmware. These are ENUMERATED FACTS, NOT a reachability verdict. An EMPTY result is NOT proof that nothing launches the binary: read exec_argv_status (and exec_runner_status for launches through a runner). Full reference: get_tool_reference(name=…

ParameterTypeDescription
target *string
limitinteger
offsetinteger
run_id

start_diff_review

Required: exactly one of diff_id / run_pair. For a version diff, start with run_pair = {run_a}::{run_b}: the whole pair cut into work units by the server — report (coverage_statement, must-read units, must_read_complete) and next_unit with its material; judge each member with annotate_diff(..., unit_id=<its unit_id>) and call again until next_unit is null; unit=<unit_id> reads one, worker/workers a shard, k the first entries per diff that are must-read (default 4). START HERE for one diff: diff_id = {run_a}::{run_b}::{binary} (list_diffs gives the ids) — the entries to read first and the c…

ParameterTypeDescription
diff_id
k
limitinteger
run_pair
sweep
unit
worker
workers

get_diff_patch_view

Required: diff_id. One diff's function-level view: an entry per function pair that changed, sorted into buckets (A, B, R = undetermined pair, C, P = in no matched pair, E = caller-set edge, S = similarity-1 pair whose pseudocode differs), plus a blind_spots ledger — evidence, never a verdict or a score. An entry nobody judged is UNREAD, which is not "nothing found". sink_candidate_counts counts hunt candidates, not calls; sink_callsite_counts counts calls (not deduplicated) and never moves attention. Default order: significance; also sort_by, the bucket / subclass / tier / blind_spot filters…

ParameterTypeDescription
diff_id *string
anchored_differsboolean
anchored_micro_sideboolean
bandboolean
blind_spot
body
bucket
detailstring
entry_id
limitinteger
not_listed_page
offsetinteger
rows_limitinteger
rows_offset
sort_by
subclass
tier
viewstring

get_diff_deltas

Required: diff_id. The tri-state dimension deltas one diff produced; filter by binary, dimension, delta_kind, page with limit / offset. A delta is a PROJECTION of two annotations, NOT a change/quality verdict; delta_undetermined is NOT 'unchanged' — read its undetermined_reason. An EMPTY result is NOT 'no changes': get_diff_capabilities says which dimensions this diff can delta. verbose=true adds the note and legend. Full reference: get_tool_reference(name="get_diff_deltas").

ParameterTypeDescription
diff_id *string
binary
delta_kind
dimension
limitinteger
offsetinteger
verboseboolean

get_diff_sink_overlay

Required: exactly one of diff_id / run_a + run_b. Candidate-level sink overlay: the A and B sink candidates lined up, each row with a presence — persisted or presence_undetermined, with its presence_reason. EVIDENCE ONLY, never a fix-status verdict. No row ever says a call is gone or new; ``presence_undetermined`` is NOT 'unchanged'. Scope: diff_id, or run_a + run_b (every diff of the pair plus the candidates no diff covers; slow). detail='summary' gives counts, detail='rows' a page (limit / offset); filter by binary, sink_class, presence, reason, side (a_only / b_only / both), min_alignment…

ParameterTypeDescription
binary
detailstring
diff_id
limitinteger
min_alignment_confidence
offsetinteger
presence
reason
run_a
run_b
side
sink_class

same_shape_siblings

Required: diff_id; exactly one of evidence_ref / candidate_anchor. For one sink call of a diff (evidence_ref, or candidate_anchor): the other calls of the same shape in the same binary on the same side, and where each landed in this diff — counts, never a verdict. The group carries group_ref (pass it to annotate_diff when a judgment leaned on the group), shape, member_count, by_landing and states_unreadable: a member that could not be read is never counted as not listed. sibling_set_bounds names what can make the group look smaller; members_offset pages the members. Full reference: get_tool_…

ParameterTypeDescription
diff_id *string
candidate_anchor
evidence_ref
members_offset

get_diff_meta

Required: diff_id. The meta facts of one diff: binary scope, tool versions, alignment and presence counts, and functions split by the view's own facts (unchanged / changed / unverified / no_body / alignment_undetermined / one_sided). version_skew=1: every delta is version_skew undetermined — do not read it as 'no change'. changed.no_scoped_signal is NOT 'noise'. diff_ok=0: the binary did not diff, and an empty get_diff_deltas for it is a BLIND SPOT, never 'no change'. Also banners, source_stale, the run pair's non_binary counts, string_delta (how many string literals sit on one side only; th…

ParameterTypeDescription
diff_id *string

get_diff_string_delta

Required: diff_id. The string literals present on one side only between a diff's two runs — a_only = A\B, b_only = B\A — each with its resolved reference anchors. A FACT, NOT proof a string was created or deleted (the two sides are different builds); a_only and b_only are symmetric. A ref with ref_in_func null is a reference in no function, shown not dropped. refs_exported False means that side exported no string_refs at all — UNKNOWN, never 'no references'. strings_truncated is each side's state (clean / truncated / unknown): a truncated or unknown side is NOT 'complete' (then unconfirm…

ParameterTypeDescription
diff_id *string
limitinteger
offsetinteger

get_diff_handoff

Required: run_pair. A standardized hand-off of a run pair's changed_real findings, one block per finding, paged by offset. Each block carries the recorded judgment, tmap's facts for the finding's subject shape (the change, the reachable shape, the same-shape siblings) and two analysis placeholders a person fills. tmap draws no conclusion here: a cell it cannot read states its reason, never blank. Blocks are in a fixed order (anchor_ref); follow next_offset. The pages concatenated are the file tmap review report --handoff writes; re-fetch from offset 0 if findings_digest changes. Throughout, th…

ParameterTypeDescription
run_pair *string
offsetinteger

get_function_alignment

Required: diff_id, function. The BinDiff-aligned counterpart of one function in a diff: function takes a name or an address in any form; side='a' resolves an A-side function to its B-side match, side='b' the reverse. Returns an ALIGNMENT FACT, never a verdict: alignment_confidence (trust in the pairing) and similarity (how much the pair differs). A name matching several functions on a side (an import stub and its body) returns reason='ambiguous' listing every candidate, never one picked. No match here is NOT proof the function was added or removed; presence lists the side's unmatched functions…

ParameterTypeDescription
diff_id *string
function
limitinteger
offsetinteger
sidestring

get_diff_capabilities

Required: diff_id. Per-dimension capability state of one diff: which dimensions each side could analyse (state_a / state_b) and whether the diff can delta them. delta_supported=0 is an EXPLICIT non-judgment: the dimension is visible but this diff produces no per-subject delta for it. Read it beside an empty get_diff_deltas — 'this diff does not delta that dimension', which is NOT the same as 'nothing changed'. Full reference: get_tool_reference(name="get_diff_capabilities").

ParameterTypeDescription
diff_id *string

list_diffs

Required: none. The version diffs in the atlas, one row per binary diffed between two runs (filter by run_a_id / run_b_id, the before / after roles): matched_pairs, version_skew, functions counts and diff status; with both run ids, coverage names what no diff of the pair sees. Similarity 1 is NOT 'unchanged' (BinDiff is blind to constants and buffer sizes). An EMPTY list means no diff has been run for that filter, not 'nothing changed'. A diff_ok=0 row is a BLIND SPOT with no counts. source_stale says whether a diff is current. Full reference: get_tool_reference(name="list_diffs").

ParameterTypeDescription
limitinteger
offsetinteger
run_a_id
run_b_id

list_diff_blindspots

Required: none. The binaries a full diff could NOT analyse between two runs (diff_ok=0), each with diff_status_reason, diff_attempts, suspected_hard and source_stale; plus partial — diffs that succeeded but whose export could not hold some functions as they are. UNKNOWN is not SAFE: a binary missing from the deltas may have failed to diff. suspected_hard is a hint, never proof the binary is undiffable. run_a_id / run_b_id are the before / after roles. Full reference: get_tool_reference(name="list_diff_blindspots").

ParameterTypeDescription
run_a_id
run_b_id

get_file_diff

Required: run_pair. The non-binary files of two runs (run_pair = {run_a}::{run_b}, any two runs from list_runs) compared by path: scripts, configs, credentials, web assets. change: a_only / b_only (recorded on one side only — not proof it was created or deleted), content_differs, same, undetermined. A page lists the differing files (filter kind / change) with their structured row differences and hunk_stats; path reads one file (offset pages its lists, hunk_offset its line difference); the first page counts the .ko modules and symbolic links, ko_offset (alone) pages their lists; detail='summa…

ParameterTypeDescription
run_pair *string
change
detailstring
hunk_offsetinteger
kind
ko_offset
limitinteger
offsetinteger
path

cross_firmware_patterns

Required: none. Per-pattern recurrence across the atlas: device_spread (the distinct firmware runs a pattern appears in) and pattern_breadth (distinct fine fingerprints); a candidate whose pattern recurs across many firmware images is worth reviewing sooner. Instances from stock binaries count too. Paged by limit / offset. DERIVED, NOT a verdict. Full reference: get_tool_reference(name="cross_firmware_patterns").

ParameterTypeDescription
limitinteger
offsetinteger

pattern_density

Required: none. Candidate-instance density per (run, sink_class, fingerprint); a count that differs for the same fingerprint across runs is an early recurrence signal. Paged by limit / offset. DERIVED counts only, NOT a verdict. Full reference: get_tool_reference(name="pattern_density").

ParameterTypeDescription
limitinteger
offsetinteger

get_pseudocode

Required: run_id + function, or evidence_ref. Decompiler pseudocode of one function (function = a name or an address in any form), the default read view. binary is a selector (sha256 or a >=8-hex prefix, full path or short name); a short name naming several binaries returns ``reason='ambiguous'`` with each candidate — an answer, not an error. Paged by line (offset = paging.next_offset); the segments joined in order are the text exactly. An empty text comes with ``pseudocode_status`` (skipped_micro inlines the disassembly). A miss says whether the function lives in another run. Full reference…

ParameterTypeDescription
binary
evidence_ref
function
offsetinteger
run_id

get_callees

Required: run_id + function, or evidence_ref. Direct callee names of one function (a name or an address), intra-binary edges flagged resolved to follow. binary is a selector; a short name naming several binaries returns ``reason='ambiguous'`` with each candidate. When function resolves, its binary is used. Full reference: get_tool_reference(name="get_callees").

ParameterTypeDescription
binary
evidence_ref
function
run_id

get_xrefs

Required: run_id + function, or evidence_ref. Cross-reference edges of one function F: direction='callers' / 'callees' (cross-binary edges included) or 'address_taken' (where F's entry address is stored as data — a dispatch-table slot or a literal pool — and which function took it): a FACT, NEVER proof F is dispatched/reachable. An empty caller set may mean an indirect call; entry_words then lists the data words that hold the entry value, and next names a get_data_table call. A stored value, not proof of a call. A short binary name naming several binaries returns ``reason='ambiguous'``. Fu…

ParameterTypeDescription
binary
directionstring
evidence_ref
function
limitinteger
offsetinteger
run_id

get_strings

Required: run_id + binary, or run_id + value, or evidence_ref. Recorded strings of one binary, or searched by value (substring) across the run with each hit's address and binary. ``function`` does NOT scope the results (they are binary-wide). Paged losslessly by byte size (offset = paging.next_offset). A binary's string export is capped: truncated / search_may_be_incomplete say so, and a string NOT found there is NOT proven absent. Without binary or value it is an error naming the run. A short binary name naming several binaries returns ``reason='ambiguous'``. Full reference: get_tool_referenc…

ParameterTypeDescription
binary
evidence_ref
function
offsetinteger
run_id
value

get_functions_referencing_string

Required: text; and run_id, or evidence_ref. Which functions' pseudocode TEXT contains a string (substring); binary narrows the scan. Capped (truncated). HONEST BOUND: a TEXT match, not a resolved symbol reference — it may sit in a comment or an unrelated literal; confirm each hit. get_string_reference_anchors is the parsed sibling. A short binary name naming several binaries returns ``reason='ambiguous'``. Full reference: get_tool_reference(name="get_functions_referencing_string").

ParameterTypeDescription
text *string
binary
evidence_ref
limitinteger
offsetinteger
run_id

get_string_reference_anchors

Required: text; and run_id, or evidence_ref. Where a string is referenced by RESOLVED Ghidra data references — the parsed sibling of get_functions_referencing_string: no comment noise, but only defined strings and recovered references, and text matches the string value EXACTLY (find the literal with get_strings(value=...) first). Each anchor: ref_at, ref_in_func, ref_in_func_addr, segment. no_resolved_dataref is NOT "this string is unreferenced"; string_refs_not_exported is unknown. A short binary name naming several binaries returns ``reason='ambiguous'``. Full reference: get_tool_reference…

ParameterTypeDescription
text *string
binary
evidence_ref
limitinteger
offsetinteger
run_id

get_imports_exports

Required: run_id + binary, or evidence_ref. Import and export symbol tables of one binary (the cross-binary edge endpoints). binary is a selector (sha256 or a >=8-hex prefix, full path or short name); a short name naming several binaries returns ``reason='ambiguous'`` listing each. Without binary (or an evidence_ref that supplies one) it is an error naming the run, not an empty answer. Full reference: get_tool_reference(name="get_imports_exports").

ParameterTypeDescription
binary
evidence_ref
limitinteger
offsetinteger
run_id

get_data_bytes

Required: address; and run_id + binary, or evidence_ref. The RAW bytes a data segment stores at address (hex, any form Ghidra shows; length bytes) — what a bare DAT_ name hides. BYTES ONLY — no interpretation travels with them; ascii is a mechanical rendering. The misses (uninitialized_bss, address_not_in_any_data_block, data_blocks_not_exported) differ on purpose and none of them means "the bytes are zero". bytes_from_executable_segment: treat the run as possibly INSTRUCTIONS until confirmed data. Without binary (or an evidence_ref that supplies one) it is an error naming the run, not an…

ParameterTypeDescription
address *string
binary
evidence_ref
lengthinteger
run_id

get_data_table

Required: address; and run_id + binary, or evidence_ref. The records of a data table around address, cut by the spacing of the words that hold a function's entry address — where get_xrefs' entry_words.next points. stride / field_offset (an int or a hex string) override the inferred ones; paged by record (limit / offset, follow next_offset). RECORDS BY ENTRY-WORD SPACING, not a declared layout: how the code uses a slot is yours to trace. Without binary (or an evidence_ref that supplies one) it is an error naming the run, not an empty answer. A short binary name naming several binaries returns…

ParameterTypeDescription
address *string
binary
evidence_ref
field_offset
limitinteger
offsetinteger
run_id
stride

get_script_callsites

Required: run_id + binary, or evidence_ref. Rootfs scripts that invoke one binary — entry-reach evidence (script + line + args), paged by offset. Each site's via says where the command came from (literal / function_arg / variable / inline) and via_line the line it was derived from; via is a mechanical provenance label, not a reachability verdict. Without binary (or an evidence_ref that supplies one) it is an error naming the run, not an empty answer. Full reference: get_tool_reference(name="get_script_callsites").

ParameterTypeDescription
binary
evidence_ref
offsetinteger
run_id

get_disassembly

Required: run_id + function, or evidence_ref. The disassembly listing Ghidra produced for one function (addresses line up with the pseudocode), paged by offset, or available: false with its reason (an older scan, or the listing export failed). Each instruction carries its bytes from the stored segments; where none covers it the bytes are null with a reason, never zeroed. A short binary name naming several binaries returns ``reason='ambiguous'``. Full reference: get_tool_reference(name="get_disassembly").

ParameterTypeDescription
binary
evidence_ref
function
offsetinteger
run_id

annotate

Required: evidence_ref, verdict, rationale; verdict=safe also needs block_source + block_point + block_why. Record YOUR OWN judgment on one candidate onto the overlay; the base map is unchanged. This is YOUR decision, not a tool fact. verdict: inconclusive, suspicious (floats), excluded (sinks), safe (sinks; needs block_source + block_point + block_why) or exploitable (floats above suspicious; chain + verification_gaps recommended). rationale: why + next step + confidence. Call it for a conclusion worth keeping past THIS session, not on every read. One annotation per candidate: re-annotating O…

ParameterTypeDescription
evidence_ref *string
rationale *string
verdict *string
block_point
block_source
block_why
chain
shared_prereq
verification_gaps

annotate_diff

Required: anchor_ref, verdict; exactly one of diff_id / run_pair; verdict=no_real_change also needs why_unchanged + checked; verdict=changed_real|change_inconclusive also needs rationale. Record YOUR OWN judgment on one diff entry (get_diff_patch_view) or one non-binary file (get_file_diff): did this change do something real. anchor_ref must name something the view lists now — never a blind write. verdict: changed_real (may carry evidence), no_real_change (why_unchanged + checked, at least one anchor read in the current view; Plain-text notes are kept but do not count) or change_inconclusive…

ParameterTypeDescription
anchor_ref *string
verdict *string
attributed_to
change_kind
checked
diff_id
evidence
group_ref
rationale
run_pair
unit_id
why_unchanged
worker
workers

annotate_diff_batch

Required: annotations; exactly one of diff_id / run_pair. Record YOUR judgments on many entries of one diff at once — all of them or none. annotations is 1..200 objects with annotate_diff's per-entry fields and no diff_id: anchor_ref + verdict, optionally rationale, checked, why_unchanged, evidence, group_ref, change_kind. Only those eight keys — a stray key fails that item. unit_id as in annotate_diff. Every item is validated first; if any fails nothing is written and the failures come back merged by message with their indexes. The same anchor_ref twice refuses the batch. Full reference:…

ParameterTypeDescription
annotations *array
attributed_to
class_basis
diff_id
run_pair
unit_id
worker
workers

promote

Required: diff_id, entry_id, row_ref, verdict, rationale; verdict=safe also needs block_source + block_point + block_why; verdict=exploitable also needs chain + verification_gaps. Carry a judgment reached on a diff entry onto ONE of its candidates, as that candidate's own annotation: entry_id (the entry's entry_id or anchor_ref), row_ref (a row's a_ref or b_ref); verdict, rationale and the basis fields are annotate's, and exploitable needs chain + verification_gaps here. Refused, with the facts that refused it, unless the row lands A, persisted or P unmatched_analysis_complete, the counterpart…

ParameterTypeDescription
diff_id *string
entry_id *string
rationale *string
row_ref *string
verdict *string
allow_stale_sourceboolean
block_point
block_source
block_why
chain
shared_prereq
verification_gaps

list_overlays

Required: none. Your overlay annotations — the resume view — filtered by verdict and run_id (both AND together). Each row carries its live basis_state: unchanged, changed (re-review; the delta names what moved), unverifiable (an honest can't-say, never a clean bill) or anchor_unresolved; a promoted one carries promoted_from. Stale rows are surfaced, never dropped. These are AGENT decisions on the overlay, not tool facts. anchor_kind='diff_subject' lists your diff judgments instead (run_id is then a run pair, with review_progress). Paged (limit / offset; follow next_offset until null), in t…

ParameterTypeDescription
anchor_kindstring
limitinteger
offsetinteger
run_id
verdict

clear_overlay

Required: run_id, or evidence_ref, or anchor_ref, or clear_all=true. Delete overlay annotations and report how many went. The base map is untouched. Pass ONE scope: run_id (one firmware), evidence_ref (one candidate) or, with anchor_kind='diff_subject', anchor_ref (one diff judgment; run_id is then a run pair). No scope deletes nothing unless clear_all=true, which wipes every annotation of that kind — it cannot be undone. Full reference: get_tool_reference(name="clear_overlay").

ParameterTypeDescription
anchor_kindstring
anchor_ref
clear_allboolean
evidence_ref
run_id

list_verified_exploits

Required: none. The private exploit records a person wrote: distinct_exploits and records, each with its pattern and a has_exploit_evidence flag. The full exploit_note is WITHHELD unless reveal=True; reveal=True is a discipline path, not a protected one — on reveal it rides your own care. Full reference: get_tool_reference(name="list_verified_exploits").

ParameterTypeDescription
revealboolean

get_tool_reference

Required: none. This server's own reference. name=<tool>: that tool's full description, its required parameters (as the first line and as rules), a minimal call and every parameter; name='guide': the full working guide; name='parameters': the parameter-name table; no name: every tool with its required parameters. It reads only this server's own constants, so nothing in it can be out of date. Full reference: get_tool_reference(name="get_tool_reference").

ParameterTypeDescription
name