#capstone #engine #bindings #version #directory #testing #instructions

nightly sys libcapstone-sys

Rust bindings to the capstone engine

3 releases

Uses old Rust 2015

0.3.2 Mar 13, 2017
0.3.1 Mar 12, 2017
0.3.0 Mar 6, 2017

#9 in #capstone

Download history 9/week @ 2024-02-19 21/week @ 2024-02-26 51/week @ 2024-04-01

51 downloads per month
Used in libcapstone

MIT license

18KB
367 lines

libcapstone-sys

Complete rust bindings to the capstone engine. Currently only Linux and OS X is supported. Building on windows should work, but I currently can't test that. A nightly version of Rust is also required.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You'll need to have installed the capstone engine.

You can set the environment variable CAPSTONE_INCLUDE_DIR to the directory where the header files for the capstone engine are. The environment variable CAPSTONE_LIBRARY_DIR specifies the library directory where capstone is installed. These default to /usr/include and /usr/lib on Linux and OS X.

On windows there are no default library and include directories so you must specify these environment variables.

Then you can simply git clone this repository and cd into it.

Building

To build this project simply execute cargo build.

Examples

Examples can be found in the examples directory.

Running the tests

Simply execute cargo test.

Built With

  • rust-bindgen - Generate Rust FFI bindings to C and C++ libraries.

Difference between this and capstone-rs

capstone-rs does not have complete bindings to the capstone engine. For example, cs_detail is completly missing and also many constants are missing.

libcapstone-sys generates bindings directly from the capstone headers, so nothing is missing!

However that results in an not rust like API, for which libcapstone exists.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

No runtime deps

~0–2.1MB
~43K SLoC