From 5f9abb0263ef4f3b4eb4ac920d27d7b9c06436f0 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 4 Nov 2020 08:24:17 +0100 Subject: [PATCH] fix #1048 - add LTO dump type 0002 --- client/src/cmdhflto.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhflto.c b/client/src/cmdhflto.c index c452cc0a5..ab79423a4 100644 --- a/client/src/cmdhflto.c +++ b/client/src/cmdhflto.c @@ -198,10 +198,12 @@ static const char *lto_print_size(uint8_t ti) { switch (ti) { case 1: return "101 blocks / 3232 bytes"; + case 2: + return "95 blocks / 3040 bytes"; case 3: return "255 blocks / 8160 bytes"; default : - return ""; + return "unknown"; } } @@ -222,6 +224,9 @@ int infoLTO(bool verbose) { PrintAndLogEx(SUCCESS, "UID......... " _YELLOW_("%s"), sprint_hex_inrow(serial_number, sizeof(serial_number))); PrintAndLogEx(SUCCESS, "Type info... " _YELLOW_("%s"), sprint_hex_inrow(type_info, sizeof(type_info))); PrintAndLogEx(SUCCESS, "Memory...... " _YELLOW_("%s"), lto_print_size(type_info[1])); + if (type_info[1] > 3) { + PrintAndLogEx(INFO, "Unknown LTO tag, report to @iceman!"); + } } return ret_val; @@ -464,10 +469,13 @@ int dumpLTO(uint8_t *dump, bool verbose) { return ret_val; } // 0003 == 255 blocks x 32 = 8160 bytes + // 0002 == 95 blocks x 32 = 3040 bytes // 0001 == 101 blocks x 32 = 3232 bytes uint8_t blocks = 0xFF; if (type_info[1] == 0x01) { blocks = 0x65; + } else if (type_info[1] == 0x02) { + blocks = 0x5F; } PrintAndLogEx(SUCCESS, "Found LTO tag w " _YELLOW_("%s") " memory", lto_print_size(type_info[1]));