From f8fa7a86c10d1b8879d09736c4d95689c53fcaa8 Mon Sep 17 00:00:00 2001 From: ufm42 <220887183+ufm42@users.noreply.github.com> Date: Tue, 30 Jun 2026 18:53:18 +0400 Subject: [PATCH] Add 7.20 support (#30) * Add 7.20 support * Update readme * update hv_stack range * oops --- README.md | 2 +- include/offsets.h | 1 + source/hv_defeat_0607.c | 2 +- source/offsets.c | 42 +++++++++++++++++++++++++++++++++++++++++ source/utils.c | 3 +++ 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e545ce6..50379f5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Features: - **4.00**, **4.02**, **4.03**, **4.50**, **4.51** with M.2 support - **5.00**, **5.02**, **5.10**, **5.50** with M.2 support - **6.00**, **6.02** with M.2 support -- **7.61** with M.2 support +- **7.20**, **7.61** with M.2 support Support for 1.xx and 2.xx firmwares may be added in the future, but we will not prioritize this effort. diff --git a/include/offsets.h b/include/offsets.h index 8a2998f..606286c 100644 --- a/include/offsets.h +++ b/include/offsets.h @@ -67,6 +67,7 @@ extern offset_list off_0510; extern offset_list off_0550; extern offset_list off_0600; extern offset_list off_0602; +extern offset_list off_0720; extern offset_list off_0761; #endif diff --git a/source/hv_defeat_0607.c b/source/hv_defeat_0607.c index b0cc523..a32170b 100644 --- a/source/hv_defeat_0607.c +++ b/source/hv_defeat_0607.c @@ -29,7 +29,7 @@ static void setidt(int idx, uintptr_t func, int typ, int dpl, int ist) { } static uint64_t get_hv_stack(void) { - if (fw == 0x0761) { + if (fw >= 0x0720 && fw < 0x0800) { return 0x628ec000; } return -1; diff --git a/source/offsets.c b/source/offsets.c index 52765fb..1f73a1b 100644 --- a/source/offsets.c +++ b/source/offsets.c @@ -466,6 +466,48 @@ offset_list off_0602 = { .PS5_WIFI_FW_SIZE = 494536, }; +offset_list off_0720 = { + // .IOMMU_SOFTC not needed + // .VMSPACE_VM_VMID not needed + .VMSPACE_VM_PMAP = 0x1D8, + // .DATA_BASE_GVMSPACE not needed + .ACPIGBL_FACS = (0xffffffff83ac9c50 - KERNEL_TEXT), + .IDT = (0xffffffff83cdfdf0 - KERNEL_TEXT), + .COMMON_TSS = (0xffffffff83ce2ad0 - KERNEL_TEXT), + // .STOPPED_CPUS not needed + // .FUN_STOP_CPUS not needed + // .FUN_AS_LAPIC_EOI not needed + // .FUN_HV_UNMAP_PT_TMR not needed + .FUN_MEMCPY = (0xffffffff80493600 - KERNEL_TEXT), + .GAD_ADD_RSP_28_POP_RBP_RET = (0xffffffff80c435ff - KERNEL_TEXT), + .GAD_IRETQ = (0xffffffff809c52e8 - KERNEL_TEXT), + .GAD_POP_RAX_RET = (0xffffffff80e4c2d5 - KERNEL_TEXT), + .GAD_POP_RDI_RET = (0xffffffff80dfe38b - KERNEL_TEXT), + .GAD_POP_RSI_RET = (0xffffffff80dfdd9e - KERNEL_TEXT), + .GAD_POP_RDX_RET = (0xffffffff80a4fd38 - KERNEL_TEXT), + .GAD_POP_RCX_RET = (0xffffffff80e24def - KERNEL_TEXT), + .GAD_POP_RSP_RET = (0xffffffff80e2b4c0 - KERNEL_TEXT), + .GAD_WRMSR_RET = (0xffffffff80451d04 - KERNEL_TEXT), + // .GAD_MOV_QWORD_PTR_RDI_RSI_POP_RBP_RET not needed + // .HOOK_ACPI_WAKEUP_MACHDEP not needed + .KERNEL_CODE_CAVE = 0x500, + .FUN_PRINTF = (0xffffffff806cc830 - KERNEL_TEXT), + // .FUN_HV_IOMMU_SET_BUFFERS not needed + // .FUN_HV_IOMM_WAIT_COMPLETION not needed + .FUN_SMP_RENDEZVOUS = (0xffffffff80cb6100 - KERNEL_TEXT), + .FUN_SMP_NO_RENDEVOUS_BARRIER = (0xffffffff804c0820 - KERNEL_TEXT), + .HV_CODE_CAVE_PA = 0x62806F00, + .HV_HANDLE_VMEXIT_PA = 0x6283D800, + .KERNEL_UART_OVERRIDE = (0xffffffff822c33f8 - KERNEL_TEXT), + .KERNEL_CFI_CHECK = (0xffffffff806857a0 - KERNEL_TEXT), + .G_VBIOS = (0xffffffff83ef7a40 - KERNEL_TEXT), + .FUN_TRANSMITTER_CONTROL = (0xffffffff80dafcc0 - KERNEL_TEXT), + .FUN_MP3_INITIALIZE = (0xffffffff80bcba10 - KERNEL_TEXT), + .FUN_MP3_INVOKE = (0xffffffff80bca7d0 - KERNEL_TEXT), + .PS5_WIFI_FW_OFFSET = (0xffffffff81655700 - KERNEL_TEXT), + .PS5_WIFI_FW_SIZE = 497636, +}; + offset_list off_0761 = { // .IOMMU_SOFTC not needed // .VMSPACE_VM_VMID not needed diff --git a/source/utils.c b/source/utils.c index 4b1bfc8..88c3452 100644 --- a/source/utils.c +++ b/source/utils.c @@ -76,6 +76,9 @@ int set_offsets(void) { case 0x0602: env_offset = off_0602; break; + case 0x0720: + env_offset = off_0720; + break; case 0x0761: env_offset = off_0761; break;