#valgrind #bindings #ir #vex #translate #arch #lift

libvex

High-level bindings for valgrind's LibVEX

2 releases

new 0.1.1 Dec 3, 2024
0.1.0 Mar 8, 2021

#1 in #lift

Download history 1/week @ 2024-09-17 8/week @ 2024-09-24

78 downloads per month

MIT license

38MB
796K SLoC

C 787K SLoC // 0.1% comments Automake 7K SLoC // 0.1% comments Rust 1.5K SLoC // 0.0% comments Perl 306 SLoC // 0.1% comments GNU Style Assembly 154 SLoC Shell 12 SLoC

crates.io docs.rs

LibVEX

LibVEX provides bindings to valgrind's IR, VEX.

Quick Start

Add LibVEX to your Cargo.toml:

[dependencies]
libvex = "0.1"

Lift some code to an IRSB:

fn foo() {
    let mut vta = VexTranslateArgs::new(
        Arch::VexArchAMD64,
        Arch::VexArchAMD64,
        VexEndness::VexEndnessLE,
    );
    let irsb = vta.front_end(foo as *const _, foo as _).unwrap();
}

Or translate:

fn translate() {
    let mut buf = [0; 1000];

    let size = vta.translate(
        translate as *const _,
        translate as _,
        &mut buf,
    ).unwrap();
}

Dependencies