int CmdHF14AMfChk(const char *Cmd)\r
{\r
if (strlen(Cmd)<3) {\r
- PrintAndLog("Usage: hf mf chk <block number>|<*card memory> <key type (A/B/?)> [t] [<key (12 hex symbols)>] [<dic (*.dic)>]");\r
+ PrintAndLog("Usage: hf mf chk <block number>|<*card memory> <key type (A/B/?)> [t|d] [<key (12 hex symbols)>] [<dic (*.dic)>]");\r
PrintAndLog(" * - all sectors");\r
PrintAndLog("card memory - 0 - MINI(320 bytes), 1 - 1K, 2 - 2K, 4 - 4K, <other> - 1K");\r
PrintAndLog("d - write keys to binary file\n");\r
+ PrintAndLog("t - write keys to emulator memory");\r
PrintAndLog(" sample: hf mf chk 0 A 1234567890ab keys.dic");\r
PrintAndLog(" hf mf chk *1 ? t");\r
+ PrintAndLog(" hf mf chk *1 ? d");\r
return 0;\r
} \r
\r
uint8_t exitAfterNReads = 0;\r
uint8_t flags = 0;\r
\r
- if (param_getchar(Cmd, 0) == 'h') {\r
+ uint8_t cmdp = param_getchar(Cmd, 0);\r
+ \r
+ if (cmdp == 'h' || cmdp == 'H') {\r
PrintAndLog("Usage: hf mf sim u <uid (8 hex symbols)> n <numreads> i x");\r
+ PrintAndLog(" h this help");\r
PrintAndLog(" u (Optional) UID. If not specified, the UID from emulator memory will be used");\r
PrintAndLog(" n (Optional) Automatically exit simulation after <numreads> blocks have been read by reader. 0 = infinite");\r
PrintAndLog(" i (Optional) Interactive, means that console will not be returned until simulation finishes or is aborted");\r
PrintAndLog(" x (Optional) Crack, performs the 'reader attack', nr/ar attack against a legitimate reader, fishes out the key(s)");\r
+ PrintAndLog("");\r
PrintAndLog(" sample: hf mf sim u 0a0a0a0a ");\r
return 0;\r
}\r
char ctmp = param_getchar(Cmd, 1);\r
if (ctmp == 'w' || ctmp == 'W') wipeCard = 1;\r
\r
- PrintAndLog("--wipe card:%02x uid:%s", wipeCard, sprint_hex(uid, 4));\r
+ PrintAndLog("--wipe card:%s uid:%s", (wipeCard)?"YES":"NO", sprint_hex(uid, 4));\r
\r
res = mfCSetUID(uid, oldUid, wipeCard);\r
if (res) {\r
return 1;\r
}\r
\r
- PrintAndLog("UID:%s", sprint_hex(uid, 4));\r
return 0;\r
}\r
\r
uint8_t fillFromEmulator = 0;\r
int i, len, blockNum, flags;\r
\r
- // memset(filename, 0, sizeof(filename));\r
- // memset(buf, 0, sizeof(buf));\r
-\r
if (param_getchar(Cmd, 0) == 'h' || param_getchar(Cmd, 0)== 0x00) {\r
- PrintAndLog("It loads magic Chinese card (only works with!!!) from the file `filename.eml`");\r
+ PrintAndLog("It loads magic Chinese card from the file `filename.eml`");\r
PrintAndLog("or from emulator memory (option `e`)");\r
PrintAndLog("Usage: hf mf cload <file name w/o `.eml`>");\r
PrintAndLog(" or: hf mf cload e ");\r
blockNum = 0;\r
flags = CSETBLOCK_INIT_FIELD + CSETBLOCK_WUPC;\r
while(!feof(f)){\r
+ \r
memset(buf, 0, sizeof(buf));\r
+ \r
if (fgets(buf, sizeof(buf), f) == NULL) {\r
PrintAndLog("File reading error.");\r
return 2;\r
PrintAndLog("Loaded from file: %s", filename);\r
return 0;\r
}\r
+ return 0;\r
}\r
\r
int CmdHF14AMfCGetBlk(const char *Cmd) {\r
uint8_t buf[3000] = {0x00};\r
uint8_t * bufPtr = buf;\r
\r
- if (param_getchar(Cmd, 0) == 'h') {\r
+ char ctmp = param_getchar(Cmd, 0);\r
+ if ( ctmp == 'h' || ctmp == 'H' ) {\r
PrintAndLog("It continuously gets data from the field and saves it to: log, emulator, emulator file.");\r
PrintAndLog("You can specify:");\r
PrintAndLog(" l - save encrypted sequence to logfile `uid.log`");\r
} \r
\r
for (int i = 0; i < 4; i++) {\r
- char ctmp = param_getchar(Cmd, i);\r
+ ctmp = param_getchar(Cmd, i);\r
if (ctmp == 'l' || ctmp == 'L') wantLogToFile = true;\r
if (ctmp == 'd' || ctmp == 'D') wantDecrypt = true;\r
//if (ctmp == 'e' || ctmp == 'E') wantSaveToEml = true; TODO\r