From: merlokk Date: Wed, 1 Nov 2017 15:13:27 +0000 (+0200) Subject: Merge branch 'master' of github.com:merlokk/proxmark3 into 14a_rework3 X-Git-Tag: v3.1.0~133^2~9 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/bed3e4c20d2d885dbc560d21c1e954058145ae51 Merge branch 'master' of github.com:merlokk/proxmark3 into 14a_rework3 --- bed3e4c20d2d885dbc560d21c1e954058145ae51 diff --cc armsrc/iso14443a.c index 860af238,06a83feb..7d484015 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@@ -1909,9 -1912,8 +1913,9 @@@ 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]; + bool cantSELECT = false; if(param & ISO14A_CONNECT) { clear_trace(); diff --cc client/cmdhf14a.c index 1a7f6970,3f103f5f..f3189c10 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@@ -872,10 -805,19 +945,19 @@@ static int waitCmd(uint8_t iSelect) if (WaitForResponseTimeout(CMD_ACK,&resp,1500)) { recv = resp.d.asBytes; - uint8_t iLen = iSelect ? resp.arg[1] : resp.arg[0]; - PrintAndLog("received %i octets", iLen); + uint8_t iLen = resp.arg[0]; + if (iSelect){ + iLen = resp.arg[1]; + if (iLen){ + PrintAndLog("Card selected. UID[%i]:", iLen); + } else { + PrintAndLog("Can't select card."); + } + } else { + PrintAndLog("received %i bytes:", iLen); + } if(!iLen) - return; + return 1; hexout = (char *)malloc(iLen * 3 + 1); if (hexout != NULL) { for (int i = 0; i < iLen; i++) { // data in hex