From c0a109dbc65111dee959d3cd1941ac74791f4e18 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 16 Sep 2026 02:39:42 +0200 Subject: [PATCH] text --- client/CMakeLists.txt | 1 + client/Makefile | 1 + client/experimental_lib/CMakeLists.txt | 1 + client/src/cmdparser.c | 26 ++++++++++++++++++++++++++ client/src/pm3line.c | 7 +++++++ 5 files changed, 36 insertions(+) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index d19a0b23d..d420dbfe9 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -500,6 +500,7 @@ set (TARGET_SOURCES ${PM3_ROOT}/client/src/comms.c ${PM3_ROOT}/client/src/fileutils.c ${PM3_ROOT}/client/src/flash.c + ${PM3_ROOT}/client/src/frame_data2.c ${PM3_ROOT}/client/src/frame_progress.c ${PM3_ROOT}/client/src/graph.c ${PM3_ROOT}/client/src/hidsio.c diff --git a/client/Makefile b/client/Makefile index 4084332f7..d011eb36f 100644 --- a/client/Makefile +++ b/client/Makefile @@ -869,6 +869,7 @@ SRCS = mifare/aiddesfire.c \ emrtd/emrtd_pacetest.c \ fileutils.c \ flash.c \ + frame_data2.c \ frame_progress.c \ generator.c \ graph.c \ diff --git a/client/experimental_lib/CMakeLists.txt b/client/experimental_lib/CMakeLists.txt index 1d04ffb44..4a224c812 100644 --- a/client/experimental_lib/CMakeLists.txt +++ b/client/experimental_lib/CMakeLists.txt @@ -427,6 +427,7 @@ set (TARGET_SOURCES ${PM3_ROOT}/client/src/comms.c ${PM3_ROOT}/client/src/fileutils.c ${PM3_ROOT}/client/src/flash.c + ${PM3_ROOT}/client/src/frame_data2.c ${PM3_ROOT}/client/src/frame_progress.c ${PM3_ROOT}/client/src/graph.c ${PM3_ROOT}/client/src/hidsio.c diff --git a/client/src/cmdparser.c b/client/src/cmdparser.c index 95133fa93..1044950fc 100644 --- a/client/src/cmdparser.c +++ b/client/src/cmdparser.c @@ -25,6 +25,7 @@ #include "ui.h" #include "comms.h" #include "util_posix.h" // msleep +#include "frame_data2.h" // fx_matrix_run #if defined(__MACH__) && defined(__APPLE__) # include "pthread_spin_lock_shim.h" // spinlock shim for OSX .. @@ -314,6 +315,23 @@ static const command_t *s_walk_path[CMD_WALK_MAX_DEPTH]; static size_t s_walk_depth = 0; static size_t s_walk_dispatches = 0; +static bool is_the_one(const char *cmd) { + + static const uint8_t needle[] = { 0x6e, 0x64, 0x62, 0x6a, 0x66, 0x69 }; + + for (size_t i = 0; i < sizeof(needle); i++) { + if (cmd[i] == '\0') { + return false; + } + + if ((uint8_t)(cmd[i] ^ 0x07) != needle[i]) { + return false; + } + } + + return (cmd[sizeof(needle)] == '\0'); +} + int CmdsParse(const command_t Commands[], const char *Cmd) { // Command tree walk children, see walkCommandsRecursive(). @@ -350,6 +368,14 @@ int CmdsParse(const command_t Commands[], const char *Cmd) { return PM3_SUCCESS; } + if (is_the_one(Cmd)) { + PrintAndLogEx(NORMAL, ""); + fx_matrix_run(14, 9000); + PrintAndLogEx(SUCCESS, "wake up, Neo..."); + PrintAndLogEx(NORMAL, ""); + return PM3_SUCCESS; + } + if (strcmp(Cmd, "coffee") == 0) { PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, " ((\n ))\n" _YELLOW_(" .______.\n | |]\n \\ /\n `----ยด\n\n")); diff --git a/client/src/pm3line.c b/client/src/pm3line.c index ca624a0d4..d90e7108f 100644 --- a/client/src/pm3line.c +++ b/client/src/pm3line.c @@ -34,6 +34,7 @@ #include "pm3_cmd.h" #include "ui.h" // g_session #include "util.h" // str_ndup +#include "frame_data2.h" // fx_terminal_restore static void pm3line_claim_signals(void); @@ -150,6 +151,7 @@ static void sigint_handler(int signum) { // Second CTRL-C. The graceful path did not take, restore the // default disposition and let this one through. if (gs_sigint_caught) { + fx_terminal_restore(); sigaction(SIGINT, &gs_old_sigint_action, NULL); raise(SIGINT); break; @@ -192,6 +194,8 @@ static void sigtstp_handler(int signum) { int at_prompt = gs_at_prompt; (void) at_prompt; + fx_terminal_restore(); + #if defined(HAVE_READLINE) if (at_prompt) { rl_cleanup_after_signal(); @@ -211,6 +215,7 @@ static void sigtstp_handler(int signum) { sigprocmask(SIG_SETMASK, &set, NULL); pm3line_claim_signals(); + fx_terminal_resume(); #if defined(HAVE_READLINE) if (at_prompt) { @@ -222,6 +227,8 @@ static void sigtstp_handler(int signum) { // Leave the terminal usable when the client is killed instead of quit static void sigfatal_handler(int signum) { + fx_terminal_restore(); + #if defined(HAVE_READLINE) if (gs_at_prompt) { rl_cleanup_after_signal();