mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
cleanup
This commit is contained in:
parent
e4d0bfeced
commit
0ba4394532
2 changed files with 1 additions and 58 deletions
|
@ -15,7 +15,6 @@
|
||||||
#include "lfdemod.h"
|
#include "lfdemod.h"
|
||||||
#include "commonutil.h"
|
#include "commonutil.h"
|
||||||
#include "em4x50.h"
|
#include "em4x50.h"
|
||||||
//#include "flashmem.h"
|
|
||||||
#include "BigBuf.h"
|
#include "BigBuf.h"
|
||||||
#include "spiffs.h"
|
#include "spiffs.h"
|
||||||
#include "appmain.h" // tear
|
#include "appmain.h" // tear
|
||||||
|
@ -56,10 +55,6 @@
|
||||||
int gHigh = 190;
|
int gHigh = 190;
|
||||||
int gLow = 60;
|
int gLow = 60;
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// auxiliary functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static void wait_timer(uint32_t period) {
|
static void wait_timer(uint32_t period) {
|
||||||
|
|
||||||
// do nothing for <period> using timer0
|
// do nothing for <period> using timer0
|
||||||
|
@ -177,10 +172,6 @@ static void em4x50_setup_sim(void) {
|
||||||
AT91C_BASE_PIOA->PIO_ODR = GPIO_SSC_CLK;
|
AT91C_BASE_PIOA->PIO_ODR = GPIO_SSC_CLK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// functions for "reader" use case
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static bool get_signalproperties(void) {
|
static bool get_signalproperties(void) {
|
||||||
|
|
||||||
// calculate signal properties (mean amplitudes) from measured data:
|
// calculate signal properties (mean amplitudes) from measured data:
|
||||||
|
@ -653,10 +644,6 @@ static int get_word_from_bitstream(uint32_t *data) {
|
||||||
return PM3_EOPABORTED;
|
return PM3_EOPABORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// functions for "simulating" use case
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static bool em4x50_sim_send_bit(uint8_t bit) {
|
static bool em4x50_sim_send_bit(uint8_t bit) {
|
||||||
|
|
||||||
uint16_t check = 0;
|
uint16_t check = 0;
|
||||||
|
@ -803,10 +790,6 @@ bool em4x50_sim_send_listen_window(void) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// login functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static bool login(uint32_t password) {
|
static bool login(uint32_t password) {
|
||||||
|
|
||||||
// simple login to EM4x50,
|
// 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);
|
reply_ng(CMD_LF_EM4X50_CHK, status, (uint8_t *)&pwd, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// reset functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static int reset(void) {
|
static int reset(void) {
|
||||||
|
|
||||||
// resets EM4x50 tag (used by write function)
|
// resets EM4x50 tag (used by write function)
|
||||||
|
@ -995,10 +974,6 @@ static int reset(void) {
|
||||||
return PM3_EFAILED;
|
return PM3_EFAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// read functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static int standard_read(int *now, uint32_t *words) {
|
static int standard_read(int *now, uint32_t *words) {
|
||||||
|
|
||||||
// reads data that tag transmits when exposed to reader field
|
// 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);
|
reply_ng(CMD_LF_EM4X50_READER, now, (uint8_t *)words, 4 * now);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// write functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static int write(uint32_t word, uint32_t addresses) {
|
static int write(uint32_t word, uint32_t addresses) {
|
||||||
|
|
||||||
// writes <word> to specified <addresses>
|
// writes <word> to specified <addresses>
|
||||||
|
@ -1300,10 +1271,6 @@ void em4x50_writepwd(em4x50_data_t *etd) {
|
||||||
reply_ng(CMD_LF_EM4X50_WRITEPWD, status, 0, 0);
|
reply_ng(CMD_LF_EM4X50_WRITEPWD, status, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// simulate functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
void em4x50_sim(uint8_t *filename) {
|
void em4x50_sim(uint8_t *filename) {
|
||||||
|
|
||||||
// simulate uploaded data in emulator memory
|
// simulate uploaded data in emulator memory
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
|
|
||||||
#define BYTES2UINT32(x) ((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | (x[3]))
|
#define BYTES2UINT32(x) ((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | (x[3]))
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// output functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
static void prepare_result(const uint8_t *data, int fwr, int lwr, em4x50_word_t *words) {
|
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, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// file/memory functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
static int em4x50_load_file(const char *filename, uint8_t *data, size_t data_len, size_t *bytes_read) {
|
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
|
// 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;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// login functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
int CmdEM4x50Login(const char *Cmd) {
|
int CmdEM4x50Login(const char *Cmd) {
|
||||||
|
|
||||||
int pwdLen = 0;
|
int pwdLen = 0;
|
||||||
|
@ -479,10 +467,6 @@ int CmdEM4x50Chk(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// read functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
//quick test for EM4x50 tag
|
//quick test for EM4x50 tag
|
||||||
bool detect_4x50_block(void) {
|
bool detect_4x50_block(void) {
|
||||||
em4x50_data_t etd = {
|
em4x50_data_t etd = {
|
||||||
|
@ -803,10 +787,6 @@ int CmdEM4x50Dump(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// write functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
int CmdEM4x50Write(const char *Cmd) {
|
int CmdEM4x50Write(const char *Cmd) {
|
||||||
|
|
||||||
// envoke writing a single word (32 bit) to a EM4x50 tag
|
// envoke writing a single word (32 bit) to a EM4x50 tag
|
||||||
|
@ -1144,10 +1124,6 @@ int CmdEM4x50Restore(const char *Cmd) {
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
// simulate functions
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
int CmdEM4x50Sim(const char *Cmd) {
|
int CmdEM4x50Sim(const char *Cmd) {
|
||||||
|
|
||||||
int slen = 0, status = 0;
|
int slen = 0, status = 0;
|
||||||
|
@ -1217,7 +1193,7 @@ int CmdEM4x50Sim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static command_t CommandTable[] = {
|
static command_t CommandTable[] = {
|
||||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||||
{"dump", CmdEM4x50Dump, IfPm3EM4x50, "dump EM4x50 tag"},
|
{"dump", CmdEM4x50Dump, IfPm3EM4x50, "dump EM4x50 tag"},
|
||||||
{"info", CmdEM4x50Info, IfPm3EM4x50, "tag information EM4x50"},
|
{"info", CmdEM4x50Info, IfPm3EM4x50, "tag information EM4x50"},
|
||||||
{"write", CmdEM4x50Write, IfPm3EM4x50, "write word data to EM4x50"},
|
{"write", CmdEM4x50Write, IfPm3EM4x50, "write word data to EM4x50"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue