Commit graph

13 commits

Author SHA1 Message Date
Moussa Ouallaf
03d352d7f5 fix(dfu): read iSerial index at runtime; honor --cpid/--ecid overrides
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
2026-07-17 03:04:22 +02:00
Moussa Ouallaf
e7e22fc0cc fix(chip-db): correct device labels and add integrity canary 2026-07-17 02:45:59 +02:00
Moussa Ouallaf
9bd1a75b2d build(deps): fix pkg-config skew, libusb include, libplist/libirecovery drift
Sync PKGCONFIG_DEPS with Makefile (add libcurl); normalize
<libusb.h> include across 6 files; add compat shims for libplist
2.2/2.3 and libirecovery IRECV_SEND_OPT_DFU_NOTIFY_FINISH; add
pacman/zypper/apk installer branches; drop bogus info->pid read
in path_b_identity.c in favor of irecv_get_mode(). Extend the
mock libirecovery to expose irecv_get_mode() so the mock test
build keeps passing against the new call site. Add Makefile
compile canaries that emit -DTP_PLIST_HAS_MEM_FREE,
-DTP_PLIST_HAS_FMT_ARG, and -DTP_IRECV_HAS_NOTIFY_FINISH plus a
.build-flags diagnostic file consumed by tr4mpass doctor.

Files modified:
- Makefile
- start.sh
- start-helpers.sh
- include/compat/plist_compat.h (new)
- include/compat/libirecovery_compat.h (new)
- include/util/usb_helpers.h
- include/util/plist_helpers.h
- include/exploit/dfu_proto.h
- include/device/device.h
- include/device/usb_dfu.h
- include/activation/activation.h
- include/activation/record.h
- src/bypass/path_b_identity.c
- src/bypass/path_b.c
- src/bypass/path_a_ramdisk.c
- src/activation/session_online.c
- tests/mocks/mock_irecv_sym.c
- .gitignore

Closes: #70, #74, #67, #54, #51, #44, #21, #55, #31, #24, #19
2026-07-17 02:43:53 +02:00
Moussa Ouallaf
54c0ad652c fix(chip-db): rebuild chip_db_table*.h from gaster canonical + strict canary
Rewrite the .name / .marketing fields and banner comments in
include/device/chip_db_table.h and chip_db_table_rop.h from gaster's
canonical SecureROM SRTG -> offset table (gaster.c:519-808), so the
CLI announces the physical chip that is actually plugged in. Each
row carries a "gaster.c:NNN" comment marker traceable to the source
of truth. Offsets, CPIDs and struct layout are unchanged.

Relabels: 0x8947 (was "A7 / iPhone 5s", now S5L8947 = A5 Rev B /
Apple TV 3rd gen rev A); 0x8950 / 0x8955 (were "A5-class Apple TV",
now A6 / A6X); 0x8960 (was "A10 / iPhone 7", now A7 / iPhone 5s);
0x8002 (was "S3 / Watch Series 3", now S1P/S2/T1 covering Watch
Series 1/2 and MacBook Pro Touch Bar T1); 0x8004 GPS+Cellular
qualifier dropped; 0x8000 / 0x8003 A9 Samsung/TSMC labels swapped
to match APL0898 / APL1022; 0x8010 / 0x8011 marketing broadened to
cover the full ship list.

Add tests/chip_db_canary.c, wired as a build-time prerequisite of
tr4mpass via the new Makefile .chip-db-canary target. The probe
walks a golden expected (cpid, name-substr, marketing-substr,
checkm8) table and fails the build on drift, defeating a repeat of
issue #53. STRICT_CHIP_DB=1 by default; make STRICT_CHIP_DB=0
bypasses the probe for distro-package chip-table update races
(T5 "Chip-DB canary strictness" note).

Files modified:
- include/device/chip_db_table.h
- include/device/chip_db_table_rop.h
- Makefile
- .gitignore
- tests/chip_db_canary.c (new)

Closes: #53
2026-07-17 02:30:38 +02:00
tr4m0ryp
5b758931ac fix: USB re-enum on retry, Path B iRecovery rewrite, DFU diagnostic, tests
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>
2026-04-18 16:24:49 +02:00
tr4m0ryp
a810516aff 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>
2026-04-05 03:52:27 +02:00
tr4m0ryp
4e6f7b70ee fix(device): Correct chip naming, CPID classification, and header guards
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>
2026-04-05 03:28:45 +02:00
tr4m0ryp
412a2718d4 chore: Remove .gitkeep files from populated directories
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>
2026-04-05 02:58:42 +02:00
tr4m0ryp
e2f936d6b7 feat(device): Replace chip_db placeholders with real gaster offsets
Complete chip offset table from gaster source for 16 BootROM variants
(A9 through A11/M2). Includes all memory addresses, ROP gadgets, heap
spray params, and callback overwrite offsets. Extended chip_info_t with
full exploit configuration fields. Split table into chip_db_table.h.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 02:41:06 +02:00
tr4m0ryp
0cfd30464e Task 004: Device module (extended from research_icloud0)
Extended device_info_t with CPID, ECID, MEID, chip name, checkm8
vulnerability flag, cellular detection, and DFU mode awareness.
Integrates chip_db_lookup for automatic chip identification.

Files created:
- include/device/device.h
- src/device/device.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:58:29 +02:00
tr4m0ryp
45c814ee74 Task 005: USB DFU module (libusb device detection and I/O)
Implemented DFU mode device detection via libusb, serial string
parsing for CPID/ECID extraction, and raw USB send/recv for
DFU DNLOAD/UPLOAD operations.

Files created:
- include/device/usb_dfu.h
- src/device/usb_dfu.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:58:25 +02:00
tr4m0ryp
85caaefa9c Task 003: Chip database (CPID lookup table)
Static lookup table mapping Apple CPIDs (A7-A17) to chip names,
checkm8 vulnerability status, and exploit memory offsets. Covers
19 chip variants from iPhone 5s through iPhone 15 Pro.

Files created:
- include/device/chip_db.h
- src/device/chip_db.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:54:34 +02:00
tr4m0ryp
7d3fe3935d Task 001: Project scaffolding
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>
2026-04-05 01:52:23 +02:00