We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c24c9eb commit e6dd891Copy full SHA for e6dd891
bindings/rust/unicorn-engine/src/hook.rs
@@ -68,6 +68,9 @@ pub unsafe extern "C" fn code_hook_proxy<D, F>(
68
) where
69
F: FnMut(&mut crate::Unicorn<D>, u64, u32),
70
{
71
+ if user_data.is_null() {
72
+ return;
73
+ }
74
let user_data = unsafe { &mut *user_data };
75
let mut user_data_uc = Unicorn {
76
inner: user_data.uc.upgrade().unwrap(),
uc.c
@@ -2051,6 +2051,7 @@ uc_err uc_hook_del(uc_engine *uc, uc_hook hh)
2051
uc);
2052
g_hash_table_remove_all(hook->hooked_regions);
2053
hook->to_delete = true;
2054
+ hook->user_data = NULL;
2055
uc->hooks_count[i]--;
2056
hook_append(&uc->hooks_to_del, hook);
2057
}
0 commit comments