Crate bn_bdash_extras

Source
Expand description

§bn-bdash-extras

Documentation

An assortment of helpers that I’ve found to be useful when writing Binary Ninja plug-ins in Rust.

§Activity configuration

Upstreamed! See the activity module.

§LLIL instruction matching

Types and macros to simplify matching over LowLevelILInstruction and LowLevelILExpression can be found in the llil module.

match_instr!{
    instr,
    // Basic patterns
    CallSsa(ConstPtr(address), _) => println!("Direct call to {:#x}", address),
     
    // Variable bindings and guards
    instr @ SetRegSsa(dest, add @ Add(RegSsa(src), Const(value))) if value > 10 => {
        println!(
            "Increment of {src:?} by {value} > 10 at {:#x} (dest={dest:?}, add={add:?})",
            instr.address(),
        );
    },
     
    // OR patterns
    CallSsa(_, _) | TailCallSsa(_, _) => println!("Function call"),
     
    _ => {}
};

Modules§

llil
More ergonomic matching over Binary Ninja’s low_level_il types