]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: timeing in chk keys,
authoriceman1001 <iceman@iuse.se>
Sat, 23 Apr 2016 10:26:29 +0000 (12:26 +0200)
committericeman1001 <iceman@iuse.se>
Sat, 23 Apr 2016 10:26:29 +0000 (12:26 +0200)
client/cmdhfmf.c

index af96543d58be2284bcdf35e09d768d4dcaaff63a..2e1b2186c07d6a411499b0af84b6786cd3bff331 100644 (file)
@@ -218,8 +218,7 @@ END:
        return 0;\r
 }\r
 \r
-int CmdHF14AMfWrBl(const char *Cmd)\r
-{\r
+int CmdHF14AMfWrBl(const char *Cmd) {\r
        uint8_t blockNo = 0;\r
        uint8_t keyType = 0;\r
        uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
@@ -268,8 +267,7 @@ int CmdHF14AMfWrBl(const char *Cmd)
        return 0;\r
 }\r
 \r
-int CmdHF14AMfRdBl(const char *Cmd)\r
-{\r
+int CmdHF14AMfRdBl(const char *Cmd) {\r
        uint8_t blockNo = 0;\r
        uint8_t keyType = 0;\r
        uint8_t key[6] = {0, 0, 0, 0, 0, 0};\r
@@ -317,8 +315,7 @@ int CmdHF14AMfRdBl(const char *Cmd)
   return 0;\r
 }\r
 \r
-int CmdHF14AMfRdSc(const char *Cmd)\r
-{\r
+int CmdHF14AMfRdSc(const char *Cmd) {\r
        int i;\r
        uint8_t sectorNo = 0;\r
        uint8_t keyType = 0;\r
@@ -375,8 +372,7 @@ int CmdHF14AMfRdSc(const char *Cmd)
   return 0;\r
 }\r
 \r
-uint8_t FirstBlockOfSector(uint8_t sectorNo)\r
-{\r
+uint8_t FirstBlockOfSector(uint8_t sectorNo) {\r
        if (sectorNo < 32) {\r
                return sectorNo * 4;\r
        } else {\r
@@ -384,8 +380,7 @@ uint8_t FirstBlockOfSector(uint8_t sectorNo)
        }\r
 }\r
 \r
-uint8_t NumBlocksPerSector(uint8_t sectorNo)\r
-{\r
+uint8_t NumBlocksPerSector(uint8_t sectorNo) {\r
        if (sectorNo < 32) {\r
                return 4;\r
        } else {\r
@@ -1204,6 +1199,8 @@ int CmdHF14AMfChk(const char *Cmd) {
        \r
        // time\r
        clock_t t1 = clock();\r
+       time_t start, end;\r
+       time(&start);\r
        \r
        // check keys.\r
        for (trgKeyType = !keyType;  trgKeyType < 2;  (keyType==2) ? (++trgKeyType) : (trgKeyType=2) ) {\r
@@ -1231,12 +1228,14 @@ int CmdHF14AMfChk(const char *Cmd) {
                }\r
        }\r
        t1 = clock() - t1;\r
+       time(&end);\r
+       unsigned long elapsed_time = difftime(end, start);      \r
+\r
        if ( t1 > 0 )\r
-               printf("\nTime in checkkeys: %.0f ticks\n", (float)t1);\r
+               printf("\nTime in checkkeys: %.0f ticks %u seconds\n", (float)t1, elapsed_time);\r
 \r
        // 20160116 If Sector A is found, but not Sector B,  try just reading it of the tag?\r
        if ( keyType != 1 ) {\r
-               \r
                PrintAndLog("testing to read key B...");\r
                for (i = 0; i < SectorsCnt; i++) {\r
                        // KEY A  but not KEY B\r
Impressum, Datenschutz