summaryrefslogtreecommitdiffstats
path: root/src/irecovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-17 00:56:42 +0200
committerGravatar Nikias Bassen2012-07-17 00:56:42 +0200
commit6b1eb40e00b20c28da25731d18251aadc82ef583 (patch)
tree1462376e5118ae0aede4ec73845b33ed55ff6ba3 /src/irecovery.c
parent954c5504a03a061ff43ec6c5334f342bd919badd (diff)
downloadlibirecovery-6b1eb40e00b20c28da25731d18251aadc82ef583.tar.gz
libirecovery-6b1eb40e00b20c28da25731d18251aadc82ef583.tar.bz2
silenced a bunch of compiler warnings
Diffstat (limited to 'src/irecovery.c')
-rw-r--r--src/irecovery.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/irecovery.c b/src/irecovery.c
index 89f30a6..c4a698d 100644
--- a/src/irecovery.c
+++ b/src/irecovery.c
@@ -42,7 +42,7 @@ int progress_cb(irecv_client_t client, const irecv_event_t* event);
42int precommand_cb(irecv_client_t client, const irecv_event_t* event); 42int precommand_cb(irecv_client_t client, const irecv_event_t* event);
43int postcommand_cb(irecv_client_t client, const irecv_event_t* event); 43int postcommand_cb(irecv_client_t client, const irecv_event_t* event);
44 44
45void shell_usage() { 45static void shell_usage() {
46 printf("Usage:\n"); 46 printf("Usage:\n");
47 printf("\t/upload <file>\tSend file to client.\n"); 47 printf("\t/upload <file>\tSend file to client.\n");
48 printf("\t/exploit [file]\tSend usb exploit with optional payload\n"); 48 printf("\t/exploit [file]\tSend usb exploit with optional payload\n");
@@ -51,8 +51,8 @@ void shell_usage() {
51 printf("\t/exit\t\tExit interactive shell.\n"); 51 printf("\t/exit\t\tExit interactive shell.\n");
52} 52}
53 53
54void parse_command(irecv_client_t client, unsigned char* command, unsigned int size) { 54static void parse_command(irecv_client_t client, unsigned char* command, unsigned int size) {
55 char* cmd = strdup(command); 55 char* cmd = strdup((char*)command);
56 char* action = strtok(cmd, " "); 56 char* action = strtok(cmd, " ");
57 debug("Executing %s\n", action); 57 debug("Executing %s\n", action);
58 if (!strcmp(cmd, "/exit")) { 58 if (!strcmp(cmd, "/exit")) {
@@ -75,7 +75,7 @@ void parse_command(irecv_client_t client, unsigned char* command, unsigned int s
75 int ret; 75 int ret;
76 unsigned int cpid, bdid; 76 unsigned int cpid, bdid;
77 unsigned long long ecid; 77 unsigned long long ecid;
78 unsigned char srnm[12], imei[15], bt[15]; 78 char srnm[12], imei[15];
79 79
80 ret = irecv_get_cpid(client, &cpid); 80 ret = irecv_get_cpid(client, &cpid);
81 if(ret == IRECV_E_SUCCESS) { 81 if(ret == IRECV_E_SUCCESS) {
@@ -124,16 +124,16 @@ void parse_command(irecv_client_t client, unsigned char* command, unsigned int s
124 free(action); 124 free(action);
125} 125}
126 126
127void load_command_history() { 127static void load_command_history() {
128 read_history(FILE_HISTORY_PATH); 128 read_history(FILE_HISTORY_PATH);
129} 129}
130 130
131void append_command_to_history(char* cmd) { 131static void append_command_to_history(char* cmd) {
132 add_history(cmd); 132 add_history(cmd);
133 write_history(FILE_HISTORY_PATH); 133 write_history(FILE_HISTORY_PATH);
134} 134}
135 135
136void init_shell(irecv_client_t client) { 136static void init_shell(irecv_client_t client) {
137 irecv_error_t error = 0; 137 irecv_error_t error = 0;
138 load_command_history(); 138 load_command_history();
139 irecv_event_subscribe(client, IRECV_PROGRESS, &progress_cb, NULL); 139 irecv_event_subscribe(client, IRECV_PROGRESS, &progress_cb, NULL);
@@ -175,9 +175,8 @@ int received_cb(irecv_client_t client, const irecv_event_t* event) {
175 175
176int precommand_cb(irecv_client_t client, const irecv_event_t* event) { 176int precommand_cb(irecv_client_t client, const irecv_event_t* event) {
177 if (event->type == IRECV_PRECOMMAND) { 177 if (event->type == IRECV_PRECOMMAND) {
178 irecv_error_t error = 0;
179 if (event->data[0] == '/') { 178 if (event->data[0] == '/') {
180 parse_command(client, event->data, event->size); 179 parse_command(client, (unsigned char*)event->data, event->size);
181 return -1; 180 return -1;
182 } 181 }
183 } 182 }
@@ -248,7 +247,7 @@ void print_progress_bar(double progress) {
248 } 247 }
249} 248}
250 249
251void print_usage() { 250static void print_usage() {
252 printf("iRecovery - iDevice Recovery Utility\n"); 251 printf("iRecovery - iDevice Recovery Utility\n");
253 printf("Usage: irecovery [args]\n"); 252 printf("Usage: irecovery [args]\n");
254 printf("\t-i <ecid>\tTarget specific device by its hexadecimal ECID\n"); 253 printf("\t-i <ecid>\tTarget specific device by its hexadecimal ECID\n");