From c5a68dbf33adf5c949ebed10a706cf22ba53b1d4 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 6 Jan 2017 01:35:53 +0100 Subject: irecovery: Make /deviceinfo print ApNonce (NONC) and SEPNonce (SNON) if available --- tools/irecovery.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tools') 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"); } -- cgit v1.1-32-gdbae