HyperDbg Debugger
Loading...
Searching...
No Matches
Dispatch.h File Reference

Headers of debugger functions for dispatching, triggering and emulating events. More...

Go to the source code of this file.

Functions

VOID DispatchEventEferSysret (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to SYSRET events.
VOID DispatchEventEferSyscall (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to SYSCALL events.
VOID DispatchEventCpuid (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to CPUID events.
VOID DispatchEventXsetbv (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to XSETBV events.
VOID DispatchEventTsc (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN IsRdtscp)
 Handling debugger functions related to RDTSC/RDTSCP events.
VOID DispatchEventVmcall (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to VMCALL events.
VOID DispatchEventMode (VIRTUAL_MACHINE_STATE *VCpu, DEBUGGER_EVENT_MODE_TYPE TargetMode)
 Handling debugger functions related to user-mode/kernel-mode execution trap events.
VOID DispatchEventMovToCr3 (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to mov 2 cr3 events.
VOID DispatchEventIO (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to IO events.
VOID DispatchEventRdmsr (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to RDMSR events.
VOID DispatchEventWrmsr (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to WRMSR events.
VOID DispatchEventRdpmc (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to RDPMC events.
VOID DispatchEventMovToFromControlRegisters (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to mov to/from CR events.
VOID DispatchEventMov2DebugRegs (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to MOV 2 DR events.
VOID DispatchEventException (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to EXCEPTION events.
VOID DispatchEventExternalInterrupts (VIRTUAL_MACHINE_STATE *VCpu)
 Handling debugger functions related to external-interrupt events.
VOID DispatchEventHiddenHookExecCc (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to hidden hook exec CC events.
VOID DispatchEventHiddenHookExecDetours (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to hidden hook exec detours events.
VOID DispatchEventHiddenHookPageReadWriteExecReadPostEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to read & write & execute, read events (post).
VOID DispatchEventHiddenHookPageReadWriteExecWritePostEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to read & write & execute, write events (post).
VOID DispatchEventHiddenHookPageReadWriteExecExecutePostEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context)
 Handling debugger functions related to read & write & execute, execute events (post).
VOID DispatchEventInstrumentationTrace (VIRTUAL_MACHINE_STATE *VCpu)
BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteReadPreEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context, BOOLEAN *IsTriggeringPostEventAllowed)
 Handling debugger functions related to read & write & execute, read events (pre).
BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteWritePreEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context, BOOLEAN *IsTriggeringPostEventAllowed)
 Handling debugger functions related to read & write & execute, write events (pre).
BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteExecutePreEvent (VIRTUAL_MACHINE_STATE *VCpu, PVOID Context, BOOLEAN *IsTriggeringPostEventAllowed)
 Handling debugger functions related to read & write & execute, execute events (pre).

Detailed Description

Headers of debugger functions for dispatching, triggering and emulating events.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.1
Date
2022-09-21

Function Documentation

◆ DispatchEventCpuid()

VOID DispatchEventCpuid ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to CPUID events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
114{
115 UINT64 Context;
117 BOOLEAN PostEventTriggerReq = FALSE;
118
119 //
120 // As the context to event trigger, we send the eax before the cpuid
121 // so that the debugger can both read the eax as it's now changed by
122 // the cpuid instruction and also can modify the results
123 //
125 {
126 //
127 // Adjusting the core context (save EAX for the debugger)
128 //
129 Context = VCpu->Regs->rax & 0xffffffff;
130
131 //
132 // Triggering the pre-event
133 //
136 (PVOID)Context,
137 &PostEventTriggerReq,
138 VCpu->Regs);
139
140 //
141 // Check whether we need to short-circuiting event emulation or not
142 //
144 {
145 //
146 // Handle the CPUID event in the case of triggering event
147 //
148 HvHandleCpuid(VCpu);
149 }
150
151 //
152 // Check for the post-event triggering needs
153 //
154 if (PostEventTriggerReq)
155 {
158 (PVOID)Context,
159 NULL,
160 VCpu->Regs);
161 }
162 }
163 else
164 {
165 //
166 // Otherwise and if there is no event, we should handle the CPUID
167 // normally
168 //
169 HvHandleCpuid(VCpu);
170 }
171}
VMM_CALLBACK_TRIGGERING_EVENT_STATUS_TYPE VmmCallbackTriggerEvents(VMM_EVENT_TYPE_ENUM EventType, VMM_CALLBACK_EVENT_CALLING_STAGE_TYPE CallingStage, PVOID Context, BOOLEAN *PostEventRequired, GUEST_REGS *Regs)
routines callback to trigger events
Definition Callback.c:26
VOID HvHandleCpuid(VIRTUAL_MACHINE_STATE *VCpu)
Handle Cpuid Vmexits.
Definition Hv.c:67
UCHAR BOOLEAN
Definition BasicTypes.h:35
void * PVOID
Definition BasicTypes.h:56
#define FALSE
Definition BasicTypes.h:113
@ VMM_CALLBACK_CALLING_STAGE_PRE_EVENT_EMULATION
Definition DataTypes.h:126
@ VMM_CALLBACK_CALLING_STAGE_POST_EVENT_EMULATION
Definition DataTypes.h:127
enum _VMM_CALLBACK_TRIGGERING_EVENT_STATUS_TYPE VMM_CALLBACK_TRIGGERING_EVENT_STATUS_TYPE
The status of triggering events.
@ VMM_CALLBACK_TRIGGERING_EVENT_STATUS_SUCCESSFUL_IGNORE_EVENT
Definition Events.h:80
@ CPUID_INSTRUCTION_EXECUTION
Definition Events.h:123
BOOLEAN g_TriggerEventForCpuids
Showes whether the cpuid handler is allowed to trigger an event or not.
Definition GlobalVariables.h:149
GUEST_REGS * Regs
Definition State.h:326
UINT64 rax
Definition BasicTypes.h:141

◆ DispatchEventEferSyscall()

VOID DispatchEventEferSyscall ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to SYSCALL events.

Parameters
CoreIndexCurrent core's index
RegsGuest's gp register
Returns
VOID
70{
71 BOOLEAN PostEventTriggerReq = FALSE;
73
74 //
75 // We should trigger the event of SYSCALL here, we send the
76 // syscall number in rax
77 //
80 (PVOID)VCpu->Regs->rax,
81 &PostEventTriggerReq,
82 VCpu->Regs);
83
84 //
85 // Check whether we need to short-circuiting event emulation or not
86 //
88 {
91 }
92
93 //
94 // Check for the post-event triggering needs
95 //
96 if (PostEventTriggerReq)
97 {
100 (PVOID)VCpu->Regs->rax,
101 NULL,
102 VCpu->Regs);
103 }
104}
_Use_decl_annotations_ BOOLEAN SyscallHookEmulateSYSCALL(VIRTUAL_MACHINE_STATE *VCpu)
This function emulates the SYSCALL execution.
Definition EferHook.c:115
VOID HvSuppressRipIncrement(VIRTUAL_MACHINE_STATE *VCpu)
Suppress the incrementation of RIP.
Definition Hv.c:320
@ SYSCALL_HOOK_EFER_SYSCALL
Definition Events.h:117

◆ DispatchEventEferSysret()

VOID DispatchEventEferSysret ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to SYSRET events.

Parameters
CoreIndexCurrent core's index
RegsGuest's gp register
ContextContext of triggering the event
Returns
VOID
26{
27 BOOLEAN PostEventTriggerReq = FALSE;
29
30 //
31 // We should trigger the event of SYSRET here
32 //
35 Context,
36 &PostEventTriggerReq,
37 VCpu->Regs);
38
39 //
40 // Check whether we need to short-circuiting event emulation or not
41 //
43 {
46 }
47
48 //
49 // Check for the post-event triggering needs
50 //
51 if (PostEventTriggerReq)
52 {
55 Context,
56 NULL,
57 VCpu->Regs);
58 }
59}
_Use_decl_annotations_ BOOLEAN SyscallHookEmulateSYSRET(VIRTUAL_MACHINE_STATE *VCpu)
This function emulates the SYSRET execution.
Definition EferHook.c:202
@ SYSCALL_HOOK_EFER_SYSRET
Definition Events.h:118

◆ DispatchEventException()

VOID DispatchEventException ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to EXCEPTION events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
826{
828 BOOLEAN PostEventTriggerReq = FALSE;
829 VMEXIT_INTERRUPT_INFORMATION InterruptExit = {0};
830
831 //
832 // read the exit interruption information
833 //
834 VmxVmread32P(VMCS_VMEXIT_INTERRUPTION_INFORMATION, &InterruptExit.AsUInt);
835
836 //
837 // This type of vm-exit, can be either because of an !exception event,
838 // or it might be because we triggered APIC or X2APIC to generate an
839 // NMI, we want to halt the debuggee. We perform the checks here to
840 // avoid triggering an event for NMIs when the debuggee requested it
841 //
842 if (InterruptExit.InterruptionType == INTERRUPT_TYPE_NMI &&
843 InterruptExit.Vector == EXCEPTION_VECTOR_NMI)
844 {
845 //
846 // Check if we're waiting for an NMI on this core and if the guest is NOT in
847 // a instrument step-in ('i' command) routine
848 //
849 if (!VCpu->InstrumentationStepInMtf &&
851 {
852 return;
853 }
854 }
855
856 //
857 // *** When we reached here it means that this is not a NMI cause by guest,
858 // probably an event ***
859 //
860
861 //
862 // Triggering the pre-event
863 // As the context to event trigger, we send the vector or IDT Index
864 //
865 EventTriggerResult = VmmCallbackTriggerEvents(EXCEPTION_OCCURRED,
867 (PVOID)InterruptExit.Vector,
868 &PostEventTriggerReq,
869 VCpu->Regs);
870
871 //
872 // Now, we check if the guest enabled MTF for debugging (instrumentation stepping)
873 // This is because based on Intel SDM :
874 // If the "monitor trap flag" VM-execution control is 1 and VM entry is
875 // injecting a vectored event, an MTF VM exit is pending on the instruction
876 // boundary before the first instruction following the VM entry
877 // and,
878 // If VM entry is injecting a pending MTF VM exit, an MTF VM exit is pending on the
879 // instruction boundary before the first instruction following the VM entry
880 // This is the case even if the "monitor trap flag" VM-execution control is 0
881 //
882 // So, we'll ignore the injection of Exception in this case
883 //
884 if (VCpu->InstrumentationStepInMtf)
885 {
886 return;
887 }
888
889 //
890 // Check whether we need to short-circuiting event emulation or not
891 //
893 {
894 //
895 // Handle exception (emulate or inject the event)
896 //
897 IdtEmulationHandleExceptionAndNmi(VCpu, InterruptExit);
898 }
899
900 //
901 // Check for the post-event triggering needs
902 //
903 if (PostEventTriggerReq)
904 {
907 (PVOID)InterruptExit.Vector,
908 NULL,
909 VCpu->Regs);
910 }
911}
VOID IdtEmulationHandleExceptionAndNmi(_Inout_ VIRTUAL_MACHINE_STATE *VCpu, _In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit)
Handle NMI and exception vm-exits.
Definition IdtEmulation.c:336
UCHAR VmxVmread32P(size_t Field, UINT32 *FieldValue)
VMX VMREAD instruction (32-bit, pointer variant).
Definition PlatformIntrinsicsVmx.c:227
BOOLEAN VmxBroadcastNmiHandler(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN IsOnVmxNmiHandler)
Handle broadcast NMIs in vmx-root mode.
Definition VmxBroadcast.c:187
@ EXCEPTION_OCCURRED
Definition Events.h:140
@ EXCEPTION_VECTOR_NMI
Definition Events.h:26
@ INTERRUPT_TYPE_NMI
Definition Events.h:52
BOOLEAN InstrumentationStepInMtf
Definition State.h:319

◆ DispatchEventExternalInterrupts()

VOID DispatchEventExternalInterrupts ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to external-interrupt events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
921{
922 VMEXIT_INTERRUPT_INFORMATION InterruptExit = {0};
924 BOOLEAN PostEventTriggerReq = FALSE;
925
926 //
927 // read the exit interruption information
928 //
929 VmxVmread32P(VMCS_VMEXIT_INTERRUPTION_INFORMATION, &InterruptExit.AsUInt);
930
931 //
932 // Check for immediate vm-exit mechanism
933 //
934 if (VCpu->WaitForImmediateVmexit &&
936 {
937 //
938 // Disable vm-exit on external interrupts
939 //
941
942 //
943 // Not increase the RIP
944 //
946
947 //
948 // Handle immediate vm-exit mechanism
949 //
951
952 //
953 // No need to continue, it's a HyperDbg mechanism
954 //
955 return;
956 }
957
958 //
959 // Check process or thread change detections
960 // we cannot ignore injecting the interrupt to the guest if the target interrupt
961 // and process or thread proved to cause a system halt. it halts the system as
962 // we Windows expects to switch the thread while we're forcing it to not do it
963 // Windows fires a clk interrupt on core 0 and fires IPI on other cores
964 // to change a thread
965 //
966 // It seems that clock interrupt is not applied to all cores,
967 // (https://twitter.com/Intel80x86/status/1655461171280105472?s=20)
968 // So, we no longer check for clock interrupts only in core 0
969 //
970 if ((/* VCpu->CoreId == 0 && */ InterruptExit.Vector == CLOCK_INTERRUPT) ||
971 (VCpu->CoreId != 0 && InterruptExit.Vector == IPI_INTERRUPT))
972 {
973 //
974 // Calling the callback to trigger on clock and IPI events
975 // This is usually used for detecting changes to processes and threads
976 //
978 }
979
980 //
981 // Triggering the pre-event
982 //
985 (PVOID)InterruptExit.Vector,
986 &PostEventTriggerReq,
987 VCpu->Regs);
988
989 //
990 // Check whether we need to short-circuiting event emulation or not
991 //
993 {
994 //
995 // Handle vm-exit and perform changes
996 //
997 IdtEmulationHandleExternalInterrupt(VCpu, InterruptExit);
998 }
999
1000 //
1001 // Check for the post-event triggering needs
1002 //
1003 if (PostEventTriggerReq)
1004 {
1005 //
1006 // Trigger the event
1007 //
1008 // As the context to event trigger, we send the vector index
1009 //
1010 // Keep in mind that interrupt might be inserted in pending list
1011 // because the guest is not in a interruptible state and will
1012 // be re-injected when the guest is ready for interrupts
1013 //
1016 (PVOID)InterruptExit.Vector,
1017 NULL,
1018 VCpu->Regs);
1019 }
1020}
BOOLEAN DebuggingCallbackTriggerOnClockAndIpiEvents(UINT32 CoreId)
routine callback to trigger on clock and IPI events for checking process or thread change
Definition Callback.c:294
VOID HvSetExternalInterruptExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the External Interrupt Exiting.
Definition Hv.c:1102
VOID IdtEmulationHandleExternalInterrupt(_Inout_ VIRTUAL_MACHINE_STATE *VCpu, _In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit)
external-interrupt vm-exit handler
Definition IdtEmulation.c:512
VOID VmxMechanismHandleImmediateVmexit(VIRTUAL_MACHINE_STATE *VCpu)
Handle immediate vm-exit after vm-entry.
Definition VmxMechanisms.c:106
#define IMMEDIATE_VMEXIT_MECHANISM_VECTOR_FOR_SELF_IPI
Definition VmxMechanisms.h:18
@ EXTERNAL_INTERRUPT_OCCURRED
Definition Events.h:141
@ IPI_INTERRUPT
Definition Events.h:63
@ CLOCK_INTERRUPT
Definition Events.h:62
BOOLEAN WaitForImmediateVmexit
Definition State.h:316
UINT32 CoreId
Definition State.h:328

◆ DispatchEventHiddenHookExecCc()

VOID DispatchEventHiddenHookExecCc ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to hidden hook exec CC events.

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
Returns
VOID
1032{
1033 BOOLEAN PostEventTriggerReq = FALSE;
1034
1035 //
1036 // In syscall back, a hidden hook for the system call handler gets inserted
1037 //
1039 {
1041 }
1042
1043 //
1044 // Triggering the pre-event (This command only support the
1045 // pre-event, the post-event doesn't make sense in this command)
1046 //
1049 Context,
1050 &PostEventTriggerReq,
1051 VCpu->Regs); // it will crash if we pass it NULL
1052}
VOID SyscallCallbackHandleSystemCallHook(VIRTUAL_MACHINE_STATE *VCpu)
Handle the system call hook callback.
Definition SyscallCallback.c:402
@ HIDDEN_HOOK_EXEC_CC
Definition Events.h:112
BOOLEAN g_SyscallCallbackStatus
Shows whether the syscall callback is enabled or not.
Definition GlobalVariables.h:118
PVOID g_SystemCallHookAddress
Target hook address for the system call handler.
Definition GlobalVariables.h:124

◆ DispatchEventHiddenHookExecDetours()

VOID DispatchEventHiddenHookExecDetours ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to hidden hook exec detours events.

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
Returns
VOID
1064{
1065 BOOLEAN PostEventTriggerReq = FALSE;
1066
1067 //
1068 // Triggering the pre-event (This command only support the
1069 // pre-event, the post-event doesn't make sense in this command)
1070 //
1073 Context,
1074 &PostEventTriggerReq,
1075 VCpu->Regs); // it will crash if we pass it NULL
1076}
@ HIDDEN_HOOK_EXEC_DETOURS
Definition Events.h:111

◆ DispatchEventHiddenHookPageReadWriteExecExecutePostEvent()

VOID DispatchEventHiddenHookPageReadWriteExecExecutePostEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to read & write & execute, execute events (post).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
Returns
VOID
1461{
1462 //
1463 // Triggering the post-event (for the execute hooks)
1464 //
1467 Context,
1468 NULL,
1469 VCpu->Regs);
1470
1471 //
1472 // Triggering the post-event (for the read & execute hooks)
1473 //
1476 Context,
1477 NULL,
1478 VCpu->Regs);
1479
1480 //
1481 // Triggering the post-event (for the write & execute hooks)
1482 //
1485 Context,
1486 NULL,
1487 VCpu->Regs);
1488
1489 //
1490 // Triggering the post-event (for the read & write & execute hooks)
1491 //
1494 Context,
1495 NULL,
1496 VCpu->Regs);
1497}
@ HIDDEN_HOOK_WRITE_AND_EXECUTE
Definition Events.h:103
@ HIDDEN_HOOK_READ_AND_EXECUTE
Definition Events.h:102
@ HIDDEN_HOOK_READ_AND_WRITE_AND_EXECUTE
Definition Events.h:100
@ HIDDEN_HOOK_EXECUTE
Definition Events.h:106

◆ DispatchEventHiddenHookPageReadWriteExecReadPostEvent()

VOID DispatchEventHiddenHookPageReadWriteExecReadPostEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to read & write & execute, read events (post).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
Returns
VOID
1369{
1370 //
1371 // Triggering the post-event (for the read hooks)
1372 //
1375 Context,
1376 NULL,
1377 VCpu->Regs);
1378
1379 //
1380 // Triggering the post-event (for the read & write hooks)
1381 //
1384 Context,
1385 NULL,
1386 VCpu->Regs);
1387
1388 //
1389 // Triggering the post-event (for the read & execute hooks)
1390 //
1393 Context,
1394 NULL,
1395 VCpu->Regs);
1396
1397 //
1398 // Triggering the post-event (for the read & write & execute hooks)
1399 //
1402 Context,
1403 NULL,
1404 VCpu->Regs);
1405}
@ HIDDEN_HOOK_READ_AND_WRITE
Definition Events.h:101
@ HIDDEN_HOOK_READ
Definition Events.h:104

◆ DispatchEventHiddenHookPageReadWriteExecuteExecutePreEvent()

BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteExecutePreEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context,
BOOLEAN * IsTriggeringPostEventAllowed )

Handling debugger functions related to read & write & execute, execute events (pre).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
IsTriggeringPostEventAllowed
Returns
BOOLEAN
1276{
1278 BOOLEAN PostEventTriggerReq = FALSE;
1279 BOOLEAN ShortCircuitingEvent = FALSE;
1280
1281 //
1282 // Triggering the pre-event (for the execute hooks)
1283 //
1284 EventTriggerResult = VmmCallbackTriggerEvents(HIDDEN_HOOK_EXECUTE,
1286 Context,
1287 &PostEventTriggerReq,
1288 VCpu->Regs);
1289
1291 {
1292 ShortCircuitingEvent = TRUE;
1293 }
1294
1295 if (PostEventTriggerReq)
1296 {
1297 *IsTriggeringPostEventAllowed = TRUE;
1298 }
1299
1300 //
1301 // Triggering the pre-event (for the read & execute hooks)
1302 //
1305 Context,
1306 &PostEventTriggerReq,
1307 VCpu->Regs);
1308
1310 {
1311 ShortCircuitingEvent = TRUE;
1312 }
1313
1314 if (PostEventTriggerReq)
1315 {
1316 *IsTriggeringPostEventAllowed = TRUE;
1317 }
1318
1319 //
1320 // Triggering the pre-event (for the write & execute hooks)
1321 //
1324 Context,
1325 &PostEventTriggerReq,
1326 VCpu->Regs);
1327
1329 {
1330 ShortCircuitingEvent = TRUE;
1331 }
1332
1333 if (PostEventTriggerReq)
1334 {
1335 *IsTriggeringPostEventAllowed = TRUE;
1336 }
1337
1338 //
1339 // Triggering the pre-event (for the read & write & execute hooks)
1340 //
1343 Context,
1344 &PostEventTriggerReq,
1345 VCpu->Regs);
1346
1348 {
1349 ShortCircuitingEvent = TRUE;
1350 }
1351
1352 if (PostEventTriggerReq)
1353 {
1354 *IsTriggeringPostEventAllowed = TRUE;
1355 }
1356
1357 return ShortCircuitingEvent;
1358}
#define TRUE
Definition BasicTypes.h:114

◆ DispatchEventHiddenHookPageReadWriteExecuteReadPreEvent()

BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteReadPreEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context,
BOOLEAN * IsTriggeringPostEventAllowed )

Handling debugger functions related to read & write & execute, read events (pre).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
IsTriggeringPostEventAllowed
Returns
BOOLEAN
1088{
1090 BOOLEAN PostEventTriggerReq = FALSE;
1091 BOOLEAN ShortCircuitingEvent = FALSE;
1092
1093 //
1094 // Triggering the pre-event (for the read hooks)
1095 //
1096 EventTriggerResult = VmmCallbackTriggerEvents(HIDDEN_HOOK_READ,
1098 Context,
1099 &PostEventTriggerReq,
1100 VCpu->Regs);
1101
1103 {
1104 ShortCircuitingEvent = TRUE;
1105 }
1106
1107 if (PostEventTriggerReq)
1108 {
1109 *IsTriggeringPostEventAllowed = TRUE;
1110 }
1111
1112 //
1113 // Triggering the pre-event (for the read & write hooks)
1114 //
1117 Context,
1118 &PostEventTriggerReq,
1119 VCpu->Regs);
1120
1122 {
1123 ShortCircuitingEvent = TRUE;
1124 }
1125
1126 if (PostEventTriggerReq)
1127 {
1128 *IsTriggeringPostEventAllowed = TRUE;
1129 }
1130
1131 //
1132 // Triggering the pre-event (for the read & execute hooks)
1133 //
1136 Context,
1137 &PostEventTriggerReq,
1138 VCpu->Regs);
1139
1141 {
1142 ShortCircuitingEvent = TRUE;
1143 }
1144
1145 if (PostEventTriggerReq)
1146 {
1147 *IsTriggeringPostEventAllowed = TRUE;
1148 }
1149
1150 //
1151 // Triggering the pre-event (for the read & write & execute hooks)
1152 //
1155 Context,
1156 &PostEventTriggerReq,
1157 VCpu->Regs);
1158
1160 {
1161 ShortCircuitingEvent = TRUE;
1162 }
1163
1164 if (PostEventTriggerReq)
1165 {
1166 *IsTriggeringPostEventAllowed = TRUE;
1167 }
1168
1169 return ShortCircuitingEvent;
1170}

◆ DispatchEventHiddenHookPageReadWriteExecuteWritePreEvent()

BOOLEAN DispatchEventHiddenHookPageReadWriteExecuteWritePreEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context,
BOOLEAN * IsTriggeringPostEventAllowed )

Handling debugger functions related to read & write & execute, write events (pre).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
IsTriggeringPostEventAllowedIs the caller required to trigger post event
Returns
BOOLEAN
1182{
1184 BOOLEAN PostEventTriggerReq = FALSE;
1185 BOOLEAN ShortCircuitingEvent = FALSE;
1186
1187 //
1188 // Triggering the pre-event (for the write hooks)
1189 //
1190 EventTriggerResult = VmmCallbackTriggerEvents(HIDDEN_HOOK_WRITE,
1192 Context,
1193 &PostEventTriggerReq,
1194 VCpu->Regs);
1195
1197 {
1198 ShortCircuitingEvent = TRUE;
1199 }
1200
1201 if (PostEventTriggerReq)
1202 {
1203 *IsTriggeringPostEventAllowed = TRUE;
1204 }
1205
1206 //
1207 // Triggering the pre-event (for the read & write hooks)
1208 //
1211 Context,
1212 &PostEventTriggerReq,
1213 VCpu->Regs);
1214
1216 {
1217 ShortCircuitingEvent = TRUE;
1218 }
1219
1220 if (PostEventTriggerReq)
1221 {
1222 *IsTriggeringPostEventAllowed = TRUE;
1223 }
1224
1225 //
1226 // Triggering the pre-event (for the write & execute hooks)
1227 //
1230 Context,
1231 &PostEventTriggerReq,
1232 VCpu->Regs);
1233
1235 {
1236 ShortCircuitingEvent = TRUE;
1237 }
1238
1239 if (PostEventTriggerReq)
1240 {
1241 *IsTriggeringPostEventAllowed = TRUE;
1242 }
1243
1244 //
1245 // Triggering the pre-event (for the read & write & execute hooks)
1246 //
1249 Context,
1250 &PostEventTriggerReq,
1251 VCpu->Regs);
1252
1254 {
1255 ShortCircuitingEvent = TRUE;
1256 }
1257
1258 if (PostEventTriggerReq)
1259 {
1260 *IsTriggeringPostEventAllowed = TRUE;
1261 }
1262
1263 return ShortCircuitingEvent;
1264}
@ HIDDEN_HOOK_WRITE
Definition Events.h:105

◆ DispatchEventHiddenHookPageReadWriteExecWritePostEvent()

VOID DispatchEventHiddenHookPageReadWriteExecWritePostEvent ( VIRTUAL_MACHINE_STATE * VCpu,
PVOID Context )

Handling debugger functions related to read & write & execute, write events (post).

Parameters
VCpuThe virtual processor's state
ContextThe context of the caller
Returns
VOID
1416{
1417 //
1418 // Triggering the post-event (for the write hooks)
1419 //
1422 Context,
1423 NULL,
1424 VCpu->Regs);
1425
1426 //
1427 // Triggering the post-event (for the read & write hooks)
1428 //
1431 Context,
1432 NULL,
1433 VCpu->Regs);
1434 //
1435 // Triggering the post-event (for the write & execute hooks)
1436 //
1439 Context,
1440 NULL,
1441 VCpu->Regs);
1442 //
1443 // Triggering the post-event (for the read & write & execute hooks)
1444 //
1447 Context,
1448 NULL,
1449 VCpu->Regs);
1450}

◆ DispatchEventInstrumentationTrace()

VOID DispatchEventInstrumentationTrace ( VIRTUAL_MACHINE_STATE * VCpu)

◆ DispatchEventIO()

VOID DispatchEventIO ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to IO events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
500{
502 VMX_EXIT_QUALIFICATION_IO_INSTRUCTION IoQualification = {.AsUInt = VCpu->ExitQualification};
503 RFLAGS Flags = {0};
504 BOOLEAN PostEventTriggerReq = FALSE;
505
506 //
507 // Read Guest's RFLAGS
508 //
509 VmxVmread64P(VMCS_GUEST_RFLAGS, (UINT64 *)&Flags);
510
511 //
512 // As the context to event trigger, port address
513 //
514 if (IoQualification.DirectionOfAccess == AccessIn)
515 {
518 (PVOID)IoQualification.PortNumber,
519 &PostEventTriggerReq,
520 VCpu->Regs);
521 }
522 else if (IoQualification.DirectionOfAccess == AccessOut)
523 {
526 (PVOID)IoQualification.PortNumber,
527 &PostEventTriggerReq,
528 VCpu->Regs);
529 }
530
531 //
532 // Check whether we need to short-circuiting event emulation or not
533 //
535 {
536 //
537 // Call the I/O Handler
538 //
539 IoHandleIoVmExits(VCpu, IoQualification, Flags);
540 }
541
542 //
543 // Check for the post-event triggering needs
544 //
545 if (PostEventTriggerReq)
546 {
547 if (IoQualification.DirectionOfAccess == AccessIn)
548 {
551 (PVOID)IoQualification.PortNumber,
552 NULL,
553 VCpu->Regs);
554 }
555 else if (IoQualification.DirectionOfAccess == AccessOut)
556 {
559 (PVOID)IoQualification.PortNumber,
560 NULL,
561 VCpu->Regs);
562 }
563 }
564}
VOID IoHandleIoVmExits(VIRTUAL_MACHINE_STATE *VCpu, VMX_EXIT_QUALIFICATION_IO_INSTRUCTION IoQualification, RFLAGS Flags)
VM-Exit handler for I/O Instructions (in/out).
Definition IoHandler.c:24
@ AccessOut
Definition IoHandler.h:24
@ AccessIn
Definition IoHandler.h:25
UCHAR VmxVmread64P(size_t Field, UINT64 *FieldValue)
VMX VMREAD instruction (64-bit, pointer variant).
Definition PlatformIntrinsicsVmx.c:207
@ VMM_CALLBACK_TRIGGERING_EVENT_STATUS_SUCCESSFUL_NO_INITIALIZED
Definition Events.h:78
@ OUT_INSTRUCTION_EXECUTION
Definition Events.h:135
@ IN_INSTRUCTION_EXECUTION
Definition Events.h:134
UINT32 ExitQualification
Definition State.h:330

◆ DispatchEventMode()

VOID DispatchEventMode ( VIRTUAL_MACHINE_STATE * VCpu,
DEBUGGER_EVENT_MODE_TYPE TargetMode )

Handling debugger functions related to user-mode/kernel-mode execution trap events.

Parameters
VCpuThe virtual processor's state
IsUserModeWhether the execution event caused by a switch from kernel-to-user or otherwise user-to-kernel
Returns
VOID
365{
367 BOOLEAN PostEventTriggerReq = FALSE;
368
369 //
370 // As the context to event trigger, we send NULL
371 //
373 {
374 //
375 // check for user-mode thread interception
376 //
377 if (TargetMode == DEBUGGER_EVENT_MODE_TYPE_USER_MODE &&
379 {
380 //
381 // If the thread is intercepted, we should not trigger the event
382 // Being here means that the thread should be handled by the user-mode debugger
383 // ou
384
385 // LogInfo("Thread Id: %x, process Id: %x is intercepted by user-mode debugger - RIP: %llx",
386 // PsGetCurrentThreadId(),
387 // PsGetCurrentProcessId(),
388 // VCpu->LastVmexitRip);
389
390 //
391 // In this case, we need to short circuit the event, in user-mode debugger we
392 // prevent the execution by short-circuiting the event
393 //
395 }
396 else
397 {
398 //
399 // Triggering the pre-event
400 //
403 (PVOID)TargetMode,
404 &PostEventTriggerReq,
405 VCpu->Regs);
406 }
407
408 //
409 // Check whether we need to short-circuiting event emulation or not
410 //
412 {
413 //
414 // Handle the user-mode/kernel-mode execution trap event in the case of triggering event
415 //
417 }
418
419 //
420 // *** Post-event doesn't make sense for this kind of event! ***
421 //
422 }
423 else
424 {
425 //
426 // Otherwise and if there is no event, we should handle the
427 // user-mode/kernel-mode execution trap normally
428 //
430 }
431}
BOOLEAN DebuggingCallbackCheckThreadInterception(UINT32 CoreId)
routine callback to handle thread interception
Definition Callback.c:273
VOID ExecTrapHandleMoveToAdjustedTrapState(VIRTUAL_MACHINE_STATE *VCpu, DEBUGGER_EVENT_MODE_TYPE TargetMode)
Restore the execution of the trap to adjusted trap state.
Definition ExecTrap.c:625
@ TRAP_EXECUTION_MODE_CHANGED
Definition Events.h:169
@ DEBUGGER_EVENT_MODE_TYPE_USER_MODE
Definition Events.h:209
BOOLEAN g_ExecTrapInitialized
Showes whether the execution trap handler is allowed to trigger an event or not.
Definition GlobalVariables.h:162

◆ DispatchEventMov2DebugRegs()

VOID DispatchEventMov2DebugRegs ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to MOV 2 DR events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
709{
711 BOOLEAN PostEventTriggerReq = FALSE;
712
713 //
714 // Check to see if we should ignore handling the mov 2 debug registers or not
715 //
717 {
718 return;
719 }
720
721 //
722 // Triggering the pre-event
723 //
726 NULL,
727 &PostEventTriggerReq,
728 VCpu->Regs);
729
730 //
731 // Check whether we need to short-circuiting event emulation or not
732 //
734 {
735 //
736 // Handle RDPMC (emulate MOV 2 Debug Registers)
737 //
739 }
740
741 //
742 // Check for the post-event triggering needs
743 //
744 if (PostEventTriggerReq)
745 {
748 NULL,
749 NULL,
750 VCpu->Regs);
751 }
752}
BOOLEAN DebuggingCallbackIgnoreHandlingMov2DebugRegs(UINT32 CoreId)
routine callback to ignore handling mov 2 debug registers
Definition Callback.c:313
VOID HvHandleMovDebugRegister(VIRTUAL_MACHINE_STATE *VCpu)
Handle Mov to Debug Registers Exitings.
Definition Hv.c:792
@ DEBUG_REGISTERS_ACCESSED
Definition Events.h:146

◆ DispatchEventMovToCr3()

VOID DispatchEventMovToCr3 ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to mov 2 cr3 events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
441{
443 BOOLEAN PostEventTriggerReq = FALSE;
444
445 //
446 // As the context to event trigger, we send NULL
447 //
449 {
450 //
451 // Triggering the pre-event
452 //
455 NULL,
456 &PostEventTriggerReq,
457 VCpu->Regs);
458
459 //
460 // Check whether we need to short-circuiting event emulation or not
461 //
463 {
464 //
465 // Handle the mov 2 cr3 event in the case of triggering event
466 //
467 // ExecTrapHandleRestoringToNormalState(VCpu);
468 }
469
470 //
471 // Check for the post-event triggering needs
472 //
473 if (PostEventTriggerReq)
474 {
477 NULL,
478 NULL,
479 VCpu->Regs);
480 }
481 }
482 else
483 {
484 //
485 // Otherwise and if there is no event, we should handle the
486 // mov 2 cr3 normally
487 //
488 // ExecTrapHandleRestoringToNormalState(VCpu);
489 }
490}
@ CONTROL_REGISTER_3_MODIFIED
Definition Events.h:164

◆ DispatchEventMovToFromControlRegisters()

VOID DispatchEventMovToFromControlRegisters ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to mov to/from CR events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
762{
763 BOOLEAN ModifyReg;
764 VMX_EXIT_QUALIFICATION_MOV_CR * CrExitQualification;
766 BOOLEAN PostEventTriggerReq = FALSE;
767 UINT32 ExitQualification = 0;
768
769 //
770 // Read the exit qualification
771 //
772 VmxVmread32P(VMCS_EXIT_QUALIFICATION, &ExitQualification);
773
774 CrExitQualification = (VMX_EXIT_QUALIFICATION_MOV_CR *)&ExitQualification;
775
776 if (CrExitQualification->AccessType == VMX_EXIT_QUALIFICATION_ACCESS_MOV_TO_CR)
777 {
778 ModifyReg = TRUE;
779 }
780 else
781 {
782 ModifyReg = FALSE;
783 }
784
785 //
786 // Triggering the pre-event
787 //
790 (PVOID)CrExitQualification->ControlRegister,
791 &PostEventTriggerReq,
792 VCpu->Regs);
793
794 //
795 // Check whether we need to short-circuiting event emulation or not
796 //
798 {
799 //
800 // Handle mov to/from control registers (emulate CR access)
801 //
802 HvHandleControlRegisterAccess(VCpu, CrExitQualification);
803 }
804
805 //
806 // Check for the post-event triggering needs
807 //
808 if (PostEventTriggerReq)
809 {
812 (PVOID)CrExitQualification->ControlRegister,
813 NULL,
814 VCpu->Regs);
815 }
816}
VOID HvHandleControlRegisterAccess(VIRTUAL_MACHINE_STATE *VCpu, VMX_EXIT_QUALIFICATION_MOV_CR *CrExitQualification)
Handles Guest Access to control registers.
Definition Hv.c:140
unsigned int UINT32
Definition BasicTypes.h:54
@ CONTROL_REGISTER_READ
Definition Events.h:163
@ CONTROL_REGISTER_MODIFIED
Definition Events.h:162

◆ DispatchEventRdmsr()

VOID DispatchEventRdmsr ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to RDMSR events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
574{
576 BOOLEAN PostEventTriggerReq = FALSE;
577
578 //
579 // Triggering the pre-event
580 //
583 (PVOID)(VCpu->Regs->rcx & 0xffffffff),
584 &PostEventTriggerReq,
585 VCpu->Regs);
586
587 //
588 // Check whether we need to short-circuiting event emulation or not
589 //
591 {
592 //
593 // Handle vm-exit and perform changes
594 //
596 }
597
598 //
599 // Check for the post-event triggering needs
600 //
601 if (PostEventTriggerReq)
602 {
605 (PVOID)(VCpu->Regs->rcx & 0xffffffff),
606 NULL,
607 VCpu->Regs);
608 }
609}
VOID MsrHandleRdmsrVmexit(VIRTUAL_MACHINE_STATE *VCpu)
Handles in the cases when RDMSR causes a vm-exit.
Definition MsrHandlers.c:65
@ RDMSR_INSTRUCTION_EXECUTION
Definition Events.h:128
UINT64 rcx
Definition BasicTypes.h:142

◆ DispatchEventRdpmc()

VOID DispatchEventRdpmc ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to RDPMC events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
664{
666 BOOLEAN PostEventTriggerReq = FALSE;
667
668 //
669 // Triggering the pre-event
670 //
673 NULL,
674 &PostEventTriggerReq,
675 VCpu->Regs);
676
677 //
678 // Check whether we need to short-circuiting event emulation or not
679 //
681 {
682 //
683 // Handle RDPMC (emulate RDPMC)
684 //
686 }
687
688 //
689 // Check for the post-event triggering needs
690 //
691 if (PostEventTriggerReq)
692 {
695 NULL,
696 NULL,
697 VCpu->Regs);
698 }
699}
VOID CounterEmulateRdpmc(VIRTUAL_MACHINE_STATE *VCpu)
Emulate RDPMC.
Definition Counters.c:62
@ PMC_INSTRUCTION_EXECUTION
Definition Events.h:152

◆ DispatchEventTsc()

VOID DispatchEventTsc ( VIRTUAL_MACHINE_STATE * VCpu,
BOOLEAN IsRdtscp )

Handling debugger functions related to RDTSC/RDTSCP events.

Parameters
VCpuThe virtual processor's state
IsRdtscpIs a RDTSCP or RDTSC
Returns
VOID
249{
251 BOOLEAN PostEventTriggerReq = FALSE;
252
253 //
254 // As the context to event trigger, we send the false which means
255 // it's an rdtsc (for rdtscp we set Context to true)
256 //
259 (PVOID)IsRdtscp,
260 &PostEventTriggerReq,
261 VCpu->Regs);
262
263 //
264 // Check whether we need to short-circuiting event emulation or not
265 //
267 {
268 //
269 // Handle rdtsc (emulate rdtsc/p)
270 //
271 if (IsRdtscp)
272 {
274 }
275 else
276 {
278 }
279 }
280
281 //
282 // Check for the post-event triggering needs
283 //
284 if (PostEventTriggerReq)
285 {
288 (PVOID)IsRdtscp,
289 NULL,
290 VCpu->Regs);
291 }
292}
VOID CounterEmulateRdtscp(VIRTUAL_MACHINE_STATE *VCpu)
Emulate RDTSCP.
Definition Counters.c:43
VOID CounterEmulateRdtsc(VIRTUAL_MACHINE_STATE *VCpu)
Emulate RDTSC.
Definition Counters.c:21
@ TSC_INSTRUCTION_EXECUTION
Definition Events.h:151

◆ DispatchEventVmcall()

VOID DispatchEventVmcall ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to VMCALL events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
302{
304 BOOLEAN PostEventTriggerReq = FALSE;
305
306 //
307 // As the context to event trigger, we send NULL
308 // Registers are the best source to know the purpose
309 //
311 {
312 //
313 // Triggering the pre-event
314 //
317 NULL,
318 &PostEventTriggerReq,
319 VCpu->Regs);
320
321 //
322 // Check whether we need to short-circuiting event emulation or not
323 //
325 {
326 //
327 // Handle the VMCALL event in the case of triggering event
328 //
330 }
331
332 //
333 // Check for the post-event triggering needs
334 //
335 if (PostEventTriggerReq)
336 {
339 NULL,
340 NULL,
341 VCpu->Regs);
342 }
343 }
344 else
345 {
346 //
347 // Otherwise and if there is no event, we should handle the VMCALL
348 // normally
349 //
351 }
352}
_Use_decl_annotations_ NTSTATUS VmxHandleVmcallVmExit(VIRTUAL_MACHINE_STATE *VCpu)
Handle vm-exits of VMCALLs.
Definition Vmcall.c:74
@ VMCALL_INSTRUCTION_EXECUTION
Definition Events.h:157
BOOLEAN g_TriggerEventForVmcalls
Showes whether the vmcall handler is allowed to trigger an event or not.
Definition GlobalVariables.h:142

◆ DispatchEventWrmsr()

VOID DispatchEventWrmsr ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to WRMSR events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
619{
621 BOOLEAN PostEventTriggerReq = FALSE;
622
623 //
624 // Triggering the pre-event
625 //
628 (PVOID)(VCpu->Regs->rcx & 0xffffffff),
629 &PostEventTriggerReq,
630 VCpu->Regs);
631
632 //
633 // Check whether we need to short-circuiting event emulation or not
634 //
636 {
637 //
638 // Handle vm-exit and perform changes
639 //
641 }
642
643 //
644 // Check for the post-event triggering needs
645 //
646 if (PostEventTriggerReq)
647 {
650 (PVOID)(VCpu->Regs->rcx & 0xffffffff),
651 NULL,
652 VCpu->Regs);
653 }
654}
VOID MsrHandleWrmsrVmexit(VIRTUAL_MACHINE_STATE *VCpu)
Handles in the cases when RDMSR causes a vm-exit.
Definition MsrHandlers.c:233
@ WRMSR_INSTRUCTION_EXECUTION
Definition Events.h:129

◆ DispatchEventXsetbv()

VOID DispatchEventXsetbv ( VIRTUAL_MACHINE_STATE * VCpu)

Handling debugger functions related to XSETBV events.

Parameters
VCpuThe virtual processor's state
Returns
VOID
181{
182 UINT64 Context;
184 BOOLEAN PostEventTriggerReq = FALSE;
185
186 //
187 // As the context to event trigger, we send the ecx (XCR index) before the xsetbv
188 // so that the debugger can both read the ecx as it contains the XCR index
189 // and also can modify the results
190 //
192 {
193 //
194 // Adjusting the core context (save ECX for the debugger)
195 //
196 Context = VCpu->Regs->rcx & 0xffffffff;
197
198 //
199 // Triggering the pre-event
200 //
203 (PVOID)Context,
204 &PostEventTriggerReq,
205 VCpu->Regs);
206
207 //
208 // Check whether we need to short-circuiting event emulation or not
209 //
211 {
212 //
213 // Handle the XSETBV event in the case of triggering event
214 //
215 VmxHandleXsetbv(VCpu);
216 }
217
218 //
219 // Check for the post-event triggering needs
220 //
221 if (PostEventTriggerReq)
222 {
225 (PVOID)Context,
226 NULL,
227 VCpu->Regs);
228 }
229 }
230 else
231 {
232 //
233 // Otherwise and if there is no event, we should handle the XSETBV
234 // normally
235 //
236 VmxHandleXsetbv(VCpu);
237 }
238}
VOID VmxHandleXsetbv(VIRTUAL_MACHINE_STATE *VCpu)
Handling XSETBV Instruction vm-exits.
Definition CrossVmexits.c:21
@ XSETBV_INSTRUCTION_EXECUTION
Definition Events.h:175
BOOLEAN g_TriggerEventForXsetbvs
Definition GlobalVariables.h:151