X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/e7f43e92e9b8a8afe7aa235a34a70af59e8e6cea..59152dcb05df24432f711e7032b9c9cf6050ec47:/client/cmdhfmf.c diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index a840969e..0ea171af 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -214,14 +214,14 @@ start: } } printf("\n"); + // error + if (isOK != 1) return 1; - // par == 0, and -4 - if (isOK == -4 && par_list == 0) { + if (par_list == 0 && ks_list != 0) { // this special attack when parities is zero, uses checkkeys. Which now with block/keytype option also needs. // but it uses 0|1 instead of 0x60|0x61... if (nonce2key_ex(blockNo, keytype - 0x60 , uid, nt, nr, ks_list, &r_key) ){ - PrintAndLog("Key not found (lfsr_common_prefix list is null)."); - PrintAndLog("Failing is expected to happen in 25%% of all cases. Trying again with a different reader nonce..."); + PrintAndLog("Trying again with a different reader nonce..."); c.arg[0] = false; goto start; } else { @@ -229,10 +229,7 @@ start: goto END; } } - - // error - if (isOK != 1) return 1; - + // execute original function from util nonce2key if (nonce2key(uid, nt, nr, par_list, ks_list, &r_key)) { isOK = 2; @@ -248,7 +245,7 @@ start: uint64_t key64 = 0; int res = mfCheckKeys(blockNo, keytype - 0x60 , false, 1, keyblock, &key64); if ( res > 0 ) { - PrintAndLog("Candidate Key found (%012"llx") - Test authentication failed. Starting over darkside attack", r_key); + PrintAndLog("Candidate Key found (%012"llx") - Test authentication failed. [%d] Restarting darkside attack", r_key, res); goto start; } PrintAndLog("Found valid key: %012"llx" \n", r_key); @@ -1060,7 +1057,8 @@ int CmdHF14AMfNestedHard(const char *Cmd) { slow ? "Yes" : "No", tests); - int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key ? trgkey : NULL, nonce_file_read, nonce_file_write, slow, tests); + uint64_t foundkey = 0; + int16_t isOK = mfnestedhard(blockNo, keyType, key, trgBlockNo, trgKeyType, know_target_key ? trgkey : NULL, nonce_file_read, nonce_file_write, slow, tests, &foundkey); if (isOK) { switch (isOK) {