keystone-standalone

Crates.iokeystone-standalone
lib.rskeystone-standalone
version0.1.1
created_at2025-07-24 12:08:09.461536+00
updated_at2025-07-24 12:52:29.388684+00
descriptionStandalone high-level bindings for Keystone assembler with embedded Keystone
homepage
repositoryhttps://github.com/EvansJahja/keystone-rs-standalone
max_upload_size
id1765963
size30,462
Evans Jahja (EvansJahja)

documentation

README

keystone-rs-standalone

Yet another Rust binding for Keystone assembler framework.

Keystone is included as a submodule.

This is a fork from https://github.com/tathanhdinh/keystone-rs which does not seem to be maintained anymore.

Currently, this builds on Windows.

Building

This project requires LLVM. Tested on Windows 10 with LLVM-18.1.8.

Cloning

This project contains submodule, i.e.

git clone --recurse-submodules https://github.com/EvansJahja/keystone-rs-standalone.git

Features

  • Hierarchical architecture: low-level binding is done by keystone-sys
  • Fully wrapped and reexported types: no more low-level stuffs
  • Zero-copy: no additional memory allocation
  • Windows support

Sample

use keystone_standalone::*;

fn main() {
    let engine = Keystone::from(Arch::X86, Mode::Bit32)
        .expect("Unable to initialize Keystone engine");

    engine.option(OptionType::Syntax, OptionValue::SyntaxNasm)
        .expect("Unable to set NASM syntax");

    let asm = engine.asm("mov ebp, esp", 0x4000)
        .expect("Unable to assemble");

    println!("{}", asm);
}

Migration

The original project uses the keystone crate. When using this project, you have two options:

  1. (Recommended) change your import to keystone_standalone
  2. Alternatively, update your project's Cargo.toml and use rename dependency, i.e. keystone = { package = "keystone-standalone", version = "0.1.0" }

Contributors

Acknowledgments

Commit count: 0

cargo fmt