A Rust interface for Rizin, providing safe and ergonomic bindings to the Rizin reverse engineering framework.
rizin-rs is a Rust library that provides bindings to the Rizin reverse engineering framework. This project aims to make Rizin's powerful features accessible to Rust developers with a safe and idiomatic API.
- Safe Rust bindings for Rizin's core functionality
- Idiomatic Rust API design
- Comprehensive documentation
- Example programs
This alpha targets the Rizin 0.10 development line and requires Rizin
>=0.10.0, <0.11.0.
cargo add rizin-rs@0.10.0-alpha.1rustPlatform.buildRustPackage {
...
LIBCLANG_PATH = "${llvmPackages_18.libclang.lib}/lib";
nativeBuildInputs = [
rustPlatform.bindgenHook
pkg-config
];
buildInputs = [
rizin
llvmPackages_18.libclang
];
}The flake provides both the Rust bindings and the pinned Rizin build:
nix build .#rizin-rs
nix build .#rizinRizin is pinned to a specific commit from its dev branch. Update it to the
latest dev revision, including the upstream version and source/Meson hashes,
with:
./nix/rizin/update.shPass a full 40-character commit SHA to pin a specific revision instead:
./nix/rizin/update.sh <commit>use rizin_rs::RzCore;
fn main() {
let core = RzCore::new();
core.config_set("analysis.arch", "x86").unwrap();
core.config_set("analysis.bits", "64").unwrap();
let arch = core.config_get("analysis.arch").unwrap();
let bits = core.config_get("analysis.bits").unwrap();
println!("Rizin analysis target: {arch}-{bits}");
}Run the checked-in copy from the Nix development environment:
nix develop . --command cargo run -p rizin-rs --example basicThe crate's major/minor version tracks the compatible Rizin line. Alpha
releases use 0.10.0-alpha.N; once 0.10.0 is published, Rust-only fixes use
the crate patch version while the exact Rizin source remains recorded by the
Nix pin. See RELEASING.md for the release order.
The safe rizin-rs wrapper is released under
CC0-1.0.
The raw rizin-sys bindings and upstream Rizin are LGPL-3.0-only.
Contributions are welcome! Please feel free to submit a Pull Request.