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)