HyperDbg Debugger
Loading...
Searching...
No Matches
Vmcall.h
Go to the documentation of this file.
1
12#pragma once
13
15// Constants //
17
22#define VMCALL_TEST 0x00000001
23
28#define VMCALL_VMXOFF 0x00000002
29
34#define VMCALL_CHANGE_PAGE_ATTRIB 0x00000003
35
40#define VMCALL_INVEPT_ALL_CONTEXTS 0x00000004
41
46#define VMCALL_INVEPT_SINGLE_CONTEXT 0x00000005
47
52#define VMCALL_UNHOOK_ALL_PAGES 0x00000006
53
58#define VMCALL_UNHOOK_SINGLE_PAGE 0x00000007
59
64#define VMCALL_ENABLE_SYSCALL_HOOK_EFER 0x00000008
65
70#define VMCALL_DISABLE_SYSCALL_HOOK_EFER 0x00000009
71
76#define VMCALL_CHANGE_MSR_BITMAP_READ 0x0000000A
77
82#define VMCALL_CHANGE_MSR_BITMAP_WRITE 0x0000000B
83
88#define VMCALL_SET_RDTSC_EXITING 0x0000000C
89
94#define VMCALL_SET_RDPMC_EXITING 0x0000000D
95
100#define VMCALL_SET_EXCEPTION_BITMAP 0x0000000E
101
106#define VMCALL_ENABLE_MOV_TO_DEBUG_REGS_EXITING 0x0000000F
107
112#define VMCALL_ENABLE_EXTERNAL_INTERRUPT_EXITING 0x00000010
113
118#define VMCALL_CHANGE_IO_BITMAP 0x00000011
119
124#define VMCALL_SET_HIDDEN_CC_BREAKPOINT 0x00000012
125
130#define VMCALL_UNSET_RDTSC_EXITING 0x00000013
131
136#define VMCALL_DISABLE_EXTERNAL_INTERRUPT_EXITING_ONLY_TO_CLEAR_INTERRUPT_COMMANDS 0x00000014
137
142#define VMCALL_UNSET_RDPMC_EXITING 0x00000015
143
148#define VMCALL_DISABLE_MOV_TO_DEBUG_REGS_EXITING 0x00000016
149
154#define VMCALL_RESET_MSR_BITMAP_READ 0x00000017
155
160#define VMCALL_RESET_MSR_BITMAP_WRITE 0x00000018
161
167#define VMCALL_RESET_EXCEPTION_BITMAP_ONLY_ON_CLEARING_EXCEPTION_EVENTS 0x00000019
168
173#define VMCALL_RESET_IO_BITMAP 0x0000001A
174
179#define VMCALL_ENABLE_MOV_TO_CR3_EXITING 0x0000001B
180
185#define VMCALL_DISABLE_MOV_TO_CR3_EXITING 0x0000001C
186
191#define VMCALL_UNSET_EXCEPTION_BITMAP 0x0000001D
192
199#define VMCALL_SET_VM_ENTRY_LOAD_DEBUG_CONTROLS 0x0000001E
200
207#define VMCALL_UNSET_VM_ENTRY_LOAD_DEBUG_CONTROLS 0x0000001F
208
215#define VMCALL_SET_VM_EXIT_SAVE_DEBUG_CONTROLS 0x00000020
216
223#define VMCALL_UNSET_VM_EXIT_SAVE_DEBUG_CONTROLS 0x00000021
224
229#define VMCALL_SET_VM_EXIT_ON_NMIS 0x00000022
230
235#define VMCALL_UNSET_VM_EXIT_ON_NMIS 0x00000023
236
242#define VMCALL_DISABLE_RDTSC_EXITING_ONLY_FOR_TSC_EVENTS 0x00000024
243
249#define VMCALL_DISABLE_MOV_TO_HW_DR_EXITING_ONLY_FOR_DR_EVENTS 0x00000025
250
254#define VMCALL_ENABLE_MOV_TO_CONTROL_REGS_EXITING 0x00000026
255
260#define VMCALL_DISABLE_MOV_TO_CONTROL_REGS_EXITING 0x00000027
261
267#define VMCALL_DISABLE_MOV_TO_CR_EXITING_ONLY_FOR_CR_EVENTS 0x00000028
268
273#define VMCALL_ENABLE_DIRTY_LOGGING_MECHANISM 0x00000029
274
279#define VMCALL_DISABLE_DIRTY_LOGGING_MECHANISM 0x0000002a
280
285#define VMCALL_CHANGE_TO_MBEC_SUPPORTED_EPTP 0x0000002b
286
291#define VMCALL_RESTORE_TO_NORMAL_EPTP 0x0000002c
292
297#define VMCALL_DISABLE_OR_ENABLE_MBEC 0x0000002d
298
303#define VMCALL_READ_PHYSICAL_MEM_BYPASS_CACHING_POLICIES 0x0000002e // not used
304
309#define VMCALL_WRITE_PHYSICAL_MEM_BYPASS_CACHING_POLICIES 0x0000002f // not used
310
315#define VMCALL_READ_PHYSICAL_MEMORY 0x00000030
316
321#define VMCALL_WRITE_PHYSICAL_MEMORY 0x00000031
322
327#define VMCALL_GET_VMCS_DEBUGCTL 0x00000032
328
333#define VMCALL_SET_VMCS_DEBUGCTL 0x00000033
334
339#define VMCALL_SET_MSR_LBR_SELECT 0x00000034
340
345#define VMCALL_GET_GUEST_IA32_LBR_CTL 0x00000035
346
351#define VMCALL_SET_GUEST_IA32_LBR_CTL 0x00000036
352
357#define VMCALL_SET_VM_ENTRY_LOAD_GUEST_IA32_LBR_CTL 0x00000037
358
363#define VMCALL_UNSET_VM_ENTRY_LOAD_GUEST_IA32_LBR_CTL 0x00000038
364
369#define VMCALL_SET_CLEAR_GUEST_IA32_LBR_CTL 0x00000039
370
375#define VMCALL_UNSET_CLEAR_GUEST_IA32_LBR_CTL 0x0000003A
376
378// Functions //
380
381// ----------------------------------------------------------------------------
382// Private Interfaces
383//
384
385static NTSTATUS
386VmxHypervVmcallHandler(_Inout_ VIRTUAL_MACHINE_STATE * VCpu, _Inout_ PGUEST_REGS GuestRegs);
387
394NTSTATUS
396
406NTSTATUS
408 UINT64 VmcallNumber,
409 DIRECT_VMCALL_PARAMETERS * DirectVmcallOptions);
410
421NTSTATUS
423 _In_ UINT64 VmcallNumber,
424 _In_ UINT64 OptionalParam1,
425 _In_ UINT64 OptionalParam2,
426 _In_ UINT64 OptionalParam3);
427
436NTSTATUS
437VmcallTest(_In_ UINT64 Param1,
438 _In_ UINT64 Param2,
439 _In_ UINT64 Param3);
_Use_decl_annotations_ NTSTATUS VmxHypervVmcallHandler(VIRTUAL_MACHINE_STATE *VCpu, PGUEST_REGS GuestRegs)
Handle vm-exits of VMCALLs.
Definition Vmcall.c:24
NTSTATUS VmxVmcallDirectVmcallHandler(VIRTUAL_MACHINE_STATE *VCpu, UINT64 VmcallNumber, DIRECT_VMCALL_PARAMETERS *DirectVmcallOptions)
Direct Vmcall Handler.
Definition Vmcall.c:109
NTSTATUS VmcallTest(_In_ UINT64 Param1, _In_ UINT64 Param2, _In_ UINT64 Param3)
Test function which shows a message to test a successful VMCALL.
Definition Vmcall.c:631
NTSTATUS VmxVmcallHandler(_Inout_ VIRTUAL_MACHINE_STATE *VCpu, _In_ UINT64 VmcallNumber, _In_ UINT64 OptionalParam1, _In_ UINT64 OptionalParam2, _In_ UINT64 OptionalParam3)
Main handler for VMCALLs.
NTSTATUS VmxHandleVmcallVmExit(_Inout_ VIRTUAL_MACHINE_STATE *VCpu)
Handle vm-exits of VMCALLs.
struct GUEST_REGS * PGUEST_REGS
struct _DIRECT_VMCALL_PARAMETERS DIRECT_VMCALL_PARAMETERS
Used for sending direct VMCALLs on the VMX root-mode.
struct _VIRTUAL_MACHINE_STATE VIRTUAL_MACHINE_STATE
The status of each core after and before VMX.