mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
fix(m8): exit early when pongo cmd is boot
there was a bug in the function where after sending `bootx` it will just wait in the while loop, I assume we dont care about the bootx command output so we're just gonna exit early..
This commit is contained in:
1 parent
32d3abb40c
commit
372531f6ca
3 files changed
+7
-7
No files matched your search
+2
-2
@@ -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;
|
||||
|
||||
+2
-1
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user