Skip to content
Back to search

reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/2akouwu--reverify/badge.svg)](/listings/2akouwu--reverify)

HTML

<a href="/listings/2akouwu--reverify"><img src="/api/listings/2akouwu--reverify/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Install the CLI + MCP server from PyPI:
pip install reverify        # pure-Python core; or "reverify[full]" for capstone+unicorn+lief
reverify auto sample.bin --json

# Or run straight from a checkout — pure standard library, nothing to install:
python reverify/cli.py auto sample.bin --json
python reverify/cli.py parse-pe sample.exe --json
python reverify/cli.py disasm 90505831C0C3 --arch x86_64

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 420 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <h1 align="center">Reverify</h1>
  2. <p align="center">
  3. <strong>Stop your AI from making things up.</strong><br>
  4. It proposes; deterministic tools check every claim against ground truth, and only what's verified counts.
  5. </p>
  6. <p align="center">
  7. <a href="https://pypi.org/project/reverify/"><img src="https://img.shields.io/pypi/v/reverify?color=3fb950" alt="PyPI"></a>
  8. <img src="https://img.shields.io/pypi/pyversions/reverify" alt="Python">
  9. <a href="https://github.com/2akouwu/reverify/actions/workflows/ci.yml"><img src="https://github.com/2akouwu/reverify/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
  10. <a href="https://codecov.io/gh/2akouwu/reverify"><img src="https://codecov.io/gh/2akouwu/reverify/graph/badge.svg" alt="Coverage"></a>
  11. <a href="https://scorecard.dev/viewer/?uri=github.com/2akouwu/reverify"><img src="https://api.scorecard.dev/projects/github.com/2akouwu/reverify/badge" alt="OpenSSF Scorecard"></a>
  12. <a href="LICENSE"><img src="https://img.shields.io/github/license/2akouwu/reverify" alt="MIT"></a>
  13. <img src="https://img.shields.io/github/stars/2akouwu/reverify?style=social" alt="Stars">
  14. </p>
  15. <p align="center">
  16. <a href="https://app.ona.com/#https://github.com/2akouwu/reverify">
  17. <img src="https://ona.com/build-with-ona.svg" alt="Build with Ona" />
  18. </a>
  19. </p>
  20. AI is confident and often wrong: it invents an API, a struct field, an offset, or what a
  21. function does, and says it like fact. Reverify makes a deterministic tool the judge — the model
  22. proposes a claim, the tool checks it against the actual artifact, and it comes back **VERIFIED /
  23. REFUTED with evidence**. The model never gets to assert a fact on its own.
  24. Two things it does today:
  25. - **Keeps your AI honest** — every structural or behavioral claim is checked against ground
  26. truth, not trusted, and only what survives becomes a fact (`reverify verify`, or the MCP
  27. server your agent already talks to).
  28. - **Keeps your AI's context from rotting** — instead of a lossy auto-summary, `reverify rollover`
  29. hands the session off to a file and starts a fresh one, so long tasks don't drift or need
  30. `/clear`. Works in Claude Code, Codex, Gemini CLI and OpenCode.
  31. The hardest place to prove the first point is binary reverse engineering, where hallucination is
  32. worst — so that's where the numbers come from. On 71 real Windows system files the AI's textbook
  33. answer was wrong **97% of the time**; reverify caught every one and **never accepted a wrong
  34. claim** (0 of 71; the same gate runs in CI on Linux and macOS every push, and an independent
  35. aarch64 run found the same) ([EXAMPLE.md](EXAMPLE.md), [BENCHMARK.md](BENCHMARK.md);
  36. `python benchmarks/prologue_prior.py`).
  37. <p align="center">
  38. <img src="docs/demo.svg" alt="Reverify catches the model's hallucinated prologue on kernel32.dll, then verifies the corrected claim" width="760">
  39. </p>
  40. ## The problem
  41. Language models are great at reading code and unreliable at reverse engineering. Ask a
  42. model to reconstruct a struct or an algorithm from a binary and it will confidently invent
  43. offsets, sizes, and behavior. In binary analysis this hallucination problem is far worse
  44. than in source code, and *"did the model just make that up?"* is the single biggest blocker
  45. to using AI for real RE.
  46. ## What Reverify does
  47. Reverify pairs a language model with a **deterministic, pure-Python RE toolkit** and makes the
  48. toolkit the judge. The model proposes; the tools verify. A hypothesis about a structure or an
  49. algorithm is only reported once it has been **checked against the actual bytes** — disassembled,
  50. pattern-matched, or executed in the emulator — so the output is grounded in the binary instead
  51. of the model's imagination.
  52. - **Deterministic core** — PE/ELF/Mach-O parsing, x86/x64/ARM/ARM64 disassembly, AOB pattern
  53. scanning, CPU emulation, Protobuf/TLV dissection, Frida hook generation. Pure Python out of
  54. the box; installs clean with no Ghidra.
  55. - **Mature engines, optional** — with `pip install "reverify[full]"` the toolkit upgrades
  56. itself in place to **capstone** (disassembly), **unicorn** (real CPU emulation), **lief**
  57. (PE/ELF/Mach-O) and **Z3** (proofs); `pip install "reverify[angr]"` adds **angr** for
  58. function boundaries, the call graph and cross-references. Not installed? It falls back to
  59. the pure-Python core. `reverify backends` shows what's active.
  60. - **Grounded, not guessed** — structural claims are verified against the binary by the tools.
  61. - **Not only binaries** — `reverify equiv <reference> <candidate> --lang python` (or C) runs a
  62. candidate implementation and a reference over shared inputs and checks they agree, so an AI's
  63. rewrite or refactor is *tested, not trusted* — a refutation comes back with the input and both
  64. outputs. The same rigour, aimed at ordinary source code.
  65. - **Agent-native** — ships as an MCP server, so Claude Code, Cursor, and other agents can call
  66. the tools directly; also a plain CLI.
  67. > Reverify is for **authorized** reverse engineering — malware analysis, CTF, interoperability
  68. > research, and software you own or are permitted to analyze. See [SECURITY.md](SECURITY.md).
  69. ## Quick start
  70. ```bash
  71. # Install the CLI + MCP server from PyPI:
  72. pip install reverify # pure-Python core; or "reverify[full]" for capstone+unicorn+lief
  73. reverify auto sample.bin --json
  74. # Or run straight from a checkout — pure standard library, nothing to install:
  75. python reverify/cli.py auto sample.bin --json
  76. python reverify/cli.py parse-pe sample.exe --json
  77. python reverify/cli.py disasm 90505831C0C3 --arch x86_64
  78. ```
  79. ## The verification loop
  80. This is what the name is about. A **claim** is any hypothesis about the binary; the
  81. deterministic tools are the judge and hand back `VERIFIED`, `REFUTED`, or
  82. `INCONCLUSIVE` together with the bytes they actually observed:
  83. ```bash
  84. reverify verify sample.bin --claim '{
  85. "kind": "instructions", "offset": 4096,
  86. "mnemonics": ["push", "mov", "sub"], "note": "function prologue"
  87. }'
  88. ```
  89. ```bash
  90. # Check a reconstructed routine actually computes what the model claimed:
  91. reverify verify - --claim '{
  92. "kind": "emulate_result", "code": "b805000000b90300000001c8c3",
  93. "arch": "x86", "expect_registers": {"eax": 8}
  94. }'
  95. ```
  96. Claims can be batched from a JSON file (`--claims-file claims.json`); the CLI exits
  97. non-zero if **anything** is refuted, so an agent or CI job can gate on a grounded
  98. reconstruction. Claim kinds: `bytes_at`, `u16_at` / `u32_at` / `u64_at` (typed reads, no
  99. endianness math), `pattern_present`, `string_present`, `instructions` (mnemonics and
  100. optionally operands), `emulate_result`, `behavior_equiv`, `prove_equiv`, `protobuf_field`,
  101. `import_present`, `export_present`, `section_present`, and the semantic kinds
  102. `function_at`, `calls`, `references`, `reachable_from_entry` (see
  103. [The semantic layer](#the-semantic-layer-functions-calls-and-cross-references)). Offsets are file offsets unless a claim says
  104. `"space": "rva"` or `"va"`; the verifier translates through the section table and echoes
  105. all three addresses in the evidence, and a refuted `bytes_at` reports where the expected
  106. bytes actually are. Set `"observe": true` (or omit `expected`) to have the tools *read* a
  107. value instead of asserting one, and `"depends_on": [...]` so a refuted root invalidates
  108. the claims built on it.
  109. ### Grounded means *informative*, not just "nothing refuted"
  110. "Every claim verified" is trivially reachable: assert that the file starts with `MZ` and
  111. that `.text` exists. So Reverify also weighs how much a verified set actually says. Each
  112. result carries a `weight` — zero for claims that merely restate the fact sheet the model was
  113. shown, for duplicates, for inline code/data that does not occur in the binary
  114. (self-referential), and for echoes of the tools' own previous output; otherwise it is
  115. **measured from the binary itself** — how often the expected content occurs in this file and
  116. how much entropy it has — so zero padding, a ubiquitous prologue, or a pattern that matches
  117. everywhere weigh almost nothing even though they verify, and emulation must actually execute
  118. non-degenerate code. A reconstruction is **grounded** only when nothing
  119. is refuted *and* the verified weight reaches `--min-information` (default 1.0). This follows
  120. the CORE refinement of FActScore: credit only claims that are factual, informative and
  121. non-repetitive. `reverify reconstruct --samples N` draws several proposals per round and
  122. lets the verifier — not the model's confidence — select among them.
  123. [EXAMPLE.md](EXAMPLE.md) walks through one run on `kernel32.dll` — the model
  124. proposes the textbook prologue from prior, the verifier refutes it with the real
  125. bytes, and the model corrects to grounded, with no API key and no specific model.
  126. [BENCHMARK.md](BENCHMARK.md) is the reproducible measurement behind the numbers above.
  127. ## Evidence, not claims
  128. Everything above is checkable without trusting the author:
  129. - **The verifier is checked by independent judges**, not by its own tests: the pure
  130. parser against lief on real binaries, the disassembler against capstone, binutils
  131. `objdump` and hand-verified Intel vectors, the emulator against Unicorn, the semantic
  132. engine against the export table — plus fuzzing that a malformed file never crashes the
  133. reader and that a wrong claim is never VERIFIED. All of it runs in CI on Linux, Windows
  134. and macOS, with and without the engines; a nightly job fuzzes 20k inputs.
  135. - **The benchmark runs in CI on every push, on each platform's own system binaries**, and
  136. **fails the build if a single wrong claim is VERIFIED**. Each run leaves a
  137. machine-readable record — SHA-256 of every binary, verdicts, tool versions — as an
  138. artifact; reference runs live in [`benchmarks/results/`](benchmarks/results/), and a
  139. third-party aarch64 replication is in [BENCHMARK.md](BENCHMARK.md).
  140. - **The verifier is measured like a classifier**: for every claim kind, known-true and
  141. known-false claims on real binaries give a confusion matrix — 0 false VERIFIED of 475
  142. known-false claims, 0 known-true claims missed — gated in every CI job.
  143. - **Every verdict carries a receipt**: `reverify verify --json` (and `re_verify_claim`)
  144. include the binary's SHA-256, the reverify version and which engines judged, so a report
  145. can be handed over and replayed rather than believed. Releases ship with a SLSA build
  146. provenance attestation.
  147. - **A replication package**: [`benchmarks/README.md`](benchmarks/README.md) — one command
  148. per benchmark, a pinned Dockerfile, expected output, and how to submit a run; a
  149. model-in-the-loop benchmark anyone can run against any OpenAI-compatible endpoint.
  150. ## The ledger: state that survives a context reset
  151. Every agent harness handles a full context window the same way — a model summarizes the
  152. transcript, the rest is dropped, and the docs warn that repeated compactions degrade
  153. accuracy. That loss is unavoidable for free-form conversation, because nothing in a
  154. transcript says which parts were *state* and which were chatter.
  155. Reverify's loop can do better for itself, because it already draws that line: the only
  156. things that matter are what the tools **verified, observed, proved — and refuted**.
  157. Everything else (the model's prose, its unverified guesses) was never trusted, so dropping
  158. it loses nothing. Since v0.8.0 exactly that state is written to disk as it happens:
  159. - **`.reverify/ledger/<sha256>.json` per binary** (content-keyed, so a renamed copy shares
  160. its ledger), checkpointed after **every** round — a crash, a `/clear`, an auto-compact or
  161. a new process all resume from the same grounded position.
  162. - **Negative memory**: refutations come back as `KNOWN FALSE`, so a fresh context does not
  163. re-propose the same wrong prior — the part a summary usually drops.
  164. - **Bounded in context, unbounded on disk**: the prompt shows the most recent `--max-facts`
  165. (proof-grade facts pinned), and a deterministic ladder trims the *shown* fact sheet to
  166. `--prompt-budget` characters (kernel32.dll: 43k chars fit a 20k budget with the section
  167. table, entry point and header intact). Scoring uses the full sheet, so hiding a fact never
  168. makes restating it profitable, and a claim already in the ledger scores zero (`known`).
  169. - **Lazy hand-off**: the hook injects one index line per binary; the facts are pulled on
  170. demand, so recovering state costs a few dozen tokens, not a slice of the fresh window.
  171. ```bash
  172. reverify reconstruct target.exe --goal "..." # resumes from .reverify/ automatically
  173. reverify ledger target.exe # what is established, what is known false
  174. reverify ledger --hook # Claude Code SessionStart hook (compact|clear|resume)
  175. ```
  176. Over MCP the same happens with no setup: `re_verify_claim` records every grounded result,
  177. and `re_ledger` hands them back after the host compacts or clears its context (the
  178. server's `instructions` tell the agent to do so). Nothing unverified is ever stored — claim
  179. notes are excluded on purpose.
  180. ## The loop that never fills up: fresh sessions with a verified hand-off
  181. For a long task the ledger is not enough on its own — something has to decide *when* to
  182. drop the transcript and *what* the next context starts with. `reverify orchestrate` runs a
  183. goal as a sequence of fresh-context sessions and keeps the model in charge of the timing:
  184. ```bash
  185. reverify orchestrate target.exe --goal "map the loader: entry, imports it really uses, exports" \
  186. --driver claude # Claude Agent SDK on your Claude Code login; or openai (OPENAI_* env), or mock
  187. ```
  188. - The model works through a small JSON protocol: propose claims, take notes, update its
  189. hand-off, **ask for a rollover** when its context feels long or confused, or declare done.
  190. - A rollover also happens on a **token budget** per session and on **drift** — when
  191. restatements (trivial, echo, already-known) dominate the last turns, the loop is going in
  192. circles and gets a fresh start.
  193. - The next session opens with the fact sheet, a one-line ledger index and a bounded
  194. hand-off. **ESTABLISHED and KNOWN FALSE come from the ledger, never from the model**; the
  195. model's own decisions and notes travel labelled *unverified*. That is the difference from
  196. every "summarize and continue" loop: a hallucination cannot ride the hand-off into the
  197. next context as if it were a fact.
  198. - The checkpoint (`.reverify/sessions/<task>/checkpoint.json`, with a history) resumes across
  199. runs (`--task <id>`). Over MCP, `re_checkpoint` saves and loads the same hand-off so an
  200. agent that lives in someone else's context (Claude Code, Cursor) can do the same before
  201. its host compacts or clears.
  202. A real run with the Claude Agent SDK driver on `msimg32.dll` (2 sessions × 4 turns, no API
  203. key): 15 grounded facts across the rollover — the real entry-point instructions, the machine
  204. type, header pointers read through typed observes — 2 guessed call-stub patterns refuted, 0
  205. false accepts, and the second session started from the ledger, not from a summary
  206. ([`benchmarks/results/orchestrate-claude-msimg32-2026-09-04.json`](benchmarks/results/orchestrate-claude-msimg32-2026-09-04.json)).
  207. ## Any agent CLI without compaction: `reverify rollover`
  208. The same rule applied to an interactive session — Claude Code, Codex CLI, Gemini CLI or
  209. OpenCode. Built-in compaction is turned off; the model hands off to files, and instead of a
  210. model-written summary the session is *replaced* wherever the CLI lets a hook do that (Gemini
  211. CLI, OpenCode) or a launcher owns the process. Where it does not (a plain `claude` or `codex`),
  212. reverify keeps the context *lean* rather than pretending to clear it: bulky tool output goes to
  213. files that stay re-readable, edits stay local, exploration goes to subagents, and the hand-off
  214. is always current. We are asking those vendors for the missing primitive.
  215. ```bash
  216. pip install reverify
  217. reverify rollover install # every CLI found on PATH (or --harness claude,codex,gemini,opencode); backups kept
  218. reverify rollover doctor # what is wired, whether the hook commands still resolve, recent events
  219. ```
  220. Then use your CLI exactly as before. The hooks do the hand-off; Gemini CLI and OpenCode also
  221. open the fresh session themselves. For Claude Code and Codex, or whenever you want the fresh
  222. session to open automatically, start the CLI through the launcher instead:
  223. ```bash
  224. reverify rollover claude # same arguments as the CLI itself, e.g.
  225. reverify rollover codex --full-auto
  226. reverify rollover instructions --write AGENTS.md # optional: the protocol paragraph for the model
  227. ```
  228. - **A session nobody can end keeps growing — check `doctor`.** The hooks can write the hand-off
  229. but cannot end a Claude Code or Codex session. If you start the CLI yourself, or through the
  230. desktop app, a background job (`claude --bg`), or Remote Control server mode, the hand-off is
  231. written and nothing follows it: with native compaction off the conversation has no ceiling (one
  232. measured session reached 909k tokens before its owner noticed). `reverify rollover doctor` now
  233. reports receipts that no launcher consumed. Either start the CLI through the launcher
  234. (`reverify rollover claude --remote-control` keeps phone/web access through Remote Control), or
  235. set `REVERIFY_ROLLOVER_SUCCESSOR=bg` in `~/.claude/settings.json` → `env`: every receipt then
  236. starts a fresh `claude --bg` session that opens with the hand-off and appears in your session
  237. list, and you switch to it. Neither route resumes or rewrites the old transcript. The successor
  238. starts in the old session's project directory (Claude Code keys trust and MCP approvals per
  239. project), and `doctor` names a successor that is stuck waiting on an approval.
  240. - **Small windows stay safe.** Native compaction is off, so when the harness records the
  241. model's context window (Codex does) the threshold is capped at 75% of it and the hand-off is
  242. refreshed more often.
  243. - **Guard.** At the harness's "turn finished" hook (Claude Code / Codex `Stop`, Gemini
  244. `AfterAgent`, OpenCode `session.idle` via a plugin) the guard measures the live context from
  245. the harness's own transcript. At the threshold (`REVERIFY_ROLLOVER_TOKENS`, default 200k),
  246. or when the model itself runs `reverify rollover request --reason ...`, it blocks one stop
  247. and asks the model to write the hand-off *file* — fixed sections, labelled UNVERIFIED — and
  248. its memory index. Nothing is summarized in the conversation.
  249. - **Receipt, fail closed.** On the next stop the guard checks that the hand-off was really
  250. rewritten and is well-formed; only then does it write a receipt carrying the transcript's
  251. SHA-256 and the user's **verbatim** first and latest messages. A missing or malformed
  252. hand-off means no receipt and a re-arm 100k further up.
  253. - **Fresh session.** Whoever can end the session does it: the launcher for any CLI (waits for
  254. the receipt, gives a queued user message a moment to land — if one did, that rollover is
  255. off — ends the session, starts a fresh one whose first message points at the hand-off and
  256. quotes the original request verbatim); Gemini CLI in-process through its own
  257. `clearContext`, with the opening injected on the next turn; OpenCode through the SDK
  258. (new session, opening prompt). The old transcript stays on disk as an audit trail and is
  259. never resumed; every decision is appended to `~/.reverify/rollover/events.jsonl`.
  260. - **What `install` touches**, all with backups and reversible by `uninstall`: Claude Code
  261. `~/.claude/settings.json` (hooks, `autoCompactEnabled: false`); Codex `~/.codex/hooks.json`
  262. + `config.toml` (`[features] hooks = true`, a compaction limit no session reaches); Gemini
  263. `~/.gemini/settings.json` (hooks, `model.compressionThreshold` above 1); OpenCode
  264. `~/.config/opencode/plugins/reverify-rollover.js` + `opencode.json` (`compaction.auto: false`;
  265. the directory follows `OPENCODE_CONFIG_DIR` / `XDG_CONFIG_HOME` exactly as opencode does).
  266. Compare with a compaction summary: the hand-off is written while the model still has the
  267. whole context, into a file with a fixed shape, separated from verified facts (memory files,
  268. the ledger) — and the conversation that produced it is dropped, not paraphrased. Zero
  269. dependencies; the hooks fail open, the rollover fails closed.
  270. ## The semantic layer: functions, calls and cross-references
  271. Bytes, instructions, imports and emulation are what the deterministic core can judge on
  272. its own. The claims analysts actually make — *function X calls Y*, *this string is
  273. referenced from that routine*, *this code is reachable from the entry point* — need
  274. function boundaries and cross-references, which means a real program-analysis engine.
  275. Reverify does not build one. It stands on **angr** (`pip install "reverify[angr]"`) and
  276. keeps its own part thin: an engine-neutral view of functions, call edges, data references
  277. and reachability, and four claim kinds checked against it.
  278. ```bash
  279. reverify functions msimg32.dll # what the engine recovered
  280. reverify verify msimg32.dll \
  281. --claim '{"kind": "calls", "params": {"from": "AlphaBlend", "to": "SetLastError"}}' \
  282. --claim '{"kind": "references", "params": {"to": 12632, "space": "rva", "from": "AlphaBlend"}}' \
  283. --claim '{"kind": "function_at", "params": {"offset": 4112, "space": "rva"}}' \
  284. --claim '{"kind": "reachable_from_entry", "params": {"name": "DllInitialize"}}'
  285. ```
  286. A refuted `calls` lists the function's real callees and a refuted `references` lists the
  287. functions that do reference the address, so a model can fix the claim instead of guessing
  288. again. `observe: true` reads instead of asserts (a function's size, blocks and callees; the
  289. referencing functions of a string).
  290. Honesty about strength: a recovered control-flow graph is *analysis-derived* — CFGFast is
  291. heuristic and can miss or split functions — so semantic verdicts name the engine and are
  292. recorded at a **`DERIVED`** tier below `VERIFIED`. Without an engine the pure fallback only
  293. knows what is independently certain (the entry point and the exports are function starts)
  294. and answers `INCONCLUSIVE` for everything else, never a guess. And the engine is checked the
  295. way the readers are: the export table, parsed independently of angr, must agree with the
  296. functions it recovers.
  297. ## The toolkit
  298. | Command | What it does |
  299. |---|---|
  300. | `reconstruct` | **Closed loop: a model proposes claims, the tools verify, iterate until grounded** |
  301. | `verify` | **Check a claim about the binary against the tools — VERIFIED / REFUTED / INCONCLUSIVE** |
  302. | `verify` (behavior_equiv) | **Run the original function and a candidate over shared inputs; a mismatch returns a counterexample** |
  303. | `auto` | Auto-triage: detect format, architecture, sections, top strings |
  304. | `parse` | PE / ELF / Mach-O: arch, entry, sections, imports, exports (lief when installed) |
  305. | `parse-pe` | PE32/PE32+ headers, imports, exports |
  306. | `backends` | Show which engines are active (capstone / unicorn / lief) |
  307. | `disasm` | x86/x64 disassembly of hex or a section |
  308. | `pattern-scan` | AOB scan with `??` wildcards |
  309. | `strings` | ASCII + UTF-16LE extraction with offsets |
  310. | `emulate` | CPU register/stack micro-emulation |
  311. | `decode-protobuf` / `decode-tlv` | schema-less wire-format dissection |
  312. | `gen-hook` | Frida interceptor script generation |
  313. | `hexdump` | aligned hex dump |
  314. | `diff-patch` | binary diff / patch generation |
  315. | `audit-boundary` | defensive filesystem/SSRF boundary audit |
  316. ## MCP server
  317. Reverify exposes the toolkit to AI agents over the Model Context Protocol:
  318. ```bash
  319. python reverify/mcp_server.py
  320. ```
  321. Point Claude Code or Cursor at it and the agent can parse, disassemble, and scan binaries
  322. directly — with the deterministic tools as ground truth. The `re_verify_claim` tool exposes
  323. the verification loop, so an agent can have its own hypotheses judged against the bytes
  324. before it reports them — and records every grounded result in the binary's ledger.
  325. `re_ledger` restores that state after the host's own compaction or `/clear` (see
  326. [The ledger](#the-ledger-state-that-survives-a-context-reset)); ledgers are also exposed as
  327. `reverify://ledger/<sha>` resources.
  328. ## Status
  329. **v0.9.0 — the semantic layer**, on [PyPI](https://pypi.org/project/reverify/)
  330. (`pip install reverify`). The tool-grounded judge — a claim about the binary is checked
  331. against the actual bytes and returned as `VERIFIED` / `REFUTED` / `INCONCLUSIVE` /
  332. `OBSERVED` / `INVALIDATED` with evidence — ships as `reverify verify` and the
  333. `re_verify_claim` MCP tool, and `reverify reconstruct` closes the loop. v0.3.0 brought the
  334. mature engines (capstone, unicorn, lief); v0.4.x hardened the loop against gaming
  335. (information-weighted scoring measured from the binary, address spaces, typed reads,
  336. observe-then-assert, dependencies) and added a testbed that cross-checks the readers
  337. themselves (pure parser vs lief on real binaries, disassembler/emulator vs capstone, Unicorn
  338. and known-answer vectors, plus fuzzing). **v0.5.0** adds the strongest grounding — the
  339. `behavior_equiv` claim runs the original function and a candidate reconstruction over shared
  340. inputs and compares outputs, returning a concrete counterexample on a mismatch (the ExeBench /
  341. LLM4Decompile re-executability methodology). **v0.6.0** makes the reconstruction loop two-stage
  342. (observe, then hypothesize) with an established-facts ledger: only what the tools verified or
  343. read is carried between rounds, so the model can't build on its own earlier guesses — the
  344. defense against context hallucination. **v0.7.0** adds a proof tier: the `prove_equiv` claim uses
  345. Z3 to prove two expressions equal for *all* inputs (verifying MBA deobfuscation), giving an honest
  346. strength ladder — proven > tested > observed. **v0.8.0** makes the loop's state durable: a
  347. per-binary ledger of what the tools verified, observed, proved and refuted, checkpointed every
  348. round and restored after `/clear`, compaction or a restart — lossless by construction, because
  349. nothing the model said on its own was ever kept. **v0.9.0** adds the semantic layer on angr:
  350. function boundaries, the call graph and cross-references as `function_at` / `calls` /
  351. `references` / `reachable_from_entry` claims, recorded at an honest `DERIVED` tier, with the
  352. export table as an independent oracle for the engine. Tested with 208 unit tests, so the
  353. verifier is not just trusted, it is checked.
  354. ## Community
  355. Shared on [LINUX DO](https://linux.do). Bugs and false-accept reports: open an issue.
  356. ## License
  357. MIT — see [LICENSE](LICENSE).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.