r2smt-pcode 0.1.1

Ghidra/SLEIGH P-code lifter for r2SMT — emits IrStmt from radare2 `pdgsd` P-code text.
Documentation
  • Coverage
  • 100%
    30 out of 30 items documented0 out of 8 items with examples
  • Size
  • Source code size: 39.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 599.47 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • seifreed/r2SMT
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • seifreed

Ghidra / SLEIGH P-code lifter for r2SMT.

radare2's r2ghidra plugin emits SLEIGH P-code for a run of instructions via pdgsd N — a decompiler-grade IR with explicit SSA-style unique varnodes, regular ~30-opcode integer/boolean semantics, and explicit flag derivation (no NZCV guessing). That makes it a cleaner analysis source than per-instruction ESIL for the cases it covers.

This crate turns that text into a Vec<r2smt_ir::IrStmt> so the existing slicer → SSA → SMT pipeline can consume it unchanged.

Like the r2smt_esil crate it is intentionally a strict subset: [lift_pcode] returns a [PcodeError] on any opcode or flag construct whose lowering is not provably sound against the IR model (notably ARM NZCV C/V/N polarity, which differs from the per-mnemonic AArch64 flag model — only the Z flag maps cleanly). Callers fall back to the ESIL / per-mnemonic lifter on error, so an unsupported construct never produces a wrong verdict — it just declines the P-code path.

See [lift_pcode] for the entry point and [parse] for the pure grammar parser.