no table when no AID found

This commit is contained in:
iceman1001
2026-08-27 14:25:40 +02:00
parent 8b9f3951b1
commit f78890cb03
2 changed files with 15 additions and 4 deletions
+10
View File
@@ -799,6 +799,16 @@ static int CmdEMVSearch(const char *Cmd) {
struct tlvdb *t = tlvdb_fixed(1, strlen(al), (const unsigned char *)al);
if (EMVSearch(channel, activateField, leaveSignalON, decodeTLV, t, false)) {
PrintAndLogEx(FAILED, "Search failed, no answer from the card");
// Without activation the ARM never reads the ATR, so it does not know
// which protocols the card offers and cannot redirect a T=0 request to
// a T=1 only card. That used to end here without a word.
if ((channel == CC_CONTACT) && (activateField == false)) {
PrintAndLogEx(HINT, "Hint: the card is activated by `" _YELLOW_("-s") "`, try `" _YELLOW_("emv search -w -s") "`");
}
tlvdb_free(t);
SetAPDULogging(false);
return PM3_ERFTRANS;
+5 -4
View File
@@ -266,6 +266,11 @@ void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv) {
ttmp = tlvdb_find_next(ttmp, 0x6f);
}
if (n == 0) {
PrintAndLogEx(INFO, "No applications found");
return;
}
size_t w_aid = strlen("AID");
size_t w_prio = strlen("Priority");
size_t w_name = strlen("Name");
@@ -289,10 +294,6 @@ void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv) {
(int)w_aid, "AID", (int)w_prio, "Priority", (int)w_name, "Name");
PrintAndLogEx(INFO, "%s", rule);
if (n == 0) {
PrintAndLogEx(INFO, "| %-*s |", (int)(w_aid + w_prio + w_name + 6), "none");
}
for (size_t i = 0; i < n; i++) {
PrintAndLogEx(INFO, "| " _YELLOW_("%-*s") " | %-*s | " _CYAN_("%-*s") " |",
(int)w_aid, rows[i].aid,