mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fixing false positives
This commit is contained in:
parent
0810f07a41
commit
4e411bec22
1 changed files with 29 additions and 16 deletions
|
@ -442,11 +442,12 @@ static bool get_14b_UID(uint8_t *d, iso14b_type_t *found_type) {
|
||||||
memcpy(d, resp.data.asBytes, sizeof(iso14b_card_select_t));
|
memcpy(d, resp.data.asBytes, sizeof(iso14b_card_select_t));
|
||||||
|
|
||||||
iso14b_card_select_t *card = (iso14b_card_select_t*)d;
|
iso14b_card_select_t *card = (iso14b_card_select_t*)d;
|
||||||
uint8_t empty[] = "\x00\0x00\x00\0x00\x00\0x00\x00\0x00";
|
uint8_t empty[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
if (memcmp(card->uid, empty, card->uidlen)) {
|
if (memcmp(card->uid, empty, card->uidlen)) {
|
||||||
*found_type = ISO14B_SR;
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
*found_type = ISO14B_SR;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -918,6 +919,11 @@ static bool HF14B_ST_Info(bool verbose, bool do_aid_search) {
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
uint8_t empty[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
if ((card.uidlen < 8) || (memcmp(card.uid, empty, card.uidlen) == 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
print_st_general_info(card.uid, card.uidlen);
|
print_st_general_info(card.uid, card.uidlen);
|
||||||
|
|
||||||
if (do_aid_search) {
|
if (do_aid_search) {
|
||||||
|
@ -969,13 +975,14 @@ static bool HF14B_st_reader(bool verbose) {
|
||||||
iso14b_card_select_t card;
|
iso14b_card_select_t card;
|
||||||
memcpy(&card, (iso14b_card_select_t *)resp.data.asBytes, sizeof(iso14b_card_select_t));
|
memcpy(&card, (iso14b_card_select_t *)resp.data.asBytes, sizeof(iso14b_card_select_t));
|
||||||
|
|
||||||
uint8_t empty[] = "\x00\0x00\x00\0x00\x00\0x00\x00\0x00";
|
uint8_t empty[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
if ((card.uidlen < 8) || (memcmp(card.uid, empty, card.uidlen) == 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int status = resp.oldarg[0];
|
int status = resp.oldarg[0];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
if (memcmp(card.uid, empty, card.uidlen) == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
print_st_general_info(card.uid, card.uidlen);
|
print_st_general_info(card.uid, card.uidlen);
|
||||||
return true;
|
return true;
|
||||||
case -1:
|
case -1:
|
||||||
|
@ -1011,12 +1018,18 @@ static bool HF14B_std_reader(bool verbose) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int status = resp.oldarg[0];
|
int status = resp.oldarg[0];
|
||||||
|
|
||||||
|
iso14b_card_select_t card;
|
||||||
|
memcpy(&card, (iso14b_card_select_t *)resp.data.asBytes, sizeof(iso14b_card_select_t));
|
||||||
|
|
||||||
|
uint8_t empty[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
if (memcmp(card.uid, empty, card.uidlen) == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0: {
|
case 0: {
|
||||||
iso14b_card_select_t card;
|
|
||||||
memcpy(&card, (iso14b_card_select_t *)resp.data.asBytes, sizeof(iso14b_card_select_t));
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(SUCCESS, " UID : " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen));
|
PrintAndLogEx(SUCCESS, " UID : " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen));
|
||||||
PrintAndLogEx(SUCCESS, " ATQB : %s", sprint_hex(card.atqb, sizeof(card.atqb)));
|
PrintAndLogEx(SUCCESS, " ATQB : %s", sprint_hex(card.atqb, sizeof(card.atqb)));
|
||||||
|
@ -1111,13 +1124,13 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a 0x000b3f80 command ans:");
|
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x000b3f80") " command ans:");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
free(packet);
|
free(packet);
|
||||||
return true;
|
return true;
|
||||||
} else if (status > 0) {
|
} else if (status > 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a 0x000b3f80 command ans:");
|
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x000b3f80") " command ans:");
|
||||||
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
free(packet);
|
free(packet);
|
||||||
|
@ -1141,13 +1154,13 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a 0x0A command ans:");
|
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0A") " command ans:");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
free(packet);
|
free(packet);
|
||||||
return true;
|
return true;
|
||||||
} else if (status > 0) {
|
} else if (status > 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a 0x0A command ans:");
|
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x0A") " command ans:");
|
||||||
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
free(packet);
|
free(packet);
|
||||||
|
@ -1170,12 +1183,12 @@ static bool HF14B_other_reader(bool verbose) {
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a 0x0C command ans:");
|
PrintAndLogEx(SUCCESS, "Unknown tag type answered to a " _YELLOW_("0x0C") " command ans:");
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
return true;
|
return true;
|
||||||
} else if (status > 0) {
|
} else if (status > 0) {
|
||||||
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
PrintAndLogEx(SUCCESS, "\n14443-3b tag found:");
|
||||||
PrintAndLogEx(SUCCESS, "unknown tag type answered to a 0x0C command ans:");
|
PrintAndLogEx(SUCCESS, "unknown tag type answered to a " _YELLOW_("0x0C") " command ans:");
|
||||||
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
PrintAndLogEx(SUCCESS, "%s", sprint_hex(resp.data.asBytes, status));
|
||||||
switch_off_field_14b();
|
switch_off_field_14b();
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue