Bitdefender Hypervisor Memory Introspection
winselfmap.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Bitdefender
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #ifndef _WINSELFMAP_H_
6 #define _WINSELFMAP_H_
7 
8 #include "guests.h"
9 
11 
21 #define SELF_MAP_ENTRY(Cr3) (CLEAN_PHYS_ADDRESS64(((QWORD)(Cr3))) + gGuest.Mm.SelfMapIndex * 8ull)
22 
34 #define SELF_MAP_ENTRY_IS_DETECTION(entry) (((entry) & PT_P) != 0 && ((entry) & PT_US) != 0)
35 
39 #define SELF_MAP_ENTRY_VA (0xFFFF800000000000 | ((QWORD)gGuest.Mm.SelfMapIndex << 39) | \
40  ((QWORD)gGuest.Mm.SelfMapIndex << 30) | ((QWORD)gGuest.Mm.SelfMapIndex << 21) | \
41  ((QWORD)gGuest.Mm.SelfMapIndex << 12) | ((QWORD)gGuest.Mm.SelfMapIndex * 8))
42 
43 
46  void
47  );
48 
52  );
53 
57  );
58 
61  void
62  );
63 
66  void
67  );
68 
72  );
73 
74 #endif
int INTSTATUS
The status data type.
Definition: introstatus.h:24
INTSTATUS IntWinSelfMapGetAndCheckSelfMapEntry(WIN_PROCESS_OBJECT *Process)
Sets and validates the self map entry values for a process.
Definition: winselfmap.c:579
INTSTATUS IntWinSelfMapProtectSelfMapIndex(WIN_PROCESS_OBJECT *Process)
Protects the self map index of a process by placing an EPT write hook on it.
Definition: winselfmap.c:710
INTSTATUS IntWinSelfMapUnprotectSelfMapIndex(WIN_PROCESS_OBJECT *Process)
Removes the EPT protection for the self map entry index of a process.
Definition: winselfmap.c:802
#define _Inout_
Definition: intro_sal.h:20
struct _WIN_PROCESS_OBJECT * PWIN_PROCESS_OBJECT
Definition: winselfmap.h:10
INTSTATUS IntWinSelfMapValidateSelfMapEntries(void)
Validates the self map entries for every process in the system.
Definition: winselfmap.c:453
INTSTATUS IntWinSelfMapEnableSelfMapEntryProtection(void)
Enables the self map protection mechanism for the entire system.
Definition: winselfmap.c:516
INTSTATUS IntWinSelfMapDisableSelfMapEntryProtection(void)
Disables the self map entry protection for all the processes on the system.
Definition: winselfmap.c:656
This structure describes a running process inside the guest.
Definition: winprocess.h:83