+ ctmp = param_getchar(Cmd, 2);\r
+ if (ctmp == 't' || ctmp == 'T') transferToEml = 1;\r
+ else if (ctmp == 'd' || ctmp == 'D') createDumpFile = 1;\r
+ \r
+ for (i = transferToEml || createDumpFile; param_getchar(Cmd, 2 + i); i++) {\r
+ if (!param_gethex(Cmd, 2 + i, keyBlock + 6 * keycnt, 12)) {\r
+ if ( stKeyBlock - keycnt < 2) {\r
+ p = realloc(keyBlock, 6*(stKeyBlock+=10));\r
+ if (!p) {\r
+ PrintAndLog("Cannot allocate memory for Keys");\r
+ free(keyBlock);\r
+ return 2;\r
+ }\r
+ keyBlock = p;\r
+ }\r
+ PrintAndLog("chk key[%d] %02x%02x%02x%02x%02x%02x", keycnt,\r
+ (keyBlock + 6*keycnt)[0],(keyBlock + 6*keycnt)[1], (keyBlock + 6*keycnt)[2],\r
+ (keyBlock + 6*keycnt)[3], (keyBlock + 6*keycnt)[4], (keyBlock + 6*keycnt)[5], 6);\r
+ keycnt++;\r
+ } else {\r
+ // May be a dic file\r
+ if ( param_getstr(Cmd, 2 + i,filename) > 255 ) {\r
+ PrintAndLog("File name too long");\r
+ free(keyBlock);\r
+ return 2;\r
+ }\r
+ \r
+ if ( (f = fopen( filename , "r")) ) {\r
+ while( !feof(f) ){\r
+ memset(buf, 0, sizeof(buf));\r
+ fgets(buf, sizeof(buf), f);\r
+ \r
+ if (strlen(buf) < 12 || buf[11] == '\n')\r
+ continue;\r
+ \r
+ while (fgetc(f) != '\n' && !feof(f)) ; //goto next line\r
+ \r
+ if( buf[0]=='#' ) continue; //The line start with # is remcommnet,skip\r