mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-07 16:48:15 +08:00
Rework Cmd exposed API, use more static and fix [-Wmissing-prototypes], ongoing...
This commit is contained in:
parent
f6a6ec8447
commit
8aa5b42cdf
14 changed files with 135 additions and 133 deletions
|
@ -60,7 +60,7 @@ static uint64_t getJablontronCardId(uint64_t rawcode) {
|
|||
}
|
||||
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdJablotronDemod(const char *Cmd) {
|
||||
static int CmdJablotronDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
//Differential Biphase / di-phase (inverted biphase)
|
||||
|
@ -115,12 +115,12 @@ int CmdJablotronDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdJablotronRead(const char *Cmd) {
|
||||
static int CmdJablotronRead(const char *Cmd) {
|
||||
lf_read(true, 10000);
|
||||
return CmdJablotronDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdJablotronClone(const char *Cmd) {
|
||||
static int CmdJablotronClone(const char *Cmd) {
|
||||
|
||||
uint64_t fullcode = 0;
|
||||
uint32_t blocks[3] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_64 | 2 << T55x7_MAXBLOCK_SHIFT, 0, 0};
|
||||
|
@ -170,7 +170,7 @@ int CmdJablotronClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdJablotronSim(const char *Cmd) {
|
||||
static int CmdJablotronSim(const char *Cmd) {
|
||||
uint64_t fullcode = 0;
|
||||
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
|
@ -208,15 +208,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFJablotron(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFJablotron(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ static int CmdKeriDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdKeriRead(const char *Cmd) {
|
||||
static int CmdKeriRead(const char *Cmd) {
|
||||
lf_read(true, 10000);
|
||||
return CmdKeriDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdKeriClone(const char *Cmd) {
|
||||
static int CmdKeriClone(const char *Cmd) {
|
||||
|
||||
uint32_t internalid = 0;
|
||||
uint32_t blocks[3] = {
|
||||
|
@ -164,7 +164,7 @@ int CmdKeriClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdKeriSim(const char *Cmd) {
|
||||
static int CmdKeriSim(const char *Cmd) {
|
||||
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
if (strlen(Cmd) == 0 || cmdp == 'h') return usage_lf_keri_sim();
|
||||
|
@ -206,15 +206,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFKeri(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFKeri(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
int CmdNexWatchDemod(const char *Cmd) {
|
||||
static int CmdNexWatchDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
if (!PSKDemod("", false)) {
|
||||
|
@ -69,7 +69,7 @@ int CmdNexWatchDemod(const char *Cmd) {
|
|||
|
||||
//by marshmellow
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdNexWatchRead(const char *Cmd) {
|
||||
static int CmdNexWatchRead(const char *Cmd) {
|
||||
lf_read(true, 10000);
|
||||
return CmdNexWatchDemod(Cmd);
|
||||
}
|
||||
|
@ -81,15 +81,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFNEXWATCH(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFNEXWATCH(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ static uint8_t noralsy_chksum(uint8_t *bits, uint8_t len) {
|
|||
}
|
||||
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdNoralsyDemod(const char *Cmd) {
|
||||
static int CmdNoralsyDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
//ASK / Manchester
|
||||
|
@ -118,12 +118,12 @@ int CmdNoralsyDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdNoralsyRead(const char *Cmd) {
|
||||
static int CmdNoralsyRead(const char *Cmd) {
|
||||
lf_read(true, 8000);
|
||||
return CmdNoralsyDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdNoralsyClone(const char *Cmd) {
|
||||
static int CmdNoralsyClone(const char *Cmd) {
|
||||
|
||||
uint16_t year = 0;
|
||||
uint32_t id = 0;
|
||||
|
@ -170,7 +170,7 @@ int CmdNoralsyClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdNoralsySim(const char *Cmd) {
|
||||
static int CmdNoralsySim(const char *Cmd) {
|
||||
|
||||
uint8_t bits[96];
|
||||
uint8_t *bs = bits;
|
||||
|
@ -214,15 +214,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFNoralsy(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFNoralsy(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
//see NRZDemod for what args are accepted
|
||||
int CmdPacDemod(const char *Cmd) {
|
||||
static int CmdPacDemod(const char *Cmd) {
|
||||
|
||||
//NRZ
|
||||
if (!NRZrawDemod(Cmd, false)) {
|
||||
|
@ -51,7 +51,7 @@ int CmdPacDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdPacRead(const char *Cmd) {
|
||||
static int CmdPacRead(const char *Cmd) {
|
||||
lf_read(true, 4096 * 2 + 20);
|
||||
return CmdPacDemod(Cmd);
|
||||
}
|
||||
|
@ -63,14 +63,14 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFPac(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFPac(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ static int usage_lf_paradox_sim(void) {
|
|||
//by marshmellow
|
||||
//Paradox Prox demod - FSK2a RF/50 with preamble of 00001111 (then manchester encoded)
|
||||
//print full Paradox Prox ID and some bit format details if found
|
||||
int CmdParadoxDemod(const char *Cmd) {
|
||||
static int CmdParadoxDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
//raw fsk demod no manchester decoding no start bit finding just get binary from wave
|
||||
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
||||
|
@ -104,12 +104,12 @@ int CmdParadoxDemod(const char *Cmd) {
|
|||
}
|
||||
//by marshmellow
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdParadoxRead(const char *Cmd) {
|
||||
static int CmdParadoxRead(const char *Cmd) {
|
||||
lf_read(true, 10000);
|
||||
return CmdParadoxDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdParadoxSim(const char *Cmd) {
|
||||
static int CmdParadoxSim(const char *Cmd) {
|
||||
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
if (strlen(Cmd) == 0 || cmdp == 'h') return usage_lf_paradox_sim();
|
||||
|
@ -156,15 +156,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFParadox(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFParadox(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ static int usage_pcf7931_config() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdLFPCF7931Read(const char *Cmd) {
|
||||
static int CmdLFPCF7931Read(const char *Cmd) {
|
||||
|
||||
uint8_t ctmp = param_getchar(Cmd, 0);
|
||||
if (ctmp == 'H' || ctmp == 'h') return usage_pcf7931_read();
|
||||
|
@ -110,7 +110,7 @@ int CmdLFPCF7931Read(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdLFPCF7931Config(const char *Cmd) {
|
||||
static int CmdLFPCF7931Config(const char *Cmd) {
|
||||
|
||||
uint8_t ctmp = param_getchar(Cmd, 0);
|
||||
if (ctmp == 0) return pcf7931_printConfig();
|
||||
|
@ -127,7 +127,7 @@ int CmdLFPCF7931Config(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdLFPCF7931Write(const char *Cmd) {
|
||||
static int CmdLFPCF7931Write(const char *Cmd) {
|
||||
|
||||
uint8_t ctmp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) < 1 || ctmp == 'h' || ctmp == 'H') return usage_pcf7931_write();
|
||||
|
@ -165,14 +165,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdLFPCF7931(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ static int usage_lf_presco_sim(void) {
|
|||
}
|
||||
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdPrescoDemod(const char *Cmd) {
|
||||
static int CmdPrescoDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
bool st = true;
|
||||
if (!ASKDemod_ext("32 0 0 0 0 a", false, false, 1, &st)) {
|
||||
|
@ -82,7 +82,7 @@ int CmdPrescoDemod(const char *Cmd) {
|
|||
}
|
||||
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdPrescoRead(const char *Cmd) {
|
||||
static int CmdPrescoRead(const char *Cmd) {
|
||||
// Presco Number: 123456789 --> Sitecode 30 | usercode 8665
|
||||
lf_read(true, 12000);
|
||||
return CmdPrescoDemod(Cmd);
|
||||
|
@ -90,7 +90,7 @@ int CmdPrescoRead(const char *Cmd) {
|
|||
|
||||
// takes base 12 ID converts to hex
|
||||
// Or takes 8 digit hex ID
|
||||
int CmdPrescoClone(const char *Cmd) {
|
||||
static int CmdPrescoClone(const char *Cmd) {
|
||||
|
||||
bool Q5 = false;
|
||||
uint32_t sitecode = 0, usercode = 0, fullcode = 0;
|
||||
|
@ -138,7 +138,7 @@ int CmdPrescoClone(const char *Cmd) {
|
|||
|
||||
// takes base 12 ID converts to hex
|
||||
// Or takes 8 digit hex ID
|
||||
int CmdPrescoSim(const char *Cmd) {
|
||||
static int CmdPrescoSim(const char *Cmd) {
|
||||
uint32_t sitecode = 0, usercode = 0, fullcode = 0;
|
||||
bool Q5 = false;
|
||||
// get wiegand from printed number.
|
||||
|
@ -167,15 +167,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFPresco(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFPresco(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ static int usage_lf_pyramid_sim(void) {
|
|||
//by marshmellow
|
||||
//Pyramid Prox demod - FSK RF/50 with preamble of 0000000000000001 (always a 128 bit data stream)
|
||||
//print full Farpointe Data/Pyramid Prox ID and some bit format details if found
|
||||
int CmdPyramidDemod(const char *Cmd) {
|
||||
static int CmdPyramidDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
//raw fsk demod no manchester decoding no start bit finding just get binary from wave
|
||||
uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0};
|
||||
|
@ -192,12 +192,12 @@ int CmdPyramidDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdPyramidRead(const char *Cmd) {
|
||||
static int CmdPyramidRead(const char *Cmd) {
|
||||
lf_read(true, 15000);
|
||||
return CmdPyramidDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdPyramidClone(const char *Cmd) {
|
||||
static int CmdPyramidClone(const char *Cmd) {
|
||||
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) == 0 || cmdp == 'h' || cmdp == 'H') return usage_lf_pyramid_clone();
|
||||
|
@ -248,7 +248,7 @@ int CmdPyramidClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdPyramidSim(const char *Cmd) {
|
||||
static int CmdPyramidSim(const char *Cmd) {
|
||||
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) == 0 || cmdp == 'h' || cmdp == 'H') return usage_lf_pyramid_sim();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdSecurakeyDemod(const char *Cmd) {
|
||||
static int CmdSecurakeyDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
//ASK / Manchester
|
||||
|
@ -94,7 +94,7 @@ int CmdSecurakeyDemod(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdSecurakeyRead(const char *Cmd) {
|
||||
static int CmdSecurakeyRead(const char *Cmd) {
|
||||
lf_read(true, 8000);
|
||||
return CmdSecurakeyDemod(Cmd);
|
||||
}
|
||||
|
@ -108,15 +108,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFSecurakey(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFSecurakey(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ static int usage_lf_deviceconfig() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd);
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
void printT5xxHeader(uint8_t page) {
|
||||
PrintAndLogEx(NORMAL, "Reading Page %d:", page);
|
||||
|
@ -238,7 +238,7 @@ void printT5xxHeader(uint8_t page) {
|
|||
PrintAndLogEx(NORMAL, "----+----------+----------------------------------+-------");
|
||||
}
|
||||
|
||||
int CmdT55xxSetConfig(const char *Cmd) {
|
||||
static int CmdT55xxSetConfig(const char *Cmd) {
|
||||
|
||||
uint8_t offset = 0, bitRate = 0;
|
||||
char modulation[6] = {0x00};
|
||||
|
@ -381,7 +381,7 @@ int T55xxReadBlock(uint8_t block, bool page1, bool usepwd, bool override, uint32
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdT55xxReadBlock(const char *Cmd) {
|
||||
static int CmdT55xxReadBlock(const char *Cmd) {
|
||||
uint8_t block = REGULAR_READ_MODE_BLOCK;
|
||||
uint32_t password = 0; //default to blank Block 7
|
||||
bool usepwd = false;
|
||||
|
@ -506,7 +506,7 @@ static int SanityOfflineCheck(bool useGraphBuffer) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdT55xxDetect(const char *Cmd) {
|
||||
static int CmdT55xxDetect(const char *Cmd) {
|
||||
bool errors = false;
|
||||
bool useGB = false, usepwd = false;
|
||||
uint32_t password = 0;
|
||||
|
@ -991,7 +991,7 @@ int printConfiguration(t55xx_conf_block_t b) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdT55xxWakeUp(const char *Cmd) {
|
||||
static int CmdT55xxWakeUp(const char *Cmd) {
|
||||
uint32_t password = 0;
|
||||
uint8_t cmdp = 0;
|
||||
bool errors = false;
|
||||
|
@ -1019,7 +1019,7 @@ int CmdT55xxWakeUp(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdT55xxWriteBlock(const char *Cmd) {
|
||||
static int CmdT55xxWriteBlock(const char *Cmd) {
|
||||
uint8_t block = 0xFF; //default to invalid block
|
||||
uint32_t data = 0; //default to blank Block
|
||||
uint32_t password = 0; //default to blank Block 7
|
||||
|
@ -1093,7 +1093,7 @@ int CmdT55xxWriteBlock(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdT55xxReadTrace(const char *Cmd) {
|
||||
static int CmdT55xxReadTrace(const char *Cmd) {
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
if (strlen(Cmd) > 1 || cmdp == 'h') return usage_t55xx_trace();
|
||||
|
||||
|
@ -1333,7 +1333,7 @@ static void printT5x7KnownBlock0(uint32_t b0) {
|
|||
PrintAndLogEx(NORMAL, "\n Config block match : " _YELLOW_("%s"), s);
|
||||
}
|
||||
|
||||
int CmdT55xxInfo(const char *Cmd) {
|
||||
static int CmdT55xxInfo(const char *Cmd) {
|
||||
/*
|
||||
Page 0 Block 0 Configuration data.
|
||||
Normal mode
|
||||
|
@ -1471,7 +1471,7 @@ int CmdT55xxInfo(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdT55xxDump(const char *Cmd) {
|
||||
static int CmdT55xxDump(const char *Cmd) {
|
||||
|
||||
uint32_t password = 0;
|
||||
bool override = false;
|
||||
|
@ -1761,7 +1761,7 @@ void t55x7_create_config_block(int tagtype) {
|
|||
PrintAndLogEx(NORMAL, buf);
|
||||
}
|
||||
|
||||
int CmdResetRead(const char *Cmd) {
|
||||
static int CmdResetRead(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
UsbCommand c = {CMD_T55XX_RESET_READ, {0, 0, 0}, {{0}}};
|
||||
clearCommandBuffer();
|
||||
|
@ -1780,7 +1780,7 @@ int CmdResetRead(const char *Cmd) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int CmdT55xxWipe(const char *Cmd) {
|
||||
static int CmdT55xxWipe(const char *Cmd) {
|
||||
char writeData[20] = {0};
|
||||
char *ptrData = writeData;
|
||||
char cmdp = tolower(param_getchar(Cmd, 0));
|
||||
|
@ -1821,7 +1821,7 @@ bool IsCancelled(void) {
|
|||
}
|
||||
|
||||
// load a default pwd file.
|
||||
int CmdT55xxChkPwds(const char *Cmd) {
|
||||
static int CmdT55xxChkPwds(const char *Cmd) {
|
||||
|
||||
char filename[FILE_PATH_SIZE] = {0};
|
||||
bool found = false;
|
||||
|
@ -1943,7 +1943,7 @@ out:
|
|||
}
|
||||
|
||||
// Bruteforce - incremental password range search
|
||||
int CmdT55xxBruteForce(const char *Cmd) {
|
||||
static int CmdT55xxBruteForce(const char *Cmd) {
|
||||
|
||||
uint32_t start_password = 0x00000000; //start password
|
||||
uint32_t end_password = 0xFFFFFFFF; //end password
|
||||
|
@ -2009,7 +2009,7 @@ int tryOnePassword(uint32_t password) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdT55xxRecoverPW(const char *Cmd) {
|
||||
static int CmdT55xxRecoverPW(const char *Cmd) {
|
||||
int bit = 0;
|
||||
uint32_t orig_password = 0x0;
|
||||
uint32_t curr_password = 0x0;
|
||||
|
@ -2204,7 +2204,7 @@ bool tryDetectP1(bool getData) {
|
|||
return false;
|
||||
}
|
||||
// does this need to be a callable command?
|
||||
int CmdT55xxDetectPage1(const char *Cmd) {
|
||||
static int CmdT55xxDetectPage1(const char *Cmd) {
|
||||
bool errors = false;
|
||||
bool useGB = false;
|
||||
bool usepwd = false;
|
||||
|
@ -2242,7 +2242,7 @@ int CmdT55xxDetectPage1(const char *Cmd) {
|
|||
return success;
|
||||
}
|
||||
|
||||
int CmdT55xxSetDeviceConfig(const char *Cmd) {
|
||||
static int CmdT55xxSetDeviceConfig(const char *Cmd) {
|
||||
uint8_t startgap = 0, writegap = 0;
|
||||
uint8_t write0 = 0, write1 = 0, readgap = 0;
|
||||
bool errors = false, shall_persist = false;
|
||||
|
@ -2315,14 +2315,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdLFT55XX(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
int CmdTIDemod(const char *Cmd) {
|
||||
static int CmdTIDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
/* MATLAB as follows:
|
||||
f_s = 2000000; % sampling frequency
|
||||
|
@ -273,7 +273,7 @@ out:
|
|||
}
|
||||
|
||||
// read a TI tag and return its ID
|
||||
int CmdTIRead(const char *Cmd) {
|
||||
static int CmdTIRead(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
UsbCommand c = {CMD_READ_TI_TYPE};
|
||||
clearCommandBuffer();
|
||||
|
@ -282,7 +282,7 @@ int CmdTIRead(const char *Cmd) {
|
|||
}
|
||||
|
||||
// write new data to a r/w TI tag
|
||||
int CmdTIWrite(const char *Cmd) {
|
||||
static int CmdTIWrite(const char *Cmd) {
|
||||
int res = 0;
|
||||
UsbCommand c = {CMD_WRITE_TI_TYPE};
|
||||
res = sscanf(Cmd, "%012" SCNx64 " %012" SCNx64 " %012" SCNx64 "", &c.arg[0], &c.arg[1], &c.arg[2]);
|
||||
|
@ -307,15 +307,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFTI(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFTI(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ static int usage_lf_viking_sim(void) {
|
|||
|
||||
//by marshmellow
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdVikingDemod(const char *Cmd) {
|
||||
static int CmdVikingDemod(const char *Cmd) {
|
||||
if (!ASKDemod(Cmd, false, false, 1)) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Viking ASKDemod failed");
|
||||
return 0;
|
||||
|
@ -65,12 +65,12 @@ int CmdVikingDemod(const char *Cmd) {
|
|||
|
||||
//by marshmellow
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdVikingRead(const char *Cmd) {
|
||||
static int CmdVikingRead(const char *Cmd) {
|
||||
lf_read(true, 10000);
|
||||
return CmdVikingDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdVikingClone(const char *Cmd) {
|
||||
static int CmdVikingClone(const char *Cmd) {
|
||||
uint32_t id = 0;
|
||||
uint64_t rawID = 0;
|
||||
bool Q5 = false;
|
||||
|
@ -99,7 +99,7 @@ int CmdVikingClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdVikingSim(const char *Cmd) {
|
||||
static int CmdVikingSim(const char *Cmd) {
|
||||
uint32_t id = 0;
|
||||
uint64_t rawID = 0;
|
||||
uint8_t clk = 32, encoding = 1, separator = 0, invert = 0;
|
||||
|
@ -135,15 +135,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFViking(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFViking(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ static uint8_t visa_parity(uint32_t id) {
|
|||
*
|
||||
**/
|
||||
//see ASKDemod for what args are accepted
|
||||
int CmdVisa2kDemod(const char *Cmd) {
|
||||
static int CmdVisa2kDemod(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
|
||||
save_restoreGB(GRAPH_SAVE);
|
||||
|
@ -141,12 +141,12 @@ int CmdVisa2kDemod(const char *Cmd) {
|
|||
}
|
||||
|
||||
// 64*96*2=12288 samples just in case we just missed the first preamble we can still catch 2 of them
|
||||
int CmdVisa2kRead(const char *Cmd) {
|
||||
static int CmdVisa2kRead(const char *Cmd) {
|
||||
lf_read(true, 20000);
|
||||
return CmdVisa2kDemod(Cmd);
|
||||
}
|
||||
|
||||
int CmdVisa2kClone(const char *Cmd) {
|
||||
static int CmdVisa2kClone(const char *Cmd) {
|
||||
|
||||
uint64_t id = 0;
|
||||
uint32_t blocks[4] = {T55x7_MODULATION_MANCHESTER | T55x7_BITRATE_RF_64 | T55x7_ST_TERMINATOR | 3 << T55x7_MAXBLOCK_SHIFT, BL0CK1, 0};
|
||||
|
@ -182,7 +182,7 @@ int CmdVisa2kClone(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdVisa2kSim(const char *Cmd) {
|
||||
static int CmdVisa2kSim(const char *Cmd) {
|
||||
|
||||
uint32_t id = 0;
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
|
@ -219,15 +219,15 @@ static command_t CommandTable[] = {
|
|||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdLFVisa2k(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
static int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
int CmdLFVisa2k(const char *Cmd) {
|
||||
clearCommandBuffer();
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue