X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/4b2e63be17a44223c52917c9341a51e5053405f0..89a40c3d1dcf9aeb2170515ec5e559aa65e6a2be:/client/cmdhfmfhard.c?ds=sidebyside diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index 169b40cf..fbfeeb76 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -856,8 +856,14 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ } if (!initialize) { - if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) return 1; - if (resp.arg[0]) return resp.arg[0]; // error during nested_hard + if (!WaitForResponseTimeout(CMD_ACK, &resp, 3000)) { + fclose(fnonces); + return 1; + } + if (resp.arg[0]) { + fclose(fnonces); + return resp.arg[0]; // error during nested_hard + } } initialize = false; @@ -1457,15 +1463,15 @@ int mfnestedhard(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBloc // best_first_bytes[9] ); PrintAndLog("Number of first bytes with confidence > %2.1f%%: %d", CONFIDENCE_THRESHOLD*100.0, num_good_first_bytes); - time_t start_time = clock(); + 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; + free_nonces_memory(); + free_statelist_cache(); + free_candidates_memory(candidates); + candidates = NULL; } return 0;