Skip to content

Capstone Rust compatibility for Robustone #11

@luojia65

Description

@luojia65

By now Capstone has capstone-rs crate which provides a Rust interface with modules, structures, built over FFI C bindings (capstone-sys crate) to be linked with C language Capstone libraries. With Robustone written originally in Rust, we erase demand for FFI links for a productive disassembler, thus removing all unsafe code in our Capstone-like implementation.

To implement Capstone Rust compatibility, we should mirror all the structures from capstone-rs and implement them in robustone_compat::capstone module.

// Before:
use capstone::prelude::*;
use capstone::InsnDetail;
// After:
use robustone_compat::capstone as capstone;
use capstone::prelude::*; // <- not modified
use capstone::InsnDetail; // <- not modified

Projects may also switch between Capstone and Robustone with feature gates to compare them for comptability, performance or security.

#[cfg(feature = "robustone")]
use robustone_compat::capstone as capstone;
#[cfg(feature = "capstone")]
extern crate capstone;

By this way, existing research or industrial code would gain 100% safe Rust guarantees, and convenient integration to Webassembly, without having to modify existing capstone Rust code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions