mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
hint now uses session struct, in preperation for a preference file.
This commit is contained in:
parent
063eeb2610
commit
82077b2f1c
4 changed files with 8 additions and 13 deletions
|
@ -196,30 +196,25 @@ static int CmdHints(const char *Cmd) {
|
|||
char ctmp = tolower(param_getchar(Cmd, 0));
|
||||
if (ctmp == 'h') return usage_hints();
|
||||
|
||||
if (strlen(Cmd) < 1) {
|
||||
PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
if (strlen(Cmd) > 1){
|
||||
str_lower((char *)Cmd);
|
||||
if (str_startswith(Cmd, "of")) {
|
||||
g_showhints = false;
|
||||
session.show_hints = false;
|
||||
} else {
|
||||
g_showhints = true;
|
||||
session.show_hints = true;
|
||||
}
|
||||
} else {
|
||||
} else if (strlen(Cmd) == 1) {
|
||||
if (param_getchar(Cmd, 0) != 0x00) {
|
||||
ms = param_get32ex(Cmd, 0, 0, 10);
|
||||
if (ms == 0) {
|
||||
g_showhints = false;
|
||||
session.show_hints = false;
|
||||
} else {
|
||||
g_showhints = true;
|
||||
session.show_hints = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF");
|
||||
PrintAndLogEx(INFO, "Hints are %s", (session.show_hints) ? "ON" : "OFF");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ extern size_t DemodBufferLen;
|
|||
extern size_t g_DemodStartIdx;
|
||||
extern bool showDemod;
|
||||
extern uint8_t g_debugMode;
|
||||
extern uint8_t g_showhints;
|
||||
|
||||
#ifndef FILE_PATH_SIZE
|
||||
#define FILE_PATH_SIZE 1000
|
||||
|
|
|
@ -131,7 +131,7 @@ void PrintAndLogEx(logLevel_t level, const char *fmt, ...) {
|
|||
return;
|
||||
|
||||
// skip HINT messages if client has hints turned off i.e. 'HINT 0'
|
||||
if (g_showhints == 0 && level == HINT)
|
||||
if (session.show_hints == false && level == HINT)
|
||||
return;
|
||||
|
||||
char prefix[40] = {0};
|
||||
|
|
|
@ -27,6 +27,7 @@ typedef struct {
|
|||
emojiMode_t emoji_mode;
|
||||
bool pm3_present;
|
||||
bool help_dump_mode;
|
||||
bool show_hints;
|
||||
} session_arg_t;
|
||||
|
||||
extern session_arg_t session;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue