mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
fix: keep error msgs until we have proper error codes to diff them on the client side
This commit is contained in:
parent
e15356ab0e
commit
ec827887bf
1 changed files with 12 additions and 11 deletions
|
@ -450,21 +450,21 @@ static void hts_handle_reader_command(uint8_t *rx, const size_t rxlen,
|
||||||
tag.pstate = HT_READY;
|
tag.pstate = HT_READY;
|
||||||
tag.tstate = HT_NO_OP;
|
tag.tstate = HT_NO_OP;
|
||||||
|
|
||||||
if ((rx[0] & 0xf0) == HITAGS_UID_REQ_STD) {
|
if (rx[0] == HITAGS_UID_REQ_STD) {
|
||||||
DBG Dbprintf("HT_STANDARD");
|
DBG Dbprintf("HT_STANDARD");
|
||||||
tag.mode = HT_STANDARD;
|
tag.mode = HT_STANDARD;
|
||||||
sof_bits = 1;
|
sof_bits = 1;
|
||||||
m = AC2K;
|
m = AC2K;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rx[0] & 0xf0) == HITAGS_UID_REQ_ADV) {
|
if (rx[0] == HITAGS_UID_REQ_ADV) {
|
||||||
DBG Dbprintf("HT_ADVANCED");
|
DBG Dbprintf("HT_ADVANCED");
|
||||||
tag.mode = HT_ADVANCED;
|
tag.mode = HT_ADVANCED;
|
||||||
sof_bits = 3;
|
sof_bits = 3;
|
||||||
m = AC2K;
|
m = AC2K;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((rx[0] & 0xf0) == HITAGS_UID_REQ_FADV) {
|
if (rx[0] == HITAGS_UID_REQ_FADV) {
|
||||||
DBG Dbprintf("HT_FAST_ADVANCED");
|
DBG Dbprintf("HT_FAST_ADVANCED");
|
||||||
tag.mode = HT_FAST_ADVANCED;
|
tag.mode = HT_FAST_ADVANCED;
|
||||||
sof_bits = 3;
|
sof_bits = 3;
|
||||||
|
@ -730,7 +730,6 @@ void hts_simulate(bool tag_mem_supplied, const uint8_t *data, bool ledcontrol) {
|
||||||
clear_trace();
|
clear_trace();
|
||||||
|
|
||||||
DbpString("Starting Hitag S simulation");
|
DbpString("Starting Hitag S simulation");
|
||||||
if (ledcontrol) LED_D_ON();
|
|
||||||
|
|
||||||
tag.pstate = HT_READY;
|
tag.pstate = HT_READY;
|
||||||
tag.tstate = HT_NO_OP;
|
tag.tstate = HT_NO_OP;
|
||||||
|
@ -874,6 +873,8 @@ void hts_simulate(bool tag_mem_supplied, const uint8_t *data, bool ledcontrol) {
|
||||||
// synchronized startup procedure
|
// synchronized startup procedure
|
||||||
while (AT91C_BASE_TC0->TC_CV != 0); // wait until TC0 returned to zero
|
while (AT91C_BASE_TC0->TC_CV != 0); // wait until TC0 returned to zero
|
||||||
|
|
||||||
|
if (ledcontrol) LED_D_ON();
|
||||||
|
|
||||||
while ((BUTTON_PRESS() == false) && (data_available() == false)) {
|
while ((BUTTON_PRESS() == false) && (data_available() == false)) {
|
||||||
|
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
@ -1210,7 +1211,7 @@ static int hts_select_tag(const lf_hitag_data_t *packet, uint8_t *tx, size_t siz
|
||||||
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, t_wait, ledcontrol, true);
|
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, t_wait, ledcontrol, true);
|
||||||
|
|
||||||
if (rxlen != 32) {
|
if (rxlen != 32) {
|
||||||
DBG DbpString("UID Request failed!");
|
DbpString("UID Request failed!");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,7 +1230,7 @@ static int hts_select_tag(const lf_hitag_data_t *packet, uint8_t *tx, size_t siz
|
||||||
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
||||||
|
|
||||||
if (rxlen != 40) {
|
if (rxlen != 40) {
|
||||||
DBG Dbprintf("Select UID failed! %i", rxlen);
|
Dbprintf("Select UID failed! %i", rxlen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1334,7 +1335,7 @@ static int hts_select_tag(const lf_hitag_data_t *packet, uint8_t *tx, size_t siz
|
||||||
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
||||||
|
|
||||||
if ((rxlen != 2) || (rx[0] >> (8 - 2) != 0x01)) {
|
if ((rxlen != 2) || (rx[0] >> (8 - 2) != 0x01)) {
|
||||||
DBG Dbprintf("no write access on page " _YELLOW_("64") ". not 82xx?");
|
Dbprintf("no write access on page " _YELLOW_("64") ". not 82xx?");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1346,23 +1347,23 @@ static int hts_select_tag(const lf_hitag_data_t *packet, uint8_t *tx, size_t siz
|
||||||
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
||||||
|
|
||||||
if ((rxlen != 2) || (rx[0] >> (8 - 2) != 0x01)) {
|
if ((rxlen != 2) || (rx[0] >> (8 - 2) != 0x01)) {
|
||||||
DBG Dbprintf("write to page " _YELLOW_("64") " failed! wrong password?");
|
Dbprintf("write to page " _YELLOW_("64") " failed! wrong password?");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else if (packet->cmd == RHTSF_PLAIN || packet->cmd == WHTSF_PLAIN) {
|
} else if (packet->cmd == RHTSF_PLAIN || packet->cmd == WHTSF_PLAIN) {
|
||||||
DBG Dbprintf("Error, " _YELLOW_("AUT=1") " This tag is configured in Authentication Mode");
|
Dbprintf("Error, " _YELLOW_("AUT=1") " This tag is configured in Authentication Mode");
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
DBG Dbprintf("Error, unknown function: " _RED_("%d"), packet->cmd);
|
Dbprintf("Error, unknown function: " _RED_("%d"), packet->cmd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
hts_send_receive(tx, txlen, rx, sizeofrx, &rxlen, HITAG_T_WAIT_SC, ledcontrol, false);
|
||||||
|
|
||||||
if (rxlen != 40) {
|
if (rxlen != 40) {
|
||||||
DBG Dbprintf("Authenticate failed! " _RED_("%i"), rxlen);
|
Dbprintf("Authenticate failed! " _RED_("%i"), rxlen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue