mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 10:36:58 -07:00
Merge branch 'master' into fix_hfmfsim
This commit is contained in:
commit
82f4955245
16 changed files with 442 additions and 129 deletions
|
@ -1702,6 +1702,13 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u
|
|||
int cascade_level = 0;
|
||||
int len;
|
||||
|
||||
// init card struct
|
||||
if(p_hi14a_card) {
|
||||
p_hi14a_card->uidlen = 0;
|
||||
memset(p_hi14a_card->uid, 0, 10);
|
||||
p_hi14a_card->ats_len = 0;
|
||||
}
|
||||
|
||||
// Broadcast for a card, WUPA (0x52) will force response from all cards in the field
|
||||
ReaderTransmitBitsPar(wupa, 7, NULL, NULL);
|
||||
|
||||
|
@ -1710,8 +1717,6 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u
|
|||
|
||||
if(p_hi14a_card) {
|
||||
memcpy(p_hi14a_card->atqa, resp, 2);
|
||||
p_hi14a_card->uidlen = 0;
|
||||
memset(p_hi14a_card->uid,0,10);
|
||||
}
|
||||
|
||||
if (anticollision) {
|
||||
|
@ -1817,10 +1822,9 @@ int iso14443a_select_card(byte_t *uid_ptr, iso14a_card_select_t *p_hi14a_card, u
|
|||
|
||||
if(p_hi14a_card) {
|
||||
p_hi14a_card->sak = sak;
|
||||
p_hi14a_card->ats_len = 0;
|
||||
}
|
||||
|
||||
// non iso14443a compliant tag
|
||||
// PICC compilant with iso14443a-4 ---> (SAK & 0x20 != 0)
|
||||
if( (sak & 0x20) == 0) return 2;
|
||||
|
||||
if (!no_rats) {
|
||||
|
@ -1912,7 +1916,7 @@ void ReaderIso14443a(UsbCommand *c)
|
|||
size_t lenbits = c->arg[1] >> 16;
|
||||
uint32_t timeout = c->arg[2];
|
||||
uint32_t arg0 = 0;
|
||||
byte_t buf[USB_CMD_DATA_SIZE];
|
||||
byte_t buf[USB_CMD_DATA_SIZE] = {0};
|
||||
uint8_t par[MAX_PARITY_SIZE];
|
||||
|
||||
if(param & ISO14A_CONNECT) {
|
||||
|
|
|
@ -1510,6 +1510,14 @@ void MifareCIdent(){
|
|||
|
||||
uint8_t receivedAnswer[MAX_MIFARE_FRAME_SIZE];
|
||||
uint8_t receivedAnswerPar[MAX_MIFARE_PARITY_SIZE];
|
||||
|
||||
LED_A_ON();
|
||||
LED_B_OFF();
|
||||
LED_C_OFF();
|
||||
iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);
|
||||
|
||||
clear_trace();
|
||||
set_tracing(true);
|
||||
|
||||
ReaderTransmitBitsPar(wupC1,7,0, NULL);
|
||||
if(ReaderReceive(receivedAnswer, receivedAnswerPar) && (receivedAnswer[0] == 0x0a)) {
|
||||
|
@ -1523,8 +1531,13 @@ void MifareCIdent(){
|
|||
|
||||
// From iceman1001: removed the if, since some magic tags misbehavies and send an answer to it.
|
||||
mifare_classic_halt(NULL, 0);
|
||||
|
||||
|
||||
LED_B_ON();
|
||||
cmd_send(CMD_ACK,isOK,0,0,0,0);
|
||||
LED_B_OFF();
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LEDsoff();
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue