From a223570dbf01758b4a16fedd651e1fdc461ac00a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 28 May 2025 20:52:51 +0200 Subject: [PATCH] hf iclass tear - only inform about read failures and keep on, instead of quiting command --- client/src/cmdhficlass.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index bd5dd3681..6cd08c7ee 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -3252,21 +3252,20 @@ static int CmdHFiClass_TearBlock(const char *Cmd) { } else if (res != PM3_SUCCESS) { decrease = true; } - if (readcount >= 10){ - PrintAndLogEx(WARNING, "\n"_RED_("Read failed too many times, giving up")); - isok = PM3_EFAILED; - goto out; - } + readcount++; } + if (readcount > 1) { + PrintAndLogEx(WARNING, "\nRead block failed "_RED_("%d") " times", readcount); + } + // if there was an error reading repeat the tearoff with the same delay if (decrease && (tearoff_start > tearoff_increment) && (tearoff_start >= tearoff_original_start)) { tearoff_start -= tearoff_increment; - if(verbose){ + if (verbose) { PrintAndLogEx(INFO, " -> Read failed, retearing with "_CYAN_("%u")" us", tearoff_start); } - } bool tear_success = true;