]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Added work with "magic Chinese" card (card from: ouyangweidaxian@live.cn) with wipe...
[proxmark3-svn] / client / cmdhfmf.c
index 081d197c1ffe7027ab6798f61c1ed4080d3caa8b..9928cb1b899de4f42ff1e7a8e210d78b87eb3e49 100644 (file)
@@ -1218,6 +1218,51 @@ int CmdHF14AMfEKeyPrn(const char *Cmd)
        return 0;\r
 }\r
 \r
+int CmdHF14AMfCSetUID(const char *Cmd)\r
+{\r
+       uint8_t wipeCard = 0;\r
+       uint8_t uid[8];\r
+       uint8_t oldUid[8];\r
+       int res;\r
+\r
+       if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r
+               PrintAndLog("Usage:  hf mf csetuid <UID 8 hex symbols> <w>");\r
+               PrintAndLog("sample:  hf mf csetuid 01020304 w");\r
+               PrintAndLog("Set UID for magic Chinese card (only works with!!!)");\r
+               PrintAndLog("If you want wipe card then add 'w' into command line. \n");\r
+               return 0;\r
+       }       \r
+\r
+       if (param_getchar(Cmd, 0) && param_gethex(Cmd, 0, uid, 8)) {\r
+               PrintAndLog("UID must include 8 HEX symbols");\r
+               return 1;\r
+       }\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
+\r
+       res = mfCSetUID(uid, oldUid, wipeCard);\r
+       if (res) {\r
+                       PrintAndLog("Can't set UID. error=%d", res);\r
+                       return 1;\r
+               }\r
+       \r
+       PrintAndLog("old UID:%s", sprint_hex(oldUid, 4));\r
+       return 0;\r
+}\r
+\r
+int CmdHF14AMfCSetBlk(const char *Cmd)\r
+{\r
+       return 0;\r
+}\r
+\r
+int CmdHF14AMfCLoad(const char *Cmd)\r
+{\r
+       return 0;\r
+}\r
+\r
 static command_t CommandTable[] =\r
 {\r
   {"help",             CmdHelp,                                1, "This help"},\r
@@ -1238,6 +1283,9 @@ static command_t CommandTable[] =
   {"esave",            CmdHF14AMfESave,                0, "Save to file emul dump"},\r
   {"ecfill",   CmdHF14AMfECFill,               0, "Fill simulator memory with help of keys from simulator"},\r
   {"ekeyprn",  CmdHF14AMfEKeyPrn,      0, "Print keys from simulator memory"},\r
+  {"csetuid",  CmdHF14AMfCSetUID,      0, "Set UID for magic Chinese card"},\r
+  {"csetblk",  CmdHF14AMfCSetBlk,      0, "(n/a)Write block into magic Chinese card"},\r
+  {"cload",            CmdHF14AMfCLoad,                0, "(n/a)Load dump into magic Chinese card"},\r
   {NULL, NULL, 0, NULL}\r
 };\r
 \r
Impressum, Datenschutz