HyperDbg Debugger
Loading...
Searching...
No Matches
Hv.h
Go to the documentation of this file.
1
13#pragma once
14
16// Functions //
18
28HvSetGuestSelector(PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector);
29
40
47VOID
49
58VOID
59HvFillGuestSelectorData(PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector);
60
67VOID
69 VMX_EXIT_QUALIFICATION_MOV_CR * CrExitQualification);
70
76VOID
78
86extern inline VOID
88
96extern inline VOID
98
105VOID
107
115VOID
117
125VOID
127
135VOID
137
145VOID
147
155VOID
157
164VOID
166
173VOID
175
184VOID
185HvSetMovControlRegsExiting(BOOLEAN Set, UINT64 ControlRegister, UINT64 MaskRegister);
186
193VOID
195
202VOID
204
210UINT32
212
219VOID
221
228VOID
230
237VOID
239
246VOID
248
255VOID
257
264VOID
266
273VOID
275
282VOID
284
292VOID
294
302VOID
304
311VOID
313
321VOID
323
330VOID
332
338UINT16
340
346UINT64
348
355VOID
356HvSetRflags(UINT64 Rflags);
357
363UINT64
364HvGetRip();
365
372VOID
373HvSetRip(UINT64 Rip);
374
380UINT64
382
388UINT64
389HvClearSteppingBits(UINT64 Interruptibility);
390
397VOID
398HvSetInterruptibilityState(UINT64 InterruptibilityState);
399
407VOID
409
417VOID
419
427VOID
429
437HvInitVmm(VMM_CALLBACKS * VmmCallbacks);
438
444VOID
446
453VOID
455
461UINT64
463
470VOID
472
478UINT64
480
486UINT64
488
497VOID
498HvGetAndStoreDebugctl(UINT64 * StoreDebugctl);
499
508VOID
509HvGetAndStoreGuestIa32LbrCtl(UINT64 * StoreGuestIa32Lbr);
510
517VOID
518HvSetDebugctl(UINT64 Value);
519
526VOID
528
536VOID
537HvSetLbrSelect(UINT64 FilterOptions);
538
546
554
561VOID
562HvSetDebugReg7(UINT64 Value);
563
571VOID
VOID HvHandleControlRegisterAccess(VIRTUAL_MACHINE_STATE *VCpu, VMX_EXIT_QUALIFICATION_MOV_CR *CrExitQualification)
Handle Guest's Control Registers Access.
Definition Hv.c:140
UINT32 HvAdjustControls(UINT32 Ctl, UINT32 Msr)
Returns the Cpu Based and Secondary Processor Based Controls and other controls based on hardware sup...
Definition Hv.c:23
VOID HvRestoreRegisters()
Reset GDTR/IDTR and other old when you do vmxoff as the patchguard will detect them left modified.
Definition Hv.c:491
VOID HvSetRip(UINT64 Rip)
Set guest's RIP.
Definition Hv.c:1240
VOID HvFillGuestSelectorData(PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector)
Fill guest selector data.
Definition Hv.c:272
VOID HvSetPmcVmexit(BOOLEAN Set)
Set vm-exit for rdpmc instructions.
Definition Hv.c:553
VOID HvGetAndStoreDebugctl(UINT64 *StoreDebugctl)
Get and store the guest state of IA32_DEBUGCTL.
Definition Hv.c:1561
VOID HvSetSaveDebugControls(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set SAVE DEBUG CONTROLS on Vm-exit controls.
Definition Hv.c:446
VOID HvHandleMovDebugRegister(VIRTUAL_MACHINE_STATE *VCpu)
Handle Mov to Debug Registers Exitings.
Definition Hv.c:792
VOID HvSetNmiExiting(BOOLEAN Set)
Set the NMI Exiting.
Definition Hv.c:1000
VOID HvUnsetExceptionBitmap(VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex)
Unset exception bitmap in VMCS.
Definition Hv.c:1086
VOID HvSetGuestIa32LbrCtl(UINT64 Value)
Set the guest state of IA32_LBR_CTL.
Definition Hv.c:1620
BOOLEAN HvSetGuestSelector(PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector)
Set Guest Selector Registers.
Definition Hv.c:42
UINT32 HvReadExceptionBitmap()
Read the exception bitmap.
Definition Hv.c:631
UINT64 HvGetRflags()
Read guest's RFLAGS.
Definition Hv.c:1197
VOID HvSetMovDebugRegsExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the Mov to Debug Registers Exiting.
Definition Hv.c:1167
VOID HvSuppressRipIncrement(VIRTUAL_MACHINE_STATE *VCpu)
Suppress the incrementation of RIP.
Definition Hv.c:320
VOID HvCheckAndEnableExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Check and enable external interrupts.
Definition Hv.c:1317
VOID HvSetInterruptWindowExiting(BOOLEAN Set)
Set Interrupt-window exiting.
Definition Hv.c:650
VOID HvSetDebugctl(UINT64 Value)
Set the guest state of IA32_DEBUGCTL.
Definition Hv.c:1607
VOID HvWriteExceptionBitmap(UINT32 BitmapMask)
Write to the exception bitmap.
Definition Hv.c:616
UINT64 HvGetDebugctl()
Get the guest state of IA32_DEBUGCTL.
Definition Hv.c:1526
VOID HvResumeToNextInstruction()
Resume GUEST_RIP to next instruction.
Definition Hv.c:298
VOID HvEnableAndCheckForPreviousExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Checks to enable and reinject previous interrupts.
Definition Hv.c:1118
UINT64 HvGetInterruptibilityState()
Read guest's interruptibility state.
Definition Hv.c:1251
VOID HvPreventExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Adjust external interrupt state.
Definition Hv.c:1475
VOID HvHandleTrapFlag()
Handle the case when the trap flag is set, and we need to inject the single-step exception right afte...
Definition Hv.c:1754
VOID HvSetPmlEnableFlag(BOOLEAN Set)
Set Page Modification Logging Enable bit.
Definition Hv.c:684
VOID HvPerformRipIncrement(VIRTUAL_MACHINE_STATE *VCpu)
Perform the incrementation of RIP.
Definition Hv.c:333
VOID HvSetVmxPreemptionTimerExiting(BOOLEAN Set)
Set the VMX Preemptiom Timer.
Definition Hv.c:1036
UINT64 HvClearSteppingBits(UINT64 Interruptibility)
Clear STI and MOV SS bits.
Definition Hv.c:1266
VOID HvSetExternalInterruptExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the External Interrupt Exiting.
Definition Hv.c:1102
VOID HvHandleCpuid(VIRTUAL_MACHINE_STATE *VCpu)
Handle Cpuid.
Definition Hv.c:67
VOID HvSetClearGuestIa32LbrCtl(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set SAVE GUEST IA32_LBR_CTL on Vm-exit controls.
Definition Hv.c:459
VOID HvSetDebugReg7(UINT64 Value)
Set the guest state of DR7.
Definition Hv.c:1741
UINT64 HvGetRip()
Read guest's RIP.
Definition Hv.c:1224
VOID HvDisableExternalInterruptsAndInterruptWindow(VIRTUAL_MACHINE_STATE *VCpu)
Disable external-interrupts and interrupt window.
Definition Hv.c:1346
VOID HvSetPendingDebugExceptions(UINT64 Value)
Set the guest state of pending debug exceptions.
Definition Hv.c:1515
VOID HvGetAndStoreGuestIa32LbrCtl(UINT64 *StoreGuestIa32Lbr)
Get and store the guest state of IA32_LBR_CTL.
Definition Hv.c:1585
VOID HvSetLbrSelect(UINT64 FilterOptions)
Set LBR selector.
Definition Hv.c:1633
VOID HvSetMovControlRegsExiting(BOOLEAN Set, UINT64 ControlRegister, UINT64 MaskRegister)
Set vm-exit for mov-to-cr0/4.
Definition Hv.c:587
VOID HvSetRdtscExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the RDTSC/P Exiting.
Definition Hv.c:1154
VOID HvEnableMtfAndChangeExternalInterruptState(VIRTUAL_MACHINE_STATE *VCpu)
Enables MTF and adjust external interrupt state.
Definition Hv.c:1438
VOID HvSetModeBasedExecutionEnableFlag(BOOLEAN Set)
Set Mode-based Execution Control (MBEC) Enable bit.
Definition Hv.c:721
BOOLEAN HvInitVmm(VMM_CALLBACKS *VmmCallbacks)
Initializes the hypervisor.
Definition Hv.c:1368
BOOLEAN HvCheckCpuSupportForSaveAndLoadDebugControls()
Check if CPU support save and load debug controls on exit and load entries.
Definition Hv.c:1644
VOID HvSetLoadDebugControls(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set LOAD DEBUG CONTROLS on Vm-entry controls.
Definition Hv.c:399
VOID HvSetNmiWindowExiting(BOOLEAN Set)
Set NMI-window exiting.
Definition Hv.c:758
VOID HvSetMovToCr3Vmexit(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set vm-exit for mov-to-cr3.
Definition Hv.c:602
VOID HvSetLoadGuestIa32LbrCtl(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set LOAD GUEST IA32_LBR_CTL on Vm-entry controls.
Definition Hv.c:412
VOID HvSetInterruptibilityState(UINT64 InterruptibilityState)
Set guest's interruptibility state.
Definition Hv.c:1282
VOID HvInjectPendingExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Inject pending external interrupts.
Definition Hv.c:1295
UINT64 HvGetPendingDebugExceptions()
Get the guest state of pending debug exceptions.
Definition Hv.c:1500
VOID HvSetExceptionBitmap(VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex)
Set exception bitmap in VMCS.
Definition Hv.c:1069
UINT64 HvGetGuestIa32LbrCtl()
Get the guest state of IA32_LBR_CTL.
Definition Hv.c:1543
VOID HvSetRflags(UINT64 Rflags)
Set guest's RFLAGS.
Definition Hv.c:1213
VOID HvSetMonitorTrapFlag(BOOLEAN Set)
Set or unset the monitor trap flags.
Definition Hv.c:345
VOID HvSetRflagTrapFlag(BOOLEAN Set)
Set the rflag's trap flag.
Definition Hv.c:377
BOOLEAN HvCheckCpuSupportForLoadAndClearGuestIa32LbrCtlControls()
Check if CPU support load and clear guest IA32_LBR_CTL controls on VM-entry and VM-exit.
Definition Hv.c:1692
UINT16 HvGetCsSelector()
Read CS selector.
Definition Hv.c:1178
_In_ UINT16 Selector
Definition Segmentation.h:50
unsigned short UINT16
Definition BasicTypes.h:53
UCHAR BOOLEAN
Definition BasicTypes.h:35
void * PVOID
Definition BasicTypes.h:56
unsigned int UINT32
Definition BasicTypes.h:54
struct _VMM_CALLBACKS VMM_CALLBACKS
Prototype of each function needed by VMM module.
struct _VIRTUAL_MACHINE_STATE VIRTUAL_MACHINE_STATE
The status of each core after and before VMX.
RequestedActionOfThePacket Value(0x1) 00000000