Implementation:2akouwu Reverify Verifier
| Knowledge Sources | |
|---|---|
| Domains | Verification, Binary_Analysis, Scoring |
| Last Updated | 2026-10-24 12:00 GMT |
Overview
Concrete tool for verifying claims about a binary against deterministic tools and scoring results with information-weighted anti-gaming metrics provided by the Reverify library.
Description
The Verifier class is the heart of Reverify. It takes binary bytes, dispatches each Claim to a deterministic checker (one per claim kind), and returns a structured verdict with evidence. It supports 20+ claim kinds: bytes_at, u16/u32/u64_at, pattern_present, string_present, instructions, emulate_result, behavior_equiv, prove_equiv, exebench, functions_equiv, protobuf_field, import_present, export_present, section_present, function_at, calls, references, reachable_from_entry.
The verify_all method verifies a batch of claims, applies dependency ordering, and calls summarize to produce the information-weighted report. The summarize function (module-level) computes per-claim weights (rarity × entropy, zeroed for trivial/duplicate/echoed/known), aggregate counts, and the grounded boolean.
The receipt method produces a replay record: binary SHA-256, engine versions, platform — everything a third party needs to reproduce the verdicts.
Usage
Import this class when you need to:
- Verify a single claim or batch of claims about a binary (CLI
verifysubcommand). - Run the core verification in the closed reconstruction loop (called by
ReconstructionAgenteach round). - Expose verification over MCP (
re_verify_claimtool). - Score results with information-weighted anti-gaming metrics.
Code Reference
Source Location
- Repository: Reverify
- File: reverify/verifier.py
- Lines:
Verifierclass at L162-257;verifyat L225-239;verify_allat L241-257;summarizeat L1184-1235;receiptat L196-215
Signature
class Verifier:
SUPPORTED = (
"bytes_at", "u16_at", "u32_at", "u64_at",
"pattern_present", "string_present", "instructions",
"emulate_result", "behavior_equiv", "prove_equiv",
"exebench", "functions_equiv", "protobuf_field",
"import_present", "export_present", "section_present",
"pe_import", # alias of import_present
"function_at", "calls", "references", "reachable_from_entry",
)
def __init__(self, data: bytes):
...
def receipt(self) -> Dict[str, Any]:
"""Binary SHA-256, engine versions, platform — for replay."""
def verify(self, claim: Claim) -> Dict[str, Any]:
"""Check a single claim and return a structured verdict."""
def verify_all(
self,
claims: List[Claim],
facts: Optional[Dict[str, Any]] = None,
min_information: float = 1.0,
) -> Dict[str, Any]:
"""Check many claims, apply dependencies, and score how much they say."""
def summarize(
results: List[Dict[str, Any]],
facts: Optional[Dict[str, Any]] = None,
min_information: float = 1.0,
) -> Dict[str, Any]:
"""Weight results (CORE-style) and build the report.
Sets weight, trivial, duplicate on each result in place; the agent may
set echoed beforehand to zero a claim that merely copied the tools'
previous output.
"""
Import
from reverify.verifier import Verifier, Claim, summarize
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| data | bytes | Yes | Raw binary bytes (constructor) |
| claims | List[Claim] | Yes | Claims to verify |
| facts | Dict | No | Fact sheet the model was shown (for triviality scoring) |
| min_information | float | No | Weight threshold for "informative". Default 1.0. |
Outputs
| Name | Type | Description |
|---|---|---|
| return | Dict | Report: total_claims, verified, refuted, inconclusive, observed, invalidated, grounded_ratio, information, grounded_score, trivial_verified, duplicates, echoed, known, trustworthy, informative, grounded, results (per-claim), receipt |
Usage Examples
Verify a Single Claim
from reverify.verifier import Verifier, Claim
with open("target.dll", "rb") as f:
data = f.read()
verifier = Verifier(data)
claim = Claim("bytes_at", {"offset": 0x28, "expected": "554889e5"})
result = verifier.verify(claim)
print(f"{result['verdict']}: {result['detail']}")
# VERIFIED: 4 bytes match at file offset 0x28
Verify a Batch with Scoring
from reverify.verifier import Verifier, Claim
verifier = Verifier(data)
claims = [
Claim("bytes_at", {"offset": 0x28, "expected": "554889e5"}),
Claim("import_present", {"name": "CreateFileW"}),
Claim("instructions", {"offset": 0x1000, "space": "rva", "mnemonics": ["push", "mov"], "arch": "x86_64"}),
]
report = verifier.verify_all(claims, min_information=1.0)
print(f"Grounded: {report['grounded']}, Information: {report['information']}")
print(f"Verified: {report['verified']}, Refuted: {report['refuted']}")
Generate a Receipt
# The receipt is included in verify_all output; also available directly
receipt = verifier.receipt()
print(f"Binary SHA-256: {receipt['binary_sha256']}")
print(f"Engines: {receipt['engines']}")
# This can be handed to a third party to replay the verdicts
Related Pages
Implements Principle
- Principle:2akouwu_Reverify_Tool_Grounded_Verification
- Principle:2akouwu_Reverify_Information_Weighted_Scoring
- Principle:2akouwu_Reverify_Closed_Verification_Loop
- Principle:2akouwu_Reverify_MCP_Tool_Integration