HyperDbg Debugger
Loading...
Searching...
No Matches
Export.c File Reference

Implementation of exported functions from hypervisor. More...

#include "pch.h"

Functions

VOID VmFuncPerformRipIncrement (UINT32 CoreId)
 Perform the incrementation of RIP.
VOID VmFuncSuppressRipIncrement (UINT32 CoreId)
 Suppress the incrementation of RIP.
VOID VmFuncChangeMtfUnsettingState (UINT32 CoreId, BOOLEAN Set)
 Suppress unsetting MTF.
VOID VmFuncChangeIgnoreOneMtfState (UINT32 CoreId, BOOLEAN Set)
 Change ignore one MTF state.
VOID VmFuncSetInstrumentationStepInState (UINT32 CoreId)
 Set instrumentation step in MTF (used for single stepping with MTF).
VOID VmFuncUnsetInstrumentationStepInState (UINT32 CoreId)
 Unset instrumentation step in MTF (used for single stepping with MTF).
BOOLEAN VmFuncQueryInstrumentationStepInState (UINT32 CoreId)
 Query instrumentation step in MTF state.
VOID VmFuncSetMonitorTrapFlag (BOOLEAN Set)
 Set the monitor trap flag.
VOID VmFuncSetRflagTrapFlag (BOOLEAN Set)
 Set Rflag's trap flag.
VOID VmFuncSetLoadDebugControls (UINT32 CoreId, BOOLEAN Set)
 Set LOAD DEBUG CONTROLS on Vm-entry controls.
VOID VmFuncSetLoadGuestIa32LbrCtl (UINT32 CoreId, BOOLEAN Set)
 Set LOAD GUEST IA32_LBR_CTL on Vm-entry controls.
VOID VmFuncSetSaveDebugControls (UINT32 CoreId, BOOLEAN Set)
 Set SAVE DEBUG CONTROLS on Vm-exit controls.
VOID VmFuncSetClearGuestIa32LbrCtl (UINT32 CoreId, BOOLEAN Set)
 Set CLEAR GUEST IA32_LBR_CTL on Vm-exit controls.
VOID VmFuncSetPmcVmexit (BOOLEAN Set)
 Set vm-exit for rdpmc instructions.
VOID VmFuncSetMovControlRegsExiting (BOOLEAN Set, UINT64 ControlRegister, UINT64 MaskRegister)
 Set vm-exit for mov-to-cr0/4.
VOID VmFuncSetMovToCr3Vmexit (UINT32 CoreId, BOOLEAN Set)
 Set vm-exit for mov-to-cr3.
VOID VmFuncWriteExceptionBitmap (UINT32 BitmapMask)
 Write on exception bitmap in VMCS DO NOT CALL IT DIRECTLY, instead use HvSetExceptionBitmap.
UINT32 VmFuncReadExceptionBitmap ()
 Read exception bitmap in VMCS.
VOID VmFuncSetInterruptWindowExiting (BOOLEAN Set)
 Set Interrupt-window exiting.
VOID VmFuncSetNmiWindowExiting (BOOLEAN Set)
 Set NMI-window exiting.
VOID VmFuncSetNmiExiting (BOOLEAN Set)
 Set the NMI Exiting.
VOID VmFuncSetExceptionBitmap (UINT32 CoreId, UINT32 IdtIndex)
 Set exception bitmap in VMCS.
VOID VmFuncUnsetExceptionBitmap (UINT32 CoreId, UINT32 IdtIndex)
 Unset exception bitmap in VMCS.
VOID VmFuncSetExternalInterruptExiting (UINT32 CoreId, BOOLEAN Set)
 Set the External Interrupt Exiting.
VOID VmFuncSetRdtscExiting (UINT32 CoreId, BOOLEAN Set)
 Set the RDTSC/P Exiting.
VOID VmFuncSetMovDebugRegsExiting (UINT32 CoreId, BOOLEAN Set)
 Set or unset the Mov to Debug Registers Exiting.
UINT64 VmFuncGetLastVmexitRip (UINT32 CoreId)
 get the last vm-exit RIP
VOID VmFuncInjectPendingExternalInterrupts (UINT32 CoreId)
 Inject pending external interrupts.
UINT16 VmFuncGetCsSelector ()
 Read CS selector.
UINT64 VmFuncGetRflags ()
 Read guest's RFLAGS.
VOID VmFuncSetRflags (UINT64 Rflags)
 Set guest's RFLAGS.
UINT64 VmFuncGetRip ()
 Read guest's RIP.
VOID VmFuncSetRip (UINT64 Rip)
 Set guest's RIP.
UINT64 VmFuncGetDebugctl ()
 Get the guest state of IA32_DEBUGCTL.
UINT64 VmFuncGetDebugctlVmcallOnTargetCore ()
 Get the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.
UINT64 VmFuncGetGuestIa32LbrCtl ()
 Get the guest state of IA32_LBR_CTL.
UINT64 VmFuncGetGuestIa32LbrCtlVmcallOnTargetCore ()
 Get the guest state of IA32_LBR_CTL on the target core from VMCS.
BOOLEAN VmFuncCheckCpuSupportForSaveAndLoadDebugControls ()
 Check if CPU support save and load debug controls on exit and load entries.
BOOLEAN VmFuncCheckCpuSupportForLoadAndClearGuestIa32LbrCtlControls ()
 Check if CPU support load and clear guest IA32_LBR_CTL controls on VM-entry and VM-exit.
VOID VmFuncSetDebugctl (UINT64 Value)
 Set the guest state of IA32_DEBUGCTL.
VOID VmFuncSetDebugctlVmcallOnTargetCore (UINT64 Value)
 Set the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.
VOID VmFuncSetGuestIa32LbrCtl (UINT64 Value)
 Set the guest state of IA32_LBR_CTL.
VOID VmFuncSetGuestIa32LbrCtlVmcallOnTargetCore (UINT64 Value)
 Set the guest state of IA32_LBR_CTL on the target core from VMCS using VMCALL.
VOID VmFuncSetLbrSelect (UINT64 FilterOptions)
 Set the guest state of MSR_LEGACY_LBR_SELECT.
VOID VmFuncSetLbrSelectVmcallOnTargetCore (UINT64 FilterOptions)
 Set the guest state of MSR_LEGACY_LBR_SELECT on the target core from VMCS using VMCALL.
VOID VmFuncSetLoadDebugControlsVmcallOnTargetCore (BOOLEAN Set)
 Set LOAD DEBUG CONTROLS on VM-entry controls on the target core from VMCS using VMCALL.
VOID VmFuncSetLoadGuestIa32LbrCtlVmcallOnTargetCore (BOOLEAN Set)
 Set LOAD GUEST IA32_LBR_CTL on VM-entry controls on the target core from VMCS using VMCALL.
VOID VmFuncSetSaveDebugControlsVmcallOnTargetCore (BOOLEAN Set)
 Set SAVE DEBUG CONTROLS on VM-exit controls on the target core from VMCS using VMCALL.
VOID VmFuncSetClearGuestIa32LbrCtlVmcallOnTargetCore (BOOLEAN Set)
 Set CLEAR GUEST IA32_LBR_CTL on VM-exit controls on the target core from VMCS using VMCALL.
VOID VmFuncSetDebugReg7 (UINT64 Value)
 Set the guest state of DR7.
UINT64 VmFuncGetInterruptibilityState ()
 Read guest's interruptibility state.
UINT64 VmFuncClearSteppingBits (UINT64 Interruptibility)
 Clear STI and MOV SS bits.
VOID VmFuncSetInterruptibilityState (UINT64 InterruptibilityState)
 Set guest's interruptibility state.
BOOLEAN VmFuncNmiBroadcastRequest (UINT32 CoreId)
 Broadcast NMI requests.
BOOLEAN VmFuncNmiBroadcastInvalidateEptSingleContext (UINT32 CoreId)
 Broadcast NMI requests for single-context EPT invalidation.
BOOLEAN VmFuncNmiBroadcastInvalidateEptAllContexts (UINT32 CoreId)
 Broadcast NMI requests for all contexts EPT invalidation.
VOID VmFuncInvalidateEptSingleContext (UINT32 CoreId)
 Requests for single-context EPT invalidation.
VOID VmFuncInvalidateEptAllContexts ()
 Requests for all contexts EPT invalidation.
VOID VmFuncCheckAndEnableExternalInterrupts (UINT32 CoreId)
 Check and enable external interrupts.
VOID VmFuncDisableExternalInterruptsAndInterruptWindow (UINT32 CoreId)
 Disable external-interrupts and interrupt window.
BOOLEAN VmFuncInitVmm (VMM_CALLBACKS *VmmCallbacks)
 Initializes hypervisor.
VOID VmFuncUninitVmm ()
 Uninitialize Terminate Vmx on all logical cores.
BOOLEAN VmFuncVmxGetCurrentExecutionMode ()
 Get the current VMX operation state.
BOOLEAN VmFuncQueryModeExecTrap ()
 Get the current state of mode exec trap mechanism.
VOID VmFuncSetTriggerEventForVmcalls (BOOLEAN Set)
 Set triggering events for VMCALLs.
VOID VmFuncSetTriggerEventForCpuids (BOOLEAN Set)
 Set triggering events for CPUIDs.
VOID VmFuncSetTriggerEventForXsetbvs (BOOLEAN Set)
 Set trigger event for XSETBVs.
UINT32 VmFuncVmxCompatibleStrlen (const CHAR *s)
 VMX-root compatible strlen.
UINT32 VmFuncVmxCompatibleWcslen (const WCHAR *s)
 VMX-root compatible strlen.
VOID VmFuncVmxCompatibleMicroSleep (UINT64 Us)
 VMX-root compatible micro sleep.
VOID VmFuncEventInjectPageFaultWithCr2 (UINT32 CoreId, UINT64 Address, UINT32 PageFaultCode)
 Inject #PF and configure CR2 register.
VOID VmFuncEventInjectPageFaultRangeAddress (UINT32 CoreId, UINT64 AddressFrom, UINT64 AddressTo, UINT32 PageFaultCode)
 Inject a range of page-faults.
VOID VmFuncEventInjectInterruption (UINT32 InterruptionType, UINT32 Vector, BOOLEAN DeliverErrorCode, UINT32 ErrorCode)
 Inject interrupt/faults/exceptions.
NTSTATUS VmFuncVmxVmcall (UINT64 VmcallNumber, UINT64 OptionalParam1, UINT64 OptionalParam2, UINT64 OptionalParam3)
 Export for running VMX VMCALLs.
VOID VmFuncVmxBroadcastInitialize ()
 Export for initialize the VMX Broadcast mechanism.
VOID VmFuncVmxBroadcastUninitialize ()
 Export for uninitialize the VMX Broadcast mechanism.
VOID VmFuncEventInjectBreakpoint ()
 Inject #BP to the guest (Event Injection).
INT32 VmFuncVmxCompatibleStrcmp (const CHAR *Address1, const CHAR *Address2)
 VMX-root compatible strcmp.
INT32 VmFuncVmxCompatibleStrncmp (const CHAR *Address1, const CHAR *Address2, SIZE_T Num)
 VMX-root compatible strncmp.
INT32 VmFuncVmxCompatibleWcscmp (const WCHAR *Address1, const WCHAR *Address2)
 VMX-root compatible wcscmp.
INT32 VmFuncVmxCompatibleWcsncmp (const WCHAR *Address1, const WCHAR *Address2, SIZE_T Num)
 VMX-root compatible wcsncmp.
INT32 VmFuncVmxCompatibleMemcmp (const CHAR *Address1, const CHAR *Address2, SIZE_T Count)
 VMX-root compatible memcmp.
VOID VmFuncEnableMtfAndChangeExternalInterruptState (UINT32 CoreId)
 Enables MTF and adjust external interrupt state.
VOID VmFuncEnableAndCheckForPreviousExternalInterrupts (UINT32 CoreId)
 Checks to enable and reinject previous interrupts.
BOOLEAN VmFuncApicStoreLocalApicFields (PLAPIC_PAGE LocalApicBuffer, PBOOLEAN IsUsingX2APIC)
 Store the details Local APIC in xapic or x2apic modes.
BOOLEAN VmFuncApicStoreIoApicFields (IO_APIC_ENTRY_PACKETS *IoApicPackets)
 Store the details of I/O APIC.
VOID VmFuncIdtQueryEntries (PINTERRUPT_DESCRIPTOR_TABLE_ENTRIES_PACKETS IdtQueryRequest, BOOLEAN ReadFromVmxRoot)
 Perform query for IDT entries.
BOOLEAN VmFuncSmmPerformSmiOperation (SMI_OPERATION_PACKETS *SmiOperationRequest, BOOLEAN ApplyFromVmxRootMode)
 Perform actions related to System Management Interrupts (SMIs).

Detailed Description

Implementation of exported functions from hypervisor.

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

Function Documentation

◆ VmFuncApicStoreIoApicFields()

BOOLEAN VmFuncApicStoreIoApicFields ( IO_APIC_ENTRY_PACKETS * IoApicPackets)

Store the details of I/O APIC.

Parameters
IoApicPackets
Returns
BOOLEAN
1112{
1113 return ApicStoreIoApicFields(IoApicPackets);
1114}
BOOLEAN ApicStoreIoApicFields(IO_APIC_ENTRY_PACKETS *IoApicPackets)
Store the details of I/O APIC.
Definition Apic.c:345

◆ VmFuncApicStoreLocalApicFields()

BOOLEAN VmFuncApicStoreLocalApicFields ( PLAPIC_PAGE LocalApicBuffer,
PBOOLEAN IsUsingX2APIC )

Store the details Local APIC in xapic or x2apic modes.

Parameters
LocalApicBuffer
IsUsingX2APIC
Returns
BOOLEAN
1100{
1101 return ApicStoreLocalApicFields(LocalApicBuffer, IsUsingX2APIC);
1102}
BOOLEAN ApicStoreLocalApicFields(PLAPIC_PAGE LApicBuffer, PBOOLEAN IsUsingX2APIC)
Store the details of APIC in xAPIC and x2APIC mode.
Definition Apic.c:324

◆ VmFuncChangeIgnoreOneMtfState()

VOID VmFuncChangeIgnoreOneMtfState ( UINT32 CoreId,
BOOLEAN Set )

Change ignore one MTF state.

Parameters
CoreIdTarget core's ID
SetState of setting or unsetting
Returns
VOID
61{
62 g_GuestState[CoreId].IgnoreOneMtf = Set;
63}
VIRTUAL_MACHINE_STATE * g_GuestState
Save the state and variables related to virtualization on each to logical core.
Definition GlobalVariables.h:38

◆ VmFuncChangeMtfUnsettingState()

VOID VmFuncChangeMtfUnsettingState ( UINT32 CoreId,
BOOLEAN Set )

Suppress unsetting MTF.

Parameters
CoreIdTarget core's ID
SetState of setting or unsetting
Returns
VOID
48{
49 g_GuestState[CoreId].IgnoreMtfUnset = Set;
50}

◆ VmFuncCheckAndEnableExternalInterrupts()

VOID VmFuncCheckAndEnableExternalInterrupts ( UINT32 CoreId)

Check and enable external interrupts.

Parameters
CoreIdTarget core's ID
Returns
VOID
756{
758}
VOID HvCheckAndEnableExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Check and enable external interrupts.
Definition Hv.c:1317

◆ VmFuncCheckCpuSupportForLoadAndClearGuestIa32LbrCtlControls()

BOOLEAN VmFuncCheckCpuSupportForLoadAndClearGuestIa32LbrCtlControls ( )

Check if CPU support load and clear guest IA32_LBR_CTL controls on VM-entry and VM-exit.

Returns
BOOLEAN
500{
502}
BOOLEAN HvCheckCpuSupportForLoadAndClearGuestIa32LbrCtlControls()
Check if CPU support load and clear guest IA32_LBR_CTL controls on entry and exit.
Definition Hv.c:1692

◆ VmFuncCheckCpuSupportForSaveAndLoadDebugControls()

BOOLEAN VmFuncCheckCpuSupportForSaveAndLoadDebugControls ( )

Check if CPU support save and load debug controls on exit and load entries.

Returns
BOOLEAN
489{
491}
BOOLEAN HvCheckCpuSupportForSaveAndLoadDebugControls()
Check if CPU support save and load debug controls on exit and load entries.
Definition Hv.c:1644

◆ VmFuncClearSteppingBits()

UINT64 VmFuncClearSteppingBits ( UINT64 Interruptibility)

Clear STI and MOV SS bits.

Returns
UINT64
660{
661 return HvClearSteppingBits(Interruptibility);
662}
UINT64 HvClearSteppingBits(UINT64 Interruptibility)
Clear STI and MOV SS bits.
Definition Hv.c:1266

◆ VmFuncDisableExternalInterruptsAndInterruptWindow()

VOID VmFuncDisableExternalInterruptsAndInterruptWindow ( UINT32 CoreId)

Disable external-interrupts and interrupt window.

Parameters
CoreId
Returns
VOID
769{
771}
VOID HvDisableExternalInterruptsAndInterruptWindow(VIRTUAL_MACHINE_STATE *VCpu)
Disable external-interrupts and interrupt window.
Definition Hv.c:1346

◆ VmFuncEnableAndCheckForPreviousExternalInterrupts()

VOID VmFuncEnableAndCheckForPreviousExternalInterrupts ( UINT32 CoreId)

Checks to enable and reinject previous interrupts.

Parameters
CoreId
Returns
VOID
1087{
1089}
VOID HvEnableAndCheckForPreviousExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Checks to enable and reinject previous interrupts.
Definition Hv.c:1118

◆ VmFuncEnableMtfAndChangeExternalInterruptState()

VOID VmFuncEnableMtfAndChangeExternalInterruptState ( UINT32 CoreId)

Enables MTF and adjust external interrupt state.

Parameters
CoreId
Returns
VOID
1074{
1076}
VOID HvEnableMtfAndChangeExternalInterruptState(VIRTUAL_MACHINE_STATE *VCpu)
Enables MTF and adjust external interrupt state.
Definition Hv.c:1438

◆ VmFuncEventInjectBreakpoint()

VOID VmFuncEventInjectBreakpoint ( )

Inject #BP to the guest (Event Injection).

Returns
VOID
994{
996}
VOID EventInjectBreakpoint()
Inject BP to the guest (Event Injection).
Definition Events.c:46

◆ VmFuncEventInjectInterruption()

VOID VmFuncEventInjectInterruption ( UINT32 InterruptionType,
UINT32 Vector,
BOOLEAN DeliverErrorCode,
UINT32 ErrorCode )

Inject interrupt/faults/exceptions.

Parameters
InterruptionType
Vector
DeliverErrorCode
ErrorCode
Returns
VOID
940{
941 EventInjectInterruption(InterruptionType,
942 Vector,
943 DeliverErrorCode,
944 ErrorCode);
945}
VOID EventInjectInterruption(INTERRUPT_TYPE InterruptionType, EXCEPTION_VECTORS Vector, BOOLEAN DeliverErrorCode, UINT32 ErrorCode)
Injects interruption to a guest.
Definition Events.c:24

◆ VmFuncEventInjectPageFaultRangeAddress()

VOID VmFuncEventInjectPageFaultRangeAddress ( UINT32 CoreId,
UINT64 AddressFrom,
UINT64 AddressTo,
UINT32 PageFaultCode )

Inject a range of page-faults.

Parameters
CoreIdTarget core's ID
AddressFromPage-fault address (from)
AddressToPage-fault address (to)
AddressPage-fault address
PageFaultCodePage-fault error code
Returns
VOID
921{
922 EventInjectPageFaultRangeAddress(&g_GuestState[CoreId], AddressFrom, AddressTo, PageFaultCode);
923}
VOID EventInjectPageFaultRangeAddress(VIRTUAL_MACHINE_STATE *VCpu, UINT64 AddressFrom, UINT64 AddressTo, UINT32 PageFaultCode)
Inject a range of page-faults.
Definition Events.c:237

◆ VmFuncEventInjectPageFaultWithCr2()

VOID VmFuncEventInjectPageFaultWithCr2 ( UINT32 CoreId,
UINT64 Address,
UINT32 PageFaultCode )

Inject #PF and configure CR2 register.

Parameters
CoreIdTarget core's ID
AddressPage-fault address
PageFaultCodePage-fault error code
Returns
VOID
901{
902 EventInjectPageFaultWithCr2(&g_GuestState[CoreId], Address, PageFaultCode);
903}
VOID EventInjectPageFaultWithCr2(VIRTUAL_MACHINE_STATE *VCpu, UINT64 Address, UINT32 PageFaultCode)
Inject page-fault with an address as cr2.
Definition Events.c:281

◆ VmFuncGetCsSelector()

UINT16 VmFuncGetCsSelector ( )

Read CS selector.

Returns
UINT16
387{
388 return HvGetCsSelector();
389}
UINT16 HvGetCsSelector()
Read CS selector.
Definition Hv.c:1178

◆ VmFuncGetDebugctl()

UINT64 VmFuncGetDebugctl ( )

Get the guest state of IA32_DEBUGCTL.

Returns
UINT64
444{
445 return HvGetDebugctl();
446}
UINT64 HvGetDebugctl()
Get the guest state of IA32_DEBUGCTL.
Definition Hv.c:1526

◆ VmFuncGetDebugctlVmcallOnTargetCore()

UINT64 VmFuncGetDebugctlVmcallOnTargetCore ( )

Get the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.

Returns
UINT64
456{
458}
UINT64 CrossVmcallGetDebugctlVmcallOnTargetCore()
Get the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:21

◆ VmFuncGetGuestIa32LbrCtl()

UINT64 VmFuncGetGuestIa32LbrCtl ( )

Get the guest state of IA32_LBR_CTL.

Returns
UINT64
467{
468 return HvGetGuestIa32LbrCtl();
469}
UINT64 HvGetGuestIa32LbrCtl()
Get the guest state of IA32_LBR_CTL.
Definition Hv.c:1543

◆ VmFuncGetGuestIa32LbrCtlVmcallOnTargetCore()

UINT64 VmFuncGetGuestIa32LbrCtlVmcallOnTargetCore ( )

Get the guest state of IA32_LBR_CTL on the target core from VMCS.

Returns
UINT64
478{
480}
UINT64 CrossVmcallGetGuestIa32LbrCtlVmcallOnTargetCore()
Get the guest state of IA32_LBR_CTL on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:34

◆ VmFuncGetInterruptibilityState()

UINT64 VmFuncGetInterruptibilityState ( )

Read guest's interruptibility state.

Returns
UINT64
649{
651}
UINT64 HvGetInterruptibilityState()
Read guest's interruptibility state.
Definition Hv.c:1251

◆ VmFuncGetLastVmexitRip()

UINT64 VmFuncGetLastVmexitRip ( UINT32 CoreId)

get the last vm-exit RIP

Parameters
CoreIdTarget core's ID
Returns
UINT64
364{
365 return g_GuestState[CoreId].LastVmexitRip;
366}

◆ VmFuncGetRflags()

UINT64 VmFuncGetRflags ( )

Read guest's RFLAGS.

Returns
UINT64
398{
399 return HvGetRflags();
400}
UINT64 HvGetRflags()
Read guest's RFLAGS.
Definition Hv.c:1197

◆ VmFuncGetRip()

UINT64 VmFuncGetRip ( )

Read guest's RIP.

Returns
UINT64
421{
422 return HvGetRip();
423}
UINT64 HvGetRip()
Read guest's RIP.
Definition Hv.c:1224

◆ VmFuncIdtQueryEntries()

VOID VmFuncIdtQueryEntries ( PINTERRUPT_DESCRIPTOR_TABLE_ENTRIES_PACKETS IdtQueryRequest,
BOOLEAN ReadFromVmxRoot )

Perform query for IDT entries.

Parameters
IdtQueryRequest
ReadFromVmxRoot
Returns
VOID
1127{
1128 IdtEmulationQueryIdtEntriesRequest(IdtQueryRequest, ReadFromVmxRoot);
1129}
VOID IdtEmulationQueryIdtEntriesRequest(PINTERRUPT_DESCRIPTOR_TABLE_ENTRIES_PACKETS IdtQueryRequest, BOOLEAN ReadFromVmxRoot)
Perform query for IDT entries.
Definition IdtEmulation.c:23

◆ VmFuncInitVmm()

BOOLEAN VmFuncInitVmm ( VMM_CALLBACKS * VmmCallbacks)

Initializes hypervisor.

Parameters
VmmCallbacks
Returns
BOOLEAN Shows whether the initialization was successful or not
781{
782 return HvInitVmm(VmmCallbacks);
783}
BOOLEAN HvInitVmm(VMM_CALLBACKS *VmmCallbacks)
Initializes the hypervisor.
Definition Hv.c:1368

◆ VmFuncInjectPendingExternalInterrupts()

VOID VmFuncInjectPendingExternalInterrupts ( UINT32 CoreId)

Inject pending external interrupts.

Parameters
CoreIdTarget core's ID
Returns
VOID
376{
378}
VOID HvInjectPendingExternalInterrupts(VIRTUAL_MACHINE_STATE *VCpu)
Inject pending external interrupts.
Definition Hv.c:1295

◆ VmFuncInvalidateEptAllContexts()

VOID VmFuncInvalidateEptAllContexts ( )

Requests for all contexts EPT invalidation.

Returns
VOID
740{
741 //
742 // Broadcast NMI requests
743 //
745}
UCHAR EptInveptAllContexts()
Invalidates all contexts in EPT cache table.
Definition Invept.c:54

◆ VmFuncInvalidateEptSingleContext()

VOID VmFuncInvalidateEptSingleContext ( UINT32 CoreId)

Requests for single-context EPT invalidation.

Parameters
CoreIdTarget core's ID
Returns
VOID
729{
730 EptInveptSingleContext(g_GuestState[CoreId].EptPointer.AsUInt);
731}
UCHAR EptInveptSingleContext(_In_ UINT64 EptPointer)
Invalidates a single context in ept cache table.
Definition Invept.c:40

◆ VmFuncNmiBroadcastInvalidateEptAllContexts()

BOOLEAN VmFuncNmiBroadcastInvalidateEptAllContexts ( UINT32 CoreId)

Broadcast NMI requests for all contexts EPT invalidation.

Parameters
CoreIdTarget core's ID
Returns
BOOLEAN
714{
715 //
716 // Broadcast NMI requests
717 //
719}
BOOLEAN VmxBroadcastNmi(VIRTUAL_MACHINE_STATE *VCpu, NMI_BROADCAST_ACTION_TYPE VmxBroadcastAction)
Broadcast NMI in vmx-root mode.
Definition VmxBroadcast.c:143
@ NMI_BROADCAST_ACTION_INVALIDATE_EPT_CACHE_ALL_CONTEXTS
Definition State.h:55

◆ VmFuncNmiBroadcastInvalidateEptSingleContext()

BOOLEAN VmFuncNmiBroadcastInvalidateEptSingleContext ( UINT32 CoreId)

Broadcast NMI requests for single-context EPT invalidation.

Parameters
CoreIdTarget core's ID
Returns
BOOLEAN
699{
700 //
701 // Broadcast NMI requests
702 //
704}
@ NMI_BROADCAST_ACTION_INVALIDATE_EPT_CACHE_SINGLE_CONTEXT
Definition State.h:54

◆ VmFuncNmiBroadcastRequest()

BOOLEAN VmFuncNmiBroadcastRequest ( UINT32 CoreId)

Broadcast NMI requests.

Parameters
CoreIdTarget core's ID
Returns
BOOLEAN
684{
685 //
686 // Broadcast NMI requests
687 //
689}
@ NMI_BROADCAST_ACTION_REQUEST
Definition State.h:53

◆ VmFuncPerformRipIncrement()

VOID VmFuncPerformRipIncrement ( UINT32 CoreId)

Perform the incrementation of RIP.

Parameters
CoreIdTarget core's ID
Returns
VOID
23{
25}
VOID HvPerformRipIncrement(VIRTUAL_MACHINE_STATE *VCpu)
Perform the incrementation of RIP.
Definition Hv.c:333

◆ VmFuncQueryInstrumentationStepInState()

BOOLEAN VmFuncQueryInstrumentationStepInState ( UINT32 CoreId)

Query instrumentation step in MTF state.

Parameters
CoreIdTarget core's ID
Returns
BOOLEAN
100{
101 return g_GuestState[CoreId].InstrumentationStepInMtf;
102}

◆ VmFuncQueryModeExecTrap()

BOOLEAN VmFuncQueryModeExecTrap ( )

Get the current state of mode exec trap mechanism.

Returns
BOOLEAN
814{
816}
BOOLEAN g_ExecTrapInitialized
Showes whether the execution trap handler is allowed to trigger an event or not.
Definition GlobalVariables.h:162

◆ VmFuncReadExceptionBitmap()

UINT32 VmFuncReadExceptionBitmap ( )

Read exception bitmap in VMCS.

Should be called in vmx-root

Returns
UINT32
249{
250 return HvReadExceptionBitmap();
251}
UINT32 HvReadExceptionBitmap()
Read exception bitmap in VMCS.
Definition Hv.c:631

◆ VmFuncSetClearGuestIa32LbrCtl()

VOID VmFuncSetClearGuestIa32LbrCtl ( UINT32 CoreId,
BOOLEAN Set )

Set CLEAR GUEST IA32_LBR_CTL on Vm-exit controls.

Parameters
CoreIdtarget core id
SetSet or unset
Returns
VOID
180{
182}
VOID HvSetClearGuestIa32LbrCtl(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set SAVE GUEST IA32_LBR_CTL on Vm-exit controls.
Definition Hv.c:459

◆ VmFuncSetClearGuestIa32LbrCtlVmcallOnTargetCore()

VOID VmFuncSetClearGuestIa32LbrCtlVmcallOnTargetCore ( BOOLEAN Set)

Set CLEAR GUEST IA32_LBR_CTL on VM-exit controls on the target core from VMCS using VMCALL.

Parameters
SetSet or unset
Returns
VOID
626{
628}
VOID CrossVmcallSetClearGuestIa32LbrCtlVmcallOnTargetCore(BOOLEAN Set)
Set CLEAR GUEST IA32_LBR_CTL on Vm-exit controls on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:145

◆ VmFuncSetDebugctl()

VOID VmFuncSetDebugctl ( UINT64 Value)

Set the guest state of IA32_DEBUGCTL.

Parameters
Value
Returns
VOID
512{
514}
VOID HvSetDebugctl(UINT64 Value)
Set the guest state of IA32_DEBUGCTL.
Definition Hv.c:1607
RequestedActionOfThePacket Value(0x1) 00000000

◆ VmFuncSetDebugctlVmcallOnTargetCore()

VOID VmFuncSetDebugctlVmcallOnTargetCore ( UINT64 Value)

Set the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.

Parameters
Value
Returns
VOID
525{
527}
VOID CrossVmcallSetDebugctlVmcallOnTargetCore(UINT64 Value)
Set the guest state of IA32_DEBUGCTL on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:48

◆ VmFuncSetDebugReg7()

VOID VmFuncSetDebugReg7 ( UINT64 Value)

Set the guest state of DR7.

Parameters
Value
Returns
VOID
638{
640}
VOID HvSetDebugReg7(UINT64 Value)
Set the guest state of DR7.
Definition Hv.c:1741

◆ VmFuncSetExceptionBitmap()

VOID VmFuncSetExceptionBitmap ( UINT32 CoreId,
UINT32 IdtIndex )

Set exception bitmap in VMCS.

Should be called in vmx-root

Parameters
CoreIdTarget core's ID
IdtIndexInterrupt Descriptor Table index of exception
Returns
VOID
299{
300 HvSetExceptionBitmap(&g_GuestState[CoreId], IdtIndex);
301}
VOID HvSetExceptionBitmap(VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex)
Set exception bitmap in VMCS.
Definition Hv.c:1069

◆ VmFuncSetExternalInterruptExiting()

VOID VmFuncSetExternalInterruptExiting ( UINT32 CoreId,
BOOLEAN Set )

Set the External Interrupt Exiting.

Parameters
CoreIdTarget core's ID
SetSet or unset the External Interrupt Exiting
Returns
VOID
326{
328}
VOID HvSetExternalInterruptExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the External Interrupt Exiting.
Definition Hv.c:1102

◆ VmFuncSetGuestIa32LbrCtl()

VOID VmFuncSetGuestIa32LbrCtl ( UINT64 Value)

Set the guest state of IA32_LBR_CTL.

Parameters
Value
Returns
VOID
537{
539}
VOID HvSetGuestIa32LbrCtl(UINT64 Value)
Set the guest state of IA32_LBR_CTL.
Definition Hv.c:1620

◆ VmFuncSetGuestIa32LbrCtlVmcallOnTargetCore()

VOID VmFuncSetGuestIa32LbrCtlVmcallOnTargetCore ( UINT64 Value)

Set the guest state of IA32_LBR_CTL on the target core from VMCS using VMCALL.

Parameters
Value
Returns
VOID
550{
552}
VOID CrossVmcallSetGuestIa32LbrCtlVmcallOnTargetCore(UINT64 Value)
Set the guest state of IA32_LBR_CTL on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:60

◆ VmFuncSetInstrumentationStepInState()

VOID VmFuncSetInstrumentationStepInState ( UINT32 CoreId)

Set instrumentation step in MTF (used for single stepping with MTF).

Parameters
CoreIdTarget core's ID
Returns
VOID
74{
75 g_GuestState[CoreId].InstrumentationStepInMtf = TRUE;
76}
#define TRUE
Definition BasicTypes.h:114

◆ VmFuncSetInterruptibilityState()

VOID VmFuncSetInterruptibilityState ( UINT64 InterruptibilityState)

Set guest's interruptibility state.

Parameters
InterruptibilityState
Returns
VOID
672{
673 HvSetInterruptibilityState(InterruptibilityState);
674}
VOID HvSetInterruptibilityState(UINT64 InterruptibilityState)
Set guest's interruptibility state.
Definition Hv.c:1282

◆ VmFuncSetInterruptWindowExiting()

VOID VmFuncSetInterruptWindowExiting ( BOOLEAN Set)

Set Interrupt-window exiting.

Parameters
SetSet or unset the Interrupt-window exiting
Returns
VOID
261{
263}
VOID HvSetInterruptWindowExiting(BOOLEAN Set)
Set Interrupt-window exiting.
Definition Hv.c:650

◆ VmFuncSetLbrSelect()

VOID VmFuncSetLbrSelect ( UINT64 FilterOptions)

Set the guest state of MSR_LEGACY_LBR_SELECT.

Parameters
FilterOptions
Returns
VOID
562{
563 HvSetLbrSelect(FilterOptions);
564}
VOID HvSetLbrSelect(UINT64 FilterOptions)
Set LBR selector.
Definition Hv.c:1633

◆ VmFuncSetLbrSelectVmcallOnTargetCore()

VOID VmFuncSetLbrSelectVmcallOnTargetCore ( UINT64 FilterOptions)

Set the guest state of MSR_LEGACY_LBR_SELECT on the target core from VMCS using VMCALL.

Parameters
FilterOptions
Returns
VOID
574{
576}
VOID CrossVmcallSetLbrSelectVmcallOnTargetCore(UINT64 FilterOptions)
Set the guest state of MSR_LEGACY_LBR_SELECT on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:72

◆ VmFuncSetLoadDebugControls()

VOID VmFuncSetLoadDebugControls ( UINT32 CoreId,
BOOLEAN Set )

Set LOAD DEBUG CONTROLS on Vm-entry controls.

Parameters
CoreIdtarget core id
SetSet or unset
Returns
VOID
138{
140}
VOID HvSetLoadDebugControls(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set LOAD DEBUG CONTROLS on Vm-entry controls.
Definition Hv.c:399

◆ VmFuncSetLoadDebugControlsVmcallOnTargetCore()

VOID VmFuncSetLoadDebugControlsVmcallOnTargetCore ( BOOLEAN Set)

Set LOAD DEBUG CONTROLS on VM-entry controls on the target core from VMCS using VMCALL.

Parameters
SetSet or unset
Returns
VOID
587{
589}
VOID CrossVmcallSetLoadDebugControlsVmcallOnTargetCore(BOOLEAN Set)
Set LOAD DEBUG CONTROLS on Vm-entry controls on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:85

◆ VmFuncSetLoadGuestIa32LbrCtl()

VOID VmFuncSetLoadGuestIa32LbrCtl ( UINT32 CoreId,
BOOLEAN Set )

Set LOAD GUEST IA32_LBR_CTL on Vm-entry controls.

Parameters
CoreIdtarget core id
SetSet or unset
Returns
VOID
152{
154}
VOID HvSetLoadGuestIa32LbrCtl(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set LOAD GUEST IA32_LBR_CTL on Vm-entry controls.
Definition Hv.c:412

◆ VmFuncSetLoadGuestIa32LbrCtlVmcallOnTargetCore()

VOID VmFuncSetLoadGuestIa32LbrCtlVmcallOnTargetCore ( BOOLEAN Set)

Set LOAD GUEST IA32_LBR_CTL on VM-entry controls on the target core from VMCS using VMCALL.

Parameters
SetSet or unset
Returns
VOID
600{
602}
VOID CrossVmcallSetLoadGuestIa32LbrCtlVmcallOnTargetCore(BOOLEAN Set)
Set CLEAR GUEST IA32_LBR_CTL on Vm-entry controls on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:105

◆ VmFuncSetMonitorTrapFlag()

VOID VmFuncSetMonitorTrapFlag ( BOOLEAN Set)

Set the monitor trap flag.

Parameters
SetSet or unset the MTFs
Returns
VOID
112{
114}
VOID HvSetMonitorTrapFlag(BOOLEAN Set)
Set the monitor trap flag.
Definition Hv.c:345

◆ VmFuncSetMovControlRegsExiting()

VOID VmFuncSetMovControlRegsExiting ( BOOLEAN Set,
UINT64 ControlRegister,
UINT64 MaskRegister )

Set vm-exit for mov-to-cr0/4.

Should be called in vmx-root

Parameters
Setor unset the vm-exits
ControlRegister
MaskRegister
Returns
VOID
208{
209 HvSetMovControlRegsExiting(Set, ControlRegister, MaskRegister);
210}
VOID HvSetMovControlRegsExiting(BOOLEAN Set, UINT64 ControlRegister, UINT64 MaskRegister)
Set vm-exit for mov-to-cr0/4.
Definition Hv.c:587

◆ VmFuncSetMovDebugRegsExiting()

VOID VmFuncSetMovDebugRegsExiting ( UINT32 CoreId,
BOOLEAN Set )

Set or unset the Mov to Debug Registers Exiting.

Parameters
CoreIdTarget core's ID
SetSet or unset the Mov to Debug Registers Exiting
Returns
VOID
352{
354}
VOID HvSetMovDebugRegsExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set or unset the Mov to Debug Registers Exiting.
Definition Hv.c:1167

◆ VmFuncSetMovToCr3Vmexit()

VOID VmFuncSetMovToCr3Vmexit ( UINT32 CoreId,
BOOLEAN Set )

Set vm-exit for mov-to-cr3.

Should be called in vmx-root

Parameters
CoreIdtarget core id
SetSet or unset the vm-exits
Returns
VOID
223{
224 HvSetMovToCr3Vmexit(&g_GuestState[CoreId], Set);
225}
VOID HvSetMovToCr3Vmexit(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set vm-exit for mov-to-cr3.
Definition Hv.c:602

◆ VmFuncSetNmiExiting()

VOID VmFuncSetNmiExiting ( BOOLEAN Set)

Set the NMI Exiting.

Parameters
SetSet or unset the NMI Exiting
Returns
VOID
285{
286 HvSetNmiExiting(Set);
287}
VOID HvSetNmiExiting(BOOLEAN Set)
Set the NMI Exiting.
Definition Hv.c:1000

◆ VmFuncSetNmiWindowExiting()

VOID VmFuncSetNmiWindowExiting ( BOOLEAN Set)

Set NMI-window exiting.

Parameters
SetSet or unset the NMI-window exiting
Returns
VOID
273{
275}
VOID HvSetNmiWindowExiting(BOOLEAN Set)
Set NMI-window exiting.
Definition Hv.c:758

◆ VmFuncSetPmcVmexit()

VOID VmFuncSetPmcVmexit ( BOOLEAN Set)

Set vm-exit for rdpmc instructions.

Should be called in vmx-root

Parameters
SetSet or unset the vm-exits
Returns
VOID
193{
194 HvSetPmcVmexit(Set);
195}
VOID HvSetPmcVmexit(BOOLEAN Set)
Set vm-exit for rdpmc instructions.
Definition Hv.c:553

◆ VmFuncSetRdtscExiting()

VOID VmFuncSetRdtscExiting ( UINT32 CoreId,
BOOLEAN Set )

Set the RDTSC/P Exiting.

Parameters
CoreIdTarget core's ID
SetSet or unset the RDTSC/P Exiting
Returns
VOID
339{
340 HvSetRdtscExiting(&g_GuestState[CoreId], Set);
341}
VOID HvSetRdtscExiting(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set the RDTSC/P Exiting.
Definition Hv.c:1154

◆ VmFuncSetRflags()

VOID VmFuncSetRflags ( UINT64 Rflags)

Set guest's RFLAGS.

Parameters
Rflags
Returns
VOID
410{
411 HvSetRflags(Rflags);
412}
VOID HvSetRflags(UINT64 Rflags)
Set guest's RFLAGS.
Definition Hv.c:1213

◆ VmFuncSetRflagTrapFlag()

VOID VmFuncSetRflagTrapFlag ( BOOLEAN Set)

Set Rflag's trap flag.

Parameters
SetSet or unset the TF
Returns
VOID
124{
126}
VOID HvSetRflagTrapFlag(BOOLEAN Set)
Set the rflag's trap flag.
Definition Hv.c:377

◆ VmFuncSetRip()

VOID VmFuncSetRip ( UINT64 Rip)

Set guest's RIP.

Parameters
Rip
Returns
VOID
433{
434 HvSetRip(Rip);
435}
VOID HvSetRip(UINT64 Rip)
Set guest's RIP.
Definition Hv.c:1240

◆ VmFuncSetSaveDebugControls()

VOID VmFuncSetSaveDebugControls ( UINT32 CoreId,
BOOLEAN Set )

Set SAVE DEBUG CONTROLS on Vm-exit controls.

Parameters
CoreIdtarget core id
SetSet or unset
Returns
VOID
166{
168}
VOID HvSetSaveDebugControls(VIRTUAL_MACHINE_STATE *VCpu, BOOLEAN Set)
Set SAVE DEBUG CONTROLS on Vm-exit controls.
Definition Hv.c:446

◆ VmFuncSetSaveDebugControlsVmcallOnTargetCore()

VOID VmFuncSetSaveDebugControlsVmcallOnTargetCore ( BOOLEAN Set)

Set SAVE DEBUG CONTROLS on VM-exit controls on the target core from VMCS using VMCALL.

Parameters
SetSet or unset
Returns
VOID
613{
615}
VOID CrossVmcallSetSaveDebugControlsVmcallOnTargetCore(BOOLEAN Set)
Set SAVE DEBUG CONTROLS on Vm-exit controls on the target core from VMCS using VMCALL.
Definition CrossVmcalls.c:125

◆ VmFuncSetTriggerEventForCpuids()

VOID VmFuncSetTriggerEventForCpuids ( BOOLEAN Set)

Set triggering events for CPUIDs.

Parameters
SetSet or unset the trigger
Returns
VOID
838{
840}
BOOLEAN g_TriggerEventForCpuids
Showes whether the cpuid handler is allowed to trigger an event or not.
Definition GlobalVariables.h:149

◆ VmFuncSetTriggerEventForVmcalls()

VOID VmFuncSetTriggerEventForVmcalls ( BOOLEAN Set)

Set triggering events for VMCALLs.

Parameters
SetSet or unset the trigger
Returns
VOID
826{
828}
BOOLEAN g_TriggerEventForVmcalls
Showes whether the vmcall handler is allowed to trigger an event or not.
Definition GlobalVariables.h:142

◆ VmFuncSetTriggerEventForXsetbvs()

VOID VmFuncSetTriggerEventForXsetbvs ( BOOLEAN Set)

Set trigger event for XSETBVs.

Parameters
SetSet or unset the trigger
Returns
VOID
850{
852}
BOOLEAN g_TriggerEventForXsetbvs
Definition GlobalVariables.h:151

◆ VmFuncSmmPerformSmiOperation()

BOOLEAN VmFuncSmmPerformSmiOperation ( SMI_OPERATION_PACKETS * SmiOperationRequest,
BOOLEAN ApplyFromVmxRootMode )

Perform actions related to System Management Interrupts (SMIs).

Parameters
SmiOperationRequest
ApplyFromVmxRootMode
Returns
BOOLEAN
1142{
1143 return SmmPerformSmiOperation(SmiOperationRequest, ApplyFromVmxRootMode);
1144}
BOOLEAN SmmPerformSmiOperation(SMI_OPERATION_PACKETS *SmiOperationRequest, BOOLEAN ApplyFromVmxRootMode)
Perform actions related to System Management Interrupts (SMIs).
Definition Smm.c:83

◆ VmFuncSuppressRipIncrement()

VOID VmFuncSuppressRipIncrement ( UINT32 CoreId)

Suppress the incrementation of RIP.

Parameters
CoreIdTarget core's ID
Returns
VOID
35{
37}
VOID HvSuppressRipIncrement(VIRTUAL_MACHINE_STATE *VCpu)
Suppress the incrementation of RIP.
Definition Hv.c:320

◆ VmFuncUninitVmm()

VOID VmFuncUninitVmm ( )

Uninitialize Terminate Vmx on all logical cores.

Returns
VOID
792{
794}
VOID VmxPerformTermination()
Terminate Vmx on all logical cores.
Definition Vmx.c:1104

◆ VmFuncUnsetExceptionBitmap()

VOID VmFuncUnsetExceptionBitmap ( UINT32 CoreId,
UINT32 IdtIndex )

Unset exception bitmap in VMCS.

Should be called in vmx-root

Parameters
CoreIdTarget core's ID
IdtIndexInterrupt Descriptor Table index of exception
Returns
VOID
313{
314 HvUnsetExceptionBitmap(&g_GuestState[CoreId], IdtIndex);
315}
VOID HvUnsetExceptionBitmap(VIRTUAL_MACHINE_STATE *VCpu, UINT32 IdtIndex)
Unset exception bitmap in VMCS.
Definition Hv.c:1086

◆ VmFuncUnsetInstrumentationStepInState()

VOID VmFuncUnsetInstrumentationStepInState ( UINT32 CoreId)

Unset instrumentation step in MTF (used for single stepping with MTF).

Parameters
CoreIdTarget core's ID
Returns
VOID
87{
88 g_GuestState[CoreId].InstrumentationStepInMtf = FALSE;
89}
#define FALSE
Definition BasicTypes.h:113

◆ VmFuncVmxBroadcastInitialize()

VOID VmFuncVmxBroadcastInitialize ( )

Export for initialize the VMX Broadcast mechanism.

Returns
VOID
972{
974}
VOID VmxBroadcastInitialize()
Initialize the VMX Broadcast mechanism.
Definition VmxBroadcast.c:20

◆ VmFuncVmxBroadcastUninitialize()

VOID VmFuncVmxBroadcastUninitialize ( )

Export for uninitialize the VMX Broadcast mechanism.

Returns
VOID
983{
985}
VOID VmxBroadcastUninitialize()
Uninitialize the VMX Broadcast mechanism.
Definition VmxBroadcast.c:57

◆ VmFuncVmxCompatibleMemcmp()

INT32 VmFuncVmxCompatibleMemcmp ( const CHAR * Address1,
const CHAR * Address2,
SIZE_T Count )

VMX-root compatible memcmp.

Parameters
Address1
Address2
Count
Returns
INT32
1062{
1063 return VmxCompatibleMemcmp(Address1, Address2, Count);
1064}
INT32 VmxCompatibleMemcmp(const CHAR *Address1, const CHAR *Address2, SIZE_T Count)
implementation of vmx-root mode compatible memcmp
Definition Vmx.c:1674

◆ VmFuncVmxCompatibleMicroSleep()

VOID VmFuncVmxCompatibleMicroSleep ( UINT64 Us)

VMX-root compatible micro sleep.

Parameters
UsDelay in micro seconds
Returns
VOID
886{
888}
VOID VmxCompatibleMicroSleep(UINT64 Us)
VMX-root compatible micro sleep.
Definition Vmx.c:1371

◆ VmFuncVmxCompatibleStrcmp()

INT32 VmFuncVmxCompatibleStrcmp ( const CHAR * Address1,
const CHAR * Address2 )

VMX-root compatible strcmp.

Parameters
Address1
Address2
Returns
INT32
1007{
1008 return VmxCompatibleStrcmp(Address1, Address2, NULL_ZERO, FALSE);
1009}
INT32 VmxCompatibleStrcmp(const CHAR *Address1, const CHAR *Address2, SIZE_T Num, BOOLEAN IsStrncmp)
implementation of vmx-root mode compatible strcmp and strncmp
Definition Vmx.c:1398
#define NULL_ZERO
Definition BasicTypes.h:110

◆ VmFuncVmxCompatibleStrlen()

UINT32 VmFuncVmxCompatibleStrlen ( const CHAR * s)

VMX-root compatible strlen.

Parameters
sA pointer to the string
Returns
UINT32
862{
863 return VmxCompatibleStrlen(s);
864}
UINT32 VmxCompatibleStrlen(const CHAR *S)
implementation of vmx-root mode compatible strlen
Definition Vmx.c:1192

◆ VmFuncVmxCompatibleStrncmp()

INT32 VmFuncVmxCompatibleStrncmp ( const CHAR * Address1,
const CHAR * Address2,
SIZE_T Num )

VMX-root compatible strncmp.

Parameters
Address1
Address2
Num
Returns
INT32
1021{
1022 return VmxCompatibleStrcmp(Address1, Address2, Num, TRUE);
1023}
@ Num
Definition commands.h:167

◆ VmFuncVmxCompatibleWcscmp()

INT32 VmFuncVmxCompatibleWcscmp ( const WCHAR * Address1,
const WCHAR * Address2 )

VMX-root compatible wcscmp.

Parameters
Address1
Address2
Returns
INT32
1034{
1035 return VmxCompatibleWcscmp(Address1, Address2, NULL_ZERO, FALSE);
1036}
INT32 VmxCompatibleWcscmp(const WCHAR *Address1, const WCHAR *Address2, SIZE_T Num, BOOLEAN IsWcsncmp)
implementation of vmx-root mode compatible wcscmp and wcsncmp
Definition Vmx.c:1536

◆ VmFuncVmxCompatibleWcslen()

UINT32 VmFuncVmxCompatibleWcslen ( const WCHAR * s)

VMX-root compatible strlen.

Parameters
sA pointer to the string
Returns
UINT32
874{
875 return VmxCompatibleWcslen(s);
876}
UINT32 VmxCompatibleWcslen(const WCHAR *S)
implementation of vmx-root mode compatible wcslen
Definition Vmx.c:1281

◆ VmFuncVmxCompatibleWcsncmp()

INT32 VmFuncVmxCompatibleWcsncmp ( const WCHAR * Address1,
const WCHAR * Address2,
SIZE_T Num )

VMX-root compatible wcsncmp.

Parameters
Address1
Address2
Num
Returns
INT32
1048{
1049 return VmxCompatibleWcscmp(Address1, Address2, Num, TRUE);
1050}

◆ VmFuncVmxGetCurrentExecutionMode()

BOOLEAN VmFuncVmxGetCurrentExecutionMode ( )

Get the current VMX operation state.

Returns
BOOLEAN
803{
805}
BOOLEAN VmxGetCurrentExecutionMode()
Check current execution mode (vmx-root and non-root).
Definition Vmx.c:76

◆ VmFuncVmxVmcall()

NTSTATUS VmFuncVmxVmcall ( UINT64 VmcallNumber,
UINT64 OptionalParam1,
UINT64 OptionalParam2,
UINT64 OptionalParam3 )

Export for running VMX VMCALLs.

Parameters
VmcallNumber
OptionalParam1
OptionalParam2
OptionalParam3
Returns
NTSTATUS
961{
962 return AsmVmxVmcall(VmcallNumber, OptionalParam1, OptionalParam2, OptionalParam3);
963}
NTSTATUS AsmVmxVmcall(UINT64 VmcallNumber, UINT64 OptionalParam1, UINT64 OptionalParam2, UINT64 OptionalParam3)
Request Vmcall.

◆ VmFuncWriteExceptionBitmap()

VOID VmFuncWriteExceptionBitmap ( UINT32 BitmapMask)

Write on exception bitmap in VMCS DO NOT CALL IT DIRECTLY, instead use HvSetExceptionBitmap.

Should be called in vmx-root

Parameters
BitmapMaskThe content to write on exception bitmap
Returns
VOID
237{
238 HvWriteExceptionBitmap(BitmapMask);
239}
VOID HvWriteExceptionBitmap(UINT32 BitmapMask)
Write on exception bitmap in VMCS DO NOT CALL IT DIRECTLY, instead use HvSetExceptionBitmap.
Definition Hv.c:616