14a ATR fingerprint: skip if hist bytes <= 1

This commit is contained in:
Philippe Teuwen committed 2025-09-20 22:06:32 +02:00
1 parent bde33711c7
commit 45fe423cd4
1 file changed
+13 -11
+13 -11
View File
@@ -3024,18 +3024,20 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
, sprint_ascii(card.ats + pos, calen)
);
}
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "------------------ " _CYAN_("ATR fingerprinting") " ---------------------------");
uint8_t atr[256] = {0};
int atrLen = 0;
atsToEmulatedAtr(card.ats, atr, &atrLen);
char *copy = str_dup(getAtrInfo(sprint_hex_inrow(atr, atrLen)));
char *token = strtok(copy, "\n");
while (token != NULL) {
PrintAndLogEx(SUCCESS, " %s", token);
token = strtok(NULL, "\n");
if (calen > 1) {
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "------------------ " _CYAN_("ATR fingerprinting") " ---------------------------");
uint8_t atr[256] = {0};
int atrLen = 0;
atsToEmulatedAtr(card.ats, atr, &atrLen);
char *copy = str_dup(getAtrInfo(sprint_hex_inrow(atr, atrLen)));
char *token = strtok(copy, "\n");
while (token != NULL) {
PrintAndLogEx(SUCCESS, " %s", token);
token = strtok(NULL, "\n");
}
free(copy);
}
free(copy);
}
}
}