From c7e8513c5e3be98d8e6e2b6b1c8a9f921b1f2e06 Mon Sep 17 00:00:00 2001 From: AltimorTASDK Date: Mon, 24 Aug 2015 20:37:05 -0400 Subject: [PATCH] Changed RtlZeroMemory call to zero everything but the lower 32 bits of the guest VMCS pointer to a bitwise AND --- src/VMX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VMX.cpp b/src/VMX.cpp index c9e3e3c..6353496 100644 --- a/src/VMX.cpp +++ b/src/VMX.cpp @@ -210,7 +210,7 @@ CVmx::VmcsInit() VMWRITE_ERR_QUITB(VMX_VMCS16_HOST_FIELD_GS, m_guestState.Gs & 0xf8); VMWRITE_ERR_QUITB(VMX_VMCS16_HOST_FIELD_TR, m_guestState.Tr); - RtlZeroMemory(reinterpret_cast(reinterpret_cast(m_guestState.GVmcs.pvmcs) + 4), sizeof(void*) - 4); + *(ULONG_PTR*)(&m_guestState.GVmcs.pvmcs) &= 0xFFFFFFFF; VMWRITE_ERR_QUITB(VMX_VMCS64_GUEST_RSP, guest_rsp); VMWRITE_ERR_QUITB(VMX_VMCS64_GUEST_RIP, guest_rip);