7 Commits

Author SHA1 Message Date
null-cell 2a611d9a8c adds documentation for porting, resolves PR comments 2023-05-15 11:05:31 +02:00
null-cell db85c1e08a updates extra version of keystone, updated generated consts with RISCV 2023-03-23 12:18:11 +01:00
S.J.R. van Schaik 6bfc23feb0 rust: force CMake to use lib as libdir on systems that would normally use lib64 as libdir (#497) 2021-07-08 20:42:26 +08:00
Nguyen Anh Quynh 9d713d5a98 rust: change version from 0.10.0 to 0.9.2 2020-06-19 09:40:02 +08:00
Daniel Henry-Mantilla 27d86048be Fix Rust bindings (#437)
- A bool coming from C cannot be trusted; functionally it is a c_int,
    and conversion to bool must be done by comparing to 0;

  - similarly, a `#[repr(C)]` enum cannot be trusted to be a `u32`;
    it is more often than not a `c_int`. This could cause breakage with
    the ABI of the C functions of the binding. So the signatures and
    enum definitions have been adapted based on the
    `include/keystone/keystone.h` definitions.

  - and most importantly: a ks_handle is a `ks_engine *` in C parlance,
    and using `size_t` to represent it is not the right way. Moreover,
    so doing prevents the `Sync` and `Send` traits from being
    auto-unimplemented, meaning that this is implicitly asserting that
    keystone is multithread-safe, even for the same instance. If that is
    the case, then a `unsafe impl Sync for Keystone {}` (ditto for
    `Send`) should be added to make such assertion explicit.

    That's why an opaque type using the classic Rust idiom of a
    zero_sized #[repr(C)] struct has been made (while waiting for Rust
    to feature external types), and `Option<ptr::NonNull<_>>` is being
    used as the pointer type (equivalent to *mut _), but it allows to
    communicate nullable / non-nullable invariants at the type-level.
    This has then been transposed to the internals of keystone-rs.
2020-02-15 08:16:41 +08:00
Boris-Chengbiao Zhou ffe054aaa9 Various improvements to the Rust bindings (#401)
* Fix Rust bindings

* Various small improvements for the Rust bindings

* Remove unused dependencies

* Use the cmake crate to compile keystone

* Add Windows support to Rust bindings

* Cleanup doc a bit

* Fix symlink path

* Link to C++ standard library

* Build all keystone targets
2019-08-02 21:42:21 +08:00
Tasuku SUENAGA a.k.a. gunyarakun f231d0d843 bindings: include keystone itself on Rust bindings (#324) 2018-09-16 21:48:20 +08:00