disable syscall hooks in systemmode

This commit is contained in:
Alwin Berger 2022-01-23 16:15:14 +01:00
parent e0f197424c
commit 29f89b4b29
3 changed files with 7 additions and 0 deletions

View File

@ -432,6 +432,7 @@ where
executor.hook_write1_execution(trace_write1_asan::<I, QT, S>); executor.hook_write1_execution(trace_write1_asan::<I, QT, S>);
executor.hook_write_n_execution(trace_write_n_asan::<I, QT, S>); executor.hook_write_n_execution(trace_write_n_asan::<I, QT, S>);
#[cfg(not(feature = "systemmode"))]
executor.hook_syscalls(qasan_fake_syscall::<I, QT, S>); executor.hook_syscalls(qasan_fake_syscall::<I, QT, S>);
} }

View File

@ -242,8 +242,10 @@ extern "C" {
static mut libafl_exec_cmp_hook8: unsafe extern "C" fn(u64, u64, u64); 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_gen_cmp_hook: unsafe extern "C" fn(u64, u32) -> u64;
#[cfg(not(feature = "systemmode"))]
static mut libafl_pre_syscall_hook: static mut libafl_pre_syscall_hook:
unsafe extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult; unsafe extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult;
#[cfg(not(feature = "systemmode"))]
static mut libafl_post_syscall_hook: static mut libafl_post_syscall_hook:
unsafe extern "C" fn(u64, i32, u64, u64, u64, u64, u64, u64, u64, u64) -> u64; unsafe extern "C" fn(u64, i32, u64, u64, u64, u64, u64, u64, u64, u64) -> u64;
} }
@ -638,6 +640,7 @@ impl Emulator {
} }
} }
#[cfg(not(feature = "systemmode"))]
pub fn set_pre_syscall_hook( pub fn set_pre_syscall_hook(
&self, &self,
hook: extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult, hook: extern "C" fn(i32, u64, u64, u64, u64, u64, u64, u64, u64) -> SyscallHookResult,
@ -647,6 +650,7 @@ impl Emulator {
} }
} }
#[cfg(not(feature = "systemmode"))]
pub fn set_post_syscall_hook( pub fn set_post_syscall_hook(
&self, &self,
hook: extern "C" fn(u64, i32, u64, u64, u64, u64, u64, u64, u64, u64) -> u64, hook: extern "C" fn(u64, i32, u64, u64, u64, u64, u64, u64, u64, u64) -> u64,

View File

@ -733,6 +733,7 @@ where
#[allow(clippy::unused_self)] #[allow(clippy::unused_self)]
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
#[cfg(not(feature = "systemmode"))]
pub fn hook_syscalls( pub fn hook_syscalls(
&self, &self,
hook: fn( hook: fn(
@ -759,6 +760,7 @@ where
#[allow(clippy::unused_self)] #[allow(clippy::unused_self)]
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
#[cfg(not(feature = "systemmode"))]
pub fn hook_after_syscalls( pub fn hook_after_syscalls(
&self, &self,
hook: fn( hook: fn(