Closure hooks and on thread create hook (#542)

* Closure hooks and on thread create hook

* on thread once hook

* clippy

* fix

* fix
This commit is contained in:
Andrea Fioraldi 2022-02-21 18:30:02 +01:00 committed by GitHub
parent b3d68e8f40
commit 95d3de0f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1101 additions and 316 deletions

View File

@ -3,7 +3,7 @@ use which::which;
const QEMU_URL: &str = "https://github.com/AFLplusplus/qemu-libafl-bridge";
const QEMU_DIRNAME: &str = "qemu-libafl-bridge";
const QEMU_REVISION: &str = "152fdbe024493f31e60060714caee3b90fdf3d9e";
const QEMU_REVISION: &str = "35dcfc0c115da262622fdc811d089155f26a2abe";
fn build_dep_check(tools: &[&str]) {
for tool in tools {

View File

@ -240,6 +240,8 @@ extern "C" {
static mut libafl_exec_cmp_hook8: unsafe extern "C" fn(u64, u64, u64);
static mut libafl_gen_cmp_hook: unsafe extern "C" fn(u64, u32) -> u64;
static mut libafl_on_thread_hook: unsafe extern "C" fn(u32);
static mut libafl_pre_syscall_hook:
unsafe extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult;
static mut libafl_post_syscall_hook:
@ -662,6 +664,12 @@ impl Emulator {
}
}
pub fn set_on_thread_hook(&self, hook: extern "C" fn(tid: u32)) {
unsafe {
libafl_on_thread_hook = hook;
}
}
pub fn set_pre_syscall_hook(
&self,
hook: extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult,

File diff suppressed because it is too large Load Diff