]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Update CHANGELOG.md
[proxmark3-svn] / client / cmdhfmf.c
index 9284d14ceb4d076cb1ebeccc12499499ef4ff2fc..ef48b825116710d04a425bf88a41be734faf590a 100644 (file)
@@ -29,6 +29,7 @@
 #include "hardnested/hardnested_bf_core.h"\r
 #include "cliparser/cliparser.h"\r
 #include "cmdhf14a.h"\r
+#include "mifare/mifaredefault.h"\r
 #include "mifare/mifare4.h"\r
 #include "mifare/mad.h"\r
 #include "mifare/ndef.h"\r
@@ -1515,8 +1516,11 @@ int CmdHF14AMfSim(const char *Cmd) {
                        break;\r
                case 'u':\r
                case 'U':\r
-                       param_gethex_ex(Cmd, cmdp+1, uid, &uidlen);\r
-                       switch(uidlen) {\r
+                       uidlen = 14;\r
+                       if (param_gethex_ex(Cmd, cmdp+1, uid, &uidlen)) {\r
+                               return usage_hf14_mfsim();\r
+                       }\r
+                       switch (uidlen) {\r
                                case 14: flags = FLAG_7B_UID_IN_DATA; break;\r
                                case  8: flags = FLAG_4B_UID_IN_DATA; break;\r
                                default: return usage_hf14_mfsim();\r
@@ -2725,9 +2729,9 @@ int CmdHF14AMfSniff(const char *Cmd){
 //needs nt, ar, at, Data to decrypt\r
 int CmdDecryptTraceCmds(const char *Cmd){\r
        uint8_t data[50];\r
-       int len = 0;\r
-       param_gethex_ex(Cmd,3,data,&len);\r
-       return tryDecryptWord(param_get32ex(Cmd,0,0,16),param_get32ex(Cmd,1,0,16),param_get32ex(Cmd,2,0,16),data,len/2);\r
+       int len = 100;\r
+       param_gethex_ex(Cmd, 3, data, &len);\r
+       return tryDecryptWord(param_get32ex(Cmd, 0, 0, 16), param_get32ex(Cmd, 1, 0, 16), param_get32ex(Cmd, 2, 0, 16), data, len/2);\r
 }\r
 \r
 int CmdHF14AMfAuth4(const char *cmd) {\r
Impressum, Datenschutz