X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/cb8c358f4d31fdc7a388136c7036d57ec431c7ca..9962091e297c41414fc2631e03f69b080a33704e:/client/cmdhf14b.c diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index a6cf7d57..525ffcc6 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -145,82 +145,10 @@ demodError: int CmdHF14BList(const char *Cmd) { - uint8_t got[TRACE_BUFFER_SIZE]; - GetFromBigBuf(got,sizeof(got),0); - WaitForResponse(CMD_ACK,NULL); + PrintAndLog("Deprecated command, use 'hf list 14b' instead"); - PrintAndLog("recorded activity:"); - PrintAndLog(" time :rssi: who bytes"); - PrintAndLog("---------+----+----+-----------"); - - int i = 0; - int prev = -1; - - for(;;) { - - if(i >= TRACE_BUFFER_SIZE) { break; } - - bool isResponse; - int timestamp = *((uint32_t *)(got+i)); - if(timestamp & 0x80000000) { - timestamp &= 0x7fffffff; - isResponse = 1; - } else { - isResponse = 0; - } - int metric = *((uint32_t *)(got+i+4)); - - int len = got[i+8]; - - if(len > 100) { - break; - } - if(i + len >= TRACE_BUFFER_SIZE) { - break; - } - - uint8_t *frame = (got+i+9); - - // Break and stick with current result if buffer was not completely full - if (frame[0] == 0x44 && frame[1] == 0x44 && frame[2] == 0x44 && frame[3] == 0x44) break; - - char line[1000] = ""; - int j; - for(j = 0; j < len; j++) { - sprintf(line+(j*3), "%02x ", frame[j]); - } - - char *crc; - if(len > 2) { - uint8_t b1, b2; - ComputeCrc14443(CRC_14443_B, frame, len-2, &b1, &b2); - if(b1 != frame[len-2] || b2 != frame[len-1]) { - crc = "**FAIL CRC**"; - } else { - crc = ""; - } - } else { - crc = "(SHORT)"; - } - - char metricString[100]; - if(isResponse) { - sprintf(metricString, "%3d", metric); - } else { - strcpy(metricString, " "); - } - - PrintAndLog(" +%7d: %s: %s %s %s", - (prev < 0 ? 0 : timestamp - prev), - metricString, - (isResponse ? "TAG" : " "), line, crc); - - prev = timestamp; - i += (len + 9); - } - return 0; + return 0; } - int CmdHF14BRead(const char *Cmd) { UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443, {strtol(Cmd, NULL, 0), 0, 0}}; @@ -275,11 +203,11 @@ int CmdHF14BCmdRaw (const char *cmd) { UsbCommand resp; uint8_t *recv; UsbCommand c = {CMD_ISO_14443B_COMMAND, {0, 0, 0}}; // len,recv? - uint8_t reply = 1; - uint8_t crc = 0; - uint8_t power = 0; - char buf[5] = ""; - int i = 0; + uint8_t reply=1; + uint8_t crc=0; + uint8_t power=0; + char buf[5]=""; + int i=0; uint8_t data[100] = {0x00}; unsigned int datalen=0, temp; char *hexout; @@ -301,15 +229,15 @@ int CmdHF14BCmdRaw (const char *cmd) { switch (cmd[i+1]) { case 'r': case 'R': - reply = 0; + reply=0; break; case 'c': case 'C': - crc = 1; + crc=1; break; case 'p': case 'P': - power = 1; + power=1; break; default: PrintAndLog("Invalid option"); @@ -336,13 +264,13 @@ int CmdHF14BCmdRaw (const char *cmd) { PrintAndLog("Invalid char on input"); return 1; } - - if (datalen == 0) { + if (datalen == 0) + { PrintAndLog("Missing data input"); - return 1; + return 0; } - - if(crc) { + if(crc) + { uint8_t first, second; ComputeCrc14443(CRC_14443_B, data, datalen, &first, &second); data[datalen++] = first; @@ -458,7 +386,7 @@ static command_t CommandTable[] = { {"help", CmdHelp, 1, "This help"}, {"demod", CmdHF14BDemod, 1, "Demodulate ISO14443 Type B from tag"}, - {"list", CmdHF14BList, 0, "List ISO 14443 history"}, + {"list", CmdHF14BList, 0, "[Deprecated] List ISO 14443b history"}, {"read", CmdHF14BRead, 0, "Read HF tag (ISO 14443)"}, {"sim", CmdHF14Sim, 0, "Fake ISO 14443 tag"}, {"simlisten", CmdHFSimlisten, 0, "Get HF samples as fake tag"},