summaryrefslogtreecommitdiffstats
path: root/src/irecovery.c
diff options
context:
space:
mode:
authorGravatar Joshua Hill2010-05-24 16:28:06 -0400
committerGravatar Joshua Hill2010-05-24 16:28:06 -0400
commit8482031ce77cb4914b5a04ba4704484cc6548dcd (patch)
treebce41a307f1470521f7c9168e1778881b805d1e4 /src/irecovery.c
parent473ad5b0a574e03c68baa31dcfc4a3024ce131a7 (diff)
downloadlibirecovery-8482031ce77cb4914b5a04ba4704484cc6548dcd.tar.gz
libirecovery-8482031ce77cb4914b5a04ba4704484cc6548dcd.tar.bz2
Added irecv_send_exploit function to libirecovery.c and added -k flag in irecovery.c to trigger it.
Diffstat (limited to 'src/irecovery.c')
-rw-r--r--src/irecovery.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/irecovery.c b/src/irecovery.c
index 7150f90..98b1e90 100644
--- a/src/irecovery.c
+++ b/src/irecovery.c
@@ -27,7 +27,7 @@
#define debug(...) if(verbose) fprintf(stderr, __VA_ARGS__)
enum {
- kResetDevice, kStartShell, kSendCommand, kSendFile
+ kResetDevice, kStartShell, kSendCommand, kSendFile, kSendExploit
};
static unsigned int quit = 0;
@@ -146,9 +146,9 @@ void print_usage() {
printf("iRecovery - iDevice Recovery Utility\n");
printf("Usage: ./irecovery [args]\n");
printf("\t-v\t\tStart irecovery in verbose mode.\n");
- printf("\t-u <uuid>\ttarget specific client by its 40-digit client UUID\n");
printf("\t-c <cmd>\tSend command to client.\n");
printf("\t-f <file>\tSend file to client.\n");
+ printf("\t-k [exploit]\tSend usb exploit to client.\n");
printf("\t-h\t\tShow this help.\n");
printf("\t-r\t\tReset client.\n");
printf("\t-s\t\tStart interactive shell.\n");
@@ -162,7 +162,7 @@ int main(int argc, char** argv) {
char* argument = NULL;
irecv_error_t error = 0;
if(argc == 1) print_usage();
- while ((opt = getopt(argc, argv, "vhrsc:f:")) > 0) {
+ while ((opt = getopt(argc, argv, "vhrsc:f:k::")) > 0) {
switch (opt) {
case 'v':
verbose += 1;
@@ -190,6 +190,11 @@ int main(int argc, char** argv) {
argument = optarg;
break;
+ case 'k':
+ action = kSendExploit;
+ argument = optarg;
+ break;
+
default:
fprintf(stderr, "Unknown argument\n");
return -1;
@@ -225,6 +230,18 @@ int main(int argc, char** argv) {
debug("%s\n", irecv_strerror(error));
break;
+ case kSendExploit:
+ if(argument != NULL) {
+ error = irecv_send_file(client, argument);
+ if(error != IRECV_E_SUCCESS) {
+ debug("%s\n", irecv_strerror(error));
+ break;
+ }
+ }
+ error = irecv_send_exploit(client);
+ debug("%s\n", irecv_strerror(error));
+ break;
+
case kStartShell:
init_shell(client);
break;