]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Icemans UL-C Auth dev side fix plus a few other ...
[proxmark3-svn] / client / cmdhfmf.c
index c16b9674137d8c74441d86b325bdd72e692fc287..b96c9c1a78f8e180a9b831574e377998d005787f 100644 (file)
@@ -434,7 +434,7 @@ int CmdHF14AMfRestore(const char *Cmd)
 {\r
        uint8_t sectorNo,blockNo;\r
        uint8_t keyType = 0;\r
-       uint8_t key[6] = {0xFF};\r
+       uint8_t key[6] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};\r
        uint8_t bldata[16] = {0x00};\r
        uint8_t keyA[40][6];\r
        uint8_t keyB[40][6];\r
@@ -1499,16 +1499,16 @@ int CmdHF14AMfCSetUID(const char *Cmd)
 \r
 int CmdHF14AMfCSetBlk(const char *Cmd)\r
 {\r
-       uint8_t uid[8] = {0x00};\r
        uint8_t memBlock[16] = {0x00};\r
        uint8_t blockNo = 0;\r
+       bool wipeCard = FALSE;\r
        int res;\r
 \r
        if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r
-               PrintAndLog("Usage:  hf mf csetblk <block number> <block data (32 hex symbols)>");\r
+               PrintAndLog("Usage:  hf mf csetblk <block number> <block data (32 hex symbols)> [w]");\r
                PrintAndLog("sample:  hf mf csetblk 1 01020304050607080910111213141516");\r
-               PrintAndLog("Set block data for magic Chinese card (only works with!!!)");\r
-               PrintAndLog("If you want wipe card then add 'w' into command line. \n");\r
+               PrintAndLog("Set block data for magic Chinese card (only works with such cards)");\r
+               PrintAndLog("If you also want wipe the card then add 'w' at the end of the command line");\r
                return 0;\r
        }       \r
 \r
@@ -1519,14 +1519,15 @@ int CmdHF14AMfCSetBlk(const char *Cmd)
                return 1;\r
        }\r
 \r
+       char ctmp = param_getchar(Cmd, 2);\r
+       wipeCard = (ctmp == 'w' || ctmp == 'W');\r
        PrintAndLog("--block number:%2d data:%s", blockNo, sprint_hex(memBlock, 16));\r
 \r
-       res = mfCSetBlock(blockNo, memBlock, uid, 0, CSETBLOCK_SINGLE_OPER);\r
+       res = mfCSetBlock(blockNo, memBlock, NULL, wipeCard, CSETBLOCK_SINGLE_OPER);\r
        if (res) {\r
-                       PrintAndLog("Can't write block. error=%d", res);\r
-                       return 1;\r
-               }\r
-       \r
+               PrintAndLog("Can't write block. error=%d", res);\r
+               return 1;\r
+       }\r
        return 0;\r
 }\r
 \r
@@ -1539,7 +1540,7 @@ int CmdHF14AMfCLoad(const char *Cmd)
        char buf[64] = {0x00};\r
        uint8_t buf8[64] = {0x00};\r
        uint8_t fillFromEmulator = 0;\r
-       int i, len, blockNum, flags;\r
+       int i, len, blockNum, flags=0;\r
        \r
        if (param_getchar(Cmd, 0) == 'h' || param_getchar(Cmd, 0)== 0x00) {\r
                PrintAndLog("It loads magic Chinese card from the file `filename.eml`");\r
@@ -1637,7 +1638,7 @@ int CmdHF14AMfCGetBlk(const char *Cmd) {
        if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r
                PrintAndLog("Usage:  hf mf cgetblk <block number>");\r
                PrintAndLog("sample:  hf mf cgetblk 1");\r
-               PrintAndLog("Get block data from magic Chinese card (only works with!!!)\n");\r
+               PrintAndLog("Get block data from magic Chinese card (only works with such cards)\n");\r
                return 0;\r
        }       \r
 \r
@@ -1664,7 +1665,7 @@ int CmdHF14AMfCGetSc(const char *Cmd) {
        if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r
                PrintAndLog("Usage:  hf mf cgetsc <sector number>");\r
                PrintAndLog("sample:  hf mf cgetsc 0");\r
-               PrintAndLog("Get sector data from magic Chinese card (only works with!!!)\n");\r
+               PrintAndLog("Get sector data from magic Chinese card (only works with such cards)\n");\r
                return 0;\r
        }       \r
 \r
Impressum, Datenschutz