-
Notifications
You must be signed in to change notification settings - Fork 3
API: MmGetHookTrampoline
Returns a pointer to the trampoline of a hook created by MmCreateHook. This allows code to call a non-intercepted version of a hooked function.
PVOID MmGetHookTrampoline(
[in] AurieModule* Module
[in] std::string_view HookIdentifier
);
The module that created the hook specified by HookIdentifier
. This parameter must point to a valid module.
A unique case-sensitive name of the hook created by Module
.
The function returns the base address of the trampoline. To use the trampoline as a way of calling the hooked function without triggering the hook, the caller should cast this value to a function pointer of the same type as the hooked function.
Upon failure, a nullptr
is returned. In such scenarios, callers should assume that the hook does not exist.
The MmGetHookTrampoline
function is not designed with mid-function hooks (ie. hooks created by MmCreateMidfunctionHook) with mind, as they do not use a traditional trampoline.
Upon trying to invoke MmGetHookTrampoline
with a HookIdentifier
belonging to a mid-function hook, nullptr
will always be returned.