//-----------------------------------------------------------------------------\r
\r
#include <inttypes.h>\r
-#include "cmdhfmf.h"\r
-#include "./nonce2key/nonce2key.h"\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "proxmark3.h"\r
+#include "cmdmain.h"\r
+#include "util.h"\r
+#include "ui.h"\r
+#include "mifarehost.h"\r
+#include "mifare.h"\r
+#include "nonce2key/nonce2key.h"\r
+\r
+#define NESTED_SECTOR_RETRY 10 // how often we try mfested() until we give up\r
+\r
\r
static int CmdHelp(const char *Cmd);\r
\r
return 0;\r
}\r
\r
+\r
+typedef struct {\r
+ uint64_t Key[2];\r
+ int foundKey[2];\r
+} sector_t;\r
+\r
+\r
int CmdHF14AMfNested(const char *Cmd)\r
{\r
int i, j, res, iterations;\r
- sector *e_sector = NULL;\r
+ sector_t *e_sector = NULL;\r
uint8_t blockNo = 0;\r
uint8_t keyType = 0;\r
uint8_t trgBlockNo = 0;\r
clock_t time1;\r
time1 = clock();\r
\r
- e_sector = calloc(SectorsCnt, sizeof(sector));\r
+ e_sector = calloc(SectorsCnt, sizeof(sector_t));\r
if (e_sector == NULL) return 1;\r
\r
//test current key and additional standard keys first\r
{\r
uint8_t memBlock[16] = {0x00};\r
uint8_t blockNo = 0;\r
- bool wipeCard = FALSE;\r
+ bool wipeCard = false;\r
int res;\r
\r
if (strlen(Cmd) < 1 || param_getchar(Cmd, 0) == 'h') {\r