PrintAndLog(" w acquire nonces and write them to binary file nonces.bin");\r
PrintAndLog(" s slower acquisition (required by some non standard cards)");\r
PrintAndLog(" r read nonces.bin and start attack");\r
+ PrintAndLog(" t tests?");\r
PrintAndLog(" ");\r
PrintAndLog("samples:");\r
PrintAndLog(" hf mf hardnested 0 A FFFFFFFFFFFF 4 A");\r
PrintAndLog(" hf mf hardnested 0 A FFFFFFFFFFFF 4 A w");\r
PrintAndLog(" hf mf hardnested 0 A FFFFFFFFFFFF 4 A w s");\r
PrintAndLog(" hf mf hardnested r");\r
+ PrintAndLog(" hf mf hardnested r a0a1a2a3a4a5");\r
PrintAndLog(" ");\r
PrintAndLog("Add the known target key to check if it is present in the remaining key space:");\r
PrintAndLog(" sample5: hf mf hardnested 0 A A0A1A2A3A4A5 4 A FFFFFFFFFFFF");\r
\r
char ctmp;\r
ctmp = param_getchar(Cmd, 0);\r
- if (ctmp != 'H' && ctmp != 'h' ) return usage_hf14_hardnested();\r
+ if (ctmp == 'H' || ctmp == 'h' ) return usage_hf14_hardnested();\r
if (ctmp != 'R' && ctmp != 'r' && ctmp != 'T' && ctmp != 't' && strlen(Cmd) < 20) return usage_hf14_hardnested();\r
\r
bool know_target_key = false;\r
trgBlockNo, \r
trgKeyType?'B':'A', \r
trgkey[0], trgkey[1], trgkey[2], trgkey[3], trgkey[4], trgkey[5],\r
- know_target_key?"":" (not set)",\r
- nonce_file_write?"write":nonce_file_read?"read":"none",\r
- slow?"Yes":"No",\r
+ know_target_key ? "" : " (not set)",\r
+ nonce_file_write ? "write": nonce_file_read ? "read" : "none",\r
+ slow ? "Yes" : "No",\r
tests);\r
\r
int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key?trgkey:NULL, nonce_file_read, nonce_file_write, slow, tests);\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 %u seconds\n", (float)t1, elapsed_time);\r
+ PrintAndLog("\nTime in checkkeys: %.0f ticks %u seconds\n", (float)t1, elapsed_time);\r
\r
+ \r
// 20160116 If Sector A is found, but not Sector B, try just reading it of the tag?\r
if ( keyType != 1 ) {\r
PrintAndLog("testing to read key B...");\r