DHookRaw

Last Updated2023-07-21
Created At2021-11-17

Hook a raw pointer

native int DHookRaw(Handle setup, bool post, Address addr, DHookRemovalCB removalcb = INVALID_FUNCTION, DHookCallback callback = INVALID_FUNCTION)

Parameters

Handle setup
Setup handle to use to add the hook.
bool post
true to make the hook a post hook. (If you need to change the return value or need the return value use a post hook! If you need to change params and return use a pre and post hook!)
Address addr
This pointer address.
DHookRemovalCB removalcb
Callback for when the hook is removed (Entity hooks are auto-removed on entity destroyed and will call this callback)
DHookCallback callback
Optional callback function, if not set here must be set when creating the hook.

Return Value

int INVALID_HOOK_ID on fail a hookid on success

Error

Invalid setup handle, invalid address, invalid hook type or invalid callback.