From d930b3341d670b69621f5fa0387e7ff573ba7aee Mon Sep 17 00:00:00 2001 From: sina Date: Thu, 23 Apr 2026 18:52:41 +0200 Subject: [PATCH] change LBR control VMWRITE length --- hyperdbg/hyperhv/code/vmm/vmx/Hv.c | 4 ++-- hyperdbg/hypertrace/code/DpcRoutines.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hyperdbg/hyperhv/code/vmm/vmx/Hv.c b/hyperdbg/hyperhv/code/vmm/vmx/Hv.c index 33583ccb..852a99e9 100644 --- a/hyperdbg/hyperhv/code/vmm/vmx/Hv.c +++ b/hyperdbg/hyperhv/code/vmm/vmx/Hv.c @@ -1500,8 +1500,8 @@ HvGetAndStoreDebugctl(UINT64 * StoreDebugctl) VOID HvSetDebugctl(UINT64 Value) { - VmxVmwrite64(VMCS_GUEST_DEBUGCTL, Value & 0xFFFFFFFF); - VmxVmwrite64(VMCS_GUEST_DEBUGCTL_HIGH, Value >> 32); + VmxVmwrite32(VMCS_GUEST_DEBUGCTL, Value & 0xFFFFFFFF); + VmxVmwrite32(VMCS_GUEST_DEBUGCTL_HIGH, Value >> 32); } /** diff --git a/hyperdbg/hypertrace/code/DpcRoutines.c b/hyperdbg/hypertrace/code/DpcRoutines.c index f160d612..eab62d39 100644 --- a/hyperdbg/hypertrace/code/DpcRoutines.c +++ b/hyperdbg/hypertrace/code/DpcRoutines.c @@ -94,6 +94,11 @@ DpcRoutineDisableLbr(KDPC * Dpc, PVOID DeferredContext, PVOID SystemArgument1, P // CurrentRequest = &g_LbrRequestState[CurrentCore]; + // + // Disable LBR on all cores from VMX-root mode by VMCALL + // + LbrStopLbr(CurrentRequest, TRUE, TRUE); + // // Check if the initialization is being done for hypervisor environment or not // If it is, then we need to perform some additional steps to enable LBR in VMX @@ -108,11 +113,6 @@ DpcRoutineDisableLbr(KDPC * Dpc, PVOID DeferredContext, PVOID SystemArgument1, P g_Callbacks.VmFuncSetLoadDebugControlsVmcallOnTargetCore(FALSE); } - // - // Disable LBR on all cores from VMX-root mode by VMCALL - // - LbrStopLbr(CurrentRequest, TRUE, TRUE); - // // Wait for all DPCs to synchronize at this point //