forked from cheat-engine/cheat-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvmxsetup.h
106 lines (80 loc) · 2.49 KB
/
vmxsetup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* vmxsetup.h
*
* Created on: Jan 26, 2018
* Author: eric heijnen
*/
#ifndef VMM_VMXSETUP_H_
#define VMM_VMXSETUP_H_
#include "common.h"
#include "vmmhelper.h"
typedef struct _RMIDT
{
WORD offset;
WORD segment;
} RMIDT, *PRMIDT;
typedef union _MTRRCAP
{
QWORD Value;
struct
{
unsigned VCNT : 8; //variable range registers count
unsigned FIX : 1; //fixed range register support
unsigned reserved : 1;
unsigned WC : 1; //Write combining support
unsigned SMRR : 1; //SMRR register support
};
} MTRRCAP, *PMTRRCAP; //e.g d0a: vcnt=10 FIX=1 WC=1 SMRR=1
typedef union _MTRRDEF
{
QWORD Value;
struct
{
unsigned TYPE : 8; //variable range registers count
unsigned reserved : 2;
unsigned FE : 1; //Fixed MTTR's enable/disable
unsigned E : 1; //MTTR enable/disable
};
} MTRRDEF, *PMTRRDEF;
extern int hasMTRRsupport;
extern MTRRCAP MTRRCapabilities;
extern MTRRDEF MTRRDefType;
extern int has_EPT_1GBsupport;
extern int has_EPT_2MBSupport;
extern int has_EPT_ExecuteOnlySupport;
extern int has_EPT_INVEPTSingleContext;
extern int has_EPT_INVEPTAllContext;
extern int hasUnrestrictedSupport;
extern int hasVPIDSupport;
extern int canToggleCR3Exit;
extern int canExitOnNMI;
extern int hasVMCSShadowingSupport;
extern int hasCETSupport;
extern int has_VPID_INVVPIDIndividualAddress;
extern int has_VPID_INVVPIDSingleContext;
extern int has_VPID_INVVPIDAllContext;
extern int has_VPID_INVVPIDSingleContextRetainingGlobals;
//AMD
extern int has_VGIFSupport;
extern int has_NP_1GBsupport;
extern int has_NP_2MBsupport;
int vmx_enableProcBasedFeature(DWORD PBF);
int vmx_disableProcBasedFeature(DWORD PBF);
int vmx_enableNMIWindowExiting(void);
int vmx_disableNMIWindowExiting(void);
int vmx_enableSingleStepMode(void);
int vmx_disableSingleStepMode(void);
int vmx_addSingleSteppingReason(pcpuinfo currentcpuinfo, int reason, int ID);
int vmx_addSingleSteppingReasonEx(pcpuinfo currentcpuinfo, int reason, void *data);
void vmx_setMSRReadExit(DWORD msrValue);
void vmx_removeMSRReadExit(DWORD msrValue);
void vmx_setMSRWriteExit(DWORD msrValue);
void vmx_removeMSRWriteExit(DWORD msrValue);
void vmx_enableTSCHook(pcpuinfo currentcpuinfo);
void vmx_disableTSCHook(pcpuinfo currentcpuinfo);
void setupVMX(pcpuinfo currentcpuinfo);
void setup8086WaitForSIPI(pcpuinfo currentcpuinfo, int setupvmcontrols);
QWORD realmode_inthook_calladdressPA;
int realmode_inthook_calladdressJumpSize;
extern int TSCHooked;
#endif /* VMM_VMXSETUP_H_ */