mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
improving false positive for 14b SR tags
This commit is contained in:
parent
70bd5b80b5
commit
0810f07a41
1 changed files with 11 additions and 3 deletions
|
@ -440,10 +440,15 @@ static bool get_14b_UID(uint8_t *d, iso14b_type_t *found_type) {
|
||||||
|
|
||||||
if (resp.oldarg[0] == 0) {
|
if (resp.oldarg[0] == 0) {
|
||||||
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;
|
||||||
|
uint8_t empty[] = "\x00\0x00\x00\0x00\x00\0x00\x00\0x00";
|
||||||
|
if (memcmp(card->uid, empty, card->uidlen)) {
|
||||||
*found_type = ISO14B_SR;
|
*found_type = ISO14B_SR;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// test 14b standard
|
// test 14b standard
|
||||||
packet.flags = (ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT);
|
packet.flags = (ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT);
|
||||||
|
@ -964,9 +969,13 @@ 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";
|
||||||
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:
|
||||||
|
@ -1399,7 +1408,6 @@ static int CmdHF14BDump(const char *Cmd) {
|
||||||
return switch_off_field_14b();
|
return switch_off_field_14b();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (select_cardtype == ISO14B_SR) {
|
if (select_cardtype == ISO14B_SR) {
|
||||||
iso14b_card_select_t card;
|
iso14b_card_select_t card;
|
||||||
memcpy(&card, (iso14b_card_select_t *)&select, sizeof(iso14b_card_select_t));
|
memcpy(&card, (iso14b_card_select_t *)&select, sizeof(iso14b_card_select_t));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue