-
Notifications
You must be signed in to change notification settings - Fork 9
Description
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 modifiedProjects 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.