Sync worktree updates into main repo folder
This commit is contained in:
parent
bc1a502c1d
commit
c4d2b5d9d1
21 changed files with 1565 additions and 347 deletions
|
|
@ -34,6 +34,12 @@ int usb_dfu_init(void);
|
|||
*/
|
||||
void usb_dfu_cleanup(void);
|
||||
|
||||
/*
|
||||
* Return the libusb_context created by usb_dfu_init(). Used by callers
|
||||
* that need to pass the explicit context to libusb event-handling APIs.
|
||||
*/
|
||||
libusb_context *usb_dfu_ctx(void);
|
||||
|
||||
/*
|
||||
* Find an Apple device in DFU mode (VID=0x05AC, PID=0x1227).
|
||||
* On success, *handle is set to an opened device handle and 0 is
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#define MAX_EXPLOIT_TRIES 3
|
||||
#define STAGE_DELAY_USEC 10000 /* 10 ms */
|
||||
#define USB_RECONNECT_DELAY_USEC 2000000 /* 2 s: wait for device reset between retries */
|
||||
#define USB_RECONNECT_DELAY_USEC 8000000 /* 8 s: device reboot after exploit */
|
||||
#define STALL_TIMEOUT_MS 1 /* 1 ms async stall */
|
||||
#define USB_TIMEOUT_MS 5000
|
||||
|
||||
|
|
@ -205,6 +205,44 @@ int usb_ctrl_transfer_async_ret(libusb_device_handle *dev,
|
|||
uint16_t wLength,
|
||||
unsigned int timeout_ms);
|
||||
|
||||
/*
|
||||
* Raw control transfer helpers for exploit timing-critical requests.
|
||||
* Unlike util/usb_helpers.c these do not retry PIPE/STALL responses,
|
||||
* because those responses are part of checkm8's signaling path.
|
||||
*/
|
||||
int usb_ctrl_transfer_raw(libusb_device_handle *dev,
|
||||
uint8_t bmRequestType,
|
||||
uint8_t bRequest,
|
||||
uint16_t wValue,
|
||||
uint16_t wIndex,
|
||||
unsigned char *data,
|
||||
uint16_t wLength,
|
||||
unsigned int timeout_ms);
|
||||
|
||||
int usb_ctrl_transfer_no_data_raw(libusb_device_handle *dev,
|
||||
uint8_t bmRequestType,
|
||||
uint8_t bRequest,
|
||||
uint16_t wValue,
|
||||
uint16_t wIndex,
|
||||
unsigned int timeout_ms);
|
||||
|
||||
/*
|
||||
* usb_ctrl_transfer_dnload_abort -- Async DFU_DNLOAD with proper cancel.
|
||||
*
|
||||
* Used only by checkm8_stage_setup (stage 2) to trigger the UAF.
|
||||
* Submits an async transfer, waits abort_ms, then calls cancel_transfer.
|
||||
* The transfer has a 200ms hard timeout so it always completes cleanly.
|
||||
* Returns 0 if aborted (UAF condition), >0 if STATUS received first, -1 on error.
|
||||
*/
|
||||
int usb_ctrl_transfer_dnload_abort(libusb_device_handle *dev,
|
||||
uint8_t bmRequestType,
|
||||
uint8_t bRequest,
|
||||
uint16_t wValue,
|
||||
uint16_t wIndex,
|
||||
unsigned char *data,
|
||||
uint16_t wLength,
|
||||
unsigned int abort_ms);
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Spray helpers (checkm8_spray.c) */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ typedef struct {
|
|||
int phase; /* EXPLOIT_PHASE_* */
|
||||
uint8_t *payload_buf;
|
||||
size_t payload_len;
|
||||
int skip_clrstatus; /* 1 = DFU already in dfuIDLE, skip CLR_STATUS in stage 3 */
|
||||
} exploit_ctx_t;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue