From 0383d7f052e0c5646ce1987799febdf13dadbb6d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 3 Apr 2019 15:34:36 +0200 Subject: [PATCH] chg: 'hf mf restore' - add finish message chg: 'hf mfu restore' - add finish message chg: 'hf 15 restore' - add finish message, close filehandle when failing. --- client/cmdhf15.c | 8 +++++++- client/cmdhfmf.c | 2 +- client/cmdhfmfu.c | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 7391fd38c..f9fe0be2a 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -847,6 +847,8 @@ int CmdHF15Restore(const char *Cmd) { return 3; } + PrintAndLogEx(INFO, "Restoring data blocks."); + while (1) { tried = 0; hex[0] = 0x00; @@ -877,12 +879,16 @@ int CmdHF15Restore(const char *Cmd) { for (tried = 0; tried < retries; tried++) if (!(retval = CmdHF15Write(tmpCmd))) break; - if (tried >= retries) + if (tried >= retries) { + fclose(f); return retval; + } i++; } fclose(f); + PrintAndLogEx(INFO, "Finish restore"); + return 0; } int CmdHF15List(const char *Cmd) { diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 451a704bf..1a236cdc4 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1055,8 +1055,8 @@ int CmdHF14AMfRestore(const char *Cmd) { } } } - fclose(fdump); + PrintAndLogEx(INFO, "Finish restore"); return 0; } diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index 4097a0a3a..956cc1a70 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -2223,6 +2223,7 @@ int CmdHF14AMfURestore(const char *Cmd) { DropField(); free(dump); + PrintAndLogEx(INFO, "Finish restore"); return 0; } //