BoxedAppSDK_HookFunction

Description

The function creates a hook for the specified target function.

Hooks allow intercepting calls to system or user-defined functions so that the custom hook function is executed instead. This mechanism is a key part of BoxedApp’s ability to virtualize system APIs and simulate file system or registry access.

For a detailed explanation and usage examples, see Intercepting Functions.

Syntax

HANDLE __stdcall BoxedAppSDK_HookFunction(
  PVOID pFunction,
  PVOID pHook,
  BOOL bEnable
);
function BoxedAppSDK_HookFunction(
  pFunction: Pointer;
  pHook: Pointer;
  bEnable: BOOL
): THandle; stdcall;

Parameters

pFunction
The address of the target function to hook.
This can be a WinAPI function or a user-defined function.

pHook
The address of the custom hook function that will replace the original function.

bEnable
If set to TRUE, the hook is enabled immediately after creation.
If set to FALSE, the hook is created but not yet enabled — you can enable it later with BoxedAppSDK_EnableHook.

Remarks

When a hook is active, all calls to the hooked function are redirected to the specified hook function. Hooks can be temporarily disabled or removed to restore original behavior. BoxedApp uses hooks extensively to intercept system functions such as file and registry APIs.

See Also