From 96e05d49dfa58ac34687197a3298404e49859561 Mon Sep 17 00:00:00 2001 From: tharexde Date: Mon, 26 Oct 2020 22:10:48 +0100 Subject: [PATCH] added simple sim function for em4x50 --- armsrc/appmain.c | 4 ++++ armsrc/em4x50.h | 1 + client/src/cmdlfem4x.c | 1 + client/src/cmdlfem4x50.h | 1 + include/pm3_cmd.h | 1 + 5 files changed, 8 insertions(+) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index e4bd5f600..c5dda3f75 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1121,6 +1121,10 @@ static void PacketReceived(PacketCommandNG *packet) { em4x50_restore((em4x50_data_t *)packet->data.asBytes); break; } + case CMD_LF_EM4X50_SIM: { + em4x50_sim((uint32_t *)packet->data.asBytes); + break; + } #endif #ifdef WITH_ISO15693 diff --git a/armsrc/em4x50.h b/armsrc/em4x50.h index 7c9cda575..e71a2fd89 100644 --- a/armsrc/em4x50.h +++ b/armsrc/em4x50.h @@ -29,5 +29,6 @@ void em4x50_login(uint32_t *password); void em4x50_reset(void); void em4x50_watch(void); void em4x50_restore(em4x50_data_t *etd); +void em4x50_sim(uint32_t *word); #endif /* EM4X50_H */ diff --git a/client/src/cmdlfem4x.c b/client/src/cmdlfem4x.c index 318df61ec..fdf593fc5 100644 --- a/client/src/cmdlfem4x.c +++ b/client/src/cmdlfem4x.c @@ -662,6 +662,7 @@ static command_t CommandTable[] = { {"4x50_reset", CmdEM4x50Reset, IfPm3EM4x50, "reset EM4x50"}, {"4x50_watch", CmdEM4x50Watch, IfPm3EM4x50, "read EM4x50 continously"}, {"4x50_restore",CmdEM4x50Restore, IfPm3EM4x50, "restore EM4x50 dump to tag"}, + {"4x50_sim", CmdEM4x50Sim, IfPm3EM4x50, "simulate single EM4x50 word (uid)"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/cmdlfem4x50.h b/client/src/cmdlfem4x50.h index 8ffda2933..acadd2084 100644 --- a/client/src/cmdlfem4x50.h +++ b/client/src/cmdlfem4x50.h @@ -29,5 +29,6 @@ int CmdEM4x50Login(const char *Cmd); int CmdEM4x50Reset(const char *Cmd); int CmdEM4x50Watch(const char *Cmd); int CmdEM4x50Restore(const char *Cmd); +int CmdEM4x50Sim(const char *Cmd); #endif diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 245e2b886..8124cd82b 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -513,6 +513,7 @@ typedef struct { #define CMD_LF_EM4X50_RESET 0x0247 #define CMD_LF_EM4X50_WATCH 0x0248 #define CMD_LF_EM4X50_RESTORE 0x0249 +#define CMD_LF_EM4X50_SIM 0x0250 // Sampling configuration for LF reader/sniffer #define CMD_LF_SAMPLING_SET_CONFIG 0x021D #define CMD_LF_FSK_SIMULATE 0x021E