Bitdefender Hypervisor Memory Introspection
|
Go to the source code of this file.
Data Structures | |
struct | _HOOK_GVA |
struct | _HOOK_GVA_STATE |
Typedefs | |
typedef struct _HOOK_HEADER | HOOK_HEADER |
typedef struct _HOOK_GVA | HOOK_GVA |
typedef struct _HOOK_GVA * | PHOOK_GVA |
typedef struct _HOOK_GVA_STATE | HOOK_GVA_STATE |
typedef struct _HOOK_GVA_STATE * | PHOOK_GVA_STATE |
Functions | |
INTSTATUS | IntHookGvaSetHook (QWORD Cr3, QWORD Gva, DWORD Length, BYTE Type, void *Callback, void *Context, void *ParentHook, DWORD Flags, HOOK_GVA **GvaHook) |
Set a read, write, execute or swap hook on a guest virtual address. More... | |
INTSTATUS | IntHookGvaRemoveHook (HOOK_GVA **Hook, DWORD Flags) |
Remove a GVA hook. More... | |
INTSTATUS | IntHookGvaDeleteHook (HOOK_GVA **Hook, DWORD Flags) |
Completely delete a GVA hook. More... | |
INTSTATUS | IntHookGvaCommitHooks (void) |
Commit all the modified GVA hooks. More... | |
INTSTATUS | IntHookGvaInit (void) |
Initialize the GVA hooks system. More... | |
This structures describes a hooked guest virtual page. Page-table interception and guest physical page hooks are handled internally.
typedef struct _HOOK_GVA_STATE HOOK_GVA_STATE |
Global GVA hooks state.
typedef struct _HOOK_HEADER HOOK_HEADER |
Definition at line 11 of file hook_gva.h.
typedef struct _HOOK_GVA_STATE * PHOOK_GVA_STATE |
INTSTATUS IntHookGvaCommitHooks | ( | void | ) |
Commit all the modified GVA hooks.
This function will delete all GVA hooks which were previously marked as removed. Hooks marked with the HOOK_FLG_CHAIN_DELETE flag will not be deleted now, as it is expected that a higher level hook manager will do so.
INT_STATUS_SUCCESS | On success. |
Definition at line 657 of file hook_gva.c.
Referenced by IntHookCommitAllHooks().
Completely delete a GVA hook.
Delete the indicated GVA hook, together with the PTS or GPA hooks established through it.
[in,out] | Hook | The GVA hook to be deleted. Will be set to NULL on return. |
[in] | Flags | Flags. See HOOK_FLG* for more info. |
INT_STATUS_SUCCESS | On success. |
INT_STATUS_INVALID_PARAMETER | If an invalid parameter is used. |
Definition at line 612 of file hook_gva.c.
Referenced by IntHookObjectDeleteRegion().
INTSTATUS IntHookGvaInit | ( | void | ) |
Initialize the GVA hooks system.
INT_STATUS_SUCCESS | On success. |
Definition at line 714 of file hook_gva.c.
Referenced by IntHookInit().
Remove a GVA hook.
Removes the indicated GVA hook, together with any PTS or GPA hooks established through it. This function will not delete the hook - the actual deletion will be made either during the commit phase, or when the caller of this function (if it is a higher level hook system) decides so.
[in,out] | Hook | The GVA hook to be removed. |
[in] | Flags | Flags. See HOOK_FLG* for more info. |
INT_STATUS_SUCCESS | On success. |
INT_STATUS_INVALID_PARAMETER | If an invalid parameter is supplied. |
Definition at line 507 of file hook_gva.c.
Referenced by IntHookObjectRemoveRegionInternal(), IntHookRemoveChain(), IntLixDrvInitVfreeHandler(), IntLixDrvRemoveEntry(), IntMemClkUncloakRegionInternal(), IntUnpPageWriteCallback(), IntUnpUnWatchPageInternal(), IntVeUnlockDriver(), IntWinInfHookHandleSiloFirstWrite(), IntWinInfHookUnprotect(), IntWinSudUnprotectSudExec(), IntWinTokenPrivsUnprotectOnProcess(), IntWinTokenProtectPrivsInternal(), IntWinTokenUnprotectPrivs(), IntWinVadAdjustRange(), IntWinVadHandlePageExecution(), IntWinVadHandleProtectGeneric(), and IntWinVadRemoveRange().
INTSTATUS IntHookGvaSetHook | ( | QWORD | Cr3, |
QWORD | Gva, | ||
DWORD | Length, | ||
BYTE | Type, | ||
void * | Callback, | ||
void * | Context, | ||
void * | ParentHook, | ||
DWORD | Flags, | ||
HOOK_GVA ** | GvaHook | ||
) |
Set a read, write, execute or swap hook on a guest virtual address.
This function establishes an EPT hook on the indicates guest virtual (linear) address. A guest virtual address hook usually consists of two children hooks:
[in] | Cr3 | The virtual address space the hook is placed in. If this parameter is 0, the current System Cr3 will be used, meaning that a global hook will be placed (usually for kernel pages). |
[in] | Gva | The guest virtual address to be hooked. |
[in] | Length | The memory area size to be hooked. Ignored if Type is IG_EPT_HOOK_NONE. |
[in] | Type | Hook type. Can be IG_EPT_HOOK_READ, IG_EPT_HOOK_WRITE, IG_EPT_HOOK_EXECUTE for regular EPT hooks, or IG_EPT_HOOK_NONE for a swap hook. |
[in] | Callback | The callback to be called on [Gva, Gva + Length - 1] accesses. If type is IG_EPT_HOOK_NONE, the callback type must be PFUNC_SwapCallback, otherwise it must be PFUNC_EptViolationCallback. |
[in] | Context | Optional context to be passes as a parameter to the callback. |
[in] | ParentHook | Optional parent hook. |
[in] | Flags | Hook flags. Check our HOOK_FLG* for more info. |
[out] | GvaHook | Optional output handle for the established hook. Can later be used to remove the hook. |
INT_STATUS_SUCCESS | On success. |
INT_STATUS_NOT_SUPPORTED | If the hooked memory area spans outside the page. |
Definition at line 345 of file hook_gva.c.
Referenced by IntHookObjectHookRegion(), IntLixDrvCreateFromAddress(), IntMemClkCloakRegion(), IntUnpPageWriteCallback(), IntUnpWatchPage(), IntVeLockDriver(), IntWinInfHookGetCircularCtxLogger(), IntWinSudProtectSudExec(), IntWinTokenProtectPrivsInternal(), and IntWinVadHandleProtectGeneric().