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>
50 lines
1.8 KiB
C
50 lines
1.8 KiB
C
/*
|
|
* path_b.h -- Path B bypass module for A12+ devices.
|
|
*
|
|
* Chains: DFU identity manipulation -> signal detection ->
|
|
* drmHandshake session activation -> deletescript cleanup -> verify.
|
|
* Does NOT use a BootROM exploit -- works through identity
|
|
* manipulation and the session-mode activation protocol.
|
|
*/
|
|
|
|
#ifndef PATH_B_H
|
|
#define PATH_B_H
|
|
|
|
#include "bypass/bypass.h"
|
|
|
|
/* The Path B bypass module for registration with bypass_register(). */
|
|
extern const bypass_module_t path_b_module;
|
|
|
|
/*
|
|
* path_b_manipulate_identity -- Modify device serial descriptors in DFU.
|
|
* Appends PWND:[checkm8] marker to the device serial string via USB
|
|
* control transfers to the DFU interface. Required before session
|
|
* activation on A12+ devices.
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int path_b_manipulate_identity(device_info_t *dev);
|
|
|
|
/*
|
|
* path_b_read_serial -- Read current serial descriptor from DFU mode.
|
|
* Copies the serial string into buf (up to len bytes including NUL).
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int path_b_read_serial(device_info_t *dev, char *buf, size_t len);
|
|
|
|
/*
|
|
* path_b_write_serial -- Write a modified serial descriptor to the device.
|
|
* Routes through path_b_write_serial_irecovery() which uses libirecovery
|
|
* setenv commands from recovery mode (SET_DESCRIPTOR is rejected by A12+ BootROM).
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int path_b_write_serial(device_info_t *dev, const char *new_serial);
|
|
|
|
/*
|
|
* path_b_write_serial_irecovery -- Write serial via iRecovery setenv in recovery mode.
|
|
* Device must already be in recovery mode (PID 0x1281) before calling.
|
|
* Used internally by path_b.c step_manipulate_identity().
|
|
* Returns 0 on success, -1 on error.
|
|
*/
|
|
int path_b_write_serial_irecovery(device_info_t *dev, const char *new_serial);
|
|
|
|
#endif /* PATH_B_H */
|