Retire the three hardcoded DFU_SERIAL_INDEX = 3 constants in
usb_dfu.c, path_b_identity.c, and checkm8_internal.h. usb_dfu_find()
now captures bDeviceDescriptor.iSerialNumber into device_info_t and
usb_dfu_read_info() iterates hint -> 3 -> 4 with the sentinel check
deferred until every probe has returned only the product string. The
checkm8 spray helpers accept the resolved index as a parameter, and
the CLI override log fires whenever --cpid/--ecid populated a field
the descriptor read could not, so A14/A15/A16 devices no longer
strand users on the false NOT-in-SecureROM-DFU diagnostic.
Files modified:
- include/device/device.h
- include/device/usb_dfu.h
- include/exploit/checkm8_internal.h
- src/bypass/path_b_identity.c
- src/device/usb_dfu.c
- src/exploit/checkm8.c
- src/exploit/checkm8_spray.c
- src/main.c
- tests/mocks/mock_hw_stubs.c
Closes: #45, #65, #59, #27, #17, #52, #30, #22, #25, #10, #8, #6, #7
Path A (checkm8):
- Re-enumerate USB handle between exploit retries; prior code reused the
stale handle after the device reset on a failed attempt, causing
LIBUSB_ERROR_NO_DEVICE on attempts 2 and 3
- Add USB_RECONNECT_DELAY_USEC (2 s) constant; allocate exploit_ctx_t
fresh per attempt so cleanup is symmetric with init
Path B (A12+ bypass):
- Replace broken SET_DESCRIPTOR serial write with libirecovery setenv;
Apple A12+ BootROM always STALLs SET_DESCRIPTOR (LIBUSB_ERROR_PIPE)
- Add step_reboot_to_recovery(): DFU_ABORT -> poll for PID 0x1281
- Add step_reboot_to_normal(): irecv reboot -> poll idevice_get_device_list
- step_session_handshake() now runs after normal-mode reconnect so
dev->handle is valid; previously called with NULL handle (DFU mode)
- Expand path_b_execute() from 9 to 10 steps
Device / DFU:
- usb_dfu_read_info(): emit specific diagnostic when serial is the bare
Apple DFU string (CPID=0); includes per-model button-sequence guidance
start.sh:
- DFU branch: derive support status from binary output instead of
hardcoding SUPPORTED; gate_support() now reachable from DFU path
- parse_device_info(): guard against empty output (binary crash / no
lockdownd); print actionable advice, set DEV_STATUS=UNSUPPORTED
- WSL: detect missing usbipd and print passthrough guidance after first
poll timeout
- Arch Linux: replace exit-1 with AUR install instructions
Tests / build:
- Add tests/test_sections.c: DFU serial parsing, chip DB lookup,
bypass probe logic, retry/reconnect constants (26 tests, no hardware)
- Add `make test` target; test build excludes USB/lockdown modules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Setup stage and spray stall loops now bail after MAX_SETUP_RETRIES
(50) and MAX_STALL_RETRIES (100) attempts respectively, preventing
infinite hangs on unresponsive devices.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
Swapped EXPLOIT_PHASE_SETUP/SPRAY to match gaster execution order.
Aligned version to 0.2.0 in both tr4mpass.h and start.sh. Log now
checks isatty(stderr) before emitting ANSI colors. Makefile warns
when pkg-config cannot find required libraries.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Corrected setup stage padding logic to properly handle
config_overwrite_pad without 8-bit truncation. Fixed spray
large_leak wIndex and no_leak hole creation to match gaster's
exact USB transfer sequences.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Renamed S5L8950/S5L8955 from "A9" to correct A5-class names, moved
them to ARMV7 macro, renamed CPID_IS_A9_CLASS to CPID_IS_LEGACY_64,
disambiguated duplicate A10 entries, and fixed cross-file header guard.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All directories now contain actual source files, making the
placeholder .gitkeep files unnecessary.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updated exploit stages with actual USB transfer sequences from gaster.
Added real callback overwrite structures, magic constants, and heap
spray logic (both large_leak and no-leak paths). Replaced shellcode
placeholders with actual ARM64 and ARMv7 bytes from ipwndfu binary.
Payload assembly now builds correct per-chip header structs using
the full chip_db offset table.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implemented DFU protocol operations (DNLOAD, UPLOAD, GETSTATUS,
CLRSTATUS, GETSTATE, ABORT) with proper byte ordering for status
parsing. Foundation for checkm8 exploit delivery.
Files created:
- include/exploit/dfu_proto.h
- src/exploit/dfu_proto.c
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Created directory structure, Makefile, and itr4m.h top-level header.
Build system auto-discovers src/**/*.c via find, uses pkg-config for
library dependencies. Handles missing deps gracefully.
Files created:
- Makefile
- include/itr4m.h
- .gitkeep files in all subdirectories
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>