summaryrefslogtreecommitdiffstats
path: root/tools/irecovery.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-01-06 01:35:53 +0100
committerGravatar Nikias Bassen2017-01-06 01:35:53 +0100
commitc5a68dbf33adf5c949ebed10a706cf22ba53b1d4 (patch)
tree65cb28f1ed2b972beb19e8cf15700215bcc0f5d5 /tools/irecovery.c
parentf9ee735d6ef0b038e54076e3636f440cc77f19b1 (diff)
downloadlibirecovery-c5a68dbf33adf5c949ebed10a706cf22ba53b1d4.tar.gz
libirecovery-c5a68dbf33adf5c949ebed10a706cf22ba53b1d4.tar.bz2
irecovery: Make /deviceinfo print ApNonce (NONC) and SEPNonce (SNON) if available
Diffstat (limited to 'tools/irecovery.c')
-rw-r--r--tools/irecovery.c22
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");
}