41#define PASSIVE_LEVEL 0
44#define DISPATCH_LEVEL 2
50#define PROFILE_LEVEL 15
56#define X86_CR0_PE 0x00000001
57#define X86_CR0_MP 0x00000002
58#define X86_CR0_EM 0x00000004
59#define X86_CR0_TS 0x00000008
60#define X86_CR0_ET 0x00000010
61#define X86_CR0_NE 0x00000020
62#define X86_CR0_WP 0x00010000
63#define X86_CR0_AM 0x00040000
64#define X86_CR0_NW 0x20000000
65#define X86_CR0_CD 0x40000000
66#define X86_CR0_PG 0x80000000
72#define X86_CR4_VME 0x0001
73#define X86_CR4_PVI 0x0002
74#define X86_CR4_TSD 0x0004
75#define X86_CR4_DE 0x0008
76#define X86_CR4_PSE 0x0010
77#define X86_CR4_PAE 0x0020
78#define X86_CR4_MCE 0x0040
79#define X86_CR4_PGE 0x0080
80#define X86_CR4_PCE 0x0100
81#define X86_CR4_OSFXSR 0x0200
82#define X86_CR4_OSXMMEXCPT 0x0400
83#define X86_CR4_VMXE 0x2000
89#define X86_FLAGS_CF (1 << 0)
90#define X86_FLAGS_PF (1 << 2)
91#define X86_FLAGS_AF (1 << 4)
92#define X86_FLAGS_ZF (1 << 6)
93#define X86_FLAGS_SF (1 << 7)
94#define X86_FLAGS_TF (1 << 8)
95#define X86_FLAGS_IF (1 << 9)
96#define X86_FLAGS_DF (1 << 10)
97#define X86_FLAGS_OF (1 << 11)
98#define X86_FLAGS_STATUS_MASK (0xfff)
99#define X86_FLAGS_IOPL_MASK (3 << 12)
100#define X86_FLAGS_IOPL_SHIFT (12)
101#define X86_FLAGS_IOPL_SHIFT_2ND_BIT (13)
102#define X86_FLAGS_NT (1 << 14)
103#define X86_FLAGS_RF (1 << 16)
104#define X86_FLAGS_VM (1 << 17)
105#define X86_FLAGS_AC (1 << 18)
106#define X86_FLAGS_VIF (1 << 19)
107#define X86_FLAGS_VIP (1 << 20)
108#define X86_FLAGS_ID (1 << 21)
109#define X86_FLAGS_RESERVED_ONES 0x2
110#define X86_FLAGS_RESERVED 0xffc0802a
112#define X86_FLAGS_RESERVED_BITS 0xffc38028
113#define X86_FLAGS_FIXED 0x00000002
122#define KGDT64_NULL (0 * 16)
123#define KGDT64_R0_CODE (1 * 16)
124#define KGDT64_R0_DATA (1 * 16) + 8
125#define KGDT64_R3_CMCODE (2 * 16)
126#define KGDT64_R3_DATA (2 * 16) + 8
127#define KGDT64_R3_CODE (3 * 16)
128#define KGDT64_SYS_TSS (4 * 16)
129#define KGDT64_R3_CMTEB (5 * 16)
130#define KGDT64_R0_CMCODE (6 * 16)
131#define KGDT64_LAST (7 * 16)
137#define PCID_NONE 0x000
138#define PCID_MASK 0x003
144#define CPUID_HV_VENDOR_AND_MAX_FUNCTIONS 0x40000000
145#define CPUID_HV_INTERFACE 0x40000001
151#define CPUID_ADDR_WIDTH 0x80000008
157#define CPUID_PROCESSOR_AND_PROCESSOR_FEATURE_IDENTIFIERS 0x00000001
163#define RESERVED_MSR_RANGE_LOW 0x40000000
164#define RESERVED_MSR_RANGE_HI 0x400000F0
170#define __CPU_INDEX__ KeGetCurrentProcessorNumberEx(NULL)
176#define ALIGNMENT_PAGE_SIZE 4096
182#define MAXIMUM_ADDRESS 0xffffffffffffffff
197#define BITS_PER_LONG (sizeof(unsigned long) * 8)
198#define ORDER_LONG (sizeof(unsigned long) == 4 ? 5 : 6)
200#define BITMAP_ENTRY(_nr, _bmap) ((_bmap))[(_nr) / BITS_PER_LONG]
201#define BITMAP_SHIFT(_nr) ((_nr) % BITS_PER_LONG)
207#define PAGE_OFFSET(Va) ((PVOID)((ULONG_PTR)(Va) & (PAGE_SIZE - 1)))
213#define _XBEGIN_STARTED (~0u)
214#define _XABORT_EXPLICIT (1 << 0)
215#define _XABORT_RETRY (1 << 1)
216#define _XABORT_CONFLICT (1 << 2)
217#define _XABORT_CAPACITY (1 << 3)
218#define _XABORT_DEBUG (1 << 4)
219#define _XABORT_NESTED (1 << 5)
222# define _XABORT_CODE(x) (((x) >> 24) & 0xFF)
298CommonGetHandleFromProcess(_In_
UINT32 ProcessId, _Out_ PHANDLE Handle);
UCHAR BOOLEAN
Definition BasicTypes.h:39
unsigned char UCHAR
Definition BasicTypes.h:35
#define VOID
Definition BasicTypes.h:33
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
unsigned long ULONG
Definition BasicTypes.h:37
CPUID Registers.
Definition Common.h:236
int ebx
Definition Common.h:238
int eax
Definition Common.h:237
int edx
Definition Common.h:240
int ecx
Definition Common.h:239
KPROCESS Brief structure.
Definition Common.h:265
ULONG_PTR DirectoryTableBase
Definition Common.h:268
UCHAR Data[1]
Definition Common.h:269
DISPATCHER_HEADER Header
Definition Common.h:266
LIST_ENTRY ProfileListHead
Definition Common.h:267
The status of each core after and before VMX.
Definition State.h:290
unsigned long Low
Definition Common.h:249
struct _CR_FIXED::@0 Fields
UINT64 Flags
Definition Common.h:245
long High
Definition Common.h:250