diff options
| -rw-r--r-- | src/libirecovery.c | 15 | ||||
| -rw-r--r-- | tools/irecovery.c | 20 |
2 files changed, 15 insertions, 20 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 56294a6..f932684 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * libirecovery.c | 2 | * libirecovery.c |
| 3 | * Communication to iBoot/iBSS on Apple iOS devices via USB | 3 | * Communication to iBoot/iBSS on Apple iOS devices via USB |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2011-2019 Nikias Bassen <nikias@gmx.li> | 5 | * Copyright (c) 2011-2020 Nikias Bassen <nikias@gmx.li> |
| 6 | * Copyright (c) 2012-2015 Martin Szulecki <martin.szulecki@libimobiledevice.org> | 6 | * Copyright (c) 2012-2015 Martin Szulecki <martin.szulecki@libimobiledevice.org> |
| 7 | * Copyright (c) 2010 Chronic-Dev Team | 7 | * Copyright (c) 2010 Chronic-Dev Team |
| 8 | * Copyright (c) 2010 Joshua Hill | 8 | * Copyright (c) 2010 Joshua Hill |
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <stdint.h> | 27 | #include <stdint.h> |
| 28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
| 29 | #include <string.h> | 29 | #include <string.h> |
| 30 | #include <inttypes.h> | ||
| 30 | #include <ctype.h> | 31 | #include <ctype.h> |
| 31 | #include <unistd.h> | 32 | #include <unistd.h> |
| 32 | #include <sys/stat.h> | 33 | #include <sys/stat.h> |
| @@ -45,14 +46,10 @@ | |||
| 45 | #include <IOKit/IOCFPlugIn.h> | 46 | #include <IOKit/IOCFPlugIn.h> |
| 46 | #include <pthread.h> | 47 | #include <pthread.h> |
| 47 | #endif | 48 | #endif |
| 48 | #define _FMT_qX "%qX" | ||
| 49 | #define _FMT_016llx "%016llx" | ||
| 50 | #else | 49 | #else |
| 51 | #define WIN32_LEAN_AND_MEAN | 50 | #define WIN32_LEAN_AND_MEAN |
| 52 | #include <windows.h> | 51 | #include <windows.h> |
| 53 | #include <setupapi.h> | 52 | #include <setupapi.h> |
| 54 | #define _FMT_qX "%I64X" | ||
| 55 | #define _FMT_016llx "%016I64x" | ||
| 56 | #ifndef sleep | 53 | #ifndef sleep |
| 57 | #define sleep(n) Sleep(1000 * n) | 54 | #define sleep(n) Sleep(1000 * n) |
| 58 | #endif | 55 | #endif |
| @@ -509,7 +506,7 @@ static void irecv_load_device_info_from_iboot_string(irecv_client_t client, cons | |||
| 509 | 506 | ||
| 510 | ptr = strstr(iboot_string, "ECID:"); | 507 | ptr = strstr(iboot_string, "ECID:"); |
| 511 | if (ptr != NULL) { | 508 | if (ptr != NULL) { |
| 512 | sscanf(ptr, "ECID:" _FMT_qX, &client->device_info.ecid); | 509 | sscanf(ptr, "ECID:%" SCNx64, &client->device_info.ecid); |
| 513 | } | 510 | } |
| 514 | 511 | ||
| 515 | ptr = strstr(iboot_string, "IBFL:"); | 512 | ptr = strstr(iboot_string, "IBFL:"); |
| @@ -739,7 +736,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 739 | mobiledevice_closepipes(_client); | 736 | mobiledevice_closepipes(_client); |
| 740 | continue; | 737 | continue; |
| 741 | } | 738 | } |
| 742 | debug("found device with ECID " _FMT_016llx "\n", (unsigned long long)ecid); | 739 | debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); |
| 743 | } | 740 | } |
| 744 | found = 1; | 741 | found = 1; |
| 745 | break; | 742 | break; |
| @@ -821,7 +818,7 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec | |||
| 821 | mobiledevice_closepipes(_client); | 818 | mobiledevice_closepipes(_client); |
| 822 | continue; | 819 | continue; |
| 823 | } | 820 | } |
| 824 | debug("found device with ECID " _FMT_016llx" \n", (unsigned long long)ecid); | 821 | debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); |
| 825 | } | 822 | } |
| 826 | found = 1; | 823 | found = 1; |
| 827 | break; | 824 | break; |
| @@ -1368,7 +1365,7 @@ IRECV_API irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned l | |||
| 1368 | irecv_close(client); | 1365 | irecv_close(client); |
| 1369 | continue; | 1366 | continue; |
| 1370 | } | 1367 | } |
| 1371 | debug("found device with ECID " _FMT_016llx "\n", (unsigned long long)ecid); | 1368 | debug("found device with ECID %016" PRIx64 "\n", (unsigned long long)ecid); |
| 1372 | } | 1369 | } |
| 1373 | 1370 | ||
| 1374 | error = irecv_usb_set_configuration(client, 1); | 1371 | error = irecv_usb_set_configuration(client, 1); |
diff --git a/tools/irecovery.c b/tools/irecovery.c index 6ee89b0..91d1d48 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * irecovery.c | 2 | * irecovery.c |
| 3 | * Software frontend for iBoot/iBSS communication with iOS devices | 3 | * Software frontend for iBoot/iBSS communication with iOS devices |
| 4 | * | 4 | * |
| 5 | * Copyright (c) 2012-2019 Nikias Bassen <nikias@gmx.li> | 5 | * Copyright (c) 2012-2020 Nikias Bassen <nikias@gmx.li> |
| 6 | * Copyright (c) 2012-2015 Martin Szulecki <martin.szulecki@libimobiledevice.org> | 6 | * Copyright (c) 2012-2015 Martin Szulecki <martin.szulecki@libimobiledevice.org> |
| 7 | * Copyright (c) 2010-2011 Chronic-Dev Team | 7 | * Copyright (c) 2010-2011 Chronic-Dev Team |
| 8 | * Copyright (c) 2010-2011 Joshua Hill | 8 | * Copyright (c) 2010-2011 Joshua Hill |
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
| 28 | #include <unistd.h> | 28 | #include <unistd.h> |
| 29 | #include <string.h> | 29 | #include <string.h> |
| 30 | #include <inttypes.h> | ||
| 30 | #include <libirecovery.h> | 31 | #include <libirecovery.h> |
| 31 | #include <readline/readline.h> | 32 | #include <readline/readline.h> |
| 32 | #include <readline/history.h> | 33 | #include <readline/history.h> |
| @@ -36,9 +37,6 @@ | |||
| 36 | #ifndef sleep | 37 | #ifndef sleep |
| 37 | #define sleep(n) Sleep(1000 * n) | 38 | #define sleep(n) Sleep(1000 * n) |
| 38 | #endif | 39 | #endif |
| 39 | #define _FMT_lld "%I64d" | ||
| 40 | #else | ||
| 41 | #define _FMT_lld "%lld" | ||
| 42 | #endif | 40 | #endif |
| 43 | 41 | ||
| 44 | #define FILE_HISTORY_PATH ".irecovery" | 42 | #define FILE_HISTORY_PATH ".irecovery" |
| @@ -134,13 +132,13 @@ static void print_device_info(irecv_client_t client) | |||
| 134 | int ret, mode; | 132 | int ret, mode; |
| 135 | const struct irecv_device_info *devinfo = irecv_get_device_info(client); | 133 | const struct irecv_device_info *devinfo = irecv_get_device_info(client); |
| 136 | if (devinfo) { | 134 | if (devinfo) { |
| 137 | printf("CPID: %04x\n", devinfo->cpid); | 135 | printf("CPID: 0x%04x\n", devinfo->cpid); |
| 138 | printf("CPRV: %02x\n", devinfo->cprv); | 136 | printf("CPRV: 0x%02x\n", devinfo->cprv); |
| 139 | printf("BDID: %02x\n", devinfo->bdid); | 137 | printf("BDID: 0x%02x\n", devinfo->bdid); |
| 140 | printf("ECID: " _FMT_lld "\n", devinfo->ecid); | 138 | printf("ECID: 0x%016" PRIx64 "\n", devinfo->ecid); |
| 141 | printf("CPFM: %02x\n", devinfo->cpfm); | 139 | printf("CPFM: 0x%02x\n", devinfo->cpfm); |
| 142 | printf("SCEP: %02x\n", devinfo->scep); | 140 | printf("SCEP: 0x%02x\n", devinfo->scep); |
| 143 | printf("IBFL: %02x\n", devinfo->ibfl); | 141 | printf("IBFL: 0x%02x\n", devinfo->ibfl); |
| 144 | printf("SRTG: %s\n", (devinfo->srtg) ? devinfo->srtg : "N/A"); | 142 | printf("SRTG: %s\n", (devinfo->srtg) ? devinfo->srtg : "N/A"); |
| 145 | printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); | 143 | printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); |
| 146 | printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); | 144 | printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); |
