From d5bf81d99b7808c2b3e181ee0e30fe2683a0ff55 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 9 May 2024 18:33:33 +0200 Subject: [PATCH] Prepare exception handling --- src/driver/hypervisor.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/driver/hypervisor.cpp b/src/driver/hypervisor.cpp index 70957ff..bf54429 100644 --- a/src/driver/hypervisor.cpp +++ b/src/driver/hypervisor.cpp @@ -46,8 +46,8 @@ namespace void enable_syscall_hooking() { - int32_t cpu_info[4]{0}; - __cpuidex(cpu_info, 0x41414141, 0x42424243); + //int32_t cpu_info[4]{0}; + //__cpuidex(cpu_info, 0x41414141, 0x42424243); } void cpature_special_registers(vmx::special_registers& special_registers) @@ -460,6 +460,12 @@ void vmx_handle_invd() __wbinvd(); } +void vmx_handle_exception(vmx::guest_context& guest_context) +{ + (void)guest_context; + read_vmx(VMCS_VMEXIT_INTERRUPTION_INFORMATION); + debug_log("MABEA SYSCALL :D\n"); +} bool is_system() { @@ -587,6 +593,9 @@ void vmx_dispatch_vm_exit(vmx::guest_context& guest_context, const vmx::state& v case VMX_EXIT_REASON_EPT_MISCONFIGURATION: vm_state.ept->handle_misconfiguration(guest_context); break; + case VMX_EXIT_REASON_EXCEPTION_OR_NMI: + vmx_handle_exception(guest_context); + break; //case VMX_EXIT_REASON_EXECUTE_RDTSC: // break; default: