]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Client code cleanup:
[proxmark3-svn] / client / cmdhfmf.c
index d5ce118b52d70452ae36b719feefe4a4e40585dd..eb3dc878f15adc79fcd3349d96ef00824b2e0916 100644 (file)
@@ -9,8 +9,18 @@
 //-----------------------------------------------------------------------------\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
@@ -551,10 +561,17 @@ int CmdHF14AMfRestore(const char *Cmd)
        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
@@ -674,7 +691,7 @@ int CmdHF14AMfNested(const char *Cmd)
                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
@@ -1768,7 +1785,7 @@ int CmdHF14AMfCSetBlk(const char *Cmd)
 {\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
Impressum, Datenschutz