├── MiniVT.cpp ├── MiniVT_x64.suo ├── base ├── common.h ├── vtasm.asm ├── vtasm.h ├── common.cpp ├── vtsystem.h ├── vtsystem.cpp ├── stdafx.h └── exithandler.h ├── stdafx.cpp ├── stdafx.h ├── docs └── README_CHN.md ├── LICENSE ├── MiniVT_x64.sln ├── README.md └── MiniVT_x64.vcproj /MiniVT.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/MiniVT.cpp -------------------------------------------------------------------------------- /MiniVT_x64.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/MiniVT_x64.suo -------------------------------------------------------------------------------- /base/common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/common.h -------------------------------------------------------------------------------- /base/vtasm.asm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/vtasm.asm -------------------------------------------------------------------------------- /base/vtasm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/vtasm.h -------------------------------------------------------------------------------- /stdafx.cpp: -------------------------------------------------------------------------------- 1 | //This file is used to build a precompiled header 2 | #include "stdafx.h" -------------------------------------------------------------------------------- /base/common.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/common.cpp -------------------------------------------------------------------------------- /base/vtsystem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/vtsystem.h -------------------------------------------------------------------------------- /base/vtsystem.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaobao520123/MiniVT_x64/HEAD/base/vtsystem.cpp -------------------------------------------------------------------------------- /stdafx.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 2 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 3 | #endif 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | 9 | #endif 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #define Log(message,value) {{KdPrint(("[MiniVT] %-40s [%p]\n",message,value));}} 22 | -------------------------------------------------------------------------------- /base/stdafx.h: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 2 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 3 | #endif 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | 9 | #endif 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #define Log(message,value) {{KdPrint(("[MiniVT] %-40s [%p]\n",message,value));}} 22 | -------------------------------------------------------------------------------- /docs/README_CHN.md: -------------------------------------------------------------------------------- 1 | # MiniVT 2 | 3 | - [简体中文](README_CHN.md) 4 | - [English](../README.md) 5 | 6 | MiniVT 是一个 Windows 平台上的英特尔处理器虚拟化技术的简单示例。 7 | 8 | ## 简介 9 | 10 | - MiniVT 是一个开源的 Windows 系统驱动程序,它基于英特尔处理器的虚拟化技术。 11 | - 最初启发来自 JoenChen 开发的 Ollydbg 插件 Ddvp,超级感谢。👏 12 | - 这个驱动程序主要使用 C/C++ 和 x86-64 汇编语言编写。 13 | - 它是在 Windows 平台 VT-x 技术的最小化实现。 14 | - 加载后,驱动程序会启用操作系统的虚拟化功能,并充当 VMM(虚拟机监视程序),执行内核监管。 15 | - 它可以控制系统寄存器、内存和许多程序指令的访问、执行和权限控制。 16 | 17 | - 该驱动程序还为各种类型的虚拟化提供了简便的框架。 18 | - 如果需要,你可以添加和实现其他功能,如扩展页表(EPT)。EPT 可以实现内核级别的监控和对内存操作的控制。 19 | 20 | ## 系统要求 21 | 22 | 早期的测试结果显示,该驱动程序可在以下系统上运行: 23 | 24 | - Windows XP(with Service Pack 3) 25 | - Windows 7(with Service Pack 1) 26 | - Windows 10 Version 1607(Build 14393) 27 | 28 | ## 注意事项 29 | 30 | 该项目最初是由小宝(Xiaobao)在 2016年8月2日在 [看雪论坛](https://bbs.pediy.com) 上发布的教程的项目。它现在被交由 Github 托管,不再维护。 31 | 32 | ## x86 版本 33 | 34 | [MiniVT](https://github.com/xiaobao520123/MiniVT) 35 | 36 | ## 参考资料 37 | 38 | - [[原创] VT虚拟化架构编写视频教程①~⑥课(已修复链接)](https://bbs.kanxue.com/thread-211973-1.htm) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Xiaobao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MiniVT_x64.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MiniVT_x64", "MiniVT_x64.vcproj", "{A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Debug|x64 = Debug|x64 10 | Release|Win32 = Release|Win32 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Debug|Win32.Build.0 = Debug|Win32 16 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Debug|x64.ActiveCfg = Debug|x64 17 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Debug|x64.Build.0 = Debug|x64 18 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Release|Win32.ActiveCfg = Release|Win32 19 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Release|Win32.Build.0 = Release|Win32 20 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Release|x64.ActiveCfg = Release|x64 21 | {A6E62619-CFF0-450F-AD2A-7AADB85DB5A5}.Release|x64.Build.0 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MiniVT 2 | 3 | - [简体中文](./docs/README_CHN.md) 4 | - [English](README.md) 5 | 6 | MiniVT is a simple showcase of Intel CPU's virtualization technology VT-x on the Windows platform. 7 | 8 | ## Introduction 9 | 10 | - MiniVT is an open-source Windows system driver developed over Intel CPU's virtualization technology, VT-x. 11 | - The project was inspired by Ddvp from JoenChen. Huge shout out for his work. 👏 12 | - The driver is primarily written in C/C++ and x86-64 ASM. 13 | - It provides a minimal implementation of the VT-x technology on the Windows operating system. 14 | - When loaded, the driver enables virtualization of the OS and acts as the VMM (Virtual Machine Monitor), becoming a system hypervisor. 15 | - It allows the control over access, execution, and privileges of the system's registers, memory, and many instructions. 16 | 17 | - The driver also provides an easy framework for various types of virtualization. 18 | - If needed, you can implement other parts like Extended Page Table (EPT), which enables kernel-level monitoring and control of memory operations. 19 | 20 | ## System Requirements 21 | 22 | Early test results have shown that this driver can run on the following systems: 23 | 24 | - Windows XP (with Service Pack 3) 25 | - Windows 7 (with Service Pack 1) 26 | - Windows 10 Version 1607 (build 14393) 27 | 28 | ## Notice 29 | 30 | This project was originally published in a tutorial on [Kanxue](https://bbs.pediy.com) by Xiaobao on August 2, 2016. It has been archived on GitHub and will NOT receive any future updates. 31 | 32 | ## x86 Version 33 | 34 | [MiniVT](https://github.com/xiaobao520123/MiniVT) 35 | 36 | ## References 37 | 38 | - [[Original] Video tutorial for VT virtualization architecture (Lessons 1-6) (Fixed Links)](https://bbs.kanxue.com/thread-211973-1.htm) -------------------------------------------------------------------------------- /base/exithandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | GUEST_REGS g_GuestRegs[128]; 4 | 5 | void HandleCPUID() 6 | { 7 | ULONG64 uCPUID; 8 | uCPUID = KeGetCurrentProcessorNumber(); 9 | if (g_GuestRegs[uCPUID].rax == 'Mini') 10 | { 11 | g_GuestRegs[uCPUID].rbx = 0x88888888; 12 | g_GuestRegs[uCPUID].rcx = 0x11111111; 13 | g_GuestRegs[uCPUID].rdx = 0x12345678; 14 | } 15 | else Asm_CPUID(g_GuestRegs[uCPUID].rax,&g_GuestRegs[uCPUID].rax,&g_GuestRegs[uCPUID].rbx,&g_GuestRegs[uCPUID].rcx,&g_GuestRegs[uCPUID].rdx); 16 | } 17 | 18 | void HandleInvd() 19 | { 20 | Asm_Invd(); 21 | } 22 | 23 | void HandleVmCall() 24 | { 25 | ULONG64 JmpEIP; 26 | ULONG64 uCPUID; 27 | uCPUID = KeGetCurrentProcessorNumber(); 28 | if (g_GuestRegs[uCPUID].rax == 'SVT') 29 | { 30 | JmpEIP = g_GuestRegs[uCPUID].rip + Vmx_VmRead(VM_EXIT_INSTRUCTION_LEN); 31 | Vmx_VmxOff(); 32 | 33 | Asm_AfterVMXOff(g_GuestRegs[uCPUID].rsp,JmpEIP); 34 | } 35 | } 36 | 37 | void HandleMsrRead() 38 | { 39 | ULONG64 uCPUID; 40 | uCPUID = KeGetCurrentProcessorNumber(); 41 | switch(g_GuestRegs[uCPUID].rcx) 42 | { 43 | case MSR_IA32_SYSENTER_CS: 44 | { 45 | g_GuestRegs[uCPUID].rax = Vmx_VmRead(GUEST_SYSENTER_CS); 46 | g_GuestRegs[uCPUID].rdx = Vmx_VmRead(GUEST_SYSENTER_CS) >> 32; 47 | break; 48 | } 49 | case MSR_IA32_SYSENTER_ESP: 50 | { 51 | g_GuestRegs[uCPUID].rax = Vmx_VmRead(GUEST_SYSENTER_ESP); 52 | g_GuestRegs[uCPUID].rdx = Vmx_VmRead(GUEST_SYSENTER_ESP) >> 32; 53 | break; 54 | } 55 | case MSR_IA32_SYSENTER_EIP: // KiFastCallEntry 56 | { 57 | g_GuestRegs[uCPUID].rax = Vmx_VmRead(GUEST_SYSENTER_EIP); 58 | g_GuestRegs[uCPUID].rdx = Vmx_VmRead(GUEST_SYSENTER_EIP) >> 32; 59 | break; 60 | } 61 | case MSR_FS_BASE: 62 | { 63 | g_GuestRegs[uCPUID].rax = Vmx_VmRead(GUEST_FS_BASE); 64 | g_GuestRegs[uCPUID].rdx = Vmx_VmRead(GUEST_FS_BASE) >> 32; 65 | break; 66 | } 67 | case MSR_GS_BASE: 68 | { 69 | g_GuestRegs[uCPUID].rax = Vmx_VmRead(GUEST_GS_BASE); 70 | g_GuestRegs[uCPUID].rdx = Vmx_VmRead(GUEST_GS_BASE) >> 32; 71 | break; 72 | } 73 | case MSR_EFER: 74 | { 75 | g_GuestRegs[uCPUID].rax = Asm_ReadMsr(MSR_EFER); 76 | g_GuestRegs[uCPUID].rdx = Asm_ReadMsr(MSR_EFER) >> 32; 77 | break; 78 | } 79 | default: 80 | g_GuestRegs[uCPUID].rax = Asm_ReadMsr(g_GuestRegs[uCPUID].rcx); 81 | g_GuestRegs[uCPUID].rdx = Asm_ReadMsr(g_GuestRegs[uCPUID].rcx) >> 32; 82 | } 83 | 84 | } 85 | 86 | void HandleMsrWrite() 87 | { 88 | ULONG64 uCPUID; 89 | uCPUID = KeGetCurrentProcessorNumber(); 90 | switch(g_GuestRegs[uCPUID].rcx) 91 | { 92 | case MSR_IA32_SYSENTER_CS: 93 | { 94 | Vmx_VmWrite(GUEST_SYSENTER_CS,g_GuestRegs[uCPUID].rax|(g_GuestRegs[uCPUID].rdx<<32)); 95 | break; 96 | } 97 | case MSR_IA32_SYSENTER_ESP: 98 | { 99 | Vmx_VmWrite(GUEST_SYSENTER_ESP,g_GuestRegs[uCPUID].rax|(g_GuestRegs[uCPUID].rdx<<32)); 100 | break; 101 | } 102 | case MSR_IA32_SYSENTER_EIP: // KiFastCallEntry 103 | { 104 | Vmx_VmWrite(GUEST_SYSENTER_EIP,g_GuestRegs[uCPUID].rax|(g_GuestRegs[uCPUID].rdx<<32)); 105 | break; 106 | } 107 | case MSR_FS_BASE: 108 | { 109 | Vmx_VmWrite(GUEST_FS_BASE,(g_GuestRegs[uCPUID].rax)|(g_GuestRegs[uCPUID].rdx<<32)); 110 | break; 111 | } 112 | case MSR_GS_BASE: 113 | { 114 | Vmx_VmWrite(GUEST_GS_BASE,(g_GuestRegs[uCPUID].rax)|(g_GuestRegs[uCPUID].rdx<<32)); 115 | break; 116 | } 117 | case MSR_EFER: 118 | { 119 | Asm_WriteMsr(MSR_EFER,(g_GuestRegs[uCPUID].rax)|(g_GuestRegs[uCPUID].rdx<<32)); 120 | break; 121 | } 122 | default: 123 | Asm_WriteMsr(g_GuestRegs[uCPUID].rcx,(g_GuestRegs[uCPUID].rax)|(g_GuestRegs[uCPUID].rdx<<32)); 124 | } 125 | } 126 | 127 | void HandleCrAccess() 128 | { 129 | ULONG64 movcrControlRegister; 130 | ULONG64 movcrAccessType; 131 | ULONG64 movcrOperandType; 132 | ULONG64 movcrGeneralPurposeRegister; 133 | ULONG64 movcrLMSWSourceData; 134 | ULONG64 ExitQualification; 135 | ULONG64 uCPUID; 136 | uCPUID = KeGetCurrentProcessorNumber(); 137 | 138 | ExitQualification = Vmx_VmRead(EXIT_QUALIFICATION) ; 139 | movcrControlRegister = ( ExitQualification & 0x0000000F ); 140 | movcrAccessType = ( ( ExitQualification & 0x00000030 ) >> 4 ); 141 | movcrOperandType = ( ( ExitQualification & 0x00000040 ) >> 6 ); 142 | movcrGeneralPurposeRegister = ( ( ExitQualification & 0x00000F00 ) >> 8 ); 143 | 144 | // Control Register Access (CR3 <-- reg32) 145 | // 146 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 0 ) 147 | { 148 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rax ); 149 | } 150 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 1 ) 151 | { 152 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rcx ); 153 | } 154 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 2 ) 155 | { 156 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rdx ); 157 | } 158 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 3 ) 159 | { 160 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rbx ); 161 | } 162 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 4 ) 163 | { 164 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rsp ); 165 | } 166 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 5 ) 167 | { 168 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rbp ); 169 | } 170 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 6 ) 171 | { 172 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rsi ); 173 | } 174 | if( movcrControlRegister == 3 && movcrAccessType == 0 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 7 ) 175 | { 176 | Vmx_VmWrite( GUEST_CR3, g_GuestRegs[uCPUID].rdi ); 177 | } 178 | // Control Register Access (reg32 <-- CR3) 179 | // 180 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 0 ) 181 | { 182 | g_GuestRegs[uCPUID].rax = g_GuestRegs[uCPUID].cr3; 183 | } 184 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 1 ) 185 | { 186 | g_GuestRegs[uCPUID].rcx = g_GuestRegs[uCPUID].cr3; 187 | } 188 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 2 ) 189 | { 190 | g_GuestRegs[uCPUID].rdx = g_GuestRegs[uCPUID].cr3; 191 | } 192 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 3 ) 193 | { 194 | g_GuestRegs[uCPUID].rbx = g_GuestRegs[uCPUID].cr3; 195 | } 196 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 4 ) 197 | { 198 | g_GuestRegs[uCPUID].rsp = g_GuestRegs[uCPUID].cr3; 199 | } 200 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 5 ) 201 | { 202 | g_GuestRegs[uCPUID].rbp = g_GuestRegs[uCPUID].cr3; 203 | } 204 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 6 ) 205 | { 206 | g_GuestRegs[uCPUID].rsi = g_GuestRegs[uCPUID].cr3; 207 | } 208 | if( movcrControlRegister == 3 && movcrAccessType == 1 && movcrOperandType == 0 && movcrGeneralPurposeRegister == 7 ) 209 | { 210 | g_GuestRegs[uCPUID].rdi = g_GuestRegs[uCPUID].cr3; 211 | } 212 | } 213 | 214 | extern "C" ULONG64 GetGuestRegsAddress() 215 | { 216 | ULONG64 uCPUID; 217 | uCPUID = KeGetCurrentProcessorNumber(); 218 | return (ULONG64)&g_GuestRegs[uCPUID]; 219 | } 220 | 221 | extern "C" void VMMEntryPoint() 222 | { 223 | ULONG64 ExitReason; 224 | ULONG64 ExitInstructionLength; 225 | ULONG64 GuestResumeEIP; 226 | ULONG64 uCPUID; 227 | static BOOLEAN bWatch = FALSE; 228 | uCPUID = KeGetCurrentProcessorNumber(); 229 | ExitReason = Vmx_VmRead(VM_EXIT_REASON); 230 | ExitInstructionLength = Vmx_VmRead(VM_EXIT_INSTRUCTION_LEN); 231 | 232 | g_GuestRegs[uCPUID].rsp = Vmx_VmRead(GUEST_RSP); 233 | g_GuestRegs[uCPUID].rip = Vmx_VmRead(GUEST_RIP); 234 | g_GuestRegs[uCPUID].cr3 = Vmx_VmRead(GUEST_CR3); 235 | 236 | if (bWatch) 237 | __debugbreak(); 238 | switch(ExitReason) 239 | { 240 | case EXIT_REASON_CPUID: 241 | { 242 | HandleCPUID(); 243 | break; 244 | } 245 | case EXIT_REASON_INVD: 246 | { 247 | HandleInvd(); 248 | break; 249 | } 250 | case EXIT_REASON_VMCALL: 251 | { 252 | HandleVmCall(); 253 | break; 254 | } 255 | case EXIT_REASON_MSR_READ: 256 | { 257 | HandleMsrRead(); 258 | break; 259 | } 260 | case EXIT_REASON_MSR_WRITE: 261 | { 262 | HandleMsrWrite(); 263 | break; 264 | } 265 | case EXIT_REASON_CR_ACCESS: 266 | { 267 | HandleCrAccess(); 268 | break; 269 | } 270 | default: 271 | break; 272 | } 273 | 274 | Resume: 275 | GuestResumeEIP = g_GuestRegs[uCPUID].rip+ExitInstructionLength; 276 | Vmx_VmWrite(GUEST_RIP,GuestResumeEIP); 277 | Vmx_VmWrite(GUEST_RSP,g_GuestRegs[uCPUID].rsp); 278 | } -------------------------------------------------------------------------------- /MiniVT_x64.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 17 | 18 | 19 | 22 | 23 | 24 | 29 | 32 | 35 | 38 | 41 | 44 | 47 | 63 | 66 | 69 | 72 | 87 | 90 | 93 | 96 | 99 | 102 | 105 | 108 | 109 | 115 | 118 | 121 | 124 | 127 | 130 | 133 | 150 | 153 | 156 | 159 | 174 | 177 | 180 | 183 | 186 | 189 | 192 | 195 | 196 | 201 | 204 | 207 | 210 | 213 | 216 | 219 | 239 | 242 | 245 | 248 | 265 | 268 | 271 | 274 | 277 | 280 | 283 | 286 | 287 | 292 | 295 | 298 | 301 | 304 | 307 | 310 | 330 | 333 | 336 | 339 | 356 | 359 | 362 | 365 | 368 | 371 | 374 | 377 | 378 | 379 | 380 | 381 | 382 | 386 | 389 | 390 | 393 | 394 | 397 | 398 | 401 | 402 | 403 | 407 | 408 | 412 | 415 | 416 | 419 | 420 | 423 | 424 | 427 | 428 | 431 | 432 | 433 | 436 | 437 | 438 | 439 | 440 | 441 | --------------------------------------------------------------------------------