1 个不稳定版本

使用旧的 Rust 2015

0.9.0 2016 年 7 月 28 日

#41 in #arch

GPL-2.0 许可证

26KB
999

keystone-rs

Rust 对 keystone 引擎的绑定。

示例

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;
}

测试

cargo test

贡献者

  • Remco Verhoef (@remco_verhoef)

特别感谢

  • Sébastien Duquette (@ekse) 为他的 unicorn-rs 绑定

lib.rs:

Keystone 汇编引擎 (www.keystone-engine.org) */ 由 Nguyen Anh Quynh [email protected], 2016 */ Rust 绑定由 Remco Verhoef [email protected], 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");
}

依赖

~185KB