From 0073fc1a71105078547b29bb78e7c0ed771d61ca Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 21 Feb 2021 10:46:39 +0100 Subject: [PATCH] Modified the flashing feedback text to include suggest steps --- client/src/flash.c | 11 +++++++++++ client/src/proxmark3.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/client/src/flash.c b/client/src/flash.c index 1541b8d17..9693d8803 100644 --- a/client/src/flash.c +++ b/client/src/flash.c @@ -403,9 +403,19 @@ static int wait_for_ack(PacketResponseNG *ack) { return PM3_SUCCESS; } +static bool g_printed_msg = false; static void flash_suggest_update_bootloader(void) { + if (g_printed_msg) + return; + PrintAndLogEx(ERR, _RED_("It is recommended that you first" _YELLOW_(" update your bootloader") _RED_(" alone,"))); PrintAndLogEx(ERR, _RED_("reboot the Proxmark3 then only update the main firmware") "\n"); + PrintAndLogEx(ERR, "Follow these steps :"); + PrintAndLogEx(ERR, " 1) ./pm3-flash-bootrom"); + PrintAndLogEx(ERR, " 2) ./pm3-flash-flash-all"); + PrintAndLogEx(ERR, " 3) ./pm3"); + PrintAndLogEx(INFO, "--------------------------------------------------------"); + g_printed_msg = true; } static void flash_suggest_update_flasher(void) { @@ -532,6 +542,7 @@ const char ice[] = " !!: :!! !!: !!: !!: !!: !!! !!: !!!\n : :: :: : : :: ::: : : : : : :: : \n" _RED_(" . .. .. . . .. ... . . . . . .. . ") "\n...................................................................\n" + "...................................................................\n" ; // Write a file's segments to Flash diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index a1e4761c7..3d92b8d00 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -673,6 +673,8 @@ static int flash_pm3(char *serial_port_name, uint8_t num_files, char *filenames[ } finish: + if (ret != PM3_SUCCESS) + PrintAndLogEx(INFO, "The flashing procedure failed, follow the suggested steps!"); ret = flash_stop_flashing(); CloseProxmark(session.current_device); finish2: @@ -684,7 +686,7 @@ finish2: PrintAndLogEx(SUCCESS, _CYAN_("All done")); else PrintAndLogEx(ERR, "Aborted on error"); - PrintAndLogEx(NORMAL, "\nHave a nice day!"); + PrintAndLogEx(INFO, "\nHave a nice day!"); return ret; } #endif //LIBPM3