From 5e26c096bb6d65bafe95c00f5ce2623bee397e52 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 25 Sep 2020 16:39:07 +0200 Subject: [PATCH] hw version: display firmware platform info --- client/src/cmdhw.c | 24 +++++++++++++----------- client/src/cmdparser.c | 6 ++++++ client/src/cmdparser.h | 1 + 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index 4c93210eb..7c24bb342 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -715,18 +715,20 @@ void pm3_version(bool verbose, bool oneliner) { PrintAndLogEx(NORMAL, "%s", temp); PrintAndLogEx(NORMAL, " compiled with " PM3CLIENTCOMPILER __VERSION__ PM3HOSTOS PM3HOSTARCH); - if (IfPm3Flash() == false && IfPm3Smartcard() == false && IfPm3FpcUsartHost() == false) { - PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("PROXMARK3") " ]"); - } else { - PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("PROXMARK3 RDV4") " ]"); - PrintAndLogEx(NORMAL, " external flash: %s", IfPm3Flash() ? _GREEN_("present") : _YELLOW_("absent")); - PrintAndLogEx(NORMAL, " smartcard reader: %s", IfPm3Smartcard() ? _GREEN_("present") : _YELLOW_("absent")); - PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("PROXMARK3 RDV4 Extras") " ]"); - PrintAndLogEx(NORMAL, " FPC USART for BT add-on support: %s", IfPm3FpcUsartHost() ? _GREEN_("present") : _YELLOW_("absent")); - - if (IfPm3FpcUsartDevFromUsb()) { - PrintAndLogEx(NORMAL, " FPC USART for developer support: %s", _GREEN_("present")); + PrintAndLogEx(NORMAL, "\n [ " _YELLOW_("PROXMARK3") " ]"); + if (IfPm3Rdv4Fw() == false ){ + PrintAndLogEx(NORMAL, " firmware.........................%s", _GREEN_("PM3OTHER")); + if (IfPm3FpcUsartHost()) { + PrintAndLogEx(NORMAL, " FPC USART for BT add-on..........%s", _GREEN_("present")); } + } else { + PrintAndLogEx(NORMAL, " firmware.........................%s", _GREEN_("PM3RDV4")); + PrintAndLogEx(NORMAL, " external flash...................%s", IfPm3Flash() ? _GREEN_("present") : _YELLOW_("absent")); + PrintAndLogEx(NORMAL, " smartcard reader.................%s", IfPm3Smartcard() ? _GREEN_("present") : _YELLOW_("absent")); + PrintAndLogEx(NORMAL, " FPC USART for BT add-on..........%s", IfPm3FpcUsartHost() ? _GREEN_("present") : _YELLOW_("absent")); + } + if (IfPm3FpcUsartDevFromUsb()) { + PrintAndLogEx(NORMAL, " FPC USART for developer..........%s", _GREEN_("present")); } PrintAndLogEx(NORMAL, ""); diff --git a/client/src/cmdparser.c b/client/src/cmdparser.c index 93bba22bf..590dee87d 100644 --- a/client/src/cmdparser.c +++ b/client/src/cmdparser.c @@ -26,6 +26,12 @@ bool IfPm3Present(void) { return session.pm3_present; } +bool IfPm3Rdv4Fw(void) { + if (!IfPm3Present()) + return false; + return (pm3_capabilities.compiled_with_flash) || (pm3_capabilities.compiled_with_smartcard); +} + bool IfPm3Flash(void) { if (!IfPm3Present()) return false; diff --git a/client/src/cmdparser.h b/client/src/cmdparser.h index baade0bcb..4e1e37a77 100644 --- a/client/src/cmdparser.h +++ b/client/src/cmdparser.h @@ -24,6 +24,7 @@ typedef struct command_s { // helpers for command_t IsAvailable bool AlwaysAvailable(void); bool IfPm3Present(void); +bool IfPm3Rdv4Fw(void); bool IfPm3Flash(void); bool IfPm3Smartcard(void); bool IfPm3FpcUsart(void);