log.info("pre callback from lua", ret_val:get(), str:get())
-- false for skipping the original function call
return false
end,
function(ret_val, str)
log.info("post callback from lua 1", ret_val:get(), str:get())
ret_val:set(79.69)
log.info("post callback from lua 2", ret_val:get(), str:get())
end)
```
- **Parameters:**
-`hook_name` (string): The name of the hook.
-`return_type` (string): Type of the return value of the detoured function.
-`param_types` (table<string>): Types of the parameters of the detoured function.
-`target_func_ptr` (memory.pointer): The pointer to the function to detour.
-`pre_callback` (function): The function that will be called before the original function is about to be called. The callback must match the following signature: ( return_value (value_wrapper), arg1 (value_wrapper), arg2 (value_wrapper), ... ) -> Returns true or false (boolean) depending on whether you want the original function to be called.
-`post_callback` (function): The function that will be called after the original function is called (or just after the pre callback is called, if the original function was skipped). The callback must match the following signature: ( return_value (value_wrapper), arg1 (value_wrapper), arg2 (value_wrapper), ... ) -> void