#include "cmdmain.h"\r
#include "cmdhfmfhard.h"\r
#include "util.h"\r
+#include "util_posix.h"\r
#include "usb_cmd.h"\r
#include "ui.h"\r
#include "mifarehost.h"\r
char filename[FILE_PATH_SIZE]={0};\r
char buf[13];\r
uint8_t *keyBlock = NULL, *p;\r
- uint8_t stKeyBlock = 20;\r
+ uint16_t stKeyBlock = 20;\r
\r
int i, res;\r
int keycnt = 0;\r
break;\r
default:\r
PrintAndLog("Key type must be A , B or ?");\r
+ free(keyBlock);\r
return 1;\r
};\r
\r
}\r
\r
void readerAttack(nonces_t ar_resp[], bool setEmulatorMem, bool doStandardAttack) {\r
- #define ATTACK_KEY_COUNT 8 // keep same as define in iso14443a.c -> Mifare1ksim()\r
+ #define ATTACK_KEY_COUNT 7 // keep same as define in iso14443a.c -> Mifare1ksim()\r
+ // cannot be more than 7 or it will overrun c.d.asBytes(512)\r
uint64_t key = 0;\r
typedef struct {\r
uint64_t keyA;\r