diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index 19c16f656..d40080ae1 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -2624,13 +2624,13 @@ int iso14443a_select_card(uint8_t *uid_ptr, iso14a_card_select_t *p_card, uint32 } // else force RATS // RATS, Request for answer to select - if (!no_rats) { - uint8_t rats[] = { ISO14443A_CMD_RATS, 0x80, 0x00, 0x00 }; // FSD=256, FSDI=8, CID=0 + if (no_rats == false) { + uint8_t rats[] = { ISO14443A_CMD_RATS, 0x80, 0x00, 0x00 }; // FSD=256, FSDI=8, CID=0 AddCrc14A(rats, 2); ReaderTransmit(rats, sizeof(rats), NULL); int len = ReaderReceive(resp, resp_par); - - if (!len) return 0; + if (len == 0) + return 0; if (p_card) { memcpy(p_card->ats, resp, sizeof(p_card->ats)); @@ -2932,7 +2932,7 @@ void ReaderIso14443a(PacketCommandNG *c) { if (tearoff_hook() == PM3_ETEAROFF) { // tearoff occured FpgaDisableTracing(); - reply_old(CMD_ACK, 0, 0, 0, NULL, 0); + reply_mix(CMD_ACK, 0, 0, 0, NULL, 0); } else { arg0 = ReaderReceive(buf, par); FpgaDisableTracing(); diff --git a/armsrc/iso14443b.c b/armsrc/iso14443b.c index 976e13148..64c0ba67f 100644 --- a/armsrc/iso14443b.c +++ b/armsrc/iso14443b.c @@ -1895,12 +1895,17 @@ void SendRawCommand14443B_Ex(PacketCommandNG *c) { uint32_t eof_time = 0; CodeAndTransmit14443bAsReader(cmd, len, &start_time, &eof_time); - eof_time += DELAY_ISO14443B_VCD_TO_VICC_READER; - status = Get14443bAnswerFromTag(buf, sizeof(buf), 5 * ISO14443B_READER_TIMEOUT, &eof_time); // raw - FpgaDisableTracing(); + if (tearoff_hook() == PM3_ETEAROFF) { // tearoff occured + FpgaDisableTracing(); + reply_mix(CMD_HF_ISO14443B_COMMAND, -2, 0, 0, NULL, 0); + } else { + eof_time += DELAY_ISO14443B_VCD_TO_VICC_READER; + status = Get14443bAnswerFromTag(buf, sizeof(buf), 5 * ISO14443B_READER_TIMEOUT, &eof_time); // raw + FpgaDisableTracing(); - sendlen = MIN(Demod.len, PM3_CMD_DATA_SIZE); - reply_mix(CMD_HF_ISO14443B_COMMAND, status, sendlen, 0, Demod.output, sendlen); + sendlen = MIN(Demod.len, PM3_CMD_DATA_SIZE); + reply_mix(CMD_HF_ISO14443B_COMMAND, status, sendlen, 0, Demod.output, sendlen); + } } out: