#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
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
//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