From 3ddd9f8a914ef685fc9f43b8e20215c806445a73 Mon Sep 17 00:00:00 2001 From: tharexde Date: Sun, 1 Nov 2020 22:44:16 +0100 Subject: [PATCH] - added first version of 4x50_chk - renamed 4x50_write_password to 4x50_writepwd --- armsrc/appmain.c | 8 ++++++-- armsrc/em4x50.h | 3 ++- client/src/cmdlfem4x.c | 3 ++- client/src/cmdlfem4x50.h | 3 ++- include/pm3_cmd.h | 3 ++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index dfd4f0751..0fdfa6fd1 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1090,8 +1090,8 @@ static void PacketReceived(PacketCommandNG *packet) { em4x50_write((em4x50_data_t *)packet->data.asBytes); break; } - case CMD_LF_EM4X50_WRITE_PASSWORD: { - em4x50_write_password((em4x50_data_t *)packet->data.asBytes); + case CMD_LF_EM4X50_WRITEPWD: { + em4x50_writepwd((em4x50_data_t *)packet->data.asBytes); break; } case CMD_LF_EM4X50_READ: { @@ -1140,6 +1140,10 @@ static void PacketReceived(PacketCommandNG *packet) { emlSet(packet->data.asBytes, packet->oldarg[0], packet->oldarg[1]); break; } + case CMD_LF_EM4X50_CHK: { + em4x50_chk((uint32_t *)packet->data.asBytes); + break; + } #endif #ifdef WITH_ISO15693 diff --git a/armsrc/em4x50.h b/armsrc/em4x50.h index 57ad94b4d..d1a94d662 100644 --- a/armsrc/em4x50.h +++ b/armsrc/em4x50.h @@ -21,7 +21,7 @@ bool em4x50_sim_send_word(uint32_t word); void em4x50_info(em4x50_data_t *etd); void em4x50_write(em4x50_data_t *etd); -void em4x50_write_password(em4x50_data_t *etd); +void em4x50_writepwd(em4x50_data_t *etd); void em4x50_read(em4x50_data_t *etd); void em4x50_wipe(uint32_t *password); void em4x50_brute(em4x50_data_t *etd); @@ -31,5 +31,6 @@ void em4x50_watch(void); void em4x50_restore(em4x50_data_t *etd); void em4x50_sim(void); void em4x50_stdread(void); +void em4x50_chk(uint32_t *numkeys); #endif /* EM4X50_H */ diff --git a/client/src/cmdlfem4x.c b/client/src/cmdlfem4x.c index 8370edcfb..0c038a438 100644 --- a/client/src/cmdlfem4x.c +++ b/client/src/cmdlfem4x.c @@ -654,7 +654,7 @@ static command_t CommandTable[] = { {"4x50_dump", CmdEM4x50Dump, IfPm3EM4x50, "dump EM4x50 tag"}, {"4x50_info", CmdEM4x50Info, IfPm3EM4x50, "tag information EM4x50"}, {"4x50_write", CmdEM4x50Write, IfPm3EM4x50, "write word data to EM4x50"}, - {"4x50_write_password", CmdEM4x50WritePassword, IfPm3EM4x50, "change password of EM4x50 tag"}, + {"4x50_writepwd",CmdEM4x50WritePwd, IfPm3EM4x50, "change password of EM4x50 tag"}, {"4x50_read", CmdEM4x50Read, IfPm3EM4x50, "read word data from EM4x50"}, {"4x50_wipe", CmdEM4x50Wipe, IfPm3EM4x50, "wipe data from EM4x50"}, {"4x50_brute", CmdEM4x50Brute, IfPm3EM4x50, "guess password of EM4x50"}, @@ -666,6 +666,7 @@ static command_t CommandTable[] = { {"4x50_stdread",CmdEM4x50StdRead, IfPm3EM4x50, "show standard read mode data of EM4x50 tag"}, {"4x50_eload", CmdEM4x50ELoad, IfPm3EM4x50, "load a binary dump into emulator memory"}, {"4x50_esave", CmdEM4x50ESave, IfPm3EM4x50, "save emulator memory to file"}, + {"4x50_chk", CmdEM4x50Chk, IfPm3EM4x50, "check passwords from dictionary"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/cmdlfem4x50.h b/client/src/cmdlfem4x50.h index 2c84d9f15..753210f0a 100644 --- a/client/src/cmdlfem4x50.h +++ b/client/src/cmdlfem4x50.h @@ -20,7 +20,7 @@ int em4x50_read(em4x50_data_t *etd, em4x50_word_t *out); int CmdEM4x50Info(const char *Cmd); int CmdEM4x50Write(const char *Cmd); -int CmdEM4x50WritePassword(const char *Cmd); +int CmdEM4x50WritePwd(const char *Cmd); int CmdEM4x50Read(const char *Cmd); int CmdEM4x50Dump(const char *Cmd); int CmdEM4x50Wipe(const char *Cmd); @@ -33,5 +33,6 @@ int CmdEM4x50Sim(const char *Cmd); int CmdEM4x50StdRead(const char *Cmd); int CmdEM4x50ELoad(const char *Cmd); int CmdEM4x50ESave(const char *Cmd); +int CmdEM4x50Chk(const char *Cmd); #endif diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index bf05735da..d90b78f60 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -505,7 +505,7 @@ typedef struct { #define CMD_LF_EM410X_WATCH 0x021C #define CMD_LF_EM4X50_INFO 0x0240 #define CMD_LF_EM4X50_WRITE 0x0241 -#define CMD_LF_EM4X50_WRITE_PASSWORD 0x0242 +#define CMD_LF_EM4X50_WRITEPWD 0x0242 #define CMD_LF_EM4X50_READ 0x0243 #define CMD_LF_EM4X50_WIPE 0x0244 #define CMD_LF_EM4X50_BRUTE 0x0245 @@ -516,6 +516,7 @@ typedef struct { #define CMD_LF_EM4X50_SIM 0x0250 #define CMD_LF_EM4X50_STDREAD 0x0251 #define CMD_LF_EM4X50_ESET 0x0252 +#define CMD_LF_EM4X50_CHK 0x0253 // Sampling configuration for LF reader/sniffer #define CMD_LF_SAMPLING_SET_CONFIG 0x021D #define CMD_LF_FSK_SIMULATE 0x021E