]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: The hf mf ekeyprn defaults to print all 40 sectorblocks of keys. (ie 4K card...
authoriceman1001 <iceman@iuse.se>
Thu, 13 Nov 2014 21:13:46 +0000 (22:13 +0100)
committericeman1001 <iceman@iuse.se>
Thu, 13 Nov 2014 21:13:46 +0000 (22:13 +0100)
client/cmdhfmf.c

index 4b62027580427e3e232e9993b033660c2be9f2bb..10c56cdcd6ae4a15d2347cd80f82a3d14b96c1c0 100644 (file)
@@ -1592,13 +1592,32 @@ int CmdHF14AMfECFill(const char *Cmd)
 int CmdHF14AMfEKeyPrn(const char *Cmd)\r
 {\r
        int i;\r
 int CmdHF14AMfEKeyPrn(const char *Cmd)\r
 {\r
        int i;\r
+       uint8_t numSectors;\r
        uint8_t data[16];\r
        uint64_t keyA, keyB;\r
        \r
        uint8_t data[16];\r
        uint64_t keyA, keyB;\r
        \r
+       if (param_getchar(Cmd, 0) == 'h' || param_getchar(Cmd, 0)== 0x00) {\r
+               PrintAndLog("It prints the keys loaded in the emulator memory");\r
+               PrintAndLog("Usage:  hf mf ekeyprn [card memory]");\r
+               PrintAndLog("  [card memory]: 1 = 1K (default), 4 = 4K");\r
+               PrintAndLog("");\r
+               PrintAndLog(" sample: hf mf ekeyprn 1");\r
+               return 0;\r
+       }       \r
+\r
+       char cmdp = param_getchar(Cmd, 0);\r
+       \r
+       switch (cmdp) {\r
+               case '1' : \r
+               case '\0': numSectors = 16; break;\r
+               case '4' : numSectors = 40; break;\r
+               default:   numSectors = 16;\r
+       }       \r
+       \r
        PrintAndLog("|---|----------------|----------------|");\r
        PrintAndLog("|sec|key A           |key B           |");\r
        PrintAndLog("|---|----------------|----------------|");\r
        PrintAndLog("|---|----------------|----------------|");\r
        PrintAndLog("|sec|key A           |key B           |");\r
        PrintAndLog("|---|----------------|----------------|");\r
-       for (i = 0; i < 40; i++) {\r
+       for (i = 0; i < numSectors; i++) {\r
                if (mfEmlGetMem(data, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1)) {\r
                        PrintAndLog("error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
                        break;\r
                if (mfEmlGetMem(data, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1)) {\r
                        PrintAndLog("error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);\r
                        break;\r
Impressum, Datenschutz