mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Rework Cmd exposed API, use more static and fix [-Wmissing-prototypes]
This commit is contained in:
parent
65305f361f
commit
05374fce07
30 changed files with 1230 additions and 1367 deletions
|
@ -33,13 +33,13 @@ static const uint8_t DefaultKey[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
|||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
int CmdHFMFPInfo(const char *cmd) {
|
||||
static int CmdHFMFPInfo(const char *cmd) {
|
||||
|
||||
if (cmd && strlen(cmd) > 0)
|
||||
PrintAndLogEx(WARNING, "command don't have any parameters.\n");
|
||||
|
||||
// info about 14a part
|
||||
CmdHF14AInfo("");
|
||||
infoHF14A(false, false);
|
||||
|
||||
// Mifare Plus info
|
||||
UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}, {{0}}};
|
||||
|
@ -112,7 +112,7 @@ int CmdHFMFPInfo(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPWritePerso(const char *cmd) {
|
||||
static int CmdHFMFPWritePerso(const char *cmd) {
|
||||
uint8_t keyNum[64] = {0};
|
||||
int keyNumLen = 0;
|
||||
uint8_t key[64] = {0};
|
||||
|
@ -178,7 +178,7 @@ int CmdHFMFPWritePerso(const char *cmd) {
|
|||
|
||||
uint16_t CardAddresses[] = {0x9000, 0x9001, 0x9002, 0x9003, 0x9004, 0xA000, 0xA001, 0xA080, 0xA081, 0xC000, 0xC001};
|
||||
|
||||
int CmdHFMFPInitPerso(const char *cmd) {
|
||||
static int CmdHFMFPInitPerso(const char *cmd) {
|
||||
int res;
|
||||
uint8_t key[256] = {0};
|
||||
int keyLen = 0;
|
||||
|
@ -252,7 +252,7 @@ int CmdHFMFPInitPerso(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPCommitPerso(const char *cmd) {
|
||||
static int CmdHFMFPCommitPerso(const char *cmd) {
|
||||
CLIParserInit("hf mfp commitp",
|
||||
"Executes Commit Perso command. Can be used in SL0 mode only.",
|
||||
"Usage:\n\thf mfp commitp -> \n");
|
||||
|
@ -293,7 +293,7 @@ int CmdHFMFPCommitPerso(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPAuth(const char *cmd) {
|
||||
static int CmdHFMFPAuth(const char *cmd) {
|
||||
uint8_t keyn[250] = {0};
|
||||
int keynlen = 0;
|
||||
uint8_t key[250] = {0};
|
||||
|
@ -331,7 +331,7 @@ int CmdHFMFPAuth(const char *cmd) {
|
|||
return MifareAuth4(NULL, keyn, key, true, false, verbose);
|
||||
}
|
||||
|
||||
int CmdHFMFPRdbl(const char *cmd) {
|
||||
static int CmdHFMFPRdbl(const char *cmd) {
|
||||
uint8_t keyn[2] = {0};
|
||||
uint8_t key[250] = {0};
|
||||
int keylen = 0;
|
||||
|
@ -443,7 +443,7 @@ int CmdHFMFPRdbl(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPRdsc(const char *cmd) {
|
||||
static int CmdHFMFPRdsc(const char *cmd) {
|
||||
uint8_t keyn[2] = {0};
|
||||
uint8_t key[250] = {0};
|
||||
int keylen = 0;
|
||||
|
@ -539,7 +539,7 @@ int CmdHFMFPRdsc(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPWrbl(const char *cmd) {
|
||||
static int CmdHFMFPWrbl(const char *cmd) {
|
||||
uint8_t keyn[2] = {0};
|
||||
uint8_t key[250] = {0};
|
||||
int keylen = 0;
|
||||
|
@ -641,7 +641,7 @@ int CmdHFMFPWrbl(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPMAD(const char *cmd) {
|
||||
static int CmdHFMFPMAD(const char *cmd) {
|
||||
|
||||
CLIParserInit("hf mfp mad",
|
||||
"Checks and prints Mifare Application Directory (MAD)",
|
||||
|
@ -735,7 +735,7 @@ int CmdHFMFPMAD(const char *cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int CmdHFMFPNDEF(const char *cmd) {
|
||||
static int CmdHFMFPNDEF(const char *cmd) {
|
||||
|
||||
CLIParserInit("hf mfp ndef",
|
||||
"Prints NFC Data Exchange Format (NDEF)",
|
||||
|
@ -854,14 +854,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 CmdHFMFP(const char *Cmd) {
|
||||
(void)WaitForResponseTimeout(CMD_ACK, NULL, 100);
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd) {
|
||||
(void)Cmd; // Cmd is not used so far
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue