mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
the select funct also disconnect reader, so we must add select to read block fct
This commit is contained in:
parent
bfa912952e
commit
65e9493bce
1 changed files with 7 additions and 3 deletions
|
@ -636,7 +636,7 @@ static int read_xerox_block(iso14b_card_select_t *card, uint8_t blockno, uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up the read command
|
// set up the read command
|
||||||
packet->flags = (ISO14B_CONNECT | ISO14B_APPEND_CRC | ISO14B_RAW);
|
packet->flags = (ISO14B_CONNECT | ISO14B_SELECT_XRX | ISO14B_APPEND_CRC | ISO14B_RAW);
|
||||||
packet->raw[packet->rawlen++] = 0x02;
|
packet->raw[packet->rawlen++] = 0x02;
|
||||||
packet->raw[packet->rawlen++] = ISO14443B_XEROX_READ_BLK;
|
packet->raw[packet->rawlen++] = ISO14443B_XEROX_READ_BLK;
|
||||||
|
|
||||||
|
@ -662,6 +662,11 @@ static int read_xerox_block(iso14b_card_select_t *card, uint8_t blockno, uint8_t
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (resp.status != PM3_SUCCESS) {
|
||||||
|
PrintAndLogEx(FAILED, "trying one more time");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// sanity checks
|
// sanity checks
|
||||||
if (resp.length < 7) {
|
if (resp.length < 7) {
|
||||||
PrintAndLogEx(FAILED, "trying one more time, wrong length");
|
PrintAndLogEx(FAILED, "trying one more time, wrong length");
|
||||||
|
@ -669,13 +674,12 @@ static int read_xerox_block(iso14b_card_select_t *card, uint8_t blockno, uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *d = resp.data.asBytes;
|
uint8_t *d = resp.data.asBytes;
|
||||||
|
|
||||||
if (check_crc(CRC_14443_B, d, 7) == false) {
|
if (check_crc(CRC_14443_B, d, 7) == false) {
|
||||||
PrintAndLogEx(FAILED, "trying one more time, CRC ( " _RED_("fail") " )");
|
PrintAndLogEx(FAILED, "trying one more time, CRC ( " _RED_("fail") " )");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d[0] != 2) {
|
if (d[0] != 0x02) {
|
||||||
PrintAndLogEx(FAILED, "Tag returned Error %x %x", d[0], d[1]);
|
PrintAndLogEx(FAILED, "Tag returned Error %x %x", d[0], d[1]);
|
||||||
res = PM3_ERFTRANS;
|
res = PM3_ERFTRANS;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue