From 706dd94b55f7892fb5b3250d2b29c395d60f368c Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Tue, 26 May 2026 20:21:57 +0800 Subject: [PATCH] ensure shared t700{0,1} length at least 0xaa4 --- src/helper/hook_arm64.c | 6 +++++- src/helper/hook_x86_64.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/helper/hook_arm64.c b/src/helper/hook_arm64.c index abe13b5..f84b126 100644 --- a/src/helper/hook_arm64.c +++ b/src/helper/hook_arm64.c @@ -51,7 +51,11 @@ void setup_hooks_arm64(void *stream) assert(vm_protect(mach_task_self(), page, 0x4000, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY) == 0); - patch(t7000_patch_base, t7000_bin, t7000_bin_len); + uint32_t t7000_shared_len = 0xaa4; // shared with T7001 + if (t7000_bin_len > t7000_shared_len) + t7000_shared_len = t7000_bin_len; + + patch(t7000_patch_base, t7000_bin, t7000_shared_len); patch(t8011_patch_base, t8011_bin, t8011_bin_len); patch(t8012_patch_base, t8012_bin, t8012_bin_len); diff --git a/src/helper/hook_x86_64.c b/src/helper/hook_x86_64.c index 86323c0..f8ef954 100644 --- a/src/helper/hook_x86_64.c +++ b/src/helper/hook_x86_64.c @@ -57,7 +57,11 @@ void setup_hooks_x86_64(void *stream) assert(vm_protect(mach_task_self(), page, 0x1000, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY) == 0); - patch(t7000_patch_base, t7000_bin, t7000_bin_len); + uint32_t t7000_shared_len = 0xaa4; // shared with T7001 + if (t7000_bin_len > t7000_shared_len) + t7000_shared_len = t7000_bin_len; + + patch(t7000_patch_base, t7000_bin, t7000_shared_len); patch(t8011_patch_base, t8011_bin, t8011_bin_len); patch(t8012_patch_base, t8012_bin, t8012_bin_len);