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) <noreply@anthropic.com>
This commit is contained in:
tr4m0ryp 2026-04-05 03:52:27 +02:00
parent a15cdc0abd
commit a810516aff
2 changed files with 15 additions and 8 deletions

View file

@ -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)