mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-09 17:19:26 +00:00
minor refactor and modify changelog
This commit is contained in:
parent
1337980ec3
commit
fba6f66e1a
4 changed files with 47 additions and 47 deletions
|
|
@ -8,10 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
New release of the HyperDbg Debugger.
|
||||
|
||||
### Added
|
||||
-
|
||||
- Hypertrace now works with HyperDbg VMM ([link](https://github.com/HyperDbg/HyperDbg/pull/568))
|
||||
|
||||
### Changed
|
||||
-
|
||||
- Fix the problem of getting the PML1 entry of the target address on Intel Core Ultra processors (#567) ([link](https://github.com/HyperDbg/HyperDbg/issues/567))
|
||||
|
||||
## [0.18.0.0] - 2026-02-16
|
||||
New release of the HyperDbg Debugger.
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@
|
|||
*/
|
||||
#include "pch.h"
|
||||
|
||||
/**
|
||||
* @brief Check whether EPT features are present or not
|
||||
*
|
||||
* @return BOOLEAN Shows whether EPT is supported in this machine or not
|
||||
*/
|
||||
/**
|
||||
* @brief Check whether EPT features are present or not
|
||||
*
|
||||
* @return BOOLEAN Shows whether EPT is supported in this machine or not
|
||||
*/
|
||||
BOOLEAN
|
||||
EptCheckFeatures(VOID)
|
||||
{
|
||||
|
|
@ -196,7 +196,7 @@ EptBuildMtrrMap(VOID)
|
|||
// address ranges from C0000H to FFFFFH. This range is divided into sixty-four 4-KByte sub-ranges, 8 ranges per
|
||||
// register.
|
||||
//
|
||||
if (MTRRCap.FixedRangeSupported && MTRRDefType.FixedRangeMtrrEnable)
|
||||
if (MTRRCap.FixedRangeSupported && MTRRDefType.FixedRangeMtrrEnable)
|
||||
{
|
||||
const UINT32 K64Base = 0x0;
|
||||
const UINT32 K64Size = 0x10000;
|
||||
|
|
@ -306,7 +306,7 @@ EptGetSplitPml1VaByPml2Entry(_In_ PVMM_EPT_PAGE_TABLE EptPageTable, _In_ PEPT_PM
|
|||
{
|
||||
LIST_FOR_EACH_LINK(EptPageTable->DynamicSplitList, VMM_EPT_DYNAMIC_SPLIT, DynamicSplitList, CurrentSplit)
|
||||
{
|
||||
if (CurrentSplit->u.Entry == TargetEntry)
|
||||
if (CurrentSplit->Fields.Entry == TargetEntry)
|
||||
{
|
||||
return &CurrentSplit->PML1[0];
|
||||
}
|
||||
|
|
@ -325,9 +325,9 @@ EptGetSplitPml1VaByPml2Entry(_In_ PVMM_EPT_PAGE_TABLE EptPageTable, _In_ PEPT_PM
|
|||
PEPT_PML1_ENTRY
|
||||
EptGetPml1Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress)
|
||||
{
|
||||
SIZE_T Directory, DirectoryPointer, PML4Entry;
|
||||
PEPT_PML2_ENTRY PML2;
|
||||
PEPT_PML1_ENTRY PML1;
|
||||
SIZE_T Directory, DirectoryPointer, PML4Entry;
|
||||
PEPT_PML2_ENTRY PML2;
|
||||
PEPT_PML1_ENTRY PML1;
|
||||
|
||||
Directory = ADDRMASK_EPT_PML2_INDEX(PhysicalAddress);
|
||||
DirectoryPointer = ADDRMASK_EPT_PML3_INDEX(PhysicalAddress);
|
||||
|
|
@ -352,7 +352,7 @@ EptGetPml1Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress)
|
|||
}
|
||||
|
||||
//
|
||||
// Resolve the split PML1 VA that was recorded during EptSplitLargePage.
|
||||
// Resolve the split PML1 VA that was recorded during EptSplitLargePage
|
||||
//
|
||||
PML1 = EptGetSplitPml1VaByPml2Entry(EptPageTable, PML2);
|
||||
|
||||
|
|
@ -382,9 +382,9 @@ EptGetPml1Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress)
|
|||
PVOID
|
||||
EptGetPml1OrPml2Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress, BOOLEAN * IsLargePage)
|
||||
{
|
||||
SIZE_T Directory, DirectoryPointer, PML4Entry;
|
||||
PEPT_PML2_ENTRY PML2;
|
||||
PEPT_PML1_ENTRY PML1;
|
||||
SIZE_T Directory, DirectoryPointer, PML4Entry;
|
||||
PEPT_PML2_ENTRY PML2;
|
||||
PEPT_PML1_ENTRY PML1;
|
||||
|
||||
Directory = ADDRMASK_EPT_PML2_INDEX(PhysicalAddress);
|
||||
DirectoryPointer = ADDRMASK_EPT_PML3_INDEX(PhysicalAddress);
|
||||
|
|
@ -410,7 +410,7 @@ EptGetPml1OrPml2Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress,
|
|||
}
|
||||
|
||||
//
|
||||
// Resolve the split PML1 VA that was recorded during EptSplitLargePage.
|
||||
// Resolve the split PML1 VA that was recorded during EptSplitLargePage
|
||||
//
|
||||
PML1 = EptGetSplitPml1VaByPml2Entry(EptPageTable, PML2);
|
||||
|
||||
|
|
@ -468,8 +468,8 @@ EptGetPml2Entry(PVMM_EPT_PAGE_TABLE EptPageTable, SIZE_T PhysicalAddress)
|
|||
*/
|
||||
BOOLEAN
|
||||
EptSplitLargePage(PVMM_EPT_PAGE_TABLE EptPageTable,
|
||||
BOOLEAN UsePreAllocatedBuffer,
|
||||
SIZE_T PhysicalAddress)
|
||||
BOOLEAN UsePreAllocatedBuffer,
|
||||
SIZE_T PhysicalAddress)
|
||||
{
|
||||
PVMM_EPT_DYNAMIC_SPLIT NewSplit;
|
||||
EPT_PML1_ENTRY EntryTemplate;
|
||||
|
|
@ -520,7 +520,7 @@ EptSplitLargePage(PVMM_EPT_PAGE_TABLE EptPageTable,
|
|||
// Point back to the entry in the dynamic split for easy reference for which entry that
|
||||
// dynamic split is for
|
||||
//
|
||||
NewSplit->u.Entry = TargetEntry;
|
||||
NewSplit->Fields.Entry = TargetEntry;
|
||||
|
||||
//
|
||||
// Make a template for RWX
|
||||
|
|
@ -595,7 +595,7 @@ EptSplitLargePage(PVMM_EPT_PAGE_TABLE EptPageTable,
|
|||
|
||||
//
|
||||
// Track the split so we can directly resolve PML1 VA from PML2 entry
|
||||
// without any PA->VA reverse translation.
|
||||
// without any PA->VA reverse translation
|
||||
//
|
||||
InsertHeadList(&EptPageTable->DynamicSplitList, &(NewSplit->DynamicSplitList));
|
||||
|
||||
|
|
@ -621,9 +621,9 @@ EptIsValidForLargePage(SIZE_T PageFrameNumber)
|
|||
CurrentMemoryRange = &g_EptState->MemoryRanges[CurrentMtrrRange];
|
||||
|
||||
if ((StartAddressOfPage <= CurrentMemoryRange->PhysicalEndAddress &&
|
||||
EndAddressOfPage > CurrentMemoryRange->PhysicalEndAddress) ||
|
||||
EndAddressOfPage > CurrentMemoryRange->PhysicalEndAddress) ||
|
||||
(StartAddressOfPage < CurrentMemoryRange->PhysicalBaseAddress &&
|
||||
EndAddressOfPage >= CurrentMemoryRange->PhysicalBaseAddress))
|
||||
EndAddressOfPage >= CurrentMemoryRange->PhysicalBaseAddress))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -793,8 +793,8 @@ EptAllocateAndCreateIdentityPageTable(VOID)
|
|||
// The first 512GB is used for the main system memory and the rest is reserved for MMIO
|
||||
//
|
||||
PageTable->PML3_RSVD[i][j].PageFrameNumber = (SIZE_512_GB + // First 512GB is used for system memory
|
||||
(i * SIZE_512_GB) + (j * SIZE_1_GB)) >> // MMIO ranges
|
||||
30; // Convert to page frame number
|
||||
(i * SIZE_512_GB) + (j * SIZE_1_GB)) >> // MMIO ranges
|
||||
30; // Convert to page frame number
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -937,8 +937,8 @@ EptLogicalProcessorInitialize(VOID)
|
|||
_Use_decl_annotations_
|
||||
BOOLEAN
|
||||
EptHandlePageHookExit(VIRTUAL_MACHINE_STATE * VCpu,
|
||||
VMX_EXIT_QUALIFICATION_EPT_VIOLATION ViolationQualification,
|
||||
UINT64 GuestPhysicalAddr)
|
||||
VMX_EXIT_QUALIFICATION_EPT_VIOLATION ViolationQualification,
|
||||
UINT64 GuestPhysicalAddr)
|
||||
{
|
||||
PVOID TargetPage;
|
||||
UINT64 CurrentRip;
|
||||
|
|
@ -974,12 +974,12 @@ EptHandlePageHookExit(VIRTUAL_MACHINE_STATE * VCpu,
|
|||
if (GuestPhysicalAddr >= HookedEntry->StartOfTargetPhysicalAddress && GuestPhysicalAddr <= HookedEntry->EndOfTargetPhysicalAddress)
|
||||
{
|
||||
ResultOfHandlingHook = EptHookHandleHookedPage(VCpu,
|
||||
HookedEntry,
|
||||
ViolationQualification,
|
||||
GuestPhysicalAddr,
|
||||
&HookedEntry->LastContextState,
|
||||
&IgnoreReadOrWriteOrExec,
|
||||
&IsExecViolation);
|
||||
HookedEntry,
|
||||
ViolationQualification,
|
||||
GuestPhysicalAddr,
|
||||
&HookedEntry->LastContextState,
|
||||
&IgnoreReadOrWriteOrExec,
|
||||
&IsExecViolation);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1008,9 +1008,9 @@ EptHandlePageHookExit(VIRTUAL_MACHINE_STATE * VCpu,
|
|||
// Restore to its original entry for one instruction
|
||||
//
|
||||
EptSetPML1AndInvalidateTLB(VCpu,
|
||||
TargetPage,
|
||||
HookedEntry->OriginalEntry,
|
||||
InveptSingleContext);
|
||||
TargetPage,
|
||||
HookedEntry->OriginalEntry,
|
||||
InveptSingleContext);
|
||||
|
||||
//
|
||||
// Next we have to save the current hooked entry to restore on the next instruction's vm-exit
|
||||
|
|
@ -1147,7 +1147,7 @@ EptHandleMisconfiguration(VOID)
|
|||
LogInfo("EPT Misconfiguration!");
|
||||
|
||||
LogError("Err, a field in the EPT paging structure was invalid, faulting guest address : 0x%llx",
|
||||
GuestPhysicalAddr);
|
||||
GuestPhysicalAddr);
|
||||
|
||||
//
|
||||
// We can't continue now.
|
||||
|
|
@ -1168,9 +1168,9 @@ EptHandleMisconfiguration(VOID)
|
|||
_Use_decl_annotations_
|
||||
VOID
|
||||
EptSetPML1AndInvalidateTLB(VIRTUAL_MACHINE_STATE * VCpu,
|
||||
PEPT_PML1_ENTRY EntryAddress,
|
||||
EPT_PML1_ENTRY EntryValue,
|
||||
INVEPT_TYPE InvalidationType)
|
||||
PEPT_PML1_ENTRY EntryAddress,
|
||||
EPT_PML1_ENTRY EntryValue,
|
||||
INVEPT_TYPE InvalidationType)
|
||||
{
|
||||
//
|
||||
// set the value
|
||||
|
|
@ -1248,9 +1248,9 @@ EptCheckAndHandleEptHookBreakpoints(VIRTUAL_MACHINE_STATE * VCpu, UINT64 GuestRi
|
|||
// Restore to its original entry for one instruction
|
||||
//
|
||||
EptSetPML1AndInvalidateTLB(VCpu,
|
||||
TargetPage,
|
||||
HookedEntry->OriginalEntry,
|
||||
InveptSingleContext);
|
||||
TargetPage,
|
||||
HookedEntry->OriginalEntry,
|
||||
InveptSingleContext);
|
||||
|
||||
//
|
||||
// Next we have to save the current hooked entry to restore on the next instruction's vm-exit
|
||||
|
|
|
|||
|
|
@ -134,8 +134,8 @@ typedef struct _VMM_EPT_PAGE_TABLE
|
|||
|
||||
/**
|
||||
* @brief Tracks dynamic 2MB->4KB splits for this EPT table.
|
||||
* @details Each item stores a direct VA to the split PML1 page and the
|
||||
* corresponding PML2 entry it services.
|
||||
* NOTE: Each item stores a direct VA to the split PML1 page and the corresponding PML2 entry it services.
|
||||
*
|
||||
*/
|
||||
LIST_ENTRY DynamicSplitList;
|
||||
|
||||
|
|
|
|||
|
|
@ -147,14 +147,14 @@ typedef struct _VMM_EPT_DYNAMIC_SPLIT
|
|||
EPT_PML1_ENTRY PML1[VMM_EPT_PML1E_COUNT];
|
||||
|
||||
/**
|
||||
* @brief The pointer to the 2MB entry in the page table which this split is servicing.
|
||||
* @brief The pointer to the 2MB entry in the page table which this split is servicing
|
||||
*
|
||||
*/
|
||||
union
|
||||
{
|
||||
PEPT_PML2_ENTRY Entry;
|
||||
PEPT_PML2_POINTER Pointer;
|
||||
} u;
|
||||
} Fields;
|
||||
|
||||
/**
|
||||
* @brief Linked list entries for each dynamic split
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue