Skip to main content

r2smt_patch/
lib.rs

1#![deny(missing_docs)]
2//! Safe binary patching for r2SMT.
3//!
4//! Phase 10 closes the loop from solver verdict → committed binary
5//! change. Every applied patch is recorded in a [`PatchManifest`] and
6//! a full-file backup is taken *before* any byte is written, so the
7//! pipeline can roll back to a known-good state even if the host
8//! process is killed mid-flight.
9//!
10//! The crate is sample-agnostic: it never inspects sample-specific
11//! values or branches on opcode signatures from a single family.
12//! Strategies are defined in terms of the abstract finding kinds
13//! produced by `r2smt-core`.
14
15pub mod aarch64_encoding;
16pub mod apply;
17pub mod arm_encoding;
18pub mod digest;
19pub mod manifest;
20pub mod plan;
21pub mod x86_encoding;
22
23pub use apply::{ApplyConfig, apply_plan, rollback_from_manifest};
24pub use arm_encoding::{ARM_INSTRUCTION_BYTES, arm_nop_buffer, arm_nop_bytes};
25pub use digest::sha256_hex;
26pub use manifest::{PatchManifest, PatchRecord};
27pub use plan::{PatchPlan, PlanOperation, build_plan};
28pub use x86_encoding::{nop_buffer, patch_cmovcc_to_mov, patch_setcc};