reverify 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
reverify-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Reverify contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: reverify
3
+ Version: 0.1.0
4
+ Summary: Verified reverse engineering: AI RE grounded on deterministic tools — claims checked against the binary, not hallucinated.
5
+ Author: 2akouwu
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/2akouwu/reverify
8
+ Project-URL: Repository, https://github.com/2akouwu/reverify
9
+ Project-URL: Issues, https://github.com/2akouwu/reverify/issues
10
+ Keywords: reverse-engineering,binary-analysis,disassembler,frida,protobuf,mcp,ai-agents,malware-analysis,ctf
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Security
16
+ Classifier: Topic :: Software Development :: Disassemblers
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: capstone
21
+ Requires-Dist: capstone>=5.0; extra == "capstone"
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ <h1 align="center">Reverify</h1>
27
+
28
+ <p align="center">
29
+ <strong>Reverse engineering you can trust.</strong><br>
30
+ An AI-assisted RE toolkit whose findings are checked against the binary — not hallucinated.
31
+ </p>
32
+
33
+ ## The problem
34
+
35
+ Language models are great at reading code and unreliable at reverse engineering. Ask a
36
+ model to reconstruct a struct or an algorithm from a binary and it will confidently invent
37
+ offsets, sizes, and behavior. In binary analysis this hallucination problem is far worse
38
+ than in source code, and *"did the model just make that up?"* is the single biggest blocker
39
+ to using AI for real RE.
40
+
41
+ ## What Reverify does
42
+
43
+ Reverify pairs a language model with a **deterministic, pure-Python RE toolkit** and makes the
44
+ toolkit the judge. The model proposes; the tools verify. A hypothesis about a structure or an
45
+ algorithm is only reported once it has been **checked against the actual bytes** — disassembled,
46
+ pattern-matched, or executed in the emulator — so the output is grounded in the binary instead
47
+ of the model's imagination.
48
+
49
+ - **Deterministic core** — PE32/PE32+ parsing, x86/x64 disassembly, AOB pattern scanning,
50
+ CPU micro-emulation, Protobuf/TLV dissection, Frida hook generation. Pure Python, no Ghidra,
51
+ no heavy install.
52
+ - **Grounded, not guessed** — structural claims are verified against the binary by the tools.
53
+ - **Agent-native** — ships as an MCP server, so Claude Code, Cursor, and other agents can call
54
+ the tools directly; also a plain CLI.
55
+
56
+ > Reverify is for **authorized** reverse engineering — malware analysis, CTF, interoperability
57
+ > research, and software you own or are permitted to analyze. See [SECURITY.md](SECURITY.md).
58
+
59
+ ## Quick start
60
+
61
+ ```bash
62
+ # From a checkout — pure standard library, nothing to install:
63
+ python reverify/cli.py auto sample.bin --json
64
+ python reverify/cli.py parse-pe sample.exe --json
65
+ python reverify/cli.py disasm 90505831C0C3 --arch x86_64
66
+
67
+ # Or install the CLI + MCP server:
68
+ pip install -e . # optional: pip install -e ".[capstone]" for full disassembly
69
+ reverify auto sample.bin --json
70
+ ```
71
+
72
+ ## The verification loop
73
+
74
+ This is what the name is about. A **claim** is any hypothesis about the binary; the
75
+ deterministic tools are the judge and hand back `VERIFIED`, `REFUTED`, or
76
+ `INCONCLUSIVE` together with the bytes they actually observed:
77
+
78
+ ```bash
79
+ reverify verify sample.bin --claim '{
80
+ "kind": "instructions", "offset": 4096,
81
+ "mnemonics": ["push", "mov", "sub"], "note": "function prologue"
82
+ }'
83
+ ```
84
+
85
+ ```bash
86
+ # Check a reconstructed routine actually computes what the model claimed:
87
+ reverify verify - --claim '{
88
+ "kind": "emulate_result", "code": "b805000000b90300000001c8c3",
89
+ "arch": "x86", "expect_registers": {"eax": 8}
90
+ }'
91
+ ```
92
+
93
+ Claims can be batched from a JSON file (`--claims-file claims.json`); the CLI exits
94
+ non-zero if **anything** is refuted, so an agent or CI job can gate on a grounded
95
+ reconstruction. Supported claim kinds: `bytes_at`, `pattern_present`,
96
+ `string_present`, `instructions`, `emulate_result`, `protobuf_field`, `pe_import`.
97
+
98
+ ## The toolkit
99
+
100
+ | Command | What it does |
101
+ |---|---|
102
+ | `verify` | **Check a claim about the binary against the tools — VERIFIED / REFUTED / INCONCLUSIVE** |
103
+ | `auto` | Auto-triage: detect format, architecture, sections, top strings |
104
+ | `parse-pe` | PE32/PE32+ headers, imports, exports |
105
+ | `disasm` | x86/x64 disassembly of hex or a section |
106
+ | `pattern-scan` | AOB scan with `??` wildcards |
107
+ | `strings` | ASCII + UTF-16LE extraction with offsets |
108
+ | `emulate` | CPU register/stack micro-emulation |
109
+ | `decode-protobuf` / `decode-tlv` | schema-less wire-format dissection |
110
+ | `gen-hook` | Frida interceptor script generation |
111
+ | `hexdump` | aligned hex dump |
112
+ | `diff-patch` | binary diff / patch generation |
113
+ | `audit-boundary` | defensive filesystem/SSRF boundary audit |
114
+
115
+ ## MCP server
116
+
117
+ Reverify exposes the toolkit to AI agents over the Model Context Protocol:
118
+
119
+ ```bash
120
+ python reverify/mcp_server.py
121
+ ```
122
+
123
+ Point Claude Code or Cursor at it and the agent can parse, disassemble, and scan binaries
124
+ directly — with the deterministic tools as ground truth. The `re_verify_claim` tool exposes
125
+ the verification loop, so an agent can have its own hypotheses judged against the bytes
126
+ before it reports them.
127
+
128
+ ## Status
129
+
130
+ **v0.1.0 — the verification core is in.** The deterministic toolkit, CLI, and MCP server are
131
+ here and tested (68 unit tests). The tool-grounded judge — a claim about the binary is
132
+ checked against the actual bytes and returned as `VERIFIED` / `REFUTED` / `INCONCLUSIVE` with
133
+ observed evidence — now ships as `reverify verify` and the `re_verify_claim` MCP tool. Next
134
+ milestone: the closed agent loop that drives the judge automatically — model proposes, tools
135
+ verify, iterate until the reconstruction is fully grounded.
136
+
137
+ ## License
138
+
139
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,114 @@
1
+ <h1 align="center">Reverify</h1>
2
+
3
+ <p align="center">
4
+ <strong>Reverse engineering you can trust.</strong><br>
5
+ An AI-assisted RE toolkit whose findings are checked against the binary — not hallucinated.
6
+ </p>
7
+
8
+ ## The problem
9
+
10
+ Language models are great at reading code and unreliable at reverse engineering. Ask a
11
+ model to reconstruct a struct or an algorithm from a binary and it will confidently invent
12
+ offsets, sizes, and behavior. In binary analysis this hallucination problem is far worse
13
+ than in source code, and *"did the model just make that up?"* is the single biggest blocker
14
+ to using AI for real RE.
15
+
16
+ ## What Reverify does
17
+
18
+ Reverify pairs a language model with a **deterministic, pure-Python RE toolkit** and makes the
19
+ toolkit the judge. The model proposes; the tools verify. A hypothesis about a structure or an
20
+ algorithm is only reported once it has been **checked against the actual bytes** — disassembled,
21
+ pattern-matched, or executed in the emulator — so the output is grounded in the binary instead
22
+ of the model's imagination.
23
+
24
+ - **Deterministic core** — PE32/PE32+ parsing, x86/x64 disassembly, AOB pattern scanning,
25
+ CPU micro-emulation, Protobuf/TLV dissection, Frida hook generation. Pure Python, no Ghidra,
26
+ no heavy install.
27
+ - **Grounded, not guessed** — structural claims are verified against the binary by the tools.
28
+ - **Agent-native** — ships as an MCP server, so Claude Code, Cursor, and other agents can call
29
+ the tools directly; also a plain CLI.
30
+
31
+ > Reverify is for **authorized** reverse engineering — malware analysis, CTF, interoperability
32
+ > research, and software you own or are permitted to analyze. See [SECURITY.md](SECURITY.md).
33
+
34
+ ## Quick start
35
+
36
+ ```bash
37
+ # From a checkout — pure standard library, nothing to install:
38
+ python reverify/cli.py auto sample.bin --json
39
+ python reverify/cli.py parse-pe sample.exe --json
40
+ python reverify/cli.py disasm 90505831C0C3 --arch x86_64
41
+
42
+ # Or install the CLI + MCP server:
43
+ pip install -e . # optional: pip install -e ".[capstone]" for full disassembly
44
+ reverify auto sample.bin --json
45
+ ```
46
+
47
+ ## The verification loop
48
+
49
+ This is what the name is about. A **claim** is any hypothesis about the binary; the
50
+ deterministic tools are the judge and hand back `VERIFIED`, `REFUTED`, or
51
+ `INCONCLUSIVE` together with the bytes they actually observed:
52
+
53
+ ```bash
54
+ reverify verify sample.bin --claim '{
55
+ "kind": "instructions", "offset": 4096,
56
+ "mnemonics": ["push", "mov", "sub"], "note": "function prologue"
57
+ }'
58
+ ```
59
+
60
+ ```bash
61
+ # Check a reconstructed routine actually computes what the model claimed:
62
+ reverify verify - --claim '{
63
+ "kind": "emulate_result", "code": "b805000000b90300000001c8c3",
64
+ "arch": "x86", "expect_registers": {"eax": 8}
65
+ }'
66
+ ```
67
+
68
+ Claims can be batched from a JSON file (`--claims-file claims.json`); the CLI exits
69
+ non-zero if **anything** is refuted, so an agent or CI job can gate on a grounded
70
+ reconstruction. Supported claim kinds: `bytes_at`, `pattern_present`,
71
+ `string_present`, `instructions`, `emulate_result`, `protobuf_field`, `pe_import`.
72
+
73
+ ## The toolkit
74
+
75
+ | Command | What it does |
76
+ |---|---|
77
+ | `verify` | **Check a claim about the binary against the tools — VERIFIED / REFUTED / INCONCLUSIVE** |
78
+ | `auto` | Auto-triage: detect format, architecture, sections, top strings |
79
+ | `parse-pe` | PE32/PE32+ headers, imports, exports |
80
+ | `disasm` | x86/x64 disassembly of hex or a section |
81
+ | `pattern-scan` | AOB scan with `??` wildcards |
82
+ | `strings` | ASCII + UTF-16LE extraction with offsets |
83
+ | `emulate` | CPU register/stack micro-emulation |
84
+ | `decode-protobuf` / `decode-tlv` | schema-less wire-format dissection |
85
+ | `gen-hook` | Frida interceptor script generation |
86
+ | `hexdump` | aligned hex dump |
87
+ | `diff-patch` | binary diff / patch generation |
88
+ | `audit-boundary` | defensive filesystem/SSRF boundary audit |
89
+
90
+ ## MCP server
91
+
92
+ Reverify exposes the toolkit to AI agents over the Model Context Protocol:
93
+
94
+ ```bash
95
+ python reverify/mcp_server.py
96
+ ```
97
+
98
+ Point Claude Code or Cursor at it and the agent can parse, disassemble, and scan binaries
99
+ directly — with the deterministic tools as ground truth. The `re_verify_claim` tool exposes
100
+ the verification loop, so an agent can have its own hypotheses judged against the bytes
101
+ before it reports them.
102
+
103
+ ## Status
104
+
105
+ **v0.1.0 — the verification core is in.** The deterministic toolkit, CLI, and MCP server are
106
+ here and tested (68 unit tests). The tool-grounded judge — a claim about the binary is
107
+ checked against the actual bytes and returned as `VERIFIED` / `REFUTED` / `INCONCLUSIVE` with
108
+ observed evidence — now ships as `reverify verify` and the `re_verify_claim` MCP tool. Next
109
+ milestone: the closed agent loop that drives the judge automatically — model proposes, tools
110
+ verify, iterate until the reconstruction is fully grounded.
111
+
112
+ ## License
113
+
114
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "reverify"
7
+ version = "0.1.0"
8
+ description = "Verified reverse engineering: AI RE grounded on deterministic tools — claims checked against the binary, not hallucinated."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "2akouwu" }]
13
+ keywords = [
14
+ "reverse-engineering", "binary-analysis", "disassembler", "frida",
15
+ "protobuf", "mcp", "ai-agents", "malware-analysis", "ctf",
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Intended Audience :: Developers",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Programming Language :: Python :: 3",
22
+ "Topic :: Security",
23
+ "Topic :: Software Development :: Disassemblers",
24
+ ]
25
+ dependencies = []
26
+
27
+ [project.optional-dependencies]
28
+ # Capstone upgrades the pure-Python decoder to a full-fidelity disassembler.
29
+ capstone = ["capstone>=5.0"]
30
+ dev = ["pytest>=7.0"]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/2akouwu/reverify"
34
+ Repository = "https://github.com/2akouwu/reverify"
35
+ Issues = "https://github.com/2akouwu/reverify/issues"
36
+
37
+ [project.scripts]
38
+ reverify = "reverify.cli:main"
39
+ reverify-mcp = "reverify.mcp_server:run_mcp_server"
40
+
41
+ [tool.setuptools]
42
+ packages = ["reverify"]
43
+
44
+ [tool.setuptools.package-data]
45
+ reverify = ["py.typed"]
@@ -0,0 +1,31 @@
1
+ """Reverse Engineering, Protocol Dissection, and Dynamic Instrumentation Toolkit."""
2
+
3
+ from .pe_parser import PEParser, BinaryParseError
4
+ from .disasm import Disassembler, Instruction, pattern_scan, create_patch
5
+ from .emulator import MicroEmulator, EmulatorError
6
+ from .protocol_parser import ProtobufDissector, TLVDissector, format_hexdump, decode_varint, encode_varint
7
+ from .frida_bridge import FridaScriptGenerator
8
+ from .verifier import Verifier, Claim, verify_claims, VERIFIED, REFUTED, INCONCLUSIVE
9
+
10
+ __all__ = [
11
+ "PEParser",
12
+ "BinaryParseError",
13
+ "Disassembler",
14
+ "Instruction",
15
+ "pattern_scan",
16
+ "create_patch",
17
+ "MicroEmulator",
18
+ "EmulatorError",
19
+ "ProtobufDissector",
20
+ "TLVDissector",
21
+ "format_hexdump",
22
+ "decode_varint",
23
+ "encode_varint",
24
+ "FridaScriptGenerator",
25
+ "Verifier",
26
+ "Claim",
27
+ "verify_claims",
28
+ "VERIFIED",
29
+ "REFUTED",
30
+ "INCONCLUSIVE",
31
+ ]