summaryrefslogtreecommitdiffstats
path: root/src/limera1n.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-06-23 14:00:10 +0200
committerGravatar Nikias Bassen2025-06-23 14:00:10 +0200
commit8061f08b4e0a8f0ab5d1548b7e9978f3cc8647a2 (patch)
tree5e01ac6e10a00c065dc5edf80adbd2ee4ce273e3 /src/limera1n.c
parenta5905b7f905fc3cc83033ebd963f0dcba071e512 (diff)
downloadidevicerestore-8061f08b4e0a8f0ab5d1548b7e9978f3cc8647a2.tar.gz
idevicerestore-8061f08b4e0a8f0ab5d1548b7e9978f3cc8647a2.tar.bz2
Refactor logging and add logfile support
idevicerestore will now also create a logfile automatically, unless disabled with --logfile=NONE.
Diffstat (limited to 'src/limera1n.c')
-rw-r--r--src/limera1n.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/limera1n.c b/src/limera1n.c
index da4a7d5..f205287 100644
--- a/src/limera1n.c
+++ b/src/limera1n.c
@@ -78,7 +78,7 @@ int limera1n_exploit(struct irecv_device *device, irecv_client_t *pclient)
stack_address = 0x84033F98;
shellcode_address = 0x84023001;
} else {
- error("Unsupported ChipID 0x%04x. Can't exploit with limera1n.\n", device->chip_id);
+ logger(LL_ERROR, "Unsupported ChipID 0x%04x. Can't exploit with limera1n.\n", device->chip_id);
return -1;
}
@@ -87,10 +87,10 @@ int limera1n_exploit(struct irecv_device *device, irecv_client_t *pclient)
irecv_client_t client = *pclient;
- debug("Resetting device counters\n");
+ logger(LL_DEBUG, "Resetting device counters\n");
err = irecv_reset_counters(client);
if (err != IRECV_E_SUCCESS) {
- error("%s\n", irecv_strerror(err));
+ logger(LL_ERROR, "%s\n", irecv_strerror(err));
return -1;
}
@@ -103,7 +103,7 @@ int limera1n_exploit(struct irecv_device *device, irecv_client_t *pclient)
heap[3] = stack_address;
}
- debug("Sending chunk headers\n");
+ logger(LL_DEBUG, "Sending chunk headers\n");
irecv_usb_control_transfer(client, 0x21, 1, 0, 0, buf, 0x800, 1000);
memset(buf, 0xCC, 0x800);
@@ -111,32 +111,32 @@ int limera1n_exploit(struct irecv_device *device, irecv_client_t *pclient)
irecv_usb_control_transfer(client, 0x21, 1, 0, 0, buf, 0x800, 1000);
}
- debug("Sending exploit payload\n");
+ logger(LL_DEBUG, "Sending exploit payload\n");
irecv_usb_control_transfer(client, 0x21, 1, 0, 0, shellcode, 0x800, 1000);
- debug("Sending fake data\n");
+ logger(LL_DEBUG, "Sending fake data\n");
memset(buf, 0xBB, 0x800);
irecv_usb_control_transfer(client, 0xA1, 1, 0, 0, buf, 0x800, 1000);
irecv_usb_control_transfer(client, 0x21, 1, 0, 0, buf, 0x800, 10);
- //debug("Executing exploit\n");
+ //logger(LL_DEBUG, "Executing exploit\n");
irecv_usb_control_transfer(client, 0x21, 2, 0, 0, buf, 0, 1000);
irecv_reset(client);
irecv_finish_transfer(client);
- debug("Exploit sent\n");
+ logger(LL_DEBUG, "Exploit sent\n");
- debug("Reconnecting to device\n");
+ logger(LL_DEBUG, "Reconnecting to device\n");
*pclient = irecv_reconnect(client, 7);
if (*pclient == NULL) {
- error("Unable to reconnect\n");
+ logger(LL_ERROR, "Unable to reconnect\n");
return -1;
}
irecv_get_mode((*pclient), &mode);
if (mode != IRECV_K_DFU_MODE) {
- error("Device reconnected in non-DFU mode\n");
+ logger(LL_ERROR, "Device reconnected in non-DFU mode\n");
return -1;
}