From d5ba7e81708c5294c232f2d507d165a46aa7eb17 Mon Sep 17 00:00:00 2001 From: Diego Argueta Date: Thu, 21 Nov 2024 07:34:26 -0800 Subject: [PATCH] Remove redundant hook declaration --- csrc/unicorn.c | 1 + csrc/unicornlua/basic_hook_functions.template | 4 ++-- csrc/unicornlua/hooks.h | 5 ----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/csrc/unicorn.c b/csrc/unicorn.c index 613924c9..8697171c 100644 --- a/csrc/unicorn.c +++ b/csrc/unicorn.c @@ -24,6 +24,7 @@ * @module unicorn_c_ */ +#include "unicornlua/basic_hook_functions.h" #include "unicornlua/control_functions.h" #include "unicornlua/engine.h" #include "unicornlua/hooks.h" diff --git a/csrc/unicornlua/basic_hook_functions.template b/csrc/unicornlua/basic_hook_functions.template index 50ccad11..eefe10d6 100644 --- a/csrc/unicornlua/basic_hook_functions.template +++ b/csrc/unicornlua/basic_hook_functions.template @@ -22,12 +22,12 @@ ! for hook_name, hook_definition in pairs(basic_hook_functions) do - UNICORN_EXPORT - void ulinternal_hook_callback__$(hook_name)( + UNICORN_EXPORT void ulinternal_hook_callback__$(hook_name)( uc_engine *engine, ! for _, argument_definition in ipairs(hook_definition.arguments) do $(argument_definition.type) $(argument_definition.name), ! end void *userdata ); + int ul_create_$(hook_name)_hook(lua_State *L); ! end diff --git a/csrc/unicornlua/hooks.h b/csrc/unicornlua/hooks.h index 455a9db3..e6d3e66d 100644 --- a/csrc/unicornlua/hooks.h +++ b/csrc/unicornlua/hooks.h @@ -28,15 +28,10 @@ typedef struct void ulinternal_push_callback_to_lua(const ULHookState *hook); int ul_hook_del(lua_State *L); -int ul_create_interrupt_hook(lua_State *L); -int ul_create_memory_access_hook(lua_State *L); int ul_create_invalid_mem_access_hook(lua_State *L); int ul_create_port_in_hook(lua_State *L); -int ul_create_port_out_hook(lua_State *L); int ul_create_arm64_sys_hook(lua_State *L); int ul_create_cpuid_hook(lua_State *L); -int ul_create_generic_no_arguments_hook(lua_State *L); -int ul_create_code_hook(lua_State *L); int ul_create_edge_generated_hook(lua_State *L); int ul_create_tcg_opcode_hook(lua_State *L); int ul_release_hook_callbacks(lua_State *L);