diff --git a/CHANGELOG.md b/CHANGELOG.md index a1b23944d..8f239ac30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `hf search` - where felica reader now doesnt timeout and give wrong response (@iceman1001) - Fixed overflow in deps/jansson library (@iceman1001) - Added `lf hitag crack2` - WIP. Trying to add the second attack vector against Hitag2 (@iceman1001) - Changed `hf 14b reader --plot` - made the anticollision signal trace download optional (@iceman1001) diff --git a/armsrc/felica.c b/armsrc/felica.c index e94a08f5a..2d6437562 100644 --- a/armsrc/felica.c +++ b/armsrc/felica.c @@ -239,7 +239,7 @@ static uint8_t felica_select_card(felica_card_select_t *card) { // We try 10 times, or if answer was received. - int len = 50; + int len = 25; do { // end-of-reception response packet data, wait approx. 501μs // end-of-transmission command packet data, wait approx. 197μs @@ -547,13 +547,11 @@ void felica_sendraw(const PacketCommandNG *c) { const uint8_t *cmd = c->data.asBytes; uint32_t arg0; - felica_card_select_t card; - if ((param & FELICA_CONNECT) == FELICA_CONNECT) { clear_trace(); } - set_tracing(true); + iso18092_setup(FPGA_HF_ISO18092_FLAG_READER | FPGA_HF_ISO18092_FLAG_NOMOD); if ((param & FELICA_CONNECT) == FELICA_CONNECT) { @@ -562,6 +560,7 @@ void felica_sendraw(const PacketCommandNG *c) { // if failed selecting, turn off antenna and quite. if ((param & FELICA_NO_SELECT) != FELICA_NO_SELECT) { + felica_card_select_t card; arg0 = felica_select_card(&card); reply_mix(CMD_ACK, arg0, sizeof(card.uid), 0, &card, sizeof(felica_card_select_t)); if (arg0) { diff --git a/client/src/cmdhffelica.c b/client/src/cmdhffelica.c index 7c6e0f520..20a02619f 100644 --- a/client/src/cmdhffelica.c +++ b/client/src/cmdhffelica.c @@ -312,13 +312,13 @@ static int CmdHFFelicaList(const char *Cmd) { int read_felica_uid(bool loop, bool verbose) { - int res = PM3_SUCCESS; + int res = PM3_ETIMEOUT; do { clearCommandBuffer(); SendCommandMIX(CMD_HF_FELICA_COMMAND, FELICA_CONNECT, 0, 0, NULL, 0); PacketResponseNG resp; - if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) { + if (WaitForResponseTimeout(CMD_ACK, &resp, 2500)) { uint8_t status = resp.oldarg[0] & 0xFF; @@ -342,7 +342,10 @@ int read_felica_uid(bool loop, bool verbose) { } PrintAndLogEx(SUCCESS, "IDm: " _GREEN_("%s"), sprint_hex_inrow(card.IDm, sizeof(card.IDm))); set_last_known_card(card); + + res = PM3_SUCCESS; } + } while (loop && kbd_enter_pressed() == false); DropField();