diff --git a/src/m8/checkm8.c b/src/m8/checkm8.c index b5d9c05..97f96da 100644 --- a/src/m8/checkm8.c +++ b/src/m8/checkm8.c @@ -154,11 +154,11 @@ bool checkm8_stage_spray(const usb_handle_t *handle, struct DeviceConfiguration bool checkm8_stage_patch(const usb_handle_t *handle, struct DeviceConfiguration *deviceConfig, struct PayloadConfiguration *payloadConfig) { size_t i, data_sz, packet_sz; - uint8_t *data; + void *data; transfer_ret_t transfer_ret; bool ret = false; - void* checkra1n_payload = NULL; + const uint8_t *checkra1n_payload = NULL; void *overwrite = NULL; size_t checkra1n_payload_sz = 0; size_t overwrite_sz = 0; diff --git a/src/m8/run.c b/src/m8/run.c index 0ea870a..d734225 100644 --- a/src/m8/run.c +++ b/src/m8/run.c @@ -71,6 +71,7 @@ static void *exploit_thread(void *arg) while (!atomic_load(&s->stop)) { if (!wait_usb_handle(&handle)) { + if (atomic_load(&s->stop)) break; reset_usb_handle(&handle); continue; } @@ -166,7 +167,7 @@ static void *pongo_thread(void *arg) continue; } - if (seen) continue; + if (seen) break; seen = true; LOG_SUCCESS("Detected PongoOS device"); diff --git a/src/usb/pongo_helper.c b/src/usb/pongo_helper.c index 066fece..c990b77 100644 --- a/src/usb/pongo_helper.c +++ b/src/usb/pongo_helper.c @@ -102,6 +102,9 @@ int issue_pongo_command(const usb_handle_t *handle, const char *command) { if (!send_interface_control_request(handle, 0x21, 4, 1, 0, NULL, 0, &tx_status)) return -1; if (!send_interface_control_request(handle, 0x21, 3, 0, 0, command_buf, len, &tx_status)) return -1; + + // return early if the command is boot, we dont care about results + if (strncmp(command,"boot",4) == 0) return 0; } fetch_output: while (in_progress) { @@ -121,10 +124,6 @@ int issue_pongo_command(const usb_handle_t *handle, const char *command) { } bad: if (tx_status.ret != USB_TRANSFER_OK) { - if (command != NULL && strncmp(command,"boot",4) == 0) { - return 0; - } - LOG_ERROR("Pongo USB error: %d", tx_status.ret); return -1; }