chg: hints - allow ON/OFF

This commit is contained in:
iceman1001 2020-03-15 13:48:50 +01:00
commit e5b38c46c6

View file

@ -194,20 +194,31 @@ int CmdRem(const char *Cmd) {
static int CmdHints(const char *Cmd) {
uint32_t ms = 0;
char ctmp = tolower(param_getchar(Cmd, 0));
if (ctmp == 'h') return usage_hints();
if (ctmp == 'h') return usage_hints();
if (strlen(Cmd) < 1) {
PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF");
return PM3_SUCCESS;
}
if (param_getchar(Cmd, 0) != 0x00) {
ms = param_get32ex(Cmd, 0, 0, 10);
if (ms == 0)
if (strlen(Cmd) > 1){
str_lower((char *)Cmd);
if (str_startswith(Cmd, "of")) {
g_showhints = false;
else
g_showhints = true;
} else {
g_showhints = true;
}
} else {
if (param_getchar(Cmd, 0) != 0x00) {
ms = param_get32ex(Cmd, 0, 0, 10);
if (ms == 0) {
g_showhints = false;
} else {
g_showhints = true;
}
}
}
PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF");
return PM3_SUCCESS;
}