Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rsleigh
rsleigh is a scriptable, pure-Rust reverse-engineering workbench that turns PE, ELF, Mach-O, WebAssembly, and raw firmware into C-like pseudocode, disassembly, P-code, SSA, xrefs, call graphs, and structured output. It is built for static-analysis loops—especially when an LLM helps search the output, explain behavior, and turn findings into scripts—without requiring a Ghidra JVM or C++ bindings.
The decoder and P-code lifter are the stable core. The decompiler and analysis passes are useful but experimental: verify important conclusions against the assembly, P-code, or another tool.
A real-world solve
rsleigh recovered CTF{pyvm_r0cks} from a PyVMProtect-packed PE64 Python
extension using static analysis—no live debugger and no Ghidra JVM. The sample
contained a 53-opcode custom VM, a 117-stage init chain, two PCG decryption
passes, compressed bytecode, anti-debug checks, and per-entry VARINT data.
rsleigh found the real entry point, annotated the crypto, classified the VM
handlers, and disassembled the bytecode; a short Python decoder finished it.
Capabilities
| Task | Useful output |
|---|---|
| Understand a function | C-like pseudocode, disassembly, P-code, post-fold SSA |
| Navigate a binary | Function discovery, xrefs, call graphs, search by string, API, constant, or behavior |
| Triage an unknown sample | Hashes, IOCs, Authenticode metadata, resources, XOR strings, YARA, vulnerability heuristics |
| Investigate packed code | Crypto annotations, API-hash recognition, PEB/timing checks, SEH/TLS patch discovery, VM helpers |
| Work with an LLM or script | Compact text, brief summaries, JSON, P-code/SSA JSON, ranked NDJSON findings |
| Embed the decoder | A small multi-architecture Rust API returning disassembly and P-code |
When pseudocode is unclear, drop to disassembly, P-code, or SSA without leaving the workflow. Feed the smallest useful artifact to your model or script.
Installation
Install the CLI from crates.io:
For library use:
[]
= "0.4"
= "0.4"
The optional Z3-backed SMT analysis requires a source build; see SMT analysis.
Quickstart
Using rsleigh from a coding agent? Copy the bounded workflow contract in docs/AGENTS-rsleigh.md into the target-analysis workspace, see the agent workflow reference for schemas and caps, then start with one capped JSON map:
Start with discovered functions, then narrow the analysis:
For a large binary, generate a compact map first:
Inspect one function without allowing an unbounded dump:
Search modes pivot directly to interesting functions:
Raw firmware accepts an architecture and optional base address:
Triage workflow
Lightweight file-structure and string scans are good first passes:
Then move into semantic analysis:
These modes surface leads, not proofs. See the triage reference for schemas and limitations.
Packed-code and custom-VM analysis
PE64 analysis flags API-hash resolvers, PEB walks, timing probes, indirect trampolines, suspicious dispatchers, scratch-buffer leaks, and SHA-256 regions. Focused helpers can then inspect a candidate VM:
Add --findings-ndjson to any VM helper to emit the shared confidence-bearing
schema documented in Findings NDJSON.
These are pattern-based recon tools, not a general virtualization deobfuscator. See the feature notes and PyVMProtect walkthrough.
SMT-assisted analysis
The optional smt feature adds Z3-backed, interprocedural source-to-sink
analysis and ranked NDJSON candidates for an analyst or LLM.
On macOS with Homebrew Z3:
CPATH=/include LIBRARY_PATH=/lib \
See SMT backend for setup and scope, SMT candidates for taint evidence, and the shared findings NDJSON schema used across recon emitters.
Supported targets
Decode coverage is not the same as lift or decompile coverage. The public architecture support matrix reports decode, lift, discovery, and decompile separately for each ISA/mode.
The CLI loads ELF32/64, PE32/64, Mach-O 64, WebAssembly, and raw blobs. See architecture support for discovery details and gaps.
Rust API
rsleigh-api is the stable embedding surface for decoding instructions and
lifting them to P-code:
use ;
let mut decoder = new;
let inst = decoder.decode.unwrap;
assert_eq!;
assert_eq!;
The stable surface includes Decoder, Architecture, register-name lookup,
and re-exported pcode-ir types. Pin a version when embedding the experimental
rsleigh-decompile IR, passes, or printer.
Development and testing
Building from a checkout requires Rust 2021 stable and make:
The suite includes P-code tests, Ghidra oracle fixtures, decompiler regressions, random-byte panic checks, real binaries, SMT calibration, and pseudocode scoring. See testing and decompiler passes.
Project status
rsleigh is a v0.x, single-maintainer project. The decoder/lifter API has a narrow stability promise; the CLI, pseudocode, discovery, and analysis passes remain experimental. It has not received a dedicated security audit, so isolate it in automated malware-processing systems.
Contributing
Issues and pull requests are welcome. Bug fixes should include a regression test, and changes to generated decoders should include architecture-level coverage. Before opening a pull request, run:
The best starting points are testing, decompiler passes, and architecture support.
License
Apache-2.0. Bundled Ghidra .slaspec files are also Apache-2.0.