Expand description
Safe binary patching for r2SMT.
Phase 10 closes the loop from solver verdict → committed binary
change. Every applied patch is recorded in a PatchManifest and
a full-file backup is taken before any byte is written, so the
pipeline can roll back to a known-good state even if the host
process is killed mid-flight.
The crate is sample-agnostic: it never inspects sample-specific
values or branches on opcode signatures from a single family.
Strategies are defined in terms of the abstract finding kinds
produced by r2smt-core.
Re-exports§
pub use apply::ApplyConfig;pub use apply::apply_plan;pub use apply::rollback_from_manifest;pub use arm_encoding::ARM_INSTRUCTION_BYTES;pub use arm_encoding::arm_nop_buffer;pub use arm_encoding::arm_nop_bytes;pub use digest::sha256_hex;pub use manifest::PatchManifest;pub use manifest::PatchRecord;pub use plan::PatchPlan;pub use plan::PlanOperation;pub use plan::build_plan;pub use x86_encoding::nop_buffer;pub use x86_encoding::patch_cmovcc_to_mov;pub use x86_encoding::patch_setcc;
Modules§
- aarch64_
encoding - Operand-aware helpers for the
AArch64cset/csel/csinc/csinv/csnegfamily. - apply
- Apply a
PatchPlanthrough aBytePatcherand produce the durablePatchManifest. - arm_
encoding - Byte-level rewrites for ARM conditional branches.
- digest
- SHA-256 wrapper used by
crate::manifestto record before / after integrity hashes of the binary being patched. - manifest
- Patch manifest: the durable record of every byte r2SMT has changed.
- plan
- Build a
PatchPlanfrom r2SMT findings. - x86_
encoding - Byte-level rewrites for
setcc/cmovccon x86 /x86_64.