keyBlock = calloc(stKeyBlock, 6);\r
if (keyBlock == NULL) return 1;\r
\r
- PrintAndLog("New Downlink Supprt");\r
-\r
while(param_getchar(Cmd, cmdp) != 0x00 && !errors) {\r
switch(param_getchar(Cmd, cmdp)) {\r
case 'h':\r
if (downlink_mode > 3) downlink_mode = 0;\r
cmdp +=2;\r
cmd_offset += 4;\r
- PrintAndLog ("DL Mode : %d",downlink_mode);\r
break;\r
case 'i':\r
case 'I':\r
len = strlen(Cmd+2);\r
if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
memcpy(filename, Cmd+cmd_offset+2, len);\r
+ // Drop any characters after space\r
+ char *p = strstr(filename," ");\r
+ if (p) *p = 0;\r
cmdp += 2;\r
- // PrintAndLog (" File : [%s]",filename);\r
+ // PrintAndLog (" File : [%s]",filename);\r
break;\r
case 'r':\r
case 'R':\r
PrintAndLog ("use Range or File");\r
return 0;\r
}\r
- use_range = true; // = param_get32ex(Cmd, cmdp+1, 0, 16);\r
+ use_range = true; \r
start_password = param_get32ex(Cmd, cmdp+1, 0, 16);\r
end_password = param_get32ex(Cmd, cmdp+2, 0, 16);\r
cmdp += 3;\r
- cmd_offset += 20; // 8 + 8 + 1 + 1 + 1\r
- // PrintAndLog (" Range : [%0X] - [%0X]",start_password,end_password);\r
+ cmd_offset += 20; \r
break;\r
default:\r
PrintAndLog("Unknown parameter '%c'", param_getchar(Cmd, cmdp));\r
}\r
}\r
\r
-\r
-// if (cmdp == 'i' || cmdp == 'I') {\r
-\r
if (use_file)\r
{\r
FILE * f = fopen( filename , "r");\r
\r
PrintAndLog("Testing %08X", testpwd);\r
\r
- // Try each downlink_mode of asked to \r
+ // Try each downlink_mode if asked to \r
// donwlink_mode will = 0 if > 3 or set to 0, so loop from 0 - 3\r
for (dl_mode = downlink_mode; dl_mode <= 3; dl_mode++)\r
{\r
if ( found ) {\r
PrintAndLog("Found valid password: [%08X]", testpwd);\r
free(keyBlock);\r
- // Add downlink mode to reference.\r
+ // Add downlink mode for reference.\r
switch (dl_mode) {\r
case 0 : PrintAndLog ("Downlink : e 0 - Default/Fixed Bit Length"); break;\r
case 1 : PrintAndLog ("Downlink : e 1 - Long Leading Reference"); break;\r
\r
if (use_range)\r
{\r
- // incremental pwd range search\r
- // start_password = param_get32ex(Cmd, 0, 0, 16);\r
- // end_password = param_get32ex(Cmd, 1, 0, 16);\r
\r
if ( start_password >= end_password ) {\r
free(keyBlock);\r
\r
if (found) {\r
PrintAndLog("Found valid password: [%08x]", i);\r
- // Add downlink mode to reference.\r
+ // Add downlink mode for reference.\r
switch (downlink_mode) {\r
case 0 : PrintAndLog ("Downlink : e 0 - Default/Fixed Bit Length"); break;\r
case 1 : PrintAndLog ("Downlink : e 1 - Long Leading Reference"); break;\r