capstone-sys
Low-level, unsafe Rust bindings for the Capstone disassembly library.
Requirements
- Rust version >= 1.19
- We export Rust unions, which were first stabilized with release 1.19
- One of the following:
- A toolchain capable of compiling Capstone (see the
make.shscript) - A pre-built version 3.0 Capstone dynamic library (specify the
use_system_capstonefeature)
- A toolchain capable of compiling Capstone (see the
Supported Platforms
| Platform | system capstone | gmake | cmake | cc |
|---|---|---|---|---|
x86_64-apple-darwin |
:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
i686-apple-darwin |
:heavy_check_mark:* | :x: | :heavy_check_mark:* | :heavy_check_mark:* |
x86_64-pc-windows-msvc |
:no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :heavy_check_mark: |
x86_64-pc-windows-gnu |
:no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :heavy_check_mark: |
i686-pc-windows-msvc |
:no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :heavy_check_mark:* |
i686-pc-windows-gnu |
:no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :heavy_check_mark:* |
x86_64-unknown-linux-gnu |
:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
i686-unknown-linux-gnu |
:heavy_check_mark:* | :x: | :heavy_check_mark:* | :heavy_check_mark:* |
| Symbol | Meaning |
|---|---|
| :heavy_check_mark: | build succeeds, all tests pass |
| :heavy_check_mark:* | build succeeds, some bindgen tests fail (issue #18) |
| :no_entry_sign: | build method is not supported/tested |
| :x: | build fails |
Features
capstone-sys has different features that can be specified in Cargo.toml.
Build Features
These features affect how capstone-sys will use/build the bundled Capstone C library:
- no feature or gmake (default on non-Windows platforms): build bundled Capstone with GNU make.
use_system_capstone: use the system Capstone instead of the bundled copy of the Capstone library.- Requires that Capstone is already manually installed on the system. We highly recommend that you supply the exact version bundled with
capstone-sys.- See the
CAPSTONE_REVISIONvariable inscripts/update_capstone.shto determine the exact Git commit of Capstone.
- See the
- Does not compile Capstone
- Requires that Capstone is already manually installed on the system. We highly recommend that you supply the exact version bundled with
build_capstone_cmake: build the bundled Capstone withcmake(requires CMake to be installed).build_capstone_cc(default on Windows platforms): build the bundled Capstone with theccRust crate.
Other Features
use_bindgen: instead of using the pre-generated Capstone bindings, dynamically generate bindings withbindgen.
Tested Platforms
The following platforms have automated testing:
x86_64-unknown-linux-gnu: Travis CI