Bitdefender Hypervisor Memory Introspection
hook_dtr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _HOOK_DTR_H_
6 #define _HOOK_DTR_H_
7 
8 #include "introcpu.h"
9 #include "introtypes.h"
10 
11 
20 typedef INTSTATUS
22  _In_ DTR *OldDtr,
23  _In_ DTR *NewDtr,
24  _In_ DWORD Flags,
25  _Out_ INTRO_ACTION *Action
26  );
27 
28 
32 typedef struct _DTR_HOOK_STATE
33 {
37 
38 
42 typedef struct _HOOK_DTR
43 {
49 
50 
51 //
52 // DTR hooks related API
53 //
56  _In_ DWORD Flags,
58  _Out_opt_ void **Hook
59  );
60 
63  _In_ HOOK_DTR *Hook
64  );
65 
68  void
69  );
70 
73  void
74  );
75 
78  void
79  );
80 
81 #endif // _HOOK_DTR_H_
_Bool BOOLEAN
Definition: intro_types.h:58
#define _Out_
Definition: intro_sal.h:22
long long INT64
Definition: intro_types.h:45
#define _In_
Definition: intro_sal.h:21
INT64 HooksCount
The total number of DTR hooks.
Definition: hook_dtr.h:35
LIST_ENTRY Link
List entry element.
Definition: hook_dtr.h:44
DWORD Flags
Hook flags, a combination of IG_DESC_ACCESS.
Definition: hook_dtr.h:45
INTSTATUS IntHookDtrCommit(void)
Commit the descriptor registers hooks.
Definition: hook_dtr.c:165
PFUNC_DtrReadWriteHookCallback Callback
The callback.
Definition: hook_dtr.h:47
INTSTATUS IntHookDtrSetHook(DWORD Flags, PFUNC_DtrReadWriteHookCallback Callback, void **Hook)
Places a descriptor table register hook.
Definition: hook_dtr.c:11
int INTSTATUS
The status data type.
Definition: introstatus.h:24
struct _HOOK_DTR * PHOOK_DTR
struct _DTR_HOOK_STATE DTR_HOOK_STATE
INTSTATUS IntHookDtrUninit(void)
Uninit the descriptor registers hooks state.
Definition: hook_dtr.c:226
struct _DTR_HOOK_STATE * PDTR_HOOK_STATE
#define _Out_opt_
Definition: intro_sal.h:30
struct _HOOK_DTR HOOK_DTR
A descriptor table register. Valid for IDTR and GDTR.
Definition: introcpu.h:71
uint32_t DWORD
Definition: intro_types.h:49
enum _INTRO_ACTION INTRO_ACTION
Event actions.
INTSTATUS(* PFUNC_DtrReadWriteHookCallback)(DTR *OldDtr, DTR *NewDtr, DWORD Flags, INTRO_ACTION *Action)
Called when a descriptor table register is accessed.
Definition: hook_dtr.h:21
INTSTATUS IntHookDtrInit(void)
Initialize the descriptor registers hook state.
Definition: hook_dtr.c:203
BOOLEAN Disabled
True if the hook has been removed/disabled.
Definition: hook_dtr.h:46
INTSTATUS IntHookDtrRemoveHook(HOOK_DTR *Hook)
Remove a descriptor register hook.
Definition: hook_dtr.c:106
LIST_HEAD DtrHooksList
The list of DTR hooks.
Definition: hook_dtr.h:34