MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / block_hook_add

Function block_hook_add

icicle-cortexm/src/unicorn_api.rs:359–379  ·  view source on GitHub ↗
(
    ctx: *mut c_void,
    hook_handle: *mut uc_hook,
    callback: *mut c_void,
    user_data: *mut c_void,
    address: u64,
)

Source from the content-addressed store, hash-verified

357}
358
359pub unsafe extern "C" fn block_hook_add(
360 ctx: *mut c_void,
361 hook_handle: *mut uc_hook,
362 callback: *mut c_void,
363 user_data: *mut c_void,
364 address: u64,
365) -> uc_err {
366 tracing::debug!("icicle_unicorn_api::block_hook_add");
367 let ctx = &mut *ctx.cast::<Context>();
368
369 let vm = unsafe { &mut *ctx.vm };
370 let vtable = ctx.vtable.as_mut().unwrap().as_mut() as *mut uc_engine;
371
372 vm.hook_address(address, move |_cpu, addr| {
373 let func_ptr: fuzzware::uc_cb_hookcode_t = std::mem::transmute(callback);
374 func_ptr.unwrap()(vtable, addr, 0, user_data);
375 });
376 *hook_handle = 0;
377
378 UC_ERR_OK
379}
380
381pub unsafe extern "C" fn backtrace(ctx: *mut c_void) {
382 let vm = unsafe { &mut *(*ctx.cast::<Context>()).vm };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected