Add Rust bindings to master branch (#1401)
* Rust bindings (#1295) * rust bindings init * updated bindings/README * Improved Rust bindings: (#1309) * Added basic block hooking * Changed confusing struct naming. Before: Protection::All -> R,W,X, Now: Permission::All -> R,W,X * Fixed issue with remove_hook(..). Implementation tried to remove hook from incorrect hashmap. * Made unused private vmmap(..) public. * Improve Rust bindings (#1367) * fixed tests * constant readability * HookType as bitflags * Mode as bitflags * improve bitflags * cargo fmt * removed unnecessary "as usize" * fixed buggy deallocation of uc_context structs * Remove data field in rust bindings Co-authored-by: Lukas Seidel <pr0me@users.noreply.github.com> Co-authored-by: Nikolas Eller <nikolas.e@mail.de> Co-authored-by: Simon Wörner <git@simon-woerner.de> Co-authored-by: floesen <floesen@users.noreply.github.com>
This commit is contained in:
20
bindings/rust/build.rs
Normal file
20
bindings/rust/build.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use std::{env, process::Command};
|
||||
|
||||
use build_helper::rustc::{link_lib, link_search};
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=unicorn");
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
let unicorn = "libunicorn.a";
|
||||
let _ = Command::new("cp")
|
||||
.current_dir("../..")
|
||||
.arg(&unicorn)
|
||||
.arg(&out_dir)
|
||||
.status()
|
||||
.unwrap();
|
||||
link_search(
|
||||
Some(build_helper::SearchKind::Native),
|
||||
build_helper::out_dir(),
|
||||
);
|
||||
link_lib(Some(build_helper::LibKind::Static), "unicorn");
|
||||
}
|
||||
Reference in New Issue
Block a user