]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: some clocking for 'hf mf mifare', 'hf mf nested', 'hf mf chk'
authoriceman1001 <iceman@iuse.se>
Fri, 15 Jan 2016 11:45:15 +0000 (12:45 +0100)
committericeman1001 <iceman@iuse.se>
Fri, 15 Jan 2016 11:45:15 +0000 (12:45 +0100)
client/cmdhfmf.c

index 0caa60b9d9a08ca14fdf201512d2cd1923eddfd1..d15a4020e9ea0af8a7aaea2e67eace8613284ce0 100644 (file)
@@ -29,6 +29,7 @@ int CmdHF14AMifare(const char *Cmd)
        printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");\r
        printf("-------------------------------------------------------------------------\n");\r
 \r
        printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");\r
        printf("-------------------------------------------------------------------------\n");\r
 \r
+       time_t time1 = clock();\r
        \r
 start:\r
     clearCommandBuffer();\r
        \r
 start:\r
     clearCommandBuffer();\r
@@ -86,6 +87,7 @@ start:
                PrintAndLog("Found valid key: %012"llx" \n", r_key);\r
        }\r
        \r
                PrintAndLog("Found valid key: %012"llx" \n", r_key);\r
        }\r
        \r
+       PrintAndLog("Time in darkside: %1.0f seconds", (float)(clock() - time1)/CLOCKS_PER_SEC);\r
        PrintAndLog("");\r
        return 0;\r
 }\r
        PrintAndLog("");\r
        return 0;\r
 }\r
@@ -662,8 +664,7 @@ int CmdHF14AMfNested(const char *Cmd)
                }\r
        }\r
        else { // ------------------------------------  multiple sectors working\r
                }\r
        }\r
        else { // ------------------------------------  multiple sectors working\r
-               clock_t time1;\r
-               time1 = clock();\r
+               clock_t time1 = clock();\r
 \r
                e_sector = calloc(SectorsCnt, sizeof(sector));\r
                if (e_sector == NULL) return 1;\r
 \r
                e_sector = calloc(SectorsCnt, sizeof(sector));\r
                if (e_sector == NULL) return 1;\r
@@ -733,7 +734,7 @@ int CmdHF14AMfNested(const char *Cmd)
                        }\r
                }\r
 \r
                        }\r
                }\r
 \r
-               printf("Time in nested: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/iterations/CLOCKS_PER_SEC);\r
+               PrintAndLog("Time in nested: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/iterations/CLOCKS_PER_SEC);\r
                \r
                PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);\r
                //print them\r
                \r
                PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);\r
                //print them\r
@@ -1083,7 +1084,9 @@ int CmdHF14AMfChk(const char *Cmd)
                        }\r
                }\r
        }\r
                        }\r
                }\r
        }\r
-       \r
+       // time\r
+       time_t time1 = clock();\r
+               \r
        for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {\r
                int b=blockNo;\r
                for (int i = 0; i < SectorsCnt; ++i) {\r
        for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {\r
                int b=blockNo;\r
                for (int i = 0; i < SectorsCnt; ++i) {\r
@@ -1105,6 +1108,8 @@ int CmdHF14AMfChk(const char *Cmd)
                        b<127?(b+=4):(b+=16);   \r
                }\r
        }\r
                        b<127?(b+=4):(b+=16);   \r
                }\r
        }\r
+       printf("Time in checkkeys: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/keycnt/CLOCKS_PER_SEC);\r
+               \r
 \r
        if (transferToEml) {\r
                uint8_t block[16];\r
 \r
        if (transferToEml) {\r
                uint8_t block[16];\r
Impressum, Datenschutz