From a810516aff056b3aea8b11d08cf32e74c058c5dc Mon Sep 17 00:00:00 2001 From: tr4m0ryp Date: Sun, 5 Apr 2026 03:52:27 +0200 Subject: [PATCH] fix(device): Correct A7 (0x8947) chip classification from gaster Updated CPID 0x8947 entry based on gaster reference implementation to use correct payload path and offset values. Co-Authored-By: Claude Opus 4.6 (1M context) --- include/device/chip_db_table.h | 2 ++ include/exploit/checkm8_internal.h | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/device/chip_db_table.h b/include/device/chip_db_table.h index 8b681fb..7051ee1 100644 --- a/include/device/chip_db_table.h +++ b/include/device/chip_db_table.h @@ -20,6 +20,8 @@ static const chip_info_t g_chip_table[] = { /* CPID 0x8947 -- A7, iPhone 5s / iPad Air */ /* gaster: iBoot-1458.2 */ + /* A7 is Apple's first ARM64 SoC, but gaster's checkm8 path uses */ + /* payload_dest_armv7 / notA9_armv7 header -- treat as ARMv7 here. */ { .cpid = 0x8947, .name = "A7", diff --git a/include/exploit/checkm8_internal.h b/include/exploit/checkm8_internal.h index a79819e..3d4f4b6 100644 --- a/include/exploit/checkm8_internal.h +++ b/include/exploit/checkm8_internal.h @@ -47,20 +47,25 @@ /* CPID classification helpers */ /* ------------------------------------------------------------------ */ -/* ARMv7 32-bit chips (payload_dest_armv7 != 0) */ +/* + * CPID_IS_ARMV7 -- 32-bit ARMv7 chips (payload_dest_armv7 != 0). + * 0x8947 (A7, iPhone 5s) is included here: despite being Apple's first + * ARM64 SoC, gaster's DFU exploit path uses payload_dest_armv7 and the + * notA9_armv7 payload header for this chip, identical to the other + * 32-bit chips. It is NOT in the notA9 ARM64 branch in gaster. + */ #define CPID_IS_ARMV7(cpid) \ - ((cpid) == 0x7002 || (cpid) == 0x8002 || (cpid) == 0x8004 || \ - (cpid) == 0x8950 || (cpid) == 0x8955) + ((cpid) == 0x8947 || (cpid) == 0x7002 || (cpid) == 0x8002 || \ + (cpid) == 0x8004 || (cpid) == 0x8950 || (cpid) == 0x8955) /* * CPID_IS_LEGACY_64 -- ARM64 chips that use payload_hdr_a9_t (the simpler - * 64-bit header without ROP gadgets or tlbi). This groups A7 (0x8947) with - * the A9-family (0x8000, 0x8003) which share the same header layout. - * Note: 0x8950 and 0x8955 are 32-bit ARMv7 chips; they belong in - * CPID_IS_ARMV7, not here. + * 64-bit header without ROP gadgets or tlbi). Previously this included + * 0x8947 (A7), but gaster treats A7 as ARMv7 (payload_dest_armv7 path), + * so this macro is currently unused; kept for future use. */ #define CPID_IS_LEGACY_64(cpid) \ - ((cpid) == 0x8947) + (0) /* Chips with ROP gadgets (tlbi != 0 means newer overwrite path) */ #define CPID_HAS_TLBI(chip) ((chip)->tlbi != 0)