X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/ed69e099a15b4cf73610ba8646c8a06fa5431f43..a420e5c163f64955df4d4c3a9023d07ac6a146ed:/client/cmdhf14b.c?ds=sidebyside diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index cb93b1fc..939f0976 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -848,24 +848,28 @@ bool waitCmd(bool verbose) { if (WaitForResponseTimeout(CMD_ACK, &resp, TIMEOUT)) { - status = (resp.arg[0] & 0xFFFF); + status = (resp.arg[0] & 0xFF); if ( status > 0 ) return FALSE; - + len = (resp.arg[1] & 0xFFFF); + memcpy(data, resp.d.asBytes, len); if (verbose) { - - ComputeCrc14443(CRC_14443_B, data, len-2, &b1, &b2); - crc = ( data[len-2] == b1 && data[len-1] == b2); - - PrintAndLog("[LEN %u] %s[%02X %02X] %s", - len, - sprint_hex(data, len-2), - data[len-2], - data[len-1], - (crc) ? "OK" : "FAIL" - ); + if ( len >= 3 ) { + ComputeCrc14443(CRC_14443_B, data, len-2, &b1, &b2); + crc = ( data[len-2] == b1 && data[len-1] == b2); + + PrintAndLog("[LEN %u] %s[%02X %02X] %s", + len, + sprint_hex(data, len-2), + data[len-2], + data[len-1], + (crc) ? "OK" : "FAIL" + ); + } else { + PrintAndLog("[LEN %u] %s", len, sprint_hex(data, len) ); + } } return TRUE; } else {