]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Some more lua-scripts and library fixes from iceman, including more default keys
[proxmark3-svn] / client / cmdhfmf.c
index a26652566e812d353a6a1f739ed4a296902561f6..6075db533092957b82ae9c4a789fd8d5f7a76859 100644 (file)
@@ -1194,7 +1194,7 @@ int CmdHF14AMf1kSim(const char *Cmd)
                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("           sample: hf mf sim 0a0a0a0a ");\r
+               PrintAndLog("           sample: hf mf sim 0a0a0a0a ");\r
                return 0;\r
        }\r
        uint8_t pnr = 0;\r
@@ -1260,8 +1260,10 @@ int CmdHF14AMfDbg(const char *Cmd)
                PrintAndLog("Usage:  hf mf dbg  <debug level>");\r
                PrintAndLog(" 0 - no debug messages");\r
                PrintAndLog(" 1 - error messages");\r
-               PrintAndLog(" 2 - all messages");\r
-               PrintAndLog(" 4 - extended debug mode");\r
+               PrintAndLog(" 2 - plus information messages");\r
+               PrintAndLog(" 3 - plus debug messages");\r
+               PrintAndLog(" 4 - print even debug messages in timing critical functions");\r
+               PrintAndLog("     Note: this option therefore may cause malfunction itself");\r
                return 0;\r
        }       \r
 \r
@@ -1473,8 +1475,8 @@ int CmdHF14AMfECFill(const char *Cmd)
        uint8_t keyType = 0;\r
 \r
        if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r
-               PrintAndLog("Usage:  hf mf efill <key A/B>");\r
-               PrintAndLog("sample:  hf mf efill A");\r
+               PrintAndLog("Usage:  hf mf ecfill <key A/B>");\r
+               PrintAndLog("sample:  hf mf ecfill A");\r
                PrintAndLog("Card data blocks transfers to card emulator memory.");\r
                PrintAndLog("Keys must be laid in the simulator memory. \n");\r
                return 0;\r
@@ -1848,7 +1850,8 @@ int CmdHF14AMfSniff(const char *Cmd){
        int blockLen = 0;\r
        int num = 0;\r
        int pckNum = 0;\r
-       uint8_t uid[8];\r
+       uint8_t uid[7];\r
+       uint8_t uid_len;\r
        uint8_t atqa[2];\r
        uint8_t sak;\r
        bool isTag;\r
@@ -1926,14 +1929,19 @@ int CmdHF14AMfSniff(const char *Cmd){
                                        bufPtr += 4;\r
                                        len = bufPtr[0];\r
                                        bufPtr++;\r
-                                       if ((len == 14) && (bufPtr[0] = 0xff) && (bufPtr[1] = 0xff)) {\r
+                                       if ((len == 14) && (bufPtr[0] == 0xff) && (bufPtr[1] == 0xff)) {\r
                                                memcpy(uid, bufPtr + 2, 7);\r
                                                memcpy(atqa, bufPtr + 2 + 7, 2);\r
+                                               uid_len = (atqa[0] & 0xC0) == 0x40 ? 7 : 4;\r
                                                sak = bufPtr[11];\r
                                                \r
-                                               PrintAndLog("tag select uid:%s atqa:%02x %02x sak:0x%02x", sprint_hex(uid, 7), atqa[0], atqa[1], sak);\r
+                                               PrintAndLog("tag select uid:%s atqa:0x%02x%02x sak:0x%02x", \r
+                                                       sprint_hex(uid + (7 - uid_len), uid_len),\r
+                                                       atqa[1], \r
+                                                       atqa[0], \r
+                                                       sak);\r
                                                if (wantLogToFile || wantDecrypt) {\r
-                                                       FillFileNameByUID(logHexFileName, uid, ".log", 7);\r
+                                                       FillFileNameByUID(logHexFileName, uid + (7 - uid_len), ".log", uid_len);\r
                                                        AddLogCurrentDT(logHexFileName);\r
                                                }                                               \r
                                                if (wantDecrypt) mfTraceInit(uid, atqa, sak, wantSaveToEmlFile);\r
Impressum, Datenschutz