Closed Shadowairing closed 1 year ago
Hi, are you calling MmGetPhysicalAddress() from root-mode?
here is the code
void test_pte() {
PVOID addr = allocate_contignous_memory
NTSTATUS driver_entry(PDRIVER_OBJECT const driver, PUNICODE_STRING) { DbgPrint("[hv] Driver loaded.\n");
if (driver) driver->DriverUnload = driver_unload;
if (!hv::start()) { DbgPrint("[hv] Failed to virtualize system.\n"); return STATUS_HV_OPERATION_FAILED; }
if (ping() == hv::hypervisor_signature) DbgPrint("[client] Hypervisor signature matches.\n"); else DbgPrint("[client] Failed to ping hypervisor!\n");
test_pte(); return STATUS_SUCCESS; }
You can't call get_ept_pte() from non-root mode, since get_ept_pte() internally reads physical memory using the host page tables (host_physical_memory_base). Make your function into a hypercall, and do your stuff there.
thank you so much, I will try that later
When I use get_ept_pte(), it causes a BSOD which "system thread exception not handled".
I use "physical_address = MmGetPhysicalAddress((PVOID)addr).QuadPart & 0xFFFFFFFFFFFFF000" to find the physical_address page.
When I use "ept_pte* pte = get_ept_pte(ept, physical_address, true);", it can return a non-zero pointer.
But when I access any member of pte, such as "pte->execute_access", it causes BSOD.