X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/dd8e45133090d9684a7f0d37ef59137e6b7159a9..be1b97d81fe44d9227a5c581fd279fed062a18cd:/client/cmdlft55xx.c diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 25df4c76..da8fc703 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -67,8 +67,8 @@ int usage_t55xx_read(){ PrintAndLog(" p - OPTIONAL password (8 hex characters)"); PrintAndLog(" o - OPTIONAL override safety check"); PrintAndLog(" 1 - OPTIONAL read Page 1 instead of Page 0"); - PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed-bit-length (default), '1' Long Zero Reference"); - PrintAndLog(" '2' Leading Zero, '3' 1 of 4 "); + PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed bit length (default), '1' long leading reference"); + PrintAndLog(" '2' leading zero, '3' 1 of 4 coding reference"); PrintAndLog(" ****WARNING****"); PrintAndLog(" Use of read with password on a tag not configured for a pwd"); PrintAndLog(" can damage the tag"); @@ -88,8 +88,8 @@ int usage_t55xx_write(){ PrintAndLog(" p - OPTIONAL password 4bytes (8 hex characters)"); PrintAndLog(" 1 - OPTIONAL write Page 1 instead of Page 0"); PrintAndLog(" t - OPTIONAL test mode write - ****DANGER****"); - PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed-bit-length (default), '1' Long Zero Reference"); - PrintAndLog(" '2' Leading Zero, '3' 1 of 4 "); + PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed bit length (default), '1' long leading reference"); + PrintAndLog(" '2' leading zero, '3' 1 of 4 coding reference"); PrintAndLog(""); PrintAndLog("Examples:"); PrintAndLog(" lf t55xx write b 3 d 11223344 - write 11223344 to block 3"); @@ -136,8 +136,8 @@ int usage_t55xx_detect(){ PrintAndLog("Options:"); PrintAndLog(" 1 - if set, use Graphbuffer otherwise read data from tag."); PrintAndLog(" p - OPTIONAL password (8 hex characters)"); - PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed-bit-length (default), '1' Long Zero Reference"); - PrintAndLog(" '2' Leading Zero, '3' 1 of 4 "); + PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed bit length (default), '1' long leading reference"); + PrintAndLog(" '2' leading zero, '3' 1 of 4 coding reference"); PrintAndLog(""); PrintAndLog("Examples:"); PrintAndLog(" lf t55xx detect"); @@ -196,9 +196,10 @@ int usage_t55xx_bruteforce_downlink(){ PrintAndLog("Options:"); PrintAndLog(" h - this help"); PrintAndLog(" r - 4 byte hex value to start and end pwd search at"); - PrintAndLog(" i <*.dic> - loads a default keys dictionary file <*.dic>"); - PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed-bit-length (default), '1' Long Zero Reference"); - PrintAndLog(" '2' Leading Zero, '3' 1 of 4 "); + PrintAndLog(" i <*.dic> - loads a default keys dictionary file <*.dic>"); + PrintAndLog(" e - OPTIONAL downlink encoding '0' fixed bit length (default)"); + PrintAndLog(" '1' long leading reference, '2' leading zero "); + PrintAndLog(" '3' 1 of 4 coding reference, '4' special - try all downlink modes"); PrintAndLog(""); PrintAndLog("Examples:"); PrintAndLog(" lf t55xx bruteforce aaaaaaaa bbbbbbbb"); @@ -1634,8 +1635,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { keyBlock = calloc(stKeyBlock, 6); if (keyBlock == NULL) return 1; - PrintAndLog("New Downlink Supprt"); - while(param_getchar(Cmd, cmdp) != 0x00 && !errors) { switch(param_getchar(Cmd, cmdp)) { case 'h': @@ -1648,7 +1647,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { if (downlink_mode > 3) downlink_mode = 0; cmdp +=2; cmd_offset += 4; - PrintAndLog ("DL Mode : %d",downlink_mode); break; case 'i': case 'I': @@ -1660,8 +1658,11 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { len = strlen(Cmd+2); if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; memcpy(filename, Cmd+cmd_offset+2, len); + // Drop any characters after space + char *p = strstr(filename," "); + if (p) *p = 0; cmdp += 2; - // PrintAndLog (" File : [%s]",filename); + // PrintAndLog (" File : [%s]",filename); break; case 'r': case 'R': @@ -1669,12 +1670,11 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { PrintAndLog ("use Range or File"); return 0; } - use_range = true; // = param_get32ex(Cmd, cmdp+1, 0, 16); + use_range = true; start_password = param_get32ex(Cmd, cmdp+1, 0, 16); end_password = param_get32ex(Cmd, cmdp+2, 0, 16); cmdp += 3; - cmd_offset += 20; // 8 + 8 + 1 + 1 + 1 - // PrintAndLog (" Range : [%0X] - [%0X]",start_password,end_password); + cmd_offset += 20; break; default: PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp)); @@ -1683,9 +1683,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { } } - -// if (cmdp == 'i' || cmdp == 'I') { - if (use_file) { FILE * f = fopen( filename , "r"); @@ -1752,7 +1749,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { PrintAndLog("Testing %08X", testpwd); - // Try each downlink_mode of asked to + // Try each downlink_mode if asked to // donwlink_mode will = 0 if > 3 or set to 0, so loop from 0 - 3 for (dl_mode = downlink_mode; dl_mode <= 3; dl_mode++) { @@ -1767,7 +1764,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { if ( found ) { PrintAndLog("Found valid password: [%08X]", testpwd); free(keyBlock); - // Add downlink mode to reference. + // Add downlink mode for reference. switch (dl_mode) { case 0 : PrintAndLog ("Downlink : e 0 - Default/Fixed Bit Length"); break; case 1 : PrintAndLog ("Downlink : e 1 - Long Leading Reference"); break; @@ -1787,9 +1784,6 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { if (use_range) { - // incremental pwd range search - // start_password = param_get32ex(Cmd, 0, 0, 16); - // end_password = param_get32ex(Cmd, 1, 0, 16); if ( start_password >= end_password ) { free(keyBlock); @@ -1826,7 +1820,7 @@ int CmdT55xxBruteForce_downlink(const char *Cmd) { if (found) { PrintAndLog("Found valid password: [%08x]", i); - // Add downlink mode to reference. + // Add downlink mode for reference. switch (downlink_mode) { case 0 : PrintAndLog ("Downlink : e 0 - Default/Fixed Bit Length"); break; case 1 : PrintAndLog ("Downlink : e 1 - Long Leading Reference"); break;