-
Notifications
You must be signed in to change notification settings - Fork 34
Make unicornafl more Rust-friendly and sync with newest unicorn-engine Rust crate #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Could you try *I should also add a CI for that. |
Sure, I'll test it tomorrow. |
Also we now further depend on |
I tried
And you should also patch your
Currently in unicorn-engine = { git = "https://github.com/unicorn-engine/unicorn", branch = "dev"} |
I use
It is just not ready and the code need some cleanup
Okay I see. |
Setting |
I see, |
In this PR, there are two closely-related changes (it should be noted that the functionality and logic are never changed and everything would just work fine, no breaking changes.):
Current code is synced with newest unicorn-engine Rust crate.
Since the unicorn-engine binding and wrapper have been greatly refactored and improved.
Some APIs and internal structures are refactored to be more Rust-friendly.
The ultimate entrypoint is refactored into four functions in
lib.rs
:afl_fuzz_custom
,afl_fuzz
,uc_afl_fuzz
,uc_afl_fuzz_custom
. The first two are for Rust-users, and the last two are for FFI users (The real implementation is still thechild_fuzz
intarget.rs
, those four are just some wrappers).Since we can only expose fuzzing entrypoint to FFI users, the internal design, as a result, can be pure Rust, and no
extern "C"
, noc_void
, no*mut
. This could not only improve the maintenance of this library, but also potentially improve the performance for both Rust users and FFI users.