#arch #options

keystone

Rust bindings for the keystone-engine

1 unstable release

Uses old Rust 2015

0.9.0 Jul 28, 2016

GPL-2.0 license

26KB
999 lines

keystone-rs

Rust bindings for the keystone engine.

Sample

extern crate keystone;
use keystone::{Keystone, Arch, Mode, OptionType, OptionValue};

fn main() {
    let engine = Keystone::new(Arch::X86, Mode::Mode32)
        .expect("Could not initialize Keystone engine");

    engine.option(OptionType::Syntax, OptionValue::SyntaxNASM)
        .expect("Could not set option to nasm syntax");

    let result = engine.asm("mov ah, 0x80".to_string(), 0)
        .expect("Could not assemble");

    let _ = result;
}

Testing

cargo test

Contributors

  • Remco Verhoef (@remco_verhoef)

Special thanks to:

  • Sébastien Duquette (@ekse) for his unicorn-rs binding

lib.rs:

Keystone Assembler Engine (www.keystone-engine.org) */ By Nguyen Anh Quynh aquynh@gmail.com, 2016 */ Rust bindings by Remco Verhoef remco@dutchcoders.io, 2016 */

extern crate keystone;
use keystone::{Keystone, Arch, OptionType};

fn main() {
    let engine = Keystone::new(Arch::X86, keystone::MODE_32)
        .expect("Could not initialize Keystone engine");
    engine.option(OptionType::SYNTAX, keystone::OPT_SYNTAX_NASM)
        .expect("Could not set option to nasm syntax");
    let result = engine.asm("mov ah, 0x80".to_string(), 0)
        .expect("Could not assemble");
}

Dependencies

~175KB