Hooks

From Ark & Atlas Server API
Jump to: navigation, search

Go Back: Plugin_Development

Pointer To Hooks

ArkApi::GetHooks().

Macros

DECLARE_HOOK

  • Hook Name
  • Return type
  • Arguments...

Declares your hooks in your plugin

DECLARE_HOOK(hookName, returnType, argType1, argType2, ...);

Functions

SetHook

Hooks a function. Hooks are called in the reverse order.

  • func_name Function full name
  • detour A pointer to the detour function, which will override the target function
  • original A pointer to the trampoline function, which will be used to call the original target function

Returns true if success, false otherwise

ArkApi::GetHooks().SetHook("Structure.Function", &Hook_hookName, &hookName_original);

DisableHook

Removes a hook from a function

  • func_name Function full name
  • detour A pointer to the detour function

Returns true if success, false otherwise

ArkApi::GetHooks().DisableHook("Structure.Function", &Hook_hookName);

Go Back: Plugin_Development