Files
vphone-cli/research
zqxwceandClaude Opus 4.8 9becab4031 cfw: Fix iOS 27 DDI (/System/Developer) auto-mount
Productionize the 3-part fix that makes `pymobiledevice3 mounter auto-mount`
land the personalized DDI at /System/Developer on the iOS-27-userland /
26.4-vphone600-kernel (c0ecdb4b) JB hybrid.

- KernelJBPatchDiskImages2.swift (new; wired into KernelJBPatcher.findAll):
  DiskImages2 ABI acceptance. GATE1/GATE2b NOP the CreateDevice/Connect
  cmp#9/b.ne ABI-version rejects (kernel driver v9 vs iOS-27 controller/daemon
  v11). GATE2 widens the RegisterNotificationPort backing array + both
  bound-check field loads (all-or-nothing) to clear the `type < getMaxPorts`
  off-by-one that otherwise fails the attach ("Can't register notification
  port").
- KernelJBPatchSandboxExtended: retarget mac_policy_ops[124]
  (mpo_proc_check_syscall_unix) to the allow stub so MobileStorageMounter's
  mount_apfs can make the mount(2) syscall (unix 167) — else the kernel
  Sandbox denies it ("Protobox: mount_apfs deny(1) syscall-unix 167").
- cfw_patch_diskimagesiod.py + cfw.py + cfw_install.sh (gated to 27.*):
  force -[DIDiskArb isMountCompleteWithExpectedCount:diskTracker:] -> YES so
  MobileStorageMounter's waitForDAMount returns and it performs the real
  nobrowse mount.

GATE2a anchor fix (the critical one): Capstone on this toolchain decodes the
AllocPortsArray size-shift lsl-immediate (a UBFM alias) as 2 operands, not the
xd,xn,#imm 3-operand shape. The original 3-operand + imm==3 match found 0, so
the all-or-nothing silently skipped GATE2 on every build (only manual dd pokes
ever worked). Now matched on mnemonic + destination x1 — the unique
size-writing lsl in AllocPortsArray; the replacement is a fixed mov x1,#0x4000
so the shift amount is irrelevant. Verified from a clean build on c0ecdb4b via
`patch-component --component kernel-jb --records-out`: all five di2 records
emit (createdevice, connect, allocports_size, notif_boundcheck_d8/e8), and
`pmd3 mounter auto-mount` -> rc=0 with the DDI mounted, no poke.

Documented in research/0_binary_patch_comparison.md (JB-09, JB-28, CFW
binary-patch #13).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_013pk5tsoBeuu3jhkmnRFtic
2026-07-20 16:20:34 +03:00
..