mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-05 23:07:39 +00:00
text
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user