1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // High frequency commands
9 //-----------------------------------------------------------------------------
13 #include "proxmark3.h"
16 #include "cmdparser.h"
22 #include "cmdhflegic.h"
23 #include "cmdhficlass.h"
26 #include "cmdhfmfdes.h"
27 #include "cmdhftopaz.h"
28 #include "protocols.h"
30 static int CmdHelp(const char *Cmd
);
32 int CmdHFTune(const char *Cmd
)
34 UsbCommand c
={CMD_MEASURE_ANTENNA_TUNING_HF
};
40 //void annotateIso15693(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize){}
42 void annotateIso14443a(char *exp
, size_t size
, uint8_t* cmd
, uint8_t cmdsize
)
46 case ISO14443A_CMD_WUPA
: snprintf(exp
,size
,"WUPA"); break;
47 case ISO14443A_CMD_ANTICOLL_OR_SELECT
:{
48 // 93 20 = Anticollision (usage: 9320 - answer: 4bytes UID+1byte UID-bytes-xor)
49 // 93 70 = Select (usage: 9370+5bytes 9320 answer - answer: 1byte SAK)
52 snprintf(exp
,size
,"SELECT_UID"); break;
55 snprintf(exp
,size
,"ANTICOLL"); break;
58 case ISO14443A_CMD_ANTICOLL_OR_SELECT_2
:{
59 //95 20 = Anticollision of cascade level2
60 //95 70 = Select of cascade level2
63 snprintf(exp
,size
,"SELECT_UID-2"); break;
66 snprintf(exp
,size
,"ANTICOLL-2"); break;
69 case ISO14443A_CMD_REQA
: snprintf(exp
,size
,"REQA"); break;
70 case ISO14443A_CMD_READBLOCK
: snprintf(exp
,size
,"READBLOCK(%d)",cmd
[1]); break;
71 case ISO14443A_CMD_WRITEBLOCK
: snprintf(exp
,size
,"WRITEBLOCK(%d)",cmd
[1]); break;
72 case ISO14443A_CMD_HALT
: snprintf(exp
,size
,"HALT"); break;
73 case ISO14443A_CMD_RATS
: snprintf(exp
,size
,"RATS"); break;
74 case MIFARE_CMD_INC
: snprintf(exp
,size
,"INC(%d)",cmd
[1]); break;
75 case MIFARE_CMD_DEC
: snprintf(exp
,size
,"DEC(%d)",cmd
[1]); break;
76 case MIFARE_CMD_RESTORE
: snprintf(exp
,size
,"RESTORE(%d)",cmd
[1]); break;
77 case MIFARE_CMD_TRANSFER
: snprintf(exp
,size
,"TRANSFER(%d)",cmd
[1]); break;
78 case MIFARE_AUTH_KEYA
:{
80 snprintf(exp
,size
,"AUTH-A(%d)",cmd
[1]);
82 // case MIFARE_ULEV1_VERSION : both 0x60.
83 snprintf(exp
,size
,"EV1 VERSION");
86 case MIFARE_AUTH_KEYB
: snprintf(exp
,size
,"AUTH-B(%d)",cmd
[1]); break;
87 case MIFARE_MAGICWUPC1
: snprintf(exp
,size
,"MAGIC WUPC1"); break;
88 case MIFARE_MAGICWUPC2
: snprintf(exp
,size
,"MAGIC WUPC2"); break;
89 case MIFARE_MAGICWIPEC
: snprintf(exp
,size
,"MAGIC WIPEC"); break;
90 case MIFARE_ULC_AUTH_1
: snprintf(exp
,size
,"AUTH "); break;
91 case MIFARE_ULC_AUTH_2
: snprintf(exp
,size
,"AUTH_ANSW"); break;
92 case MIFARE_ULEV1_AUTH
:
94 snprintf(exp
,size
,"PWD-AUTH KEY: 0x%02x%02x%02x%02x", cmd
[1], cmd
[2], cmd
[3], cmd
[4] );
96 snprintf(exp
,size
,"PWD-AUTH");
99 case MIFARE_ULEV1_FASTREAD
: {
100 if ( cmdsize
>=3 && cmd
[2] <= 0xE6)
101 snprintf(exp
,size
,"READ RANGE (%d-%d)",cmd
[1],cmd
[2]);
103 snprintf(exp
,size
,"?");
106 case MIFARE_ULC_WRITE
: {
108 snprintf(exp
,size
,"WRITEBLOCK(%d)",cmd
[1]);
110 snprintf(exp
,size
,"?");
113 case MIFARE_ULEV1_READ_CNT
:{
115 snprintf(exp
,size
,"READ CNT(%d)",cmd
[1]);
117 snprintf(exp
,size
,"?");
120 case MIFARE_ULEV1_INCR_CNT
: {
122 snprintf(exp
,size
,"INCR(%d)",cmd
[1]);
124 snprintf(exp
,size
,"?");
127 case MIFARE_ULEV1_READSIG
: snprintf(exp
,size
,"READ_SIG"); break;
128 case MIFARE_ULEV1_CHECKTEAR
: snprintf(exp
,size
,"CHK_TEARING(%d)",cmd
[1]); break;
129 case MIFARE_ULEV1_VCSL
: snprintf(exp
,size
,"VCSL"); break;
130 default: snprintf(exp
,size
,"?"); break;
135 void annotateIclass(char *exp
, size_t size
, uint8_t* cmd
, uint8_t cmdsize
)
139 case ICLASS_CMD_ACTALL
: snprintf(exp
,size
,"ACTALL"); break;
140 case ICLASS_CMD_READ_OR_IDENTIFY
:{
142 snprintf(exp
,size
,"READ(%d)",cmd
[1]);
144 snprintf(exp
,size
,"IDENTIFY");
148 case ICLASS_CMD_SELECT
: snprintf(exp
,size
,"SELECT"); break;
149 case ICLASS_CMD_PAGESEL
: snprintf(exp
,size
,"PAGESEL(%d)", cmd
[1]); break;
150 case ICLASS_CMD_READCHECK_KC
:snprintf(exp
,size
,"READCHECK[Kc](%d)", cmd
[1]); break;
151 case ICLASS_CMD_READCHECK_KD
:snprintf(exp
,size
,"READCHECK[Kd](%d)", cmd
[1]); break;
152 case ICLASS_CMD_CHECK
: snprintf(exp
,size
,"CHECK"); break;
153 case ICLASS_CMD_DETECT
: snprintf(exp
,size
,"DETECT"); break;
154 case ICLASS_CMD_HALT
: snprintf(exp
,size
,"HALT"); break;
155 case ICLASS_CMD_UPDATE
: snprintf(exp
,size
,"UPDATE(%d)",cmd
[1]); break;
156 case ICLASS_CMD_ACT
: snprintf(exp
,size
,"ACT"); break;
157 case ICLASS_CMD_READ4
: snprintf(exp
,size
,"READ4(%d)",cmd
[1]); break;
158 default: snprintf(exp
,size
,"?"); break;
163 void annotateIso15693(char *exp
, size_t size
, uint8_t* cmd
, uint8_t cmdsize
)
169 case ISO15693_INVENTORY
:snprintf(exp
, size
, "INVENTORY");break;
170 case ISO15693_STAYQUIET
:snprintf(exp
, size
, "STAY_QUIET");break;
171 default: snprintf(exp
,size
,"?"); break;
174 }else if(cmd
[0] == 0x02)
178 case ISO15693_READBLOCK
:snprintf(exp
, size
, "READBLOCK");break;
179 case ISO15693_WRITEBLOCK
:snprintf(exp
, size
, "WRITEBLOCK");break;
180 case ISO15693_LOCKBLOCK
:snprintf(exp
, size
, "LOCKBLOCK");break;
181 case ISO15693_READ_MULTI_BLOCK
:snprintf(exp
, size
, "READ_MULTI_BLOCK");break;
182 case ISO15693_SELECT
:snprintf(exp
, size
, "SELECT");break;
183 case ISO15693_RESET_TO_READY
:snprintf(exp
, size
, "RESET_TO_READY");break;
184 case ISO15693_WRITE_AFI
:snprintf(exp
, size
, "WRITE_AFI");break;
185 case ISO15693_LOCK_AFI
:snprintf(exp
, size
, "LOCK_AFI");break;
186 case ISO15693_WRITE_DSFID
:snprintf(exp
, size
, "WRITE_DSFID");break;
187 case ISO15693_LOCK_DSFID
:snprintf(exp
, size
, "LOCK_DSFID");break;
188 case ISO15693_GET_SYSTEM_INFO
:snprintf(exp
, size
, "GET_SYSTEM_INFO");break;
189 case ISO15693_READ_MULTI_SECSTATUS
:snprintf(exp
, size
, "READ_MULTI_SECSTATUS");break;
190 default: snprintf(exp
,size
,"?"); break;
196 void annotateTopaz(char *exp
, size_t size
, uint8_t* cmd
, uint8_t cmdsize
)
199 case TOPAZ_REQA
:snprintf(exp
, size
, "REQA");break;
200 case TOPAZ_WUPA
:snprintf(exp
, size
, "WUPA");break;
201 case TOPAZ_RID
:snprintf(exp
, size
, "RID");break;
202 case TOPAZ_RALL
:snprintf(exp
, size
, "RALL");break;
203 case TOPAZ_READ
:snprintf(exp
, size
, "READ");break;
204 case TOPAZ_WRITE_E
:snprintf(exp
, size
, "WRITE-E");break;
205 case TOPAZ_WRITE_NE
:snprintf(exp
, size
, "WRITE-NE");break;
206 case TOPAZ_RSEG
:snprintf(exp
, size
, "RSEG");break;
207 case TOPAZ_READ8
:snprintf(exp
, size
, "READ8");break;
208 case TOPAZ_WRITE_E8
:snprintf(exp
, size
, "WRITE-E8");break;
209 case TOPAZ_WRITE_NE8
:snprintf(exp
, size
, "WRITE-NE8");break;
210 default: snprintf(exp
,size
,"?"); break;
217 0E xx = SELECT ID (xx = Chip-ID)
219 08 yy = Read Block (yy = block number)
220 09 yy dd dd dd dd = Write Block (yy = block number; dd dd dd dd = data to be written)
221 0C = Reset to Inventory
223 0A 11 22 33 44 55 66 = Authenticate (11 22 33 44 55 66 = data to authenticate)
226 void annotateIso14443b(char *exp
, size_t size
, uint8_t* cmd
, uint8_t cmdsize
)
229 case ISO14443B_REQB
: snprintf(exp
,size
,"REQB");break;
230 case ISO14443B_ATTRIB
: snprintf(exp
,size
,"ATTRIB");break;
231 case ISO14443B_HALT
: snprintf(exp
,size
,"HALT");break;
232 case ISO14443B_INITIATE
: snprintf(exp
,size
,"INITIATE");break;
233 case ISO14443B_SELECT
: snprintf(exp
,size
,"SELECT(%d)",cmd
[1]);break;
234 case ISO14443B_GET_UID
: snprintf(exp
,size
,"GET UID");break;
235 case ISO14443B_READ_BLK
: snprintf(exp
,size
,"READ_BLK(%d)", cmd
[1]);break;
236 case ISO14443B_WRITE_BLK
: snprintf(exp
,size
,"WRITE_BLK(%d)",cmd
[1]);break;
237 case ISO14443B_RESET
: snprintf(exp
,size
,"RESET");break;
238 case ISO14443B_COMPLETION
: snprintf(exp
,size
,"COMPLETION");break;
239 case ISO14443B_AUTHENTICATE
: snprintf(exp
,size
,"AUTHENTICATE");break;
240 default : snprintf(exp
,size
,"?");break;
246 * @brief iso14443A_CRC_check Checks CRC in command or response
250 * @return 0 : CRC-command, CRC not ok
251 * 1 : CRC-command, CRC ok
252 * 2 : Not crc-command
255 uint8_t iso14443A_CRC_check(bool isResponse
, uint8_t* data
, uint8_t len
)
259 if(len
<= 2) return 2;
261 if(isResponse
& (len
< 6)) return 2;
263 ComputeCrc14443(CRC_14443_A
, data
, len
-2, &b1
, &b2
);
264 if (b1
!= data
[len
-2] || b2
!= data
[len
-1]) {
273 * @brief iso14443B_CRC_check Checks CRC in command or response
277 * @return 0 : CRC-command, CRC not ok
278 * 1 : CRC-command, CRC ok
279 * 2 : Not crc-command
282 uint8_t iso14443B_CRC_check(bool isResponse
, uint8_t* data
, uint8_t len
)
286 if(len
<= 2) return 2;
288 ComputeCrc14443(CRC_14443_B
, data
, len
-2, &b1
, &b2
);
289 if(b1
!= data
[len
-2] || b2
!= data
[len
-1]) {
296 * @brief iclass_CRC_Ok Checks CRC in command or response
300 * @return 0 : CRC-command, CRC not ok
301 * 1 : CRC-command, CRC ok
302 * 2 : Not crc-command
304 uint8_t iclass_CRC_check(bool isResponse
, uint8_t* data
, uint8_t len
)
306 if(len
< 4) return 2;//CRC commands (and responses) are all at least 4 bytes
310 if(!isResponse
)//Commands to tag
313 These commands should have CRC. Total length leftmost
316 12 UPDATE - unsecured, ends with CRC16
317 14 UPDATE - secured, ends with signature instead
320 if(len
== 4 || len
== 12)//Covers three of them
322 //Don't include the command byte
323 ComputeCrc14443(CRC_ICLASS
, (data
+1), len
-3, &b1
, &b2
);
324 return b1
== data
[len
-2] && b2
== data
[len
-1];
329 These tag responses should have CRC. Total length leftmost
331 10 READ data[8] crc[2]
332 34 READ4 data[32]crc[2]
333 10 UPDATE data[8] crc[2]
334 10 SELECT csn[8] crc[2]
335 10 IDENTIFY asnb[8] crc[2]
336 10 PAGESEL block1[8] crc[2]
337 10 DETECT csn[8] crc[2]
341 4 CHECK chip_response[4]
346 In conclusion, without looking at the command; any response
347 of length 10 or 34 should have CRC
349 if(len
!= 10 && len
!= 34) return true;
351 ComputeCrc14443(CRC_ICLASS
, data
, len
-2, &b1
, &b2
);
352 return b1
== data
[len
-2] && b2
== data
[len
-1];
357 bool is_last_record(uint16_t tracepos
, uint8_t *trace
, uint16_t traceLen
)
359 return(tracepos
+ sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint16_t) >= traceLen
);
363 bool next_record_is_response(uint16_t tracepos
, uint8_t *trace
)
365 uint16_t next_records_datalen
= *((uint16_t *)(trace
+ tracepos
+ sizeof(uint32_t) + sizeof(uint16_t)));
367 return(next_records_datalen
& 0x8000);
371 bool merge_topaz_reader_frames(uint32_t timestamp
, uint32_t *duration
, uint16_t *tracepos
, uint16_t traceLen
, uint8_t *trace
, uint8_t *frame
, uint8_t *topaz_reader_command
, uint16_t *data_len
)
374 #define MAX_TOPAZ_READER_CMD_LEN 16
376 uint32_t last_timestamp
= timestamp
+ *duration
;
378 if ((*data_len
!= 1) || (frame
[0] == TOPAZ_WUPA
) || (frame
[0] == TOPAZ_REQA
)) return false;
380 memcpy(topaz_reader_command
, frame
, *data_len
);
382 while (!is_last_record(*tracepos
, trace
, traceLen
) && !next_record_is_response(*tracepos
, trace
)) {
383 uint32_t next_timestamp
= *((uint32_t *)(trace
+ *tracepos
));
384 *tracepos
+= sizeof(uint32_t);
385 uint16_t next_duration
= *((uint16_t *)(trace
+ *tracepos
));
386 *tracepos
+= sizeof(uint16_t);
387 uint16_t next_data_len
= *((uint16_t *)(trace
+ *tracepos
)) & 0x7FFF;
388 *tracepos
+= sizeof(uint16_t);
389 uint8_t *next_frame
= (trace
+ *tracepos
);
390 *tracepos
+= next_data_len
;
391 if ((next_data_len
== 1) && (*data_len
+ next_data_len
<= MAX_TOPAZ_READER_CMD_LEN
)) {
392 memcpy(topaz_reader_command
+ *data_len
, next_frame
, next_data_len
);
393 *data_len
+= next_data_len
;
394 last_timestamp
= next_timestamp
+ next_duration
;
397 *tracepos
= *tracepos
- next_data_len
- sizeof(uint16_t) - sizeof(uint16_t) - sizeof(uint32_t);
400 uint16_t next_parity_len
= (next_data_len
-1)/8 + 1;
401 *tracepos
+= next_parity_len
;
404 *duration
= last_timestamp
- timestamp
;
410 uint16_t printTraceLine(uint16_t tracepos
, uint16_t traceLen
, uint8_t *trace
, uint8_t protocol
, bool showWaitCycles
, bool markCRCBytes
)
413 uint16_t data_len
, parity_len
;
415 uint8_t topaz_reader_command
[9];
416 uint32_t timestamp
, first_timestamp
, EndOfTransmissionTimestamp
;
417 char explanation
[30] = {0};
419 if (tracepos
+ sizeof(uint32_t) + sizeof(uint16_t) + sizeof(uint16_t) > traceLen
) return traceLen
;
421 first_timestamp
= *((uint32_t *)(trace
));
422 timestamp
= *((uint32_t *)(trace
+ tracepos
));
425 duration
= *((uint16_t *)(trace
+ tracepos
));
427 data_len
= *((uint16_t *)(trace
+ tracepos
));
430 if (data_len
& 0x8000) {
436 parity_len
= (data_len
-1)/8 + 1;
438 if (tracepos
+ data_len
+ parity_len
> traceLen
) {
441 uint8_t *frame
= trace
+ tracepos
;
442 tracepos
+= data_len
;
443 uint8_t *parityBytes
= trace
+ tracepos
;
444 tracepos
+= parity_len
;
446 if (protocol
== TOPAZ
&& !isResponse
) {
447 // topaz reader commands come in 1 or 9 separate frames with 7 or 8 Bits each.
449 if (merge_topaz_reader_frames(timestamp
, &duration
, &tracepos
, traceLen
, trace
, frame
, topaz_reader_command
, &data_len
)) {
450 frame
= topaz_reader_command
;
454 //Check the CRC status
455 uint8_t crcStatus
= 2;
460 crcStatus
= iclass_CRC_check(isResponse
, frame
, data_len
);
464 crcStatus
= iso14443B_CRC_check(isResponse
, frame
, data_len
);
467 crcStatus
= iso14443A_CRC_check(isResponse
, frame
, data_len
);
473 //0 CRC-command, CRC not ok
474 //1 CRC-command, CRC ok
477 //--- Draw the data column
478 //char line[16][110];
481 for (int j
= 0; j
< data_len
&& j
/16 < 16; j
++) {
483 int oddparity
= 0x01;
486 for (k
=0 ; k
<8 ; k
++) {
487 oddparity
^= (((frame
[j
] & 0xFF) >> k
) & 0x01);
489 uint8_t parityBits
= parityBytes
[j
>>3];
490 if (isResponse
&& (oddparity
!= ((parityBits
>> (7-(j
&0x0007))) & 0x01))) {
491 snprintf(line
[j
/16]+(( j
% 16) * 4),110, "%02x! ", frame
[j
]);
493 snprintf(line
[j
/16]+(( j
% 16) * 4),110, "%02x ", frame
[j
]);
499 if(crcStatus
== 0 || crcStatus
== 1)
501 char *pos1
= line
[(data_len
-2)/16]+(((data_len
-2) % 16) * 4);
503 char *pos2
= line
[(data_len
)/16]+(((data_len
) % 16) * 4);
504 sprintf(pos2
, "%c", ']');
511 sprintf(line
[0],"<empty trace - possible error>");
514 //--- Draw the CRC column
516 char *crc
= (crcStatus
== 0 ? "!crc" : (crcStatus
== 1 ? " ok " : " "));
518 EndOfTransmissionTimestamp
= timestamp
+ duration
;
523 case ICLASS
: annotateIclass(explanation
,sizeof(explanation
),frame
,data_len
); break;
524 case ISO_14443A
: annotateIso14443a(explanation
,sizeof(explanation
),frame
,data_len
); break;
525 case ISO_14443B
: annotateIso14443b(explanation
,sizeof(explanation
),frame
,data_len
); break;
526 case TOPAZ
: annotateTopaz(explanation
,sizeof(explanation
),frame
,data_len
); break;
531 int num_lines
= MIN((data_len
- 1)/16 + 1, 16);
532 for (int j
= 0; j
< num_lines
; j
++) {
534 PrintAndLog(" %10d | %10d | %s |%-64s | %s| %s",
535 (timestamp
- first_timestamp
),
536 (EndOfTransmissionTimestamp
- first_timestamp
),
537 (isResponse
? "Tag" : "Rdr"),
539 (j
== num_lines
-1) ? crc
: " ",
540 (j
== num_lines
-1) ? explanation
: "");
542 PrintAndLog(" | | | %-64s| %s| %s",
544 (j
== num_lines
-1)?crc
:" ",
545 (j
== num_lines
-1) ? explanation
: "");
549 if (is_last_record(tracepos
, trace
, traceLen
)) return traceLen
;
551 if (showWaitCycles
&& !isResponse
&& next_record_is_response(tracepos
, trace
)) {
552 uint32_t next_timestamp
= *((uint32_t *)(trace
+ tracepos
));
553 PrintAndLog(" %9d | %9d | %s | fdt (Frame Delay Time): %d",
554 (EndOfTransmissionTimestamp
- first_timestamp
),
555 (next_timestamp
- first_timestamp
),
557 (next_timestamp
- EndOfTransmissionTimestamp
));
564 int CmdHFList(const char *Cmd
)
566 bool showWaitCycles
= false;
567 bool markCRCBytes
= false;
569 int tlen
= param_getstr(Cmd
,0,type
);
570 char param1
= param_getchar(Cmd
, 1);
571 char param2
= param_getchar(Cmd
, 2);
573 uint8_t protocol
= 0;
581 || (param1
!= 0 && param1
!= 'f' && param1
!= 'c')
582 || (param2
!= 0 && param2
!= 'f' && param2
!= 'c')) {
587 if(strcmp(type
, "iclass") == 0) {
589 } else if(strcmp(type
, "14a") == 0) {
590 protocol
= ISO_14443A
;
591 } else if(strcmp(type
, "14b") == 0) {
592 protocol
= ISO_14443B
;
593 } else if(strcmp(type
,"topaz")== 0) {
595 } else if(strcmp(type
,"raw")== 0) {
596 protocol
= -1;//No crc, no annotations
603 PrintAndLog("List protocol data in trace buffer.");
604 PrintAndLog("Usage: hf list <protocol> [f][c]");
605 PrintAndLog(" f - show frame delay times as well");
606 PrintAndLog(" c - mark CRC bytes");
607 PrintAndLog("Supported <protocol> values:");
608 PrintAndLog(" raw - just show raw data without annotations");
609 PrintAndLog(" 14a - interpret data as iso14443a communications");
610 PrintAndLog(" 14b - interpret data as iso14443b communications");
611 PrintAndLog(" iclass - interpret data as iclass communications");
612 PrintAndLog(" topaz - interpret data as topaz communications");
614 PrintAndLog("example: hf list 14a f");
615 PrintAndLog("example: hf list iclass");
620 if (param1
== 'f' || param2
== 'f') {
621 showWaitCycles
= true;
624 if (param1
== 'c' || param2
== 'c') {
629 uint16_t tracepos
= 0;
630 trace
= malloc(USB_CMD_DATA_SIZE
);
632 // Query for the size of the trace
634 GetFromBigBuf(trace
, USB_CMD_DATA_SIZE
, 0);
635 WaitForResponse(CMD_ACK
, &response
);
636 uint16_t traceLen
= response
.arg
[2];
637 if (traceLen
> USB_CMD_DATA_SIZE
) {
638 uint8_t *p
= realloc(trace
, traceLen
);
640 PrintAndLog("Cannot allocate memory for trace");
645 GetFromBigBuf(trace
, traceLen
, 0);
646 WaitForResponse(CMD_ACK
, NULL
);
649 PrintAndLog("Recorded Activity (TraceLen = %d bytes)", traceLen
);
651 PrintAndLog("Start = Start of Start Bit, End = End of last modulation. Src = Source of Transfer");
652 PrintAndLog("iso14443a - All times are in carrier periods (1/13.56Mhz)");
653 PrintAndLog("iClass - Timings are not as accurate");
655 PrintAndLog(" Start | End | Src | Data (! denotes parity error) | CRC | Annotation |");
656 PrintAndLog("------------|------------|-----|-----------------------------------------------------------------|-----|--------------------|");
658 while(tracepos
< traceLen
)
660 tracepos
= printTraceLine(tracepos
, traceLen
, trace
, protocol
, showWaitCycles
, markCRCBytes
);
667 int CmdHFSearch(const char *Cmd
){
669 ans
= CmdHF14AReader(Cmd
);
670 if (ans
> 0) return ans
;
672 ans
= CmdHF15Reader(Cmd
);
673 //if (ans > 0) return ans;
675 ans
= CmdHF14BRead(Cmd
);
676 //if (ans > 0) return ans;
678 ans
= CmdHFiClassReader(Cmd
);
679 //if (ans > 0) return ans;
683 static command_t CommandTable
[] =
685 {"help", CmdHelp
, 1, "This help"},
686 {"14a", CmdHF14A
, 1, "{ ISO14443A RFIDs... }"},
687 {"14b", CmdHF14B
, 1, "{ ISO14443B RFIDs... }"},
688 {"15", CmdHF15
, 1, "{ ISO15693 RFIDs... }"},
689 {"epa", CmdHFEPA
, 1, "{ German Identification Card... }"},
690 {"legic", CmdHFLegic
, 0, "{ LEGIC RFIDs... }"},
691 {"iclass", CmdHFiClass
, 1, "{ ICLASS RFIDs... }"},
692 {"mf", CmdHFMF
, 1, "{ MIFARE RFIDs... }"},
693 {"mfu", CmdHFMFUltra
, 1, "{ MIFARE Ultralight RFIDs... }"},
694 {"mfdes", CmdHFMFDes
, 1, "{ MIFARE Desfire RFIDs... }"},
695 {"topaz", CmdHFTopaz
, 1, "{ TOPAZ (NFC Type 1) RFIDs... }"},
696 {"tune", CmdHFTune
, 0, "Continuously measure HF antenna tuning"},
697 {"list", CmdHFList
, 1, "List protocol data in trace buffer"},
698 {"search", CmdHFSearch
, 1, "Search for known HF tags"},
699 {NULL
, NULL
, 0, NULL
}
702 int CmdHF(const char *Cmd
)
704 CmdsParse(CommandTable
, Cmd
);
708 int CmdHelp(const char *Cmd
)
710 CmdsHelp(CommandTable
);