From 0d8bb030d17b03c08d5556ed564330e985b3cb24 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 24 May 2025 15:40:13 +0200 Subject: [PATCH] text --- client/src/cmdhficlass.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index ef92e3998..5a9a4973e 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -3034,18 +3034,19 @@ static int CmdHFiClass_TearBlock(const char *Cmd) { PrintAndLogEx(ERR, "Key is incorrect length"); return PM3_EINVARG; } - - } else if (key_nr >= 0) { - + PrintAndLogEx(NORMAL, ""); + } + + if (key_nr >= 0) { if (key_nr < ICLASS_KEYS_MAX) { auth = true; memcpy(key, iClass_Key_Table[key_nr], 8); + PrintAndLogEx(NORMAL, ""); PrintAndLogEx(SUCCESS, "Using key[%d] " _GREEN_("%s"), key_nr, sprint_hex(iClass_Key_Table[key_nr], 8)); } else { PrintAndLogEx(ERR, "Key number is invalid"); return PM3_EINVARG; } - } if (data_len != 8) { @@ -3087,6 +3088,10 @@ static int CmdHFiClass_TearBlock(const char *Cmd) { PrintAndLogEx(SUCCESS, "No key supplied. Trying no authentication read/writes"); } + if (tearoff_loop > 1) { + PrintAndLogEx(SUCCESS, "Loop " _YELLOW_("%u") " times / attempt", tearoff_loop); + } + if (tearoff_sleep) { PrintAndLogEx(SUCCESS, "Using " _YELLOW_("%u") " ms delay between attempts", tearoff_sleep); } @@ -3148,7 +3153,9 @@ static int CmdHFiClass_TearBlock(const char *Cmd) { first_read = true; reread = false; } - + PrintAndLogEx(SUCCESS, "Original block data... " _CYAN_("%s"), sprint_hex_inrow(data_read_orig, sizeof(data_read_orig))); + PrintAndLogEx(SUCCESS, "New data to write..... " _YELLOW_("%s"), sprint_hex_inrow(data, sizeof(data))); + PrintAndLogEx(INFO, "------------------------------------------"); // turn off Device side debug messages uint8_t dbg_curr = DBG_NONE; if (getDeviceDebugLevel(&dbg_curr) != PM3_SUCCESS) { @@ -3315,6 +3322,8 @@ out: }; handle_tearoff(¶ms, false); PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(INFO, "Done!"); + PrintAndLogEx(NORMAL, ""); clearCommandBuffer(); return isok; }