]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
CHG: Syntax suger
[proxmark3-svn] / client / cmdhfmf.c
index e10a88f3940c7ef37b7cf6496fa64609f70834b2..c5a86b5625f0d63a4c5e1173c7ee82eaf6ee5f54 100644 (file)
@@ -21,8 +21,17 @@ int CmdHF14AMifare(const char *Cmd)
        uint64_t par_list = 0, ks_list = 0, r_key = 0;\r
        int16_t isOK = 0;\r
        int tmpchar; \r
+       uint8_t blockNo = 0;\r
+       \r
+       char cmdp = param_getchar(Cmd, 0);      \r
+       if ( cmdp == 'H' || cmdp == 'h') {\r
+               PrintAndLog("Usage:  hf mf mifare <block number>");\r
+               PrintAndLog("        sample: hf mf mifare 0");\r
+               return 0;\r
+       }       \r
        \r
-       UsbCommand c = {CMD_READER_MIFARE, {true, 0, 0}};\r
+       blockNo = param_get8(Cmd, 0);\r
+       UsbCommand c = {CMD_READER_MIFARE, {true, blockNo, 0}};\r
 \r
        // message\r
        printf("-------------------------------------------------------------------------\n");\r
@@ -93,7 +102,7 @@ start:
        }\r
        t1 = clock() - t1;\r
        if ( t1 > 0 ){\r
-               PrintAndLog("Time in darkside: %.0f ticks - %4.2f sec\n (%u)", (float)t1, ((float)t1)/CLOCKS_PER_SEC, CLOCKS_PER_SEC);\r
+               PrintAndLog("Time in darkside: %.0f ticks - %4.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC);\r
        }\r
        return 0;\r
 }\r
@@ -754,6 +763,8 @@ int CmdHF14AMfNested(const char *Cmd)
                                \r
                                uint8_t sectrail = (FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
                                \r
+                               PrintAndLog("Reading block %d", sectrail);\r
+                                                       \r
                                UsbCommand c = {CMD_MIFARE_READBL, {sectrail, 0, 0}};\r
                                num_to_bytes(e_sector[i].Key[0], 6, c.d.asBytes); // KEY A\r
                                clearCommandBuffer();\r
@@ -1159,9 +1170,11 @@ int CmdHF14AMfChk(const char *Cmd)
        for (i = 0; i < SectorsCnt; i++) {\r
                // KEY A  but not KEY B\r
                if ( e_sector[i].foundKey[0] && !e_sector[i].foundKey[1] ) {\r
-                       \r
+                                               \r
                        uint8_t sectrail = (FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
                        \r
+                       PrintAndLog("Reading block %d", sectrail);\r
+                       \r
                        UsbCommand c = {CMD_MIFARE_READBL, {sectrail, 0, 0}};\r
                        num_to_bytes(e_sector[i].Key[0], 6, c.d.asBytes); // KEY A\r
                        clearCommandBuffer();\r
Impressum, Datenschutz