text and style

This commit is contained in:
iceman1001 2025-06-11 21:41:19 +02:00
commit 2ca43e0e2d
4 changed files with 19 additions and 17 deletions

View file

@ -1918,11 +1918,10 @@ int detect_nxp_card(uint8_t sak, uint16_t atqa, uint64_t select_status,
if ((sak & 0x10) == 0x10) { // SAK b2=0 b4=0 b5=1 if ((sak & 0x10) == 0x10) { // SAK b2=0 b4=0 b5=1
if ((sak & 0x01) == 0x01) { // SAK b2=0 b4=0 b5=1 b1=1, SAK=0x11 // if ((sak & 0x01) == 0x01) { // SAK b2=0 b4=0 b5=1 b1=1, SAK=0x11
// } else { // SAK b2=0 b4=0 b5=1 b1=0, SAK=0x10
// }
type |= MTPLUS; type |= MTPLUS;
} else { // SAK b2=0 b4=0 b5=1 b1=0, SAK=0x10
type |= MTPLUS;
}
} else { // SAK b2=0 b4=0 b5=0 } else { // SAK b2=0 b4=0 b5=0
@ -2150,7 +2149,7 @@ static int detect_nxp_card_print(uint8_t sak, uint16_t atqa, uint64_t select_sta
if (lsize < 1024) { if (lsize < 1024) {
snprintf(size_str, sizeof(size_str), "%u - %uB", usize, lsize); snprintf(size_str, sizeof(size_str), "%u - %uB", usize, lsize);
} else { } else {
snprintf(size_str, sizeof(size_str), "%u - %uK", (usize / 1024), (lsize / 1024)); snprintf(size_str, sizeof(size_str), "%d - %dK", (usize / 1024), (lsize / 1024));
} }
} else { } else {
@ -2159,7 +2158,7 @@ static int detect_nxp_card_print(uint8_t sak, uint16_t atqa, uint64_t select_sta
if (lsize < 1024) { if (lsize < 1024) {
snprintf(size_str, sizeof(size_str), "%uB", lsize); snprintf(size_str, sizeof(size_str), "%uB", lsize);
} else { } else {
snprintf(size_str, sizeof(size_str), "%uK", lsize / 1024); snprintf(size_str, sizeof(size_str), "%dK", (lsize / 1024));
} }
} }
@ -2322,11 +2321,10 @@ static int detect_nxp_card_print(uint8_t sak, uint16_t atqa, uint64_t select_sta
if ((sak & 0x01) == 0x01) { // SAK b2=0 b4=0 b5=1 b1=1, SAK=0x11 if ((sak & 0x01) == 0x01) { // SAK b2=0 b4=0 b5=1 b1=1, SAK=0x11
printTag("MIFARE Plus 4K in SL2"); printTag("MIFARE Plus 4K in SL2");
type |= MTPLUS;
} else { // SAK b2=0 b4=0 b5=1 b1=0, SAK=0x10 } else { // SAK b2=0 b4=0 b5=1 b1=0, SAK=0x10
printTag("MIFARE Plus 2K in SL2"); printTag("MIFARE Plus 2K in SL2");
type |= MTPLUS;
} }
type |= MTPLUS;
} else { // SAK b2=0 b4=0 b5=0 } else { // SAK b2=0 b4=0 b5=0

View file

@ -3918,7 +3918,7 @@ static int CmdHF14AMfChk_fast(const char *Cmd) {
// BigBuf_Clear_ext(false); // BigBuf_Clear_ext(false);
goto out; goto out;
} }
PrintAndLogEx(INPLACE, "Testing %5i/%5i %02.1f%%", i, keycnt, (float)i * 100 / keycnt); PrintAndLogEx(INPLACE, "Testing %5i/%5i ( " _YELLOW_("%02.1f%%") " )", i, keycnt, (float)i * 100 / keycnt);
uint32_t size = ((keycnt - i) > chunksize) ? chunksize : keycnt - i; uint32_t size = ((keycnt - i) > chunksize) ? chunksize : keycnt - i;
// last chunk? // last chunk?
@ -3935,7 +3935,7 @@ static int CmdHF14AMfChk_fast(const char *Cmd) {
goto out; goto out;
} }
} // end chunks of keys } // end chunks of keys
PrintAndLogEx(INPLACE, "Testing %5i/%5i 100.00%%", keycnt, keycnt); PrintAndLogEx(INPLACE, "Testing %5i/%5i ( " _YELLOW_("100.00%%") " )", keycnt, keycnt);
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
firstChunk = true; firstChunk = true;
lastChunk = false; lastChunk = false;

View file

@ -3926,9 +3926,9 @@ static int CmdHF14AMfUAESAuth(const char *Cmd) {
CLIParserInit(&ctx, "hf mfu aesauth", CLIParserInit(&ctx, "hf mfu aesauth",
"Tests AES key on Mifare Ultralight AES tags.\n" "Tests AES key on Mifare Ultralight AES tags.\n"
"If no key is specified, null key will be tried.\n" "If no key is specified, null key will be tried.\n"
"Key index 0: DataProtKey (default)\n" " Key index 0... DataProtKey (default)\n"
"Key index 1: UIDRetrKey\n" " Key index 1... UIDRetrKey\n"
"Key index 2: OriginalityKey\n", " Key index 2... OriginalityKey\n",
"hf mfu aesauth\n" "hf mfu aesauth\n"
"hf mfu aesauth --key <16 hex bytes> --index <0..2>" "hf mfu aesauth --key <16 hex bytes> --index <0..2>"
); );

View file

@ -3043,18 +3043,22 @@ out:
int searchFile(char **foundpath, const char *pm3dir, const char *searchname, const char *suffix, bool silent) { int searchFile(char **foundpath, const char *pm3dir, const char *searchname, const char *suffix, bool silent) {
if (foundpath == NULL) if (foundpath == NULL) {
return PM3_EINVARG; return PM3_EINVARG;
}
if (searchname == NULL || strlen(searchname) == 0) if (searchname == NULL || strlen(searchname) == 0) {
return PM3_EINVARG; return PM3_EINVARG;
}
if (is_directory(searchname)) if (is_directory(searchname)) {
return PM3_EINVARG; return PM3_EINVARG;
}
char *filename = filenamemcopy(searchname, suffix); char *filename = filenamemcopy(searchname, suffix);
if (filename == NULL) if (filename == NULL) {
return PM3_EMALLOC; return PM3_EMALLOC;
}
if (strlen(filename) == 0) { if (strlen(filename) == 0) {
free(filename); free(filename);