HyperDbg Debugger
|
This file describes the routines in Hypervisor. More...
#include "pch.h"
Functions | |
UINT32 | HvAdjustControls (UINT32 Ctl, UINT32 Msr) |
Adjust controls for VMCS based on processor capability. | |
BOOLEAN | HvSetGuestSelector (PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector) |
Set guest's selector registers. | |
VOID | HvHandleCpuid (VIRTUAL_MACHINE_STATE *VCpu) |
Handle Cpuid Vmexits. | |
VOID | HvHandleControlRegisterAccess (VIRTUAL_MACHINE_STATE *VCpu, VMX_EXIT_QUALIFICATION_MOV_CR *CrExitQualification) |
Handles Guest Access to control registers. | |
VOID | HvFillGuestSelectorData (PVOID GdtBase, UINT32 SegmentRegister, UINT16 Selector) |
Fill the guest's selector data. | |
VOID | HvResumeToNextInstruction () |
Add the current instruction length to guest rip to resume to next instruction. | |
VOID | HvSuppressRipIncrement (VIRTUAL_MACHINE_STATE *VCpu) |
Suppress the incrementation of RIP. | |
VOID | HvPerformRipIncrement (VIRTUAL_MACHINE_STATE *VCpu) |
Perform the incrementation of RIP. | |
VOID | HvSetMonitorTrapFlag (BOOLEAN Set) |
Set the monitor trap flag. | |
VOID | HvSetRflagTrapFlag (BOOLEAN Set) |
Set the rflag's trap flag. | |
VOID | HvSetLoadDebugControls (BOOLEAN Set) |
Set LOAD DEBUG CONTROLS on Vm-entry controls. | |
VOID | HvSetSaveDebugControls (BOOLEAN Set) |
Set SAVE DEBUG CONTROLS on Vm-exit controls. | |
VOID | HvRestoreRegisters () |
Reset GDTR/IDTR and other old when you do vmxoff as the patchguard will detect them left modified. | |
VOID | HvSetPmcVmexit (BOOLEAN Set) |
Set vm-exit for rdpmc instructions. | |
VOID | HvSetMovControlRegsExiting (BOOLEAN Set, UINT64 ControlRegister, UINT64 MaskRegister) |
Set vm-exit for mov-to-cr0/4. | |
VOID | HvSetMovToCr3Vmexit (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set) |
Set vm-exit for mov-to-cr3. | |
VOID | HvWriteExceptionBitmap (UINT32 BitmapMask) |
Write on exception bitmap in VMCS DO NOT CALL IT DIRECTLY, instead use HvSetExceptionBitmap. | |
UINT32 | HvReadExceptionBitmap () |
Read exception bitmap in VMCS. | |
VOID | HvSetInterruptWindowExiting (BOOLEAN Set) |
Set Interrupt-window exiting. | |
VOID | HvSetPmlEnableFlag (BOOLEAN Set) |
Set Page Modification Logging Enable bit. | |
VOID | HvSetModeBasedExecutionEnableFlag (BOOLEAN Set) |
Set Mode-based Execution Control (MBEC) Enable bit. | |
VOID | HvSetNmiWindowExiting (BOOLEAN Set) |
Set NMI-window exiting. | |
VOID | HvHandleMovDebugRegister (VIRTUAL_MACHINE_STATE *VCpu) |
Handle Mov to Debug Registers Exitings. | |
VOID | HvSetNmiExiting (BOOLEAN Set) |
Set the NMI Exiting. | |
VOID | HvSetVmxPreemptionTimerExiting (BOOLEAN Set) |
Set the VMX preemption timer. | |
VOID | HvSetExceptionBitmap (VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex) |
Set exception bitmap in VMCS. | |
VOID | HvUnsetExceptionBitmap (VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex) |
Unset exception bitmap in VMCS. | |
VOID | HvSetExternalInterruptExiting (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set) |
Set the External Interrupt Exiting. | |
VOID | HvEnableAndCheckForPreviousExternalInterrupts (VIRTUAL_MACHINE_STATE *VCpu) |
Checks to enable and reinject previous interrupts. | |
VOID | HvSetRdtscExiting (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set) |
Set the RDTSC/P Exiting. | |
VOID | HvSetMovDebugRegsExiting (VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set) |
Set or unset the Mov to Debug Registers Exiting. | |
UINT16 | HvGetCsSelector () |
Read CS selector. | |
UINT64 | HvGetRflags () |
Read guest's RFLAGS. | |
VOID | HvSetRflags (UINT64 Rflags) |
Set guest's RFLAGS. | |
UINT64 | HvGetRip () |
Read guest's RIP. | |
VOID | HvSetRip (UINT64 Rip) |
Set guest's RIP. | |
UINT64 | HvGetInterruptibilityState () |
Read guest's interruptibility state. | |
UINT64 | HvClearSteppingBits (UINT64 Interruptibility) |
Clear STI and MOV SS bits. | |
VOID | HvSetInterruptibilityState (UINT64 InterruptibilityState) |
Set guest's interruptibility state. | |
VOID | HvInjectPendingExternalInterrupts (VIRTUAL_MACHINE_STATE *VCpu) |
Inject pending external interrupts. | |
VOID | HvCheckAndEnableExternalInterrupts (VIRTUAL_MACHINE_STATE *VCpu) |
Check and enable external interrupts. | |
VOID | HvDisableExternalInterruptsAndInterruptWindow (VIRTUAL_MACHINE_STATE *VCpu) |
Disable external-interrupts and interrupt window. | |
BOOLEAN | HvInitVmm (VMM_CALLBACKS *VmmCallbacks) |
Initializes the hypervisor. | |
VOID | HvEnableMtfAndChangeExternalInterruptState (VIRTUAL_MACHINE_STATE *VCpu) |
Enables MTF and adjust external interrupt state. | |
VOID | HvPreventExternalInterrupts (VIRTUAL_MACHINE_STATE *VCpu) |
Adjust external interrupt state. | |
This file describes the routines in Hypervisor.
vmx related routines
Adjust controls for VMCS based on processor capability.
Returns the Cpu Based and Secondary Processor Based Controls and other controls based on hardware support.
Ctl | |
Msr |
VOID HvCheckAndEnableExternalInterrupts | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Check and enable external interrupts.
VCpu | The virtual processor's state |
Clear STI and MOV SS bits.
VOID HvDisableExternalInterruptsAndInterruptWindow | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Disable external-interrupts and interrupt window.
VCpu | The virtual processor's state |
VOID HvEnableAndCheckForPreviousExternalInterrupts | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Checks to enable and reinject previous interrupts.
VCpu | The virtual processor's state |
Set | Set or unset the External Interrupt Exiting |
VOID HvEnableMtfAndChangeExternalInterruptState | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Enables MTF and adjust external interrupt state.
VCpu | The virtual processor's state |
Fill the guest's selector data.
Fill guest selector data.
GdtBase | |
SegmentRegister | |
Selector |
UINT16 HvGetCsSelector | ( | ) |
Read CS selector.
UINT64 HvGetInterruptibilityState | ( | ) |
Read guest's interruptibility state.
UINT64 HvGetRflags | ( | ) |
Read guest's RFLAGS.
UINT64 HvGetRip | ( | ) |
Read guest's RIP.
VOID HvHandleControlRegisterAccess | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
VMX_EXIT_QUALIFICATION_MOV_CR * | CrExitQualification ) |
Handles Guest Access to control registers.
Handle Guest's Control Registers Access.
VCpu | The virtual processor's state |
VOID HvHandleCpuid | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Handle Cpuid Vmexits.
Handle Cpuid.
VCpu | The virtual processor's state |
VOID HvHandleMovDebugRegister | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Handle Mov to Debug Registers Exitings.
VCpu | The virtual processor's state |
BOOLEAN HvInitVmm | ( | VMM_CALLBACKS * | VmmCallbacks | ) |
Initializes the hypervisor.
VmmCallbacks |
VOID HvInjectPendingExternalInterrupts | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Inject pending external interrupts.
VCpu | The virtual processor's state |
|
inline |
Perform the incrementation of RIP.
VCpu | The virtual processor's state |
VOID HvPreventExternalInterrupts | ( | VIRTUAL_MACHINE_STATE * | VCpu | ) |
Adjust external interrupt state.
VCpu | The virtual processor's state |
UINT32 HvReadExceptionBitmap | ( | ) |
Read exception bitmap in VMCS.
Read the exception bitmap.
Should be called in vmx-root
VOID HvRestoreRegisters | ( | ) |
Reset GDTR/IDTR and other old when you do vmxoff as the patchguard will detect them left modified.
VOID HvResumeToNextInstruction | ( | ) |
Add the current instruction length to guest rip to resume to next instruction.
Resume GUEST_RIP to next instruction.
VOID HvSetExceptionBitmap | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
UINT32 | IdtIndex ) |
Set exception bitmap in VMCS.
Should be called in vmx-root
VCpu | The virtual processor's state |
IdtIndex | Interrupt Descriptor Table index of exception |
VOID HvSetExternalInterruptExiting | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
BOOLEAN | Set ) |
Set the External Interrupt Exiting.
VCpu | The virtual processor's state |
Set | Set or unset the External Interrupt Exiting |
Set guest's selector registers.
Set Guest Selector Registers.
GdtBase | |
SegmentRegister | |
Selector |
Set guest's interruptibility state.
InterruptibilityState |
Set Interrupt-window exiting.
Set | Set or unset the Interrupt-window exiting |
Set LOAD DEBUG CONTROLS on Vm-entry controls.
Set | Set or unset |
Set Mode-based Execution Control (MBEC) Enable bit.
Set | Set or unset the MBEC |
Set the monitor trap flag.
Set or unset the monitor trap flags.
Set | Set or unset the MTFs |
Set vm-exit for mov-to-cr0/4.
Should be called in vmx-root
Set | or unset the vm-exits |
Control | Register |
Mask | Register |
VOID HvSetMovDebugRegsExiting | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
BOOLEAN | Set ) |
Set or unset the Mov to Debug Registers Exiting.
Set the Mov to Debug Registers Exiting.
VCpu | The virtual processor's state |
Set | Set or unset the Mov to Debug Registers Exiting |
VOID HvSetMovToCr3Vmexit | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
BOOLEAN | Set ) |
Set vm-exit for mov-to-cr3.
Should be called in vmx-root
VCpu | The virtual processor's state |
Set | Set or unset the vm-exits |
Set the NMI Exiting.
Set | Set or unset the NMI Exiting |
Set NMI-window exiting.
Set | Set or unset the NMI-window exiting |
Set vm-exit for rdpmc instructions.
Should be called in vmx-root
Set | Set or unset the vm-exits |
Set Page Modification Logging Enable bit.
Set | Set or unset the PML |
VOID HvSetRdtscExiting | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
BOOLEAN | Set ) |
Set the RDTSC/P Exiting.
VCpu | The virtual processor's state |
Set | Set or unset the RDTSC/P Exiting |
Set guest's RFLAGS.
Rflags |
Set the rflag's trap flag.
Set | Set or unset the TF |
Set SAVE DEBUG CONTROLS on Vm-exit controls.
Set | Set or unset |
Set the VMX preemption timer.
Set the VMX Preemptiom Timer.
Set | Set or unset the VMX preemption timer |
|
inline |
Suppress the incrementation of RIP.
VCpu | The virtual processor's state |
VOID HvUnsetExceptionBitmap | ( | VIRTUAL_MACHINE_STATE * | VCpu, |
UINT32 | IdtIndex ) |
Unset exception bitmap in VMCS.
Should be called in vmx-root
VCpu | The virtual processor's state |
IdtIndex | Interrupt Descriptor Table index of exception |
Write on exception bitmap in VMCS DO NOT CALL IT DIRECTLY, instead use HvSetExceptionBitmap.
Write to the exception bitmap.
Should be called in vmx-root
BitmapMask | The content to write on exception bitmap |