From c405c776077ed74975c80a01d507107e41ab82b0 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Wed, 24 Feb 2021 02:39:02 +0000 Subject: [PATCH] Revert "thanks drew, 64bit systems wont use PAE..." This reverts commit b5171d01623452345a4c3613cc3dcc3c224d86df --- msrexec.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/msrexec.cpp b/msrexec.cpp index 27e16db..a8b5cb0 100644 --- a/msrexec.cpp +++ b/msrexec.cpp @@ -32,12 +32,18 @@ namespace vdm cr4_value.debugging_extensions = true; cr4_value.page_size_extensions = true; cr4_value.machine_check_enable = true; - cr4_value.os_xmm_exception_support = true; - cr4_value.fsgsbase_enable = true; + + cr4_value.physical_address_extension = + cpuid_info.cpuid_feature_information_edx.physical_address_extension; cr4_value.os_fxsave_fxrstor_support = cpuid_info.cpuid_feature_information_edx.fxsave_fxrstor_instructions; + cr4_value.os_xmm_exception_support = true; + + cr4_value.fsgsbase_enable = + IsProcessorFeaturePresent(PF_RDWRFSGSBASE_AVAILABLE); + cr4_value.os_xsave = IsProcessorFeaturePresent(PF_XSAVE_ENABLED); @@ -47,9 +53,7 @@ namespace vdm m_smep_off.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; + m_smep_off.smap_enable = false; // newer cpus have this on... // WARNING: some virtual machines dont have SMEP... // my VMWare VM doesnt... nor does my Virtual Box VM...