printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n");\r
printf("-------------------------------------------------------------------------\n");\r
\r
- clock_t t = clock();\r
+ clock_t t1 = clock();\r
\r
start:\r
clearCommandBuffer();\r
printf("------------------------------------------------------------------\n");\r
PrintAndLog("Found valid key: %012"llx" \n", r_key);\r
}\r
- t = clock() - t;\r
- //printf("Time in darkside: %d ticks - %1.2f seconds\n", t, ((float)t)/CLOCKS_PER_SEC);\r
- printf("Time in darkside: %Lf ticks - %1.2Lf seconds\n", (long double)t, ((long double)t)/CLOCKS_PER_SEC);\r
+ t1 = clock() - t1;\r
+ if ( t1 > 0 ){\r
+ PrintAndLog("Time in darkside: %f ticks - %1.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC);\r
+ }\r
return 0;\r
}\r
\r
}\r
}\r
else { // ------------------------------------ multiple sectors working\r
- clock_t time1 = clock();\r
+ clock_t t1 = clock();\r
\r
e_sector = calloc(SectorsCnt, sizeof(sector));\r
if (e_sector == NULL) return 1;\r
}\r
}\r
\r
- PrintAndLog("Time in nested: %1.2f (%1.2f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/iterations/CLOCKS_PER_SEC);\r
+ t1 = clock() - t1;\r
+ if ( t1 > 0 ) {\r
+ PrintAndLog("Time in nested: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/iterations/CLOCKS_PER_SEC);\r
+ }\r
\r
PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);\r
//print them\r
}\r
}\r
// time\r
- clock_t time1 = clock();\r
+ clock_t t1 = clock();\r
\r
for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) {\r
int b=blockNo;\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
+ t1 = clock() - t1;\r
+ if ( t1 > 0 ){\r
+ printf("Time in checkkeys: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/keycnt/CLOCKS_PER_SEC);\r
+ }\r
\r
if (transferToEml) {\r
uint8_t block[16];\r
} while (num_good_first_bytes < GOOD_BYTES_REQUIRED);
+ time1 = clock() - time1;
+ if ( time1 > 0 ) {
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
total_num_nonces,
- ((float)clock()-time1)/CLOCKS_PER_SEC,
- total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
-
+ ((float)time1)/CLOCKS_PER_SEC,
+ total_num_nonces * 60.0 * CLOCKS_PER_SEC/(float)time1);
+ }
fprintf(fstats, "%d;%d;%d;%1.2f;", total_num_nonces, total_added_nonces, num_good_first_bytes, CONFIDENCE_THRESHOLD);
}
fclose(fnonces);
}
+ time1 = clock() - time1;
+ if ( time1 > 0 ) {
PrintAndLog("Acquired a total of %d nonces in %1.1f seconds (%0.0f nonces/minute)",
total_num_nonces,
- ((float)clock()-time1)/CLOCKS_PER_SEC,
- total_num_nonces*60.0*CLOCKS_PER_SEC/((float)clock()-time1));
-
+ ((float)time1)/CLOCKS_PER_SEC,
+ total_num_nonces * 60.0 * CLOCKS_PER_SEC/(float)time1
+ );
+ }
return 0;
}
fclose(fstats);
} else {
init_nonce_memory();
- if (nonce_file_read) { // use pre-acquired data from file nonces.bin
- if (read_nonce_file() != 0) {
- return 3;
- }
- Check_for_FilterFlipProperties();
- num_good_first_bytes = MIN(estimate_second_byte_sum(), GOOD_BYTES_REQUIRED);
- } else { // acquire nonces.
- uint16_t is_OK = acquire_nonces(blockNo, keyType, key, trgBlockNo, trgKeyType, nonce_file_write, slow);
- if (is_OK != 0) {
- return is_OK;
+ if (nonce_file_read) { // use pre-acquired data from file nonces.bin
+ if (read_nonce_file() != 0) {
+ return 3;
+ }
+ Check_for_FilterFlipProperties();
+ num_good_first_bytes = MIN(estimate_second_byte_sum(), GOOD_BYTES_REQUIRED);
+ } else { // acquire nonces.
+ uint16_t is_OK = acquire_nonces(blockNo, keyType, key, trgBlockNo, trgKeyType, nonce_file_write, slow);
+ if (is_OK != 0) {
+ return is_OK;
+ }
}
- }
- Tests();
-
- PrintAndLog("");
- PrintAndLog("Sum(a0) = %d", first_byte_Sum);
- // PrintAndLog("Best 10 first bytes: %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x",
- // best_first_bytes[0],
- // best_first_bytes[1],
- // best_first_bytes[2],
- // best_first_bytes[3],
- // best_first_bytes[4],
- // best_first_bytes[5],
- // best_first_bytes[6],
- // best_first_bytes[7],
- // best_first_bytes[8],
- // best_first_bytes[9] );
- PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
-
- clock_t start_time = clock();
- generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
- PrintAndLog("Time for generating key candidates list: %1.0f seconds", (float)(clock() - start_time)/CLOCKS_PER_SEC);
-
- brute_force();
- free_nonces_memory();
- free_statelist_cache();
- free_candidates_memory(candidates);
- candidates = NULL;
- }
+ Tests();
+
+ PrintAndLog("");
+ PrintAndLog("Sum(a0) = %d", first_byte_Sum);
+ // PrintAndLog("Best 10 first bytes: %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x",
+ // best_first_bytes[0],
+ // best_first_bytes[1],
+ // best_first_bytes[2],
+ // best_first_bytes[3],
+ // best_first_bytes[4],
+ // best_first_bytes[5],
+ // best_first_bytes[6],
+ // best_first_bytes[7],
+ // best_first_bytes[8],
+ // best_first_bytes[9] );
+ PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes);
+
+ clock_t time1 = clock();
+ generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
+ time1 = clock() - time1;
+ if ( time1 > 0 )
+ PrintAndLog("Time for generating key candidates list: %1.0f seconds", ((float)time1)/CLOCKS_PER_SEC);
+ brute_force();
+ free_nonces_memory();
+ free_statelist_cache();
+ free_candidates_memory(candidates);
+ candidates = NULL;
+ }
return 0;
}