]> git.zerfleddert.de Git - proxmark3-svn/blob - client/cmdlft55xx.c
ADD: @marshmellows42 's fixes for "lf cmdread" and CHANGELOG.md
[proxmark3-svn] / client / cmdlft55xx.c
1 //-----------------------------------------------------------------------------
2 //
3 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
4 // at your option, any later version. See the LICENSE.txt file for the text of
5 // the license.
6 //-----------------------------------------------------------------------------
7 // Low frequency T55xx commands
8 //-----------------------------------------------------------------------------
9
10 #include <stdio.h>
11 #include <string.h>
12 #include <inttypes.h>
13 #include <time.h>
14 #include "proxmark3.h"
15 #include "ui.h"
16 #include "graph.h"
17 #include "cmdmain.h"
18 #include "cmdparser.h"
19 #include "cmddata.h"
20 #include "cmdlf.h"
21 #include "cmdlft55xx.h"
22 #include "util.h"
23 #include "data.h"
24 #include "lfdemod.h"
25 #include "../common/crc.h"
26 #include "../common/iso14443crc.h"
27 #include "cmdhf14a.h"
28
29 #define CONFIGURATION_BLOCK 0x00
30 #define TRACE_BLOCK 0x01
31 #define T55x7_PWD 0x00000010
32
33 // Default configuration
34 t55xx_conf_block_t config = { .modulation = DEMOD_ASK, .inverted = FALSE, .offset = 0x00, .block0 = 0x00};
35
36 int usage_t55xx_config(){
37 PrintAndLog("Usage: lf t55xx config [d <demodulation>] [i 1] [o <offset>]");
38 PrintAndLog("Options:");
39 PrintAndLog(" h This help");
40 PrintAndLog(" b <8|16|32|40|50|64|100|128> Set bitrate");
41 PrintAndLog(" d <FSK|FSK1|FSK1a|FSK2|FSK2a|ASK|PSK1|PSK2|NRZ|BI|BIa> Set demodulation FSK / ASK / PSK / NRZ / Biphase / Biphase A");
42 PrintAndLog(" i [1] Invert data signal, defaults to normal");
43 PrintAndLog(" o [offset] Set offset, where data should start decode in bitstream");
44 PrintAndLog("");
45 PrintAndLog("Examples:");
46 PrintAndLog(" lf t55xx config d FSK - FSK demodulation");
47 PrintAndLog(" lf t55xx config d FSK i 1 - FSK demodulation, inverse data");
48 PrintAndLog(" lf t55xx config d FSK i 1 o 3 - FSK demodulation, inverse data, offset=3,start from position 3 to decode data");
49 PrintAndLog("");
50 return 0;
51 }
52 int usage_t55xx_read(){
53 PrintAndLog("Usage: lf t55xx read b <block> p <password> <override_safety> <wakeup>");
54 PrintAndLog("Options:");
55 PrintAndLog(" b <block>, block number to read. Between 0-7");
56 PrintAndLog(" p <password>, OPTIONAL password 4bytes (8 hex symbols)");
57 PrintAndLog(" o, OPTIONAL override safety check");
58 PrintAndLog(" w, OPTIONAL wakeup");
59 PrintAndLog(" ****WARNING****");
60 PrintAndLog(" Use of read with password on a tag not configured for a pwd");
61 PrintAndLog(" can damage the tag");
62 PrintAndLog("");
63 PrintAndLog("Examples:");
64 PrintAndLog(" lf t55xx read b 0 - read data from block 0");
65 PrintAndLog(" lf t55xx read b 0 p feedbeef - read data from block 0 password feedbeef");
66 PrintAndLog(" lf t55xx read b 0 p feedbeef o - read data from block 0 password feedbeef safety check");
67 PrintAndLog("");
68 return 0;
69 }
70 int usage_t55xx_write(){
71 PrintAndLog("Usage: lf t55xx write <block> <data> [password]");
72 PrintAndLog("Options:");
73 PrintAndLog(" <block>, block number to write. Between 0-7");
74 PrintAndLog(" <data>, 4 bytes of data to write (8 hex symbols)");
75 PrintAndLog(" [password], OPTIONAL password 4bytes (8 hex symbols)");
76 PrintAndLog("");
77 PrintAndLog("Examples:");
78 PrintAndLog(" lf t55xx write 3 11223344 - write 11223344 to block 3");
79 PrintAndLog(" lf t55xx write 3 11223344 feedbeef - write 11223344 to block 3 password feedbeef");
80 PrintAndLog("");
81 return 0;
82 }
83 int usage_t55xx_trace() {
84 PrintAndLog("Usage: lf t55xx trace [1]");
85 PrintAndLog("Options:");
86 PrintAndLog(" [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");
87 PrintAndLog("");
88 PrintAndLog("Examples:");
89 PrintAndLog(" lf t55xx trace");
90 PrintAndLog(" lf t55xx trace 1");
91 PrintAndLog("");
92 return 0;
93 }
94 int usage_t55xx_info() {
95 PrintAndLog("Usage: lf t55xx info [1]");
96 PrintAndLog("Options:");
97 PrintAndLog(" [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");
98 PrintAndLog("");
99 PrintAndLog("Examples:");
100 PrintAndLog(" lf t55xx info");
101 PrintAndLog(" lf t55xx info 1");
102 PrintAndLog("");
103 return 0;
104 }
105 int usage_t55xx_dump(){
106 PrintAndLog("Usage: lf t55xx dump <password>");
107 PrintAndLog("Options:");
108 PrintAndLog(" <password>, OPTIONAL password 4bytes (8 hex symbols)");
109 PrintAndLog("");
110 PrintAndLog("Examples:");
111 PrintAndLog(" lf t55xx dump");
112 PrintAndLog(" lf t55xx dump feedbeef");
113 PrintAndLog("");
114 return 0;
115 }
116 int usage_t55xx_detect(){
117 PrintAndLog("Usage: lf t55xx detect [1]");
118 PrintAndLog("Options:");
119 PrintAndLog(" [graph buffer data], if set, use Graphbuffer otherwise read data from tag.");
120 PrintAndLog("");
121 PrintAndLog("Examples:");
122 PrintAndLog(" lf t55xx detect");
123 PrintAndLog(" lf t55xx detect 1");
124 PrintAndLog("");
125 return 0;
126 }
127 int usage_t55xx_wakup(){
128 PrintAndLog("Usage: lf t55xx wakeup [h] p <password>");
129 PrintAndLog("This commands send the Answer-On-Request command and leaves the readerfield ON afterwards.");
130 PrintAndLog("Options:");
131 PrintAndLog(" h - this help");
132 PrintAndLog(" p <password> - password 4bytes (8 hex symbols)");
133 PrintAndLog("");
134 PrintAndLog("Examples:");
135 PrintAndLog(" lf t55xx wakeup p 11223344 - send wakeup password");
136 return 0;
137 }
138
139 static int CmdHelp(const char *Cmd);
140
141 int CmdT55xxSetConfig(const char *Cmd) {
142
143 uint8_t offset = 0;
144 bool errors = FALSE;
145 uint8_t cmdp = 0;
146 char modulation[5] = {0x00};
147 char tmp = 0x00;
148 uint8_t bitRate = 0;
149 uint8_t rates[9] = {8,16,32,40,50,64,100,128,0};
150 while(param_getchar(Cmd, cmdp) != 0x00 && !errors)
151 {
152 tmp = param_getchar(Cmd, cmdp);
153 switch(tmp)
154 {
155 case 'h':
156 case 'H':
157 return usage_t55xx_config();
158 case 'b':
159 errors |= param_getdec(Cmd, cmdp+1, &bitRate);
160 if ( !errors){
161 uint8_t i = 0;
162 for (; i < 9; i++){
163 if (rates[i]==bitRate) {
164 config.bitrate = i;
165 break;
166 }
167 }
168 if (i==9) errors = TRUE;
169 }
170 cmdp+=2;
171 break;
172 case 'd':
173 param_getstr(Cmd, cmdp+1, modulation);
174 cmdp += 2;
175
176 if ( strcmp(modulation, "FSK" ) == 0) {
177 config.modulation = DEMOD_FSK;
178 } else if ( strcmp(modulation, "FSK1" ) == 0) {
179 config.modulation = DEMOD_FSK1;
180 config.inverted=1;
181 } else if ( strcmp(modulation, "FSK1a" ) == 0) {
182 config.modulation = DEMOD_FSK1a;
183 config.inverted=0;
184 } else if ( strcmp(modulation, "FSK2" ) == 0) {
185 config.modulation = DEMOD_FSK2;
186 config.inverted=0;
187 } else if ( strcmp(modulation, "FSK2a" ) == 0) {
188 config.modulation = DEMOD_FSK2a;
189 config.inverted=1;
190 } else if ( strcmp(modulation, "ASK" ) == 0) {
191 config.modulation = DEMOD_ASK;
192 } else if ( strcmp(modulation, "NRZ" ) == 0) {
193 config.modulation = DEMOD_NRZ;
194 } else if ( strcmp(modulation, "PSK1" ) == 0) {
195 config.modulation = DEMOD_PSK1;
196 } else if ( strcmp(modulation, "PSK2" ) == 0) {
197 config.modulation = DEMOD_PSK2;
198 } else if ( strcmp(modulation, "PSK3" ) == 0) {
199 config.modulation = DEMOD_PSK3;
200 } else if ( strcmp(modulation, "BIa" ) == 0) {
201 config.modulation = DEMOD_BIa;
202 config.inverted=1;
203 } else if ( strcmp(modulation, "BI" ) == 0) {
204 config.modulation = DEMOD_BI;
205 config.inverted=0;
206 } else {
207 PrintAndLog("Unknown modulation '%s'", modulation);
208 errors = TRUE;
209 }
210 break;
211 case 'i':
212 config.inverted = param_getchar(Cmd,cmdp+1) == '1';
213 cmdp+=2;
214 break;
215 case 'o':
216 errors |= param_getdec(Cmd, cmdp+1, &offset);
217 if ( !errors )
218 config.offset = offset;
219 cmdp+=2;
220 break;
221 default:
222 PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));
223 errors = TRUE;
224 break;
225 }
226 }
227
228 // No args
229 if (cmdp == 0) {
230 printConfiguration( config );
231 return 0;
232 }
233 //Validations
234 if (errors)
235 return usage_t55xx_config();
236
237 config.block0 = 0;
238 printConfiguration ( config );
239 return 0;
240 }
241
242 int CmdT55xxReadBlock(const char *Cmd) {
243 uint8_t block = 255;
244 uint8_t wake = 0;
245 uint8_t usepwd = 0;
246 uint32_t password = 0xFFFFFFFF; //default to blank Block 7
247 uint8_t override = 0;
248 uint8_t cmdp = 0;
249 bool errors = false;
250 while(param_getchar(Cmd, cmdp) != 0x00 && !errors) {
251 switch(param_getchar(Cmd, cmdp)) {
252 case 'h':
253 case 'H':
254 return usage_t55xx_read();
255 case 'b':
256 case 'B':
257 errors |= param_getdec(Cmd, cmdp+1, &block);
258 cmdp+=2;
259 break;
260 case 'o':
261 case 'O':
262 override = 1;
263 cmdp++;
264 break;
265 case 'p':
266 case 'P':
267 password = param_get32ex(Cmd, cmdp+1, 0, 10);
268 usepwd = 1;
269 cmdp+=2;
270 break;
271 case 'w':
272 case 'W':
273 wake = 1;
274 cmdp++;
275 break;
276 default:
277 PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));
278 errors = true;
279 break;
280 }
281 }
282 if (errors) return usage_t55xx_read();
283 if (wake && !usepwd) {
284 PrintAndLog("Wake command must use a pwd");
285 return 1;
286 }
287 if ((block > 7) && !wake) {
288 PrintAndLog("Block must be between 0 and 7");
289 return 1;
290 }
291
292 UsbCommand c = {CMD_T55XX_READ_BLOCK, {0, block, password}};
293
294 //Password mode
295 if ( usepwd || wake ) {
296 // try reading the config block and verify that PWD bit is set before doing this!
297 if ( wake || override ) {
298 c.arg[0] = (wake<<8) & usepwd;
299 if ( !wake && override )
300 PrintAndLog("Safety Check Overriden - proceeding despite risk");
301 } else {
302 AquireData( CONFIGURATION_BLOCK );
303 if ( !tryDetectModulation() ) {
304 PrintAndLog("Safety Check: Could not detect if PWD bit is set in config block. Exits.");
305 return 1;
306 } else {
307 PrintAndLog("Safety Check: PWD bit is NOT set in config block. Reading without password...");
308 }
309 }
310 }
311
312 clearCommandBuffer();
313 SendCommand(&c);
314 if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) {
315 PrintAndLog("command execution time out");
316 return 2;
317 }
318
319 uint8_t got[12000];
320 GetFromBigBuf(got,sizeof(got),0);
321 WaitForResponse(CMD_ACK,NULL);
322 setGraphBuf(got, sizeof(got));
323 //DemodBufferLen=0;
324 if (!DecodeT55xxBlock()) return 3;
325 char blk[10]={0};
326 if ( wake ) {
327 sprintf(blk,"wake");
328 } else {
329 sprintf(blk,"%d", block);
330 }
331 printT55xxBlock(blk);
332 return 0;
333 }
334
335 bool DecodeT55xxBlock(){
336
337 char buf[30] = {0x00};
338 char *cmdStr = buf;
339 int ans = 0;
340 uint8_t bitRate[8] = {8,16,32,40,50,64,100,128};
341 DemodBufferLen = 0x00;
342
343 //trim 1/2 a clock from beginning
344 //snprintf(cmdStr, sizeof(buf),"%d", bitRate[config.bitrate]/2 );
345 //CmdLtrim(cmdStr);
346 switch( config.modulation ){
347 case DEMOD_FSK:
348 snprintf(cmdStr, sizeof(buf),"%d %d", bitRate[config.bitrate], config.inverted );
349 ans = FSKrawDemod(cmdStr, FALSE);
350 break;
351 case DEMOD_FSK1:
352 case DEMOD_FSK1a:
353 snprintf(cmdStr, sizeof(buf),"%d %d 8 5", bitRate[config.bitrate], config.inverted );
354 ans = FSKrawDemod(cmdStr, FALSE);
355 break;
356 case DEMOD_FSK2:
357 case DEMOD_FSK2a:
358 snprintf(cmdStr, sizeof(buf),"%d %d 10 8", bitRate[config.bitrate], config.inverted );
359 ans = FSKrawDemod(cmdStr, FALSE);
360 break;
361 case DEMOD_ASK:
362 snprintf(cmdStr, sizeof(buf),"%d %d 0", bitRate[config.bitrate], config.inverted );
363 ans = ASKDemod(cmdStr, FALSE, FALSE, 1);
364 break;
365 case DEMOD_PSK1:
366 snprintf(cmdStr, sizeof(buf),"%d %d 0", bitRate[config.bitrate], config.inverted );
367 ans = PSKDemod(cmdStr, FALSE);
368 break;
369 case DEMOD_PSK2: //inverted won't affect this
370 case DEMOD_PSK3: //not fully implemented
371 snprintf(cmdStr, sizeof(buf),"%d 0 1", bitRate[config.bitrate] );
372 ans = PSKDemod(cmdStr, FALSE);
373 psk1TOpsk2(DemodBuffer, DemodBufferLen);
374 break;
375 case DEMOD_NRZ:
376 snprintf(cmdStr, sizeof(buf),"%d %d 1", bitRate[config.bitrate], config.inverted );
377 ans = NRZrawDemod(cmdStr, FALSE);
378 break;
379 case DEMOD_BI:
380 case DEMOD_BIa:
381 snprintf(cmdStr, sizeof(buf),"0 %d %d 0", bitRate[config.bitrate], config.inverted );
382 ans = ASKbiphaseDemod(cmdStr, FALSE);
383 break;
384 default:
385 return FALSE;
386 }
387 return (bool) ans;
388 }
389
390 int CmdT55xxDetect(const char *Cmd){
391
392 char cmdp = param_getchar(Cmd, 0);
393 if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H')
394 return usage_t55xx_detect();
395
396 if (strlen(Cmd)==0)
397 AquireData( CONFIGURATION_BLOCK );
398
399 if ( !tryDetectModulation() )
400 PrintAndLog("Could not detect modulation automatically. Try setting it manually with \'lf t55xx config\'");
401
402 return 0;
403 }
404
405 // detect configuration?
406 bool tryDetectModulation(){
407 //char cmdStr[8] = {0};
408 uint8_t hits = 0;
409 t55xx_conf_block_t tests[15];
410 int bitRate=0;
411 uint8_t fc1 = 0, fc2 = 0, clk=0;
412 save_restoreGB(1);
413 if (GetFskClock("", FALSE, FALSE)){
414 fskClocks(&fc1, &fc2, &clk, FALSE);
415 //sprintf(cmdStr,"%d", clk/2);
416 //CmdLtrim(cmdStr);
417 if ( FSKrawDemod("0 0", FALSE) && test(DEMOD_FSK, &tests[hits].offset, &bitRate)){
418 tests[hits].modulation = DEMOD_FSK;
419 if (fc1==8 && fc2 == 5)
420 tests[hits].modulation = DEMOD_FSK1a;
421 else if (fc1==10 && fc2 == 8)
422 tests[hits].modulation = DEMOD_FSK2;
423 tests[hits].bitrate = bitRate;
424 tests[hits].inverted = FALSE;
425 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
426 ++hits;
427 }
428 if ( FSKrawDemod("0 1", FALSE) && test(DEMOD_FSK, &tests[hits].offset, &bitRate)) {
429 tests[hits].modulation = DEMOD_FSK;
430 if (fc1 == 8 && fc2 == 5)
431 tests[hits].modulation = DEMOD_FSK1;
432 else if (fc1 == 10 && fc2 == 8)
433 tests[hits].modulation = DEMOD_FSK2a;
434
435 tests[hits].bitrate = bitRate;
436 tests[hits].inverted = TRUE;
437 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
438 ++hits;
439 }
440 } else {
441 clk = GetAskClock("", FALSE, FALSE);
442 if (clk>0) {
443 //sprintf(cmdStr,"%d", clk/2);
444 //CmdLtrim(cmdStr);
445 if ( ASKDemod("0 0 0", FALSE, FALSE, 1) && test(DEMOD_ASK, &tests[hits].offset, &bitRate)) {
446 tests[hits].modulation = DEMOD_ASK;
447 tests[hits].bitrate = bitRate;
448 tests[hits].inverted = FALSE;
449 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
450 ++hits;
451 }
452 if ( ASKDemod("0 1 0", FALSE, FALSE, 1) && test(DEMOD_ASK, &tests[hits].offset, &bitRate)) {
453 tests[hits].modulation = DEMOD_ASK;
454 tests[hits].bitrate = bitRate;
455 tests[hits].inverted = TRUE;
456 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
457 ++hits;
458 }
459 if ( ASKbiphaseDemod("0 0 0 0", FALSE) && test(DEMOD_BI, &tests[hits].offset, &bitRate) ) {
460 tests[hits].modulation = DEMOD_BI;
461 tests[hits].bitrate = bitRate;
462 tests[hits].inverted = FALSE;
463 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
464 ++hits;
465 }
466 if ( ASKbiphaseDemod("0 0 1 0", FALSE) && test(DEMOD_BIa, &tests[hits].offset, &bitRate) ) {
467 tests[hits].modulation = DEMOD_BIa;
468 tests[hits].bitrate = bitRate;
469 tests[hits].inverted = TRUE;
470 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
471 ++hits;
472 }
473 }
474 //undo trim from ask
475 save_restoreGB(0);
476 clk = GetNrzClock("", FALSE, FALSE);
477 if (clk>0) {
478 //sprintf(cmdStr,"%d", clk/2);
479 //CmdLtrim(cmdStr);
480 if ( NRZrawDemod("0 0 1", FALSE) && test(DEMOD_NRZ, &tests[hits].offset, &bitRate)) {
481 tests[hits].modulation = DEMOD_NRZ;
482 tests[hits].bitrate = bitRate;
483 tests[hits].inverted = FALSE;
484 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
485 ++hits;
486 }
487
488 if ( NRZrawDemod("0 1 1", FALSE) && test(DEMOD_NRZ, &tests[hits].offset, &bitRate)) {
489 tests[hits].modulation = DEMOD_NRZ;
490 tests[hits].bitrate = bitRate;
491 tests[hits].inverted = TRUE;
492 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
493 ++hits;
494 }
495 }
496
497 //undo trim from nrz
498 save_restoreGB(0);
499 clk = GetPskClock("", FALSE, FALSE);
500 if (clk>0) {
501 //PrintAndLog("clk %d",clk);
502 //sprintf(cmdStr,"%d", clk/2);
503 //CmdLtrim(cmdStr);
504 if ( PSKDemod("0 0 1", FALSE) && test(DEMOD_PSK1, &tests[hits].offset, &bitRate)) {
505 tests[hits].modulation = DEMOD_PSK1;
506 tests[hits].bitrate = bitRate;
507 tests[hits].inverted = FALSE;
508 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
509 ++hits;
510 }
511 if ( PSKDemod("0 1 1", FALSE) && test(DEMOD_PSK1, &tests[hits].offset, &bitRate)) {
512 tests[hits].modulation = DEMOD_PSK1;
513 tests[hits].bitrate = bitRate;
514 tests[hits].inverted = TRUE;
515 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
516 ++hits;
517 }
518 // PSK2 - needs a call to psk1TOpsk2.
519 if ( PSKDemod("0 0 1", FALSE)) {
520 psk1TOpsk2(DemodBuffer, DemodBufferLen);
521 if (test(DEMOD_PSK2, &tests[hits].offset, &bitRate)){
522 tests[hits].modulation = DEMOD_PSK2;
523 tests[hits].bitrate = bitRate;
524 tests[hits].inverted = FALSE;
525 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
526 ++hits;
527 }
528 } // inverse waves does not affect this demod
529 // PSK3 - needs a call to psk1TOpsk2.
530 if ( PSKDemod("0 0 1", FALSE)) {
531 psk1TOpsk2(DemodBuffer, DemodBufferLen);
532 if (test(DEMOD_PSK3, &tests[hits].offset, &bitRate)){
533 tests[hits].modulation = DEMOD_PSK3;
534 tests[hits].bitrate = bitRate;
535 tests[hits].inverted = FALSE;
536 tests[hits].block0 = PackBits(tests[hits].offset, 32, DemodBuffer);
537 ++hits;
538 }
539 } // inverse waves does not affect this demod
540 }
541 }
542 if ( hits == 1) {
543 config.modulation = tests[0].modulation;
544 config.bitrate = tests[0].bitrate;
545 config.inverted = tests[0].inverted;
546 config.offset = tests[0].offset;
547 config.block0 = tests[0].block0;
548 printConfiguration( config );
549 return TRUE;
550 }
551
552 if ( hits > 1) {
553 PrintAndLog("Found [%d] possible matches for modulation.",hits);
554 for(int i=0; i<hits; ++i){
555 PrintAndLog("--[%d]---------------", i+1);
556 printConfiguration( tests[i] );
557 }
558 }
559 return FALSE;
560 }
561
562 bool testModulation(uint8_t mode, uint8_t modread){
563 switch( mode ){
564 case DEMOD_FSK:
565 if (modread > 3 && modread < 8) return TRUE;
566 break;
567 case DEMOD_ASK:
568 if (modread == DEMOD_ASK) return TRUE;
569 break;
570 case DEMOD_PSK1:
571 if (modread == DEMOD_PSK1) return TRUE;
572 break;
573 case DEMOD_PSK2:
574 if (modread == DEMOD_PSK2) return TRUE;
575 break;
576 case DEMOD_PSK3:
577 if (modread == DEMOD_PSK3) return TRUE;
578 break;
579 case DEMOD_NRZ:
580 if (modread == DEMOD_NRZ) return TRUE;
581 break;
582 case DEMOD_BI:
583 if (modread == DEMOD_BI) return TRUE;
584 break;
585 case DEMOD_BIa:
586 if (modread == DEMOD_BIa) return TRUE;
587 break;
588 default:
589 return FALSE;
590 }
591 return FALSE;
592 }
593
594 bool testBitRate(uint8_t readRate, uint8_t mod){
595 uint8_t expected[8] = {8, 16, 32, 40, 50, 64, 100, 128};
596 uint8_t detRate = 0;
597 switch( mod ){
598 case DEMOD_FSK:
599 case DEMOD_FSK1:
600 case DEMOD_FSK1a:
601 case DEMOD_FSK2:
602 case DEMOD_FSK2a:
603 detRate = GetFskClock("",FALSE, FALSE);
604 if (expected[readRate] == detRate)
605 return TRUE;
606 break;
607 case DEMOD_ASK:
608 case DEMOD_BI:
609 case DEMOD_BIa:
610 detRate = GetAskClock("",FALSE, FALSE);
611 if (expected[readRate] == detRate)
612 return TRUE;
613 break;
614 case DEMOD_PSK1:
615 case DEMOD_PSK2:
616 case DEMOD_PSK3:
617 detRate = GetPskClock("",FALSE, FALSE);
618 if (expected[readRate] == detRate)
619 return TRUE;
620 break;
621 case DEMOD_NRZ:
622 detRate = GetNrzClock("",FALSE, FALSE);
623 if (expected[readRate] == detRate)
624 return TRUE;
625 break;
626 default:
627 return FALSE;
628 }
629 return FALSE;
630 }
631
632 bool test(uint8_t mode, uint8_t *offset, int *fndBitRate){
633
634 if ( DemodBufferLen < 64 ) return FALSE;
635 uint8_t si = 0;
636 for (uint8_t idx = 0; idx < 64; idx++){
637 si = idx;
638 if ( PackBits(si, 32, DemodBuffer) == 0x00 ) continue;
639
640 uint8_t safer = PackBits(si, 4, DemodBuffer); si += 4; //master key
641 uint8_t resv = PackBits(si, 4, DemodBuffer); si += 4; //was 7 & +=7+3 //should be only 4 bits if extended mode
642 // 2nibble must be zeroed.
643 // moved test to here, since this gets most faults first.
644 if ( resv > 0x00) continue;
645
646 uint8_t xtRate = PackBits(si, 3, DemodBuffer); si += 3; //extended mode part of rate
647 int bitRate = PackBits(si, 3, DemodBuffer); si += 3; //bit rate
648 if (bitRate > 7) continue;
649 uint8_t extend = PackBits(si, 1, DemodBuffer); si += 1; //bit 15 extended mode
650 uint8_t modread = PackBits(si, 5, DemodBuffer); si += 5+2+1;
651 //uint8_t pskcr = PackBits(si, 2, DemodBuffer); si += 2+1; //could check psk cr
652 uint8_t nml01 = PackBits(si, 1, DemodBuffer); si += 1+5; //bit 24, 30, 31 could be tested for 0 if not extended mode
653 uint8_t nml02 = PackBits(si, 2, DemodBuffer); si += 2;
654
655 //if extended mode
656 bool extMode =( (safer == 0x6 || safer == 0x9) && extend) ? TRUE : FALSE;
657
658 if (!extMode){
659 if (nml01 || nml02 || xtRate) continue;
660 }
661 //test modulation
662 if (!testModulation(mode, modread)) continue;
663 if (!testBitRate(bitRate, mode)) continue;
664 *fndBitRate = bitRate;
665 *offset = idx;
666 return TRUE;
667 }
668 return FALSE;
669 }
670
671 void printT55xxBlock(const char *blockNum){
672
673 uint8_t i = config.offset;
674 uint8_t endpos = 32 + i;
675 uint32_t blockData = 0;
676 uint8_t bits[64] = {0x00};
677
678 if ( !DemodBufferLen) return;
679
680 if ( endpos > DemodBufferLen){
681 PrintAndLog("The configured offset %d is too big. Possible offset: %d)", i, DemodBufferLen-32);
682 return;
683 }
684
685 for (; i < endpos; ++i)
686 bits[i - config.offset]=DemodBuffer[i];
687
688 blockData = PackBits(0, 32, bits);
689 PrintAndLog("[%s] 0x%08X %s", blockNum, blockData, sprint_bin(bits,32));
690 }
691
692 int special(const char *Cmd) {
693 uint32_t blockData = 0;
694 uint8_t bits[32] = {0x00};
695
696 PrintAndLog("[OFFSET] [DATA] [BINARY]");
697 PrintAndLog("----------------------------------------------------");
698 int i,j = 0;
699 for (; j < 64; ++j){
700
701 for (i = 0; i < 32; ++i)
702 bits[i]=DemodBuffer[j+i];
703
704 blockData = PackBits(0, 32, bits);
705
706 PrintAndLog("[%02d] 0x%08X %s",j , blockData, sprint_bin(bits,32));
707 }
708 return 0;
709 }
710
711 void printConfiguration( t55xx_conf_block_t b){
712 PrintAndLog("Modulation : %s", GetSelectedModulationStr(b.modulation) );
713 PrintAndLog("Bit Rate : %s", GetBitRateStr(b.bitrate) );
714 PrintAndLog("Inverted : %s", (b.inverted) ? "Yes" : "No" );
715 PrintAndLog("Offset : %d", b.offset);
716 PrintAndLog("Block0 : 0x%08X", b.block0);
717 PrintAndLog("");
718 }
719
720 int CmdT55xxWriteBlock(const char *Cmd)
721 {
722 int block = 8; //default to invalid block
723 int data = 0xFFFFFFFF; //default to blank Block
724 int password = 0xFFFFFFFF; //default to blank Block 7
725
726 char cmdp = param_getchar(Cmd, 0);
727 if (cmdp == 'h' || cmdp == 'H') {
728 usage_t55xx_write();
729 return 0;
730 }
731
732 int res = sscanf(Cmd, "%d %x %x",&block, &data, &password);
733
734 if ( res < 2 || res > 3) {
735 usage_t55xx_write();
736 return 1;
737 }
738
739 if (block > 7) {
740 PrintAndLog("Block number must be between 0 and 7");
741 return 1;
742 }
743
744 UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {data, block, 0}};
745 UsbCommand resp;
746 c.d.asBytes[0] = 0x0;
747
748 PrintAndLog("Writing to block: %d data : 0x%08X", block, data);
749
750 //Password mode
751 if (res == 3) {
752 c.arg[2] = password;
753 c.d.asBytes[0] = 0x1;
754 PrintAndLog("pwd : 0x%08X", password);
755 }
756 clearCommandBuffer();
757 SendCommand(&c);
758 if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
759 PrintAndLog("Error occurred, device did not ACK write operation. (May be due to old firmware)");
760 return -1;
761 }
762 return 0;
763 }
764
765 int CmdT55xxReadTrace(const char *Cmd)
766 {
767 char cmdp = param_getchar(Cmd, 0);
768
769 if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H')
770 return usage_t55xx_trace();
771
772 if (strlen(Cmd)==0)
773 AquireData( TRACE_BLOCK );
774
775 if (!DecodeT55xxBlock()) return 1;
776
777 if ( !DemodBufferLen) return 1;
778
779 RepaintGraphWindow();
780 uint8_t repeat = 0;
781 if (config.offset > 5)
782 repeat = 32;
783 uint8_t si = config.offset+repeat;
784 uint32_t bl0 = PackBits(si, 32, DemodBuffer);
785 uint32_t bl1 = PackBits(si+32, 32, DemodBuffer);
786
787 uint32_t acl = PackBits(si, 8, DemodBuffer); si += 8;
788 uint32_t mfc = PackBits(si, 8, DemodBuffer); si += 8;
789 uint32_t cid = PackBits(si, 5, DemodBuffer); si += 5;
790 uint32_t icr = PackBits(si, 3, DemodBuffer); si += 3;
791 uint32_t year = PackBits(si, 4, DemodBuffer); si += 4;
792 uint32_t quarter = PackBits(si, 2, DemodBuffer); si += 2;
793 uint32_t lotid = PackBits(si, 14, DemodBuffer); si += 14;
794 uint32_t wafer = PackBits(si, 5, DemodBuffer); si += 5;
795 uint32_t dw = PackBits(si, 15, DemodBuffer);
796
797 time_t t = time(NULL);
798 struct tm tm = *localtime(&t);
799 if ( year > tm.tm_year-110)
800 year += 2000;
801 else
802 year += 2010;
803
804 if ( acl != 0xE0 ) {
805 PrintAndLog("The modulation is most likely wrong since the ACL is not 0xE0. ");
806 return 1;
807 }
808
809 PrintAndLog("");
810 PrintAndLog("-- T55xx Trace Information ----------------------------------");
811 PrintAndLog("-------------------------------------------------------------");
812 PrintAndLog(" ACL Allocation class (ISO/IEC 15963-1) : 0x%02X (%d)", acl, acl);
813 PrintAndLog(" MFC Manufacturer ID (ISO/IEC 7816-6) : 0x%02X (%d) - %s", mfc, mfc, getTagInfo(mfc));
814 PrintAndLog(" CID : 0x%02X (%d) - %s", cid, cid, GetModelStrFromCID(cid));
815 PrintAndLog(" ICR IC Revision : %d",icr );
816 PrintAndLog(" Manufactured");
817 PrintAndLog(" Year/Quarter : %d/%d",year, quarter);
818 PrintAndLog(" Lot ID : %d", lotid );
819 PrintAndLog(" Wafer number : %d", wafer);
820 PrintAndLog(" Die Number : %d", dw);
821 PrintAndLog("-------------------------------------------------------------");
822 PrintAndLog(" Raw Data - Page 1");
823 PrintAndLog(" Block 0 : 0x%08X %s", bl0, sprint_bin(DemodBuffer+config.offset+repeat,32) );
824 PrintAndLog(" Block 1 : 0x%08X %s", bl1, sprint_bin(DemodBuffer+config.offset+repeat+32,32) );
825 PrintAndLog("-------------------------------------------------------------");
826
827 /*
828 TRACE - BLOCK O
829 Bits Definition HEX
830 1-8 ACL Allocation class (ISO/IEC 15963-1) 0xE0
831 9-16 MFC Manufacturer ID (ISO/IEC 7816-6) 0x15 Atmel Corporation
832 17-21 CID 0x1 = Atmel ATA5577M1 0x2 = Atmel ATA5577M2
833 22-24 ICR IC revision
834 25-28 YEAR (BCD encoded) 9 (= 2009)
835 29-30 QUARTER 1,2,3,4
836 31-32 LOT ID
837
838 TRACE - BLOCK 1
839 1-12 LOT ID
840 13-17 Wafer number
841 18-32 DW, die number sequential
842 */
843
844 return 0;
845 }
846
847 int CmdT55xxInfo(const char *Cmd){
848 /*
849 Page 0 Block 0 Configuration data.
850 Normal mode
851 Extended mode
852 */
853 char cmdp = param_getchar(Cmd, 0);
854
855 if (strlen(Cmd) > 1 || cmdp == 'h' || cmdp == 'H')
856 return usage_t55xx_info();
857
858 if (strlen(Cmd)==0)
859 AquireData( CONFIGURATION_BLOCK );
860
861 if (!DecodeT55xxBlock()) return 1;
862
863 if ( DemodBufferLen < 32) return 1;
864
865 uint8_t si = config.offset;
866 uint32_t bl0 = PackBits(si, 32, DemodBuffer);
867
868 uint32_t safer = PackBits(si, 4, DemodBuffer); si += 4;
869 uint32_t resv = PackBits(si, 7, DemodBuffer); si += 7;
870 uint32_t dbr = PackBits(si, 3, DemodBuffer); si += 3;
871 uint32_t extend = PackBits(si, 1, DemodBuffer); si += 1;
872 uint32_t datamod = PackBits(si, 5, DemodBuffer); si += 5;
873 uint32_t pskcf = PackBits(si, 2, DemodBuffer); si += 2;
874 uint32_t aor = PackBits(si, 1, DemodBuffer); si += 1;
875 uint32_t otp = PackBits(si, 1, DemodBuffer); si += 1;
876 uint32_t maxblk = PackBits(si, 3, DemodBuffer); si += 3;
877 uint32_t pwd = PackBits(si, 1, DemodBuffer); si += 1;
878 uint32_t sst = PackBits(si, 1, DemodBuffer); si += 1;
879 uint32_t fw = PackBits(si, 1, DemodBuffer); si += 1;
880 uint32_t inv = PackBits(si, 1, DemodBuffer); si += 1;
881 uint32_t por = PackBits(si, 1, DemodBuffer); si += 1;
882
883 PrintAndLog("");
884 PrintAndLog("-- T55xx Configuration & Tag Information --------------------");
885 PrintAndLog("-------------------------------------------------------------");
886 PrintAndLog(" Safer key : %s", GetSaferStr(safer));
887 PrintAndLog(" reserved : %d", resv);
888 PrintAndLog(" Data bit rate : %s", GetBitRateStr(dbr));
889 PrintAndLog(" eXtended mode : %s", (extend) ? "Yes - Warning":"No");
890 PrintAndLog(" Modulation : %s", GetModulationStr(datamod));
891 PrintAndLog(" PSK clock frequency : %d", pskcf);
892 PrintAndLog(" AOR - Answer on Request : %s", (aor) ? "Yes":"No");
893 PrintAndLog(" OTP - One Time Pad : %s", (otp) ? "Yes - Warning":"No" );
894 PrintAndLog(" Max block : %d", maxblk);
895 PrintAndLog(" Password mode : %s", (pwd) ? "Yes":"No");
896 PrintAndLog(" Sequence Start Terminator : %s", (sst) ? "Yes":"No");
897 PrintAndLog(" Fast Write : %s", (fw) ? "Yes":"No");
898 PrintAndLog(" Inverse data : %s", (inv) ? "Yes":"No");
899 PrintAndLog(" POR-Delay : %s", (por) ? "Yes":"No");
900 PrintAndLog("-------------------------------------------------------------");
901 PrintAndLog(" Raw Data - Page 0");
902 PrintAndLog(" Block 0 : 0x%08X %s", bl0, sprint_bin(DemodBuffer+config.offset,32) );
903 PrintAndLog("-------------------------------------------------------------");
904
905 return 0;
906 }
907
908 int CmdT55xxDump(const char *Cmd){
909
910 char s[20] = {0x00};
911 uint8_t pwd[4] = {0x00};
912
913 char cmdp = param_getchar(Cmd, 0);
914 if ( cmdp == 'h' || cmdp == 'H') {
915 usage_t55xx_dump();
916 return 0;
917 }
918
919 bool hasPwd = ( strlen(Cmd) > 0);
920 if ( hasPwd ){
921 if (param_gethex(Cmd, 0, pwd, 8)) {
922 PrintAndLog("password must include 8 HEX symbols");
923 return 1;
924 }
925 }
926
927 for ( int i = 0; i <8; ++i){
928 memset(s,0,sizeof(s));
929 if ( hasPwd ) {
930 sprintf(s,"%d %02x%02x%02x%02x", i, pwd[0],pwd[1],pwd[2],pwd[3]);
931 } else {
932 sprintf(s,"%d", i);
933 }
934 CmdT55xxReadBlock(s);
935 }
936 return 0;
937 }
938
939 int AquireData( uint8_t block ){
940
941 UsbCommand c;
942
943 if ( block == CONFIGURATION_BLOCK )
944 c.cmd = CMD_T55XX_READ_BLOCK;
945 else if (block == TRACE_BLOCK )
946 c.cmd = CMD_T55XX_READ_TRACE;
947
948 c.arg[0] = 0x00;
949 c.arg[1] = 0x00;
950 c.arg[2] = 0x00;
951 c.d.asBytes[0] = 0x0;
952
953 //Password mode
954 // if ( res == 2 ) {
955 // c.arg[2] = password;
956 // c.d.asBytes[0] = 0x1;
957 // }
958
959 clearCommandBuffer();
960 SendCommand(&c);
961 if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) {
962 PrintAndLog("command execution time out");
963 return 1;
964 }
965
966 uint8_t got[12000];
967 GetFromBigBuf(got,sizeof(got),0);
968 WaitForResponse(CMD_ACK,NULL);
969 setGraphBuf(got, 12000);
970 return 0;
971 }
972
973 char * GetBitRateStr(uint32_t id){
974 static char buf[25];
975
976 char *retStr = buf;
977 switch (id){
978 case 0:
979 snprintf(retStr,sizeof(buf),"%d - RF/8",id);
980 break;
981 case 1:
982 snprintf(retStr,sizeof(buf),"%d - RF/16",id);
983 break;
984 case 2:
985 snprintf(retStr,sizeof(buf),"%d - RF/32",id);
986 break;
987 case 3:
988 snprintf(retStr,sizeof(buf),"%d - RF/40",id);
989 break;
990 case 4:
991 snprintf(retStr,sizeof(buf),"%d - RF/50",id);
992 break;
993 case 5:
994 snprintf(retStr,sizeof(buf),"%d - RF/64",id);
995 break;
996 case 6:
997 snprintf(retStr,sizeof(buf),"%d - RF/100",id);
998 break;
999 case 7:
1000 snprintf(retStr,sizeof(buf),"%d - RF/128",id);
1001 break;
1002 default:
1003 snprintf(retStr,sizeof(buf),"%d - (Unknown)",id);
1004 break;
1005 }
1006
1007 return buf;
1008 }
1009
1010 char * GetSaferStr(uint32_t id){
1011 static char buf[40];
1012 char *retStr = buf;
1013
1014 snprintf(retStr,sizeof(buf),"%d",id);
1015 if (id == 6) {
1016 snprintf(retStr,sizeof(buf),"%d - passwd",id);
1017 }
1018 if (id == 9 ){
1019 snprintf(retStr,sizeof(buf),"%d - testmode",id);
1020 }
1021
1022 return buf;
1023 }
1024
1025 char * GetModulationStr( uint32_t id){
1026 static char buf[60];
1027 char *retStr = buf;
1028
1029 switch (id){
1030 case 0:
1031 snprintf(retStr,sizeof(buf),"%d - DIRECT (ASK/NRZ)",id);
1032 break;
1033 case 1:
1034 snprintf(retStr,sizeof(buf),"%d - PSK 1 phase change when input changes",id);
1035 break;
1036 case 2:
1037 snprintf(retStr,sizeof(buf),"%d - PSK 2 phase change on bitclk if input high",id);
1038 break;
1039 case 3:
1040 snprintf(retStr,sizeof(buf),"%d - PSK 3 phase change on rising edge of input",id);
1041 break;
1042 case 4:
1043 snprintf(retStr,sizeof(buf),"%d - FSK 1 RF/8 RF/5",id);
1044 break;
1045 case 5:
1046 snprintf(retStr,sizeof(buf),"%d - FSK 2 RF/8 RF/10",id);
1047 break;
1048 case 6:
1049 snprintf(retStr,sizeof(buf),"%d - FSK 1a RF/5 RF/8",id);
1050 break;
1051 case 7:
1052 snprintf(retStr,sizeof(buf),"%d - FSK 2a RF/10 RF/8",id);
1053 break;
1054 case 8:
1055 snprintf(retStr,sizeof(buf),"%d - Manchester",id);
1056 break;
1057 case 16:
1058 snprintf(retStr,sizeof(buf),"%d - Biphase",id);
1059 break;
1060 case 0x18:
1061 snprintf(retStr,sizeof(buf),"%d - Biphase a - AKA Conditional Dephase Encoding(CDP)",id);
1062 break;
1063 case 17:
1064 snprintf(retStr,sizeof(buf),"%d - Reserved",id);
1065 break;
1066 default:
1067 snprintf(retStr,sizeof(buf),"0x%02X (Unknown)",id);
1068 break;
1069 }
1070 return buf;
1071 }
1072
1073 char * GetModelStrFromCID(uint32_t cid){
1074
1075 static char buf[10];
1076 char *retStr = buf;
1077
1078 if (cid == 1) snprintf(retStr, sizeof(buf),"ATA5577M1");
1079 if (cid == 2) snprintf(retStr, sizeof(buf),"ATA5577M2");
1080 return buf;
1081 }
1082
1083 char * GetSelectedModulationStr( uint8_t id){
1084
1085 static char buf[20];
1086 char *retStr = buf;
1087
1088 switch (id){
1089 case DEMOD_FSK:
1090 snprintf(retStr,sizeof(buf),"FSK");
1091 break;
1092 case DEMOD_FSK1:
1093 snprintf(retStr,sizeof(buf),"FSK1");
1094 break;
1095 case DEMOD_FSK1a:
1096 snprintf(retStr,sizeof(buf),"FSK1a");
1097 break;
1098 case DEMOD_FSK2:
1099 snprintf(retStr,sizeof(buf),"FSK2");
1100 break;
1101 case DEMOD_FSK2a:
1102 snprintf(retStr,sizeof(buf),"FSK2a");
1103 break;
1104 case DEMOD_ASK:
1105 snprintf(retStr,sizeof(buf),"ASK");
1106 break;
1107 case DEMOD_NRZ:
1108 snprintf(retStr,sizeof(buf),"DIRECT/NRZ");
1109 break;
1110 case DEMOD_PSK1:
1111 snprintf(retStr,sizeof(buf),"PSK1");
1112 break;
1113 case DEMOD_PSK2:
1114 snprintf(retStr,sizeof(buf),"PSK2");
1115 break;
1116 case DEMOD_PSK3:
1117 snprintf(retStr,sizeof(buf),"PSK3");
1118 break;
1119 case DEMOD_BI:
1120 snprintf(retStr,sizeof(buf),"BIPHASE");
1121 break;
1122 case DEMOD_BIa:
1123 snprintf(retStr,sizeof(buf),"BIPHASEa - (CDP)");
1124 break;
1125 default:
1126 snprintf(retStr,sizeof(buf),"(Unknown)");
1127 break;
1128 }
1129 return buf;
1130 }
1131
1132 void t55x7_create_config_block( int tagtype ){
1133 //switch?
1134
1135
1136 }
1137
1138 int CmdT55xxWakeUp(const char *Cmd) {
1139 uint32_t password = 0xFFFFFFFF; //default to blank Block 7
1140 uint8_t cmdp = 0;
1141 bool errors = false;
1142 while(param_getchar(Cmd, cmdp) != 0x00 && !errors) {
1143 switch(param_getchar(Cmd, cmdp)) {
1144 case 'h':
1145 case 'H':
1146 return usage_t55xx_wakup();
1147 case 'p':
1148 case 'P':
1149 password = param_get32ex(Cmd, cmdp+1, 0, 10);
1150 cmdp+=2;
1151 break;
1152 default:
1153 PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));
1154 errors = true;
1155 break;
1156 }
1157 }
1158 if (errors) return usage_t55xx_wakup();
1159
1160 UsbCommand c = {CMD_T55XX_WAKEUP, {password, 0, 0}};
1161
1162 clearCommandBuffer();
1163 SendCommand(&c);
1164 PrintAndLog("Wake up command sent. Try read now");
1165 return 0;
1166 }
1167
1168 /*
1169 uint32_t PackBits(uint8_t start, uint8_t len, uint8_t* bits){
1170
1171 int i = start;
1172 int j = len-1;
1173
1174 if (len > 32) return 0;
1175
1176 uint32_t tmp = 0;
1177 for (; j >= 0; --j, ++i)
1178 tmp |= bits[i] << j;
1179
1180 return tmp;
1181 }
1182 */
1183 static command_t CommandTable[] =
1184 {
1185 {"help", CmdHelp, 1, "This help"},
1186 {"config", CmdT55xxSetConfig, 1, "Set/Get T55XX configuration (modulation, inverted, offset, rate)"},
1187 {"detect", CmdT55xxDetect, 0, "[1] Try detecting the tag modulation from reading the configuration block."},
1188 {"read", CmdT55xxReadBlock, 0, "<block> [password] -- Read T55xx block data (page 0) [optional password]"},
1189 {"write", CmdT55xxWriteBlock,0, "<block> <data> [password] -- Write T55xx block data (page 0) [optional password]"},
1190 {"trace", CmdT55xxReadTrace, 0, "[1] Show T55xx traceability data (page 1/ blk 0-1)"},
1191 {"info", CmdT55xxInfo, 0, "[1] Show T55xx configuration data (page 0/ blk 0)"},
1192 {"dump", CmdT55xxDump, 0, "[password] Dump T55xx card block 0-7. [optional password]"},
1193 {"special", special, 0, "Show block changes with 64 different offsets"},
1194 {"wakeup", CmdT55xxWakeUp, 0, "Send AOR wakeup command"},
1195
1196 {NULL, NULL, 0, NULL}
1197 };
1198
1199 int CmdLFT55XX(const char *Cmd)
1200 {
1201 CmdsParse(CommandTable, Cmd);
1202 return 0;
1203 }
1204
1205 int CmdHelp(const char *Cmd)
1206 {
1207 CmdsHelp(CommandTable);
1208 return 0;
1209 }
Impressum, Datenschutz