mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
safer logic when touching locally g_printAndLog
This commit is contained in:
parent
2722655658
commit
4b936bc20c
4 changed files with 13 additions and 11 deletions
|
@ -182,7 +182,7 @@ void CmdsHelp(const command_t Commands[]) {
|
||||||
while (Commands[i].Name) {
|
while (Commands[i].Name) {
|
||||||
if (Commands[i].IsAvailable()) {
|
if (Commands[i].IsAvailable()) {
|
||||||
uint8_t old_printAndLog = g_printAndLog;
|
uint8_t old_printAndLog = g_printAndLog;
|
||||||
g_printAndLog = PRINTANDLOG_PRINT;
|
g_printAndLog &= PRINTANDLOG_PRINT;
|
||||||
if (Commands[i].Name[0] == '-' || Commands[i].Name[0] == ' ') {
|
if (Commands[i].Name[0] == '-' || Commands[i].Name[0] == ' ') {
|
||||||
PrintAndLogEx(NORMAL, "%-16s %s", Commands[i].Name, Commands[i].Help);
|
PrintAndLogEx(NORMAL, "%-16s %s", Commands[i].Name, Commands[i].Help);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1005,8 +1005,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_H:
|
case Qt::Key_H: {
|
||||||
g_printAndLog = PRINTANDLOG_PRINT;
|
uint8_t old_printAndLog = g_printAndLog;
|
||||||
|
g_printAndLog &= PRINTANDLOG_PRINT;
|
||||||
PrintAndLogEx(NORMAL, "\n\n" _CYAN_("PLOT window keystrokes and mouse events"));
|
PrintAndLogEx(NORMAL, "\n\n" _CYAN_("PLOT window keystrokes and mouse events"));
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Move:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Move:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Home") "/" _RED_("End"), "Move to the start/end of the graph");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Home") "/" _RED_("End"), "Move to the start/end of the graph");
|
||||||
|
@ -1031,9 +1032,9 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _YELLOW_("Right mouse click"), "Set purple cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _YELLOW_("Right mouse click"), "Set purple cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("h"), "Show this help");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("h"), "Show this help");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("q"), "Close plot window");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("q"), "Close plot window");
|
||||||
g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG;
|
g_printAndLog = old_printAndLog;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case Qt::Key_L:
|
case Qt::Key_L:
|
||||||
g_GridLocked = !g_GridLocked;
|
g_GridLocked = !g_GridLocked;
|
||||||
if (g_GridLocked)
|
if (g_GridLocked)
|
||||||
|
|
|
@ -93,8 +93,8 @@ static void showBanner_logo(LogoMode mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void showBanner(void) {
|
static void showBanner(void) {
|
||||||
|
uint8_t old_printAndLog = g_printAndLog;
|
||||||
g_printAndLog = PRINTANDLOG_PRINT;
|
g_printAndLog &= PRINTANDLOG_PRINT;
|
||||||
PrintAndLogEx(NORMAL, "\n");
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
@ -114,7 +114,7 @@ static void showBanner(void) {
|
||||||
// PrintAndLogEx(NORMAL, "\nMonero: 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
// PrintAndLogEx(NORMAL, "\nMonero: 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG;
|
g_printAndLog = old_printAndLog;
|
||||||
}
|
}
|
||||||
#endif //LIBPM3
|
#endif //LIBPM3
|
||||||
|
|
||||||
|
@ -436,8 +436,9 @@ check_script:
|
||||||
cmd[strlen(cmd) - off] = '\0';
|
cmd[strlen(cmd) - off] = '\0';
|
||||||
|
|
||||||
if (cmd[0] != '\0') {
|
if (cmd[0] != '\0') {
|
||||||
|
uint8_t old_printAndLog = g_printAndLog;
|
||||||
if (!printprompt) {
|
if (!printprompt) {
|
||||||
g_printAndLog = PRINTANDLOG_LOG;
|
g_printAndLog &= PRINTANDLOG_LOG;
|
||||||
}
|
}
|
||||||
char prompt[PROXPROMPT_MAX_SIZE] = {0};
|
char prompt[PROXPROMPT_MAX_SIZE] = {0};
|
||||||
prompt_compose(prompt, sizeof(prompt), prompt_ctx, prompt_dev);
|
prompt_compose(prompt, sizeof(prompt), prompt_ctx, prompt_dev);
|
||||||
|
@ -445,7 +446,7 @@ check_script:
|
||||||
char prompt_filtered[PROXPROMPT_MAX_SIZE] = {0};
|
char prompt_filtered[PROXPROMPT_MAX_SIZE] = {0};
|
||||||
memcpy_filter_rlmarkers(prompt_filtered, prompt, sizeof(prompt_filtered));
|
memcpy_filter_rlmarkers(prompt_filtered, prompt, sizeof(prompt_filtered));
|
||||||
PrintAndLogEx(NORMAL, "%s%s", prompt_filtered, cmd);
|
PrintAndLogEx(NORMAL, "%s%s", prompt_filtered, cmd);
|
||||||
g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG;
|
g_printAndLog = old_printAndLog;
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
// add to history if not from a script
|
// add to history if not from a script
|
||||||
|
|
|
@ -10041,6 +10041,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 589,
|
"commands_extracted": 589,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2021-12-13T01:57:16"
|
"extracted_on": "2021-12-13T02:15:15"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue