Merge pull request #2764 from tiagotriques/master

Remove duplicated block print in verbose mode in hf mf view
This commit is contained in:
Iceman 2025-02-22 16:20:55 +01:00 committed by GitHub
commit 4bf000c0a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -326,19 +326,19 @@ static void mf_print_block(uint8_t blockno, uint8_t *d, bool verbose) {
} }
} else { } else {
int32_t value = 0;
if (verbose && mfc_value(d, &value)) {
PrintAndLogEx(INFO, "%s| %3d | " _CYAN_("%s") " %"PRIi32, secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE), value);
}
if (blockno >= MIFARE_1K_MAXBLOCK) { if (blockno >= MIFARE_1K_MAXBLOCK) {
// MFC Ev1 signature blocks. // MFC Ev1 signature blocks.
PrintAndLogEx(INFO, _BACK_BLUE_("%s| %3d | %s"), secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE)); PrintAndLogEx(INFO, _BACK_BLUE_("%s| %3d | %s"), secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE));
} else {
int32_t value = 0;
if (verbose && mfc_value(d, &value)) {
PrintAndLogEx(INFO, "%s| %3d | " _CYAN_("%s") " %"PRIi32, secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE), value);
} else { } else {
PrintAndLogEx(INFO, "%s| %3d | %s", secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE)); PrintAndLogEx(INFO, "%s| %3d | %s", secstr, blockno, sprint_hex_ascii(d, MFBLOCK_SIZE));
} }
} }
} }
}
static void mf_print_blocks(uint16_t n, uint8_t *d, bool verbose) { static void mf_print_blocks(uint16_t n, uint8_t *d, bool verbose) {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");