From 0ba4394532db293b7006206093b4c1a00b3401ec Mon Sep 17 00:00:00 2001 From: tharexde Date: Sun, 6 Dec 2020 23:08:43 +0100 Subject: [PATCH] cleanup --- armsrc/em4x50.c | 33 --------------------------------- client/src/cmdlfem4x50.c | 26 +------------------------- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/armsrc/em4x50.c b/armsrc/em4x50.c index 9797ea057..f63c03bbc 100644 --- a/armsrc/em4x50.c +++ b/armsrc/em4x50.c @@ -15,7 +15,6 @@ #include "lfdemod.h" #include "commonutil.h" #include "em4x50.h" -//#include "flashmem.h" #include "BigBuf.h" #include "spiffs.h" #include "appmain.h" // tear @@ -56,10 +55,6 @@ int gHigh = 190; int gLow = 60; -//============================================================================== -// auxiliary functions -//============================================================================== - static void wait_timer(uint32_t period) { // do nothing for using timer0 @@ -177,10 +172,6 @@ static void em4x50_setup_sim(void) { AT91C_BASE_PIOA->PIO_ODR = GPIO_SSC_CLK; } -//============================================================================== -// functions for "reader" use case -//============================================================================== - static bool get_signalproperties(void) { // calculate signal properties (mean amplitudes) from measured data: @@ -653,10 +644,6 @@ static int get_word_from_bitstream(uint32_t *data) { return PM3_EOPABORTED; } -//============================================================================== -// functions for "simulating" use case -//============================================================================== - static bool em4x50_sim_send_bit(uint8_t bit) { uint16_t check = 0; @@ -803,10 +790,6 @@ bool em4x50_sim_send_listen_window(void) { return true; } -//============================================================================== -// login functions -//============================================================================== - static bool login(uint32_t password) { // simple login to EM4x50, @@ -971,10 +954,6 @@ void em4x50_chk(uint8_t *filename) { reply_ng(CMD_LF_EM4X50_CHK, status, (uint8_t *)&pwd, 32); } -//============================================================================== -// reset functions -//============================================================================== - static int reset(void) { // resets EM4x50 tag (used by write function) @@ -995,10 +974,6 @@ static int reset(void) { return PM3_EFAILED; } -//============================================================================== -// read functions -//============================================================================== - static int standard_read(int *now, uint32_t *words) { // reads data that tag transmits when exposed to reader field @@ -1129,10 +1104,6 @@ void em4x50_reader(void) { reply_ng(CMD_LF_EM4X50_READER, now, (uint8_t *)words, 4 * now); } -//============================================================================== -// write functions -//============================================================================== - static int write(uint32_t word, uint32_t addresses) { // writes to specified @@ -1300,10 +1271,6 @@ void em4x50_writepwd(em4x50_data_t *etd) { reply_ng(CMD_LF_EM4X50_WRITEPWD, status, 0, 0); } -//============================================================================== -// simulate functions -//============================================================================== - void em4x50_sim(uint8_t *filename) { // simulate uploaded data in emulator memory diff --git a/client/src/cmdlfem4x50.c b/client/src/cmdlfem4x50.c index 1eb14252c..b397ece54 100644 --- a/client/src/cmdlfem4x50.c +++ b/client/src/cmdlfem4x50.c @@ -21,10 +21,6 @@ #define BYTES2UINT32(x) ((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | (x[3])) -//============================================================================== -// output functions -//============================================================================== - static int CmdHelp(const char *Cmd); static void prepare_result(const uint8_t *data, int fwr, int lwr, em4x50_word_t *words) { @@ -128,10 +124,6 @@ static void print_info_result(uint8_t *data) { PrintAndLogEx(NORMAL, ""); } -//============================================================================== -// file/memory functions -//============================================================================== - static int em4x50_load_file(const char *filename, uint8_t *data, size_t data_len, size_t *bytes_read) { // read data from dump file; file type is derived from file name extension @@ -271,10 +263,6 @@ int CmdEM4x50ESave(const char *Cmd) { return PM3_SUCCESS; } -//============================================================================== -// login functions -//============================================================================== - int CmdEM4x50Login(const char *Cmd) { int pwdLen = 0; @@ -479,10 +467,6 @@ int CmdEM4x50Chk(const char *Cmd) { return PM3_SUCCESS; } -//============================================================================== -// read functions -//============================================================================== - //quick test for EM4x50 tag bool detect_4x50_block(void) { em4x50_data_t etd = { @@ -803,10 +787,6 @@ int CmdEM4x50Dump(const char *Cmd) { return PM3_SUCCESS; } -//============================================================================== -// write functions -//============================================================================== - int CmdEM4x50Write(const char *Cmd) { // envoke writing a single word (32 bit) to a EM4x50 tag @@ -1144,10 +1124,6 @@ int CmdEM4x50Restore(const char *Cmd) { return PM3_SUCCESS; } -//============================================================================== -// simulate functions -//============================================================================== - int CmdEM4x50Sim(const char *Cmd) { int slen = 0, status = 0; @@ -1217,7 +1193,7 @@ int CmdEM4x50Sim(const char *Cmd) { } static command_t CommandTable[] = { - {"help", CmdHelp, AlwaysAvailable, "This help"}, + {"help", CmdHelp, AlwaysAvailable, "This help"}, {"dump", CmdEM4x50Dump, IfPm3EM4x50, "dump EM4x50 tag"}, {"info", CmdEM4x50Info, IfPm3EM4x50, "tag information EM4x50"}, {"write", CmdEM4x50Write, IfPm3EM4x50, "write word data to EM4x50"},