diff options
author | Nikias Bassen | 2017-01-06 01:35:53 +0100 |
---|---|---|
committer | Nikias Bassen | 2017-01-06 01:35:53 +0100 |
commit | c5a68dbf33adf5c949ebed10a706cf22ba53b1d4 (patch) | |
tree | 65cb28f1ed2b972beb19e8cf15700215bcc0f5d5 /tools | |
parent | f9ee735d6ef0b038e54076e3636f440cc77f19b1 (diff) | |
download | libirecovery-c5a68dbf33adf5c949ebed10a706cf22ba53b1d4.tar.gz libirecovery-c5a68dbf33adf5c949ebed10a706cf22ba53b1d4.tar.bz2 |
irecovery: Make /deviceinfo print ApNonce (NONC) and SEPNonce (SNON) if available
Diffstat (limited to 'tools')
-rw-r--r-- | tools/irecovery.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index 3628b03..58b93f3 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -119,6 +119,14 @@ static void buffer_read_from_filename(const char *filename, char **buffer, uint6 *length = size; } +static void print_hex(unsigned char *buf, size_t len) +{ + size_t i; + for (i = 0; i < len; i++) { + printf("%02x", buf[i]); + } +} + static void parse_command(irecv_client_t client, unsigned char* command, unsigned int size) { char* cmd = strdup((char*)command); char* action = strtok(cmd, " "); @@ -147,6 +155,20 @@ static void parse_command(irecv_client_t client, unsigned char* command, unsigne printf("IBFL: %02x\n", devinfo->ibfl); printf("SRNM: %s\n", (devinfo->srnm) ? devinfo->srnm : "N/A"); printf("IMEI: %s\n", (devinfo->imei) ? devinfo->imei : "N/A"); + printf("NONC: "); + if (devinfo->ap_nonce) { + print_hex(devinfo->ap_nonce, devinfo->ap_nonce_size); + } else { + printf("N/A"); + } + printf("\n"); + printf("SNON: "); + if (devinfo->sep_nonce) { + print_hex(devinfo->sep_nonce, devinfo->sep_nonce_size); + } else { + printf("N/A"); + } + printf("\n"); } else { printf("Could not get device info?!\n"); } |