diff --git a/CHANGELOG.md b/CHANGELOG.md index ced8f823c7..717908287d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Changed `hf mf info` - Better handling when printing ATS (@iceman1001) - Changed to also try the MFC_B key when extracting memory (@iceman1001) - Fix parallel `make -j check` Thanks @elboulangero (@iceman1001) - Added support for 8268/8310 (@douniwan5788) diff --git a/client/src/cmdhfcryptorf.c b/client/src/cmdhfcryptorf.c index 8f765ed661..88d66f4027 100644 --- a/client/src/cmdhfcryptorf.c +++ b/client/src/cmdhfcryptorf.c @@ -126,7 +126,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) { } // retry if (retry <= 0) { - PrintAndLogEx(FAILED, "command execution timeout"); + PrintAndLogEx(FAILED, "command execution time out"); } return false; @@ -145,7 +145,7 @@ static int infoHFCryptoRF(bool verbose) { PacketResponseNG resp; if (WaitForResponseTimeout(CMD_HF_ISO14443B_COMMAND, &resp, TIMEOUT) == false) { if (verbose) { - PrintAndLogEx(WARNING, "command execution timeout"); + PrintAndLogEx(WARNING, "command execution time out"); } switch_off_field_cryptorf(); return false; diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 1439a9145f..38614e432a 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -7555,9 +7555,9 @@ static int CmdHF14AMfWipe(const char *Cmd) { char *fptr; if (keyfnlen == 0) { fptr = GenerateFilename("hf-mf-", "-key.bin"); - if (fptr == NULL) + if (fptr == NULL) { return PM3_ESOFT; - + } strncpy(keyFilename, fptr, sizeof(keyFilename) - 1); free(fptr); } @@ -7585,7 +7585,7 @@ static int CmdHF14AMfWipe(const char *Cmd) { } case (MIFARE_1K_EV1_MAX_KEY_SIZE): { PrintAndLogEx(INFO, "Loaded keys matching MIFARE Classic 1K Ev1"); - memcpy(keyA, keys, MIFARE_1K_EV1_MAXSECTOR * MIFARE_KEY_SIZE); + memcpy(keyA, keys, (MIFARE_1K_EV1_MAXSECTOR * MIFARE_KEY_SIZE)); memcpy(keyB, keys + (MIFARE_1K_EV1_MAXSECTOR * MIFARE_KEY_SIZE), (MIFARE_1K_EV1_MAXSECTOR * MIFARE_KEY_SIZE)); num_sectors = NumOfSectors('1'); memcpy(mf, "\x11\x22\x33\x44\x44\x08\x04\x00\x62\x63\x64\x65\x66\x67\x68\x69", MFBLOCK_SIZE); @@ -7863,14 +7863,27 @@ static int parse_gtu_cfg(uint8_t *d, size_t n) { break; } - PrintAndLogEx(INFO, "..............%02X unknown", d[7]); + uint8_t atslen = d[7]; + if (atslen == 0) { + PrintAndLogEx(INFO, "..............%02X ATS length %u bytes ( %s )", _YELLOW_("zero"), atslen); + } else if (atslen <= 16) { + PrintAndLogEx(INFO, "..............%02X ATS length %u bytes ( %s )", _GREEN_("ok"), atslen); + } else { + PrintAndLogEx(INFO, "..............%02X ATS length %u bytes ( %s )", _RED_("fail"), atslen); + atslen = 0; + } + PrintAndLogEx(INFO, ""); // ATS seems to have 16 bytes reserved PrintAndLogEx(INFO, _CYAN_("Config 2 - ATS")); PrintAndLogEx(INFO, "%s", sprint_hex_inrow(d + 8, 16)); + if (atslen <= 16) { PrintAndLogEx(INFO, "%s.............. ATS ( %d bytes )", sprint_hex_inrow(&d[8], d[7]), d[7]); PrintAndLogEx(INFO, "..................%s Reserved for ATS", sprint_hex_inrow(d + 8 + d[7], 16 - d[7])); + } else { + PrintAndLogEx(INFO, "%s.............. %s Reserved for ATS", sprint_hex_inrow(&d[8], 16), 16); + } PrintAndLogEx(INFO, ""); PrintAndLogEx(INFO, _CYAN_("Config 3 - Limits"));