|
Bitdefender Hypervisor Memory Introspection
|
Go to the source code of this file.
Functions | |
| INTSTATUS | IntHookMsrSetHook (DWORD Msr, DWORD Flags, PFUNC_MsrReadWriteHookCallback Callback, void *Context, void **Hook) |
| Set a model-specific register write hook. More... | |
| static INTSTATUS | IntHookMsrDeleteHook (HOOK_MSR *Hook) |
| Permanently delete a model specific register hook. More... | |
| INTSTATUS | IntHookMsrRemoveHook (HOOK_MSR *Hook) |
| Remove a model specific register hook. More... | |
| static void | IntHookMsrRemoveAllHooks (void) |
| Remove all model specific register write hooks. More... | |
| INTSTATUS | IntHookMsrCommit (void) |
| Commit the model specific register hooks. More... | |
| INTSTATUS | IntHookMsrInit (void) |
| Initialize the model specific registers hook state. More... | |
| INTSTATUS | IntHookMsrUninit (void) |
| Uninit the model specific register hooks state. More... | |
| INTSTATUS IntHookMsrCommit | ( | void | ) |
Commit the model specific register hooks.
This function will iterate the list of MSR hooks, and it will delete all the hooks that were flagged for removal.
| INT_STATUS_SUCCESS | On success. |
| INT_STATUS_NOT_INITIALIZED | If the MSR hooks state is not initialized. |
Definition at line 224 of file hook_msr.c.
Referenced by IntGuestPreReturnCallback().
Permanently delete a model specific register hook.
NOTE: When the last MSR hook is removed, the MSR notifications callback will be unregistered from the integrator.
| [in] | Hook | The MSR hook to be deleted. |
| INT_STATUS_SUCCESS | On success. |
Definition at line 108 of file hook_msr.c.
Referenced by IntHookMsrCommit(), and IntHookMsrRemoveHook().
| INTSTATUS IntHookMsrInit | ( | void | ) |
Initialize the model specific registers hook state.
| INT_STATUS_SUCCESS | On success. |
| INT_STATUS_INSUFFICIENT_RESOURCES | If a memory alloc fails. |
Definition at line 262 of file hook_msr.c.
Referenced by IntGuestInit().
|
static |
Remove all model specific register write hooks.
Definition at line 205 of file hook_msr.c.
Referenced by IntHookMsrUninit().
Remove a model specific register hook.
Removes a MSR write hook. First of all, this function will mark the hook as being disabled (the callback will never be called again). If we are currently in the context of a MSR violation, we will wait for the commit phase to permanently delete the hook. Otherwise, the hook will be deleted immediately. NOTE: If this is the last hook set on this particular MSR, VM exits will be disabled on it.
| [in] | Hook | The hook to be removed. |
| INT_STATUS_SUCCESS | On success. |
| INT_STATUS_INVALID_PARAMETER | If an invalid parameter is supplied. |
Definition at line 138 of file hook_msr.c.
Referenced by IntHandleMsrViolation(), IntHookMsrRemoveAllHooks(), and IntMsrSyscallUnprotect().
| INTSTATUS IntHookMsrSetHook | ( | DWORD | Msr, |
| DWORD | Flags, | ||
| PFUNC_MsrReadWriteHookCallback | Callback, | ||
| void * | Context, | ||
| void ** | Hook | ||
| ) |
Set a model-specific register write hook.
Establishes a hook on the given MSR (Model Specific Register). Flags may indicate whether it is a read, write or both hook. When the first hook is set on a MSR, VM exits are enabled for it. When the first MSR hook is set, the MSR access callback is registered to the HV.
| [in] | Msr | The MSR to be intercepted. |
| [in] | Flags | IG_MSR_HOOK_WRITE for write access, IG_MSR_HOOK_READ for read access. |
| [in] | Callback | The callback to be called when Msr is accessed. |
| [in] | Context | Optional context, will be passed to the callback on calls. |
| [in] | Hook | Handle to the newly placed MSR hook. |
| INT_STATUS_SUCCESS | On success. |
| INT_STATUS_INVALID_PARAMETER | If an invalid parameter is supplied. |
| INT_STATUS_INSUFFICIENT_RESOURCES | If a memory alloc fails. |
Definition at line 11 of file hook_msr.c.
Referenced by IntMsrSyscallProtect().
| INTSTATUS IntHookMsrUninit | ( | void | ) |
Uninit the model specific register hooks state.
| INT_STATUS_SUCCESS | On success. |
| INT_STATUS_NOT_INITIALIZED_HINT | If the MSR hooks state is not initialized. |
Definition at line 285 of file hook_msr.c.
Referenced by IntGuestUninit().