hint now uses session struct, in preperation for a preference file.

This commit is contained in:
iceman1001
2020-03-16 18:42:34 +01:00
parent 063eeb2610
commit 82077b2f1c
4 changed files with 8 additions and 13 deletions

View File

@@ -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;
}