iOS 27 kernelcache RE: SEP dispatch map, AMFI diff, Ghidra workflow.
iOS 27 kernelcache reverse engineering — firmware diffing, AMFI/SEP RE, and Linux-native tooling (arm64/arm64e)
Research-grade, documentation-first project. Binary diff of iOS 27.0.1 (24A446) vs 27.2 beta (24B5089g) on iPhone14,5, reverse-engineering the AMFI and AppleSEPUserClient
IOUserClientdispatch surfaces, and a fully verified, reproducible Developer Mode enablement path through Apple's stock lockdown protocol — all done from Linux, no Mac, no Xcode.Flagship open lead: silent ASTC/DDS hardening in ImageIO with the delivery chain mapped — iMessage attachment → BlastDoor → IAKC container (first public documentation of the format) → mediaanalysisd → ASTC parser. See STATUS.md and research/intel/ma_decomp/VERDICT.md.
Project paused. The research device (iPhone 13) has been sold; all remaining work is static (firmware/binary analysis), which the repo tooling fully supports. The authoritative state summary lives in STATUS.md; the complete session-by-session journal in HANDOFF.md (31 sessions).
What was achieved while active:
rlebuf format-stringKernelcache (MH_FILESET, arm64e), kexts, sandbox profiles, entitlements — full reports in diff_output/. Methodology: normalized structural diffing with difflib.SequenceMatcher to separate logic changes from relocation noise, plus a "vtable + registry membership" reachability shortcut.
selector 11 = armSecurityBootMode; dev-mode flag analysis (AMFI only reads the flag — ACM is the source of truth via command 0x25)IOExternalMethodDispatch2022 tables, 124 selectors, chained-fixup format (ARM64E) documented in HANDOFF.mdThe iOS Developer Mode chain can be driven entirely through com.apple.amfi.lockdown with pymobiledevice3 on Linux — no jailbreak, no IPA, no entitlement forging. Verified persistent at kernel level (mounter query-developer-mode-status → true, DDI mounted at /System/Developer) across an independent reboot. Full protocol and honesty log: FINDINGS_LOCK.md.
Prerequisite: remove the passcode (Settings → Face ID & Passcode → Turn Off Passcode).
# 1) enable → action=1 → REBOOT #1
python3 -m pymobiledevice3 amfi enable-developer-mode
# 2) after boot: post-restart accept → action=2 → REBOOT #2
# (CLI has no separate accept command — use poc/verify_now2.py)
# 3) reveal the Settings toggle → action=0
python3 -m pymobiledevice3 amfi reveal-developer-mode
# Verify (kernel-level, independent of the AMFI service):
python3 -m pymobiledevice3 mounter query-developer-mode-status # → true
python3 -m pymobiledevice3 mounter list # IsMounted: true
| action | Meaning | Effect |
|---|---|---|
0 | reveal | Shows the Developer Mode toggle in Settings |
1 | enable | Sets the flag, reboots the device |
2 | accept | Post-restart confirmation, reboots again |
⚠️
pymobiledevice3short-circuits when the status is alreadytrue. The two reboots are part of Apple's protocol, not incidental.
poc/build_ipa.sh produces a signed .ipa on CachyOS/Arch using clang + ld64.lld + ldid — zero Apple/Xcode dependencies. Two steps per architecture slice (avoids the clang driver swallowing -arch/-platform_version when delegating to ld64.lld). Auto-detects toolchain, graceful arm64e → arm64 fallback.
sudo pacman -S clang lld zip && yay -S ldid
mkdir -p poc/SDK
git clone https://github.com/theos/sdks poc/tmp && mv poc/tmp/iPhoneOS*.sdk poc/SDK/iPhoneOS.sdk
cd poc && IOS_SDK=/path/to/iPhoneOS.sdk ./build_ipa.sh # → EnableAMFIDevMode.ipa
| Variable | Default | Description |
|---|---|---|
CLANG | auto-detect | Path to clang binary |
IOS_SDK | auto-detect | Path to iPhoneOS.sdk |
LD64 | auto-detect | Path to ld64.lld linker |
LDID | auto-detect | Path to ldid (skipped if absent → unsigned) |
MINIOS | 16.0 | Minimum iOS deployment target |
SDKVER | auto-detect | SDK version for -platform_version |
Note: the PoC's IOKit path (
AppleMobileFileIntegrityselector 11) requires the platform-restricted entitlementcom.apple.private.amfi.developer-mode-control— a non-Apple-signed binary is refused by the userclient. The supported way to enable Developer Mode is the lockdown protocol above.run_dvt.shautomates the alternative CoreDevice/RSD-tunnel deploy path (build works; on-device deploy WIP — see HANDOFF Session 12).
| Thread | Result | Details |
|---|---|---|
| AMFI Developer Mode (lockdown protocol) | ✅ Verified working | Persistent across reboot; FINDINGS_LOCK.md |
| AMFI dev-mode flag internals | ✅ Documented | AMFI only reads; ACM is source of truth (cmd 0x25) |
| AMFI DER-entitlement patch | ✅ Documented | Beta closes the DER-omission hole |
| AppleSEPUserClient dispatch map | ✅ Documented | 19 tables / 124 selectors; data/sep_full_table.csv |
| CVE-2025-43520 TOCTOU hypothesis | ❌ Closed — false | Session 15: key addresses misidentified heuristically |
| GPSCopy OOB write (ImageIO) | ❌ Closed — unreachable | Real bug, silently patched, but zero callers in shipped userland |
| SpringBoard SBIconStateArchiver | ❌ Closed — robustness fix | New code written defensively; not type confusion |
| ImageIO ASTC/DDS hardening | 🔶 OPEN — flagship | Delivery chain mapped 2026-11-04: iMessage attachment → BlastDoor → IAKC container (first public documentation of the format) → mediaanalysisd → ASTC parser; zero-click iMessage candidate. Severity HIGH, conditional CRITICAL pending behavioral confirmation |
| CVE-2026-113915 race framework (MediaAnalysis) | 🔶 OPEN — new lead 2026-11-04 | TOCTOU windows mapped statically (audit-token check vs analysis-read, index-paired sandboxTokens); decompiles in research/intel/ma_decomp/race_*.c |
rlebuf format-string lead | 🔶 OPEN — unlocalized | See WRITEUP Session 25 |
Details in WRITEUP.md.