48 ERROR(
"[ERROR] IntHookObjectCommit failed: 0x%08x\n", status);
49 goto cleanup_and_exit;
55 ERROR(
"[ERROR] IntHookGvaCommitHooks failed: 0x%08x\n", status);
56 goto cleanup_and_exit;
62 ERROR(
"[ERROR] IntHookPtsCommitHooks failed: 0x%08x\n", status);
63 goto cleanup_and_exit;
69 ERROR(
"[ERROR] IntHookPtmCommitHooks failed: 0x%08x\n", status);
70 goto cleanup_and_exit;
76 ERROR(
"[ERROR] IntHookGpaCommitHooks failed: 0x%08x\n", status);
77 goto cleanup_and_exit;
80 #ifdef DEBUG_CHECK_HOOKS 133 pHook = &HookGpa->Header;
158 ERROR(
"[ERROR] Unknown hook type %d!\n", pHook->HookType);
183 ERROR(
"[ERROR] Trying to do IntHookInit multiple times!\n");
196 goto cleanup_and_exit;
202 goto cleanup_and_exit;
208 goto cleanup_and_exit;
214 goto cleanup_and_exit;
220 goto cleanup_and_exit;
261 ERROR(
"[ERROR] IntHookCommitAllHooks failed: 0x%08x\n", status);
267 ERROR(
"[ERROR] IntHookObjectUninit: 0x%08x\n", status);
308 ERROR(
"[ERROR] The GPA hook for address 0x%016llx does not point to a valid GVA hook: %p, type %d",
313 return pGva->
GvaPage + (Address & 0xFFF);
INTSTATUS IntHookPtmRemoveHook(HOOK_PTM **Hook, DWORD Flags)
Remove a page-table hook handle.
BOOLEAN Dirty
Set whenever hooks are added or removed.
HOOK_GVA_STATE GvaHooks
GVA hooks state.
INTSTATUS IntHookGpaRemoveHook(HOOK_GPA **Hook, DWORD Flags)
Remove a GPA hook.
#define INT_STATUS_SUCCESS
INTSTATUS IntHookInit(void)
Initialize the global hook system.
Used by the internal page monitor (used by PTS).
#define INT_SUCCESS(Status)
#define INT_STATUS_NOT_NEEDED_HINT
INTSTATUS IntHookCommitAllHooks(void)
Commits all the hooks.
An entire hook region, consisting of multiple GVA hooks.
#define HpAllocWithTag(Len, Tag)
int INTSTATUS
The status data type.
QWORD GvaPage
Guest virtual page base address, aligned to 4K.
INTSTATUS IntHookPtsCommitHooks(void)
Commit all PTS hook modifications.
BOOLEAN ObjectsRemoved
True whenever an object has been removed.
HOOK_STATE * gHooks
Global hooks state.
INTSTATUS IntHookGpaInit(void)
Initialize the GPA hook system. This function should be called only once, during introspection init...
Measures the hook commits.
BOOLEAN HooksRemoved
True if at least one hook has been removed since the last commit.
BYTE HookType
The type of the hook structure (see _HOOK_TYPE)
#define INT_STATUS_ALREADY_INITIALIZED
static void IntDbgCheckHooks(void)
__noreturn void IntBugCheck(void)
INTSTATUS IntHookObjectInit(void)
Initialize the hook object system.
struct _HOOK_HEADER * PHOOK_HEADER
void * ParentHook
The parent hook. For a GPA hook, for example, a GVA hook or a PagedHook will be the parent hook...
HOOK_HEADER Header
The hook header.
HOOK_PTM_STATE PtmHooks
Page table monitoring (internal) state.
INTSTATUS IntHookObjectUninit(void)
Uninit the hook object system.
#define HpFreeAndNullWithTag(Add, Tag)
INTSTATUS IntHookPtsRemoveHook(HOOK_PTS **Hook, DWORD Flags)
Remove a PTS hook.
BOOLEAN HooksRemoved
True if any hook has been removed.
INTSTATUS IntHookGvaRemoveHook(HOOK_GVA **Hook, DWORD Flags)
Remove a GVA hook.
HOOK_GPA_STATE GpaHooks
GPA hooks state.
INTSTATUS IntHookObjectRemoveRegion(HOOK_REGION_DESCRIPTOR **Region, DWORD Flags)
Remove a hooked region of memory.
INTSTATUS IntHookPtmInit(void)
Initialize the page-table hook system.
INTSTATUS IntHookGvaCommitHooks(void)
Commit all the modified GVA hooks.
QWORD IntHookGetGlaFromGpaHook(HOOK_GPA const *Hook, QWORD Address)
Gets the GLA from a GPA hook.
INTSTATUS IntHookPtmCommitHooks(void)
Commit the page-table hooks.
INTSTATUS IntHookRemoveChain(PHOOK_GPA HookGpa)
Removes a hook chain, starting with the given GPA hook.
HOOK_OBJECT_STATE Objects
Object hooks state.
INTSTATUS IntHookObjectCommit(void)
Commit removed hook objects and regions.
INTSTATUS IntHookUninit(void)
Uninit the global hooks system.
HOOK_PTS_STATE PtsHooks
PTS hooks state (public page-table monitoring).
#define INT_STATUS_NOT_INITIALIZED_HINT
#define INT_STATUS_INVALID_PARAMETER_1
#define INT_STATUS_NOT_SUPPORTED
Used by page-table hooks.
BOOLEAN HooksRemoved
True if hooks were removed, and we must do the cleanup..
INTSTATUS IntHookPtsInit(void)
Initializes the PTS hooks system.
INTSTATUS IntHookGpaCommitHooks(void)
Commit existing modified hooks.
INTSTATUS IntHookGvaInit(void)
Initialize the GVA hooks system.
BOOLEAN HooksRemoved
True if hooks have been removed.
#define INT_STATUS_INSUFFICIENT_RESOURCES