cliparser cleanup 2

cmdhf14a.c, cmdhfido.c, cmdhficlass.c, cmdhfmf.c
menu help updates.
cliparser.c : tweak for readability with long examples.
This commit is contained in:
mwalker33
2020-09-30 16:39:08 +10:00
parent 561c5f779e
commit e724204978
5 changed files with 91 additions and 92 deletions

View File

@@ -4120,15 +4120,14 @@ static int CmdHF14AMfCWipe(const char *cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf mf cwipe",
"Wipe gen1 magic chinese card. Set UID/ATQA/SAK/Data/Keys/Access to default values.",
"Usage:\n"
_YELLOW_("\thf mf cwipe") " -> wipe card\n"
_YELLOW_("\thf mf cwipe -u 09080706 -a 0004 -s 18") " -- set UID, ATQA and SAK and wipe card");
"hf mf cwipe -> wipe card\n"
"hf mf cwipe -u 09080706 -a 0004 -s 18 -> set UID, ATQA and SAK and wipe card");
void *argtable[] = {
arg_param_begin,
arg_str0("uU", "uid", "<UID (hex 4b)>", "UID for card"),
arg_str0("aA", "atqa", "<ATQA (hex 2b)>", "ATQA for card"),
arg_str0("sS", "sak", "<SAK (hex 1b)>", "SAK for card"),
arg_str0("u", "uid", "<UID (hex 4b)>", "UID for card"),
arg_str0("a", "atqa", "<ATQA (hex 2b)>", "ATQA for card"),
arg_str0("s", "sak", "<SAK (hex 1b)>", "SAK for card"),
arg_param_end
};
CLIExecWithReturn(ctx, cmd, argtable, true);
@@ -4799,9 +4798,8 @@ static int CmdHF14AMfAuth4(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf mf auth4",
"Executes AES authentication command in ISO14443-4",
"Usage:\n"
_YELLOW_("\thf mf auth4 4000 000102030405060708090a0b0c0d0e0f") " -> executes authentication\n"
_YELLOW_("\thf mf auth4 9003 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") " -> executes authentication\n");
"hf mf auth4 4000 000102030405060708090a0b0c0d0e0f -> executes authentication\n"
"hf mf auth4 9003 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -> executes authentication\n");
void *argtable[] = {
arg_param_begin,
@@ -4834,19 +4832,18 @@ static int CmdHF14AMfMAD(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf mf mad",
"Checks and prints MIFARE Application Directory (MAD)",
"Usage:\n"
_YELLOW_("\thf mf mad") " -> shows MAD if exists\n"
_YELLOW_("\thf mf mad --aid e103 -k ffffffffffff -b") " -> shows NDEF data if exists. read card with custom key and key B\n"
_YELLOW_("\thf mf mad --dch -k ffffffffffff") " -> decode CardHolder information\n");
"hf mf mad -> shows MAD if exists\n"
"hf mf mad --aid e103 -k ffffffffffff -b -> shows NDEF data if exists. read card with custom key and key B\n"
"hf mf mad --dch -k ffffffffffff -> decode CardHolder information\n");
void *argtable[] = {
arg_param_begin,
arg_lit0("vV", "verbose", "show technical data"),
arg_str0("", "aid", "<aid>", "print all sectors with specified aid"),
arg_str0("kK", "key", "<key>", "key for printing sectors"),
arg_lit0("bB", "keyb", "use key B for access printing sectors (by default: key A)"),
arg_lit0("", "be", "(optional, BigEndian)"),
arg_lit0("", "dch", "decode Card Holder information"),
arg_lit0("v", "verbose", "show technical data"),
arg_str0(NULL, "aid", "<aid>", "print all sectors with specified aid"),
arg_str0("k", "key", "<key>", "key for printing sectors"),
arg_lit0("b", "keyb", "use key B for access printing sectors (by default: key A)"),
arg_lit0(NULL, "be", "(optional, BigEndian)"),
arg_lit0(NULL, "dch", "decode Card Holder information"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
@@ -4976,17 +4973,16 @@ static int CmdHFMFNDEF(const char *Cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf mf ndef",
"Prints NFC Data Exchange Format (NDEF)",
"Usage:\n"
_YELLOW_("\thf mf ndef") " -> shows NDEF parsed data\n"
_YELLOW_("\thf mf ndef -vv") " -> shows NDEF parsed and raw data\n"
_YELLOW_("\thf mf ndef --aid e103 -k ffffffffffff -b") " -> shows NDEF data with custom AID, key and with key B\n");
"hf mf ndef -> shows NDEF parsed data\n"
"hf mf ndef -vv -> shows NDEF parsed and raw data\n"
"hf mf ndef --aid e103 -k ffffffffffff -b -> shows NDEF data with custom AID, key and with key B\n");
void *argtable[] = {
arg_param_begin,
arg_litn("vV", "verbose", 0, 2, "show technical data"),
arg_str0("", "aid", "<aid>", "replace default aid for NDEF"),
arg_str0("kK", "key", "<key>", "replace default key for NDEF"),
arg_lit0("bB", "keyb", "use key B for access sectors (by default: key A)"),
arg_litn("v", "verbose", 0, 2, "show technical data"),
arg_str0(NULL, "aid", "<aid>", "replace default aid for NDEF"),
arg_str0("k", "key", "<key>", "replace default key for NDEF"),
arg_lit0("b", "keyb", "use key B for access sectors (by default: key A)"),
arg_param_end
};
CLIExecWithReturn(ctx, Cmd, argtable, true);
@@ -5092,17 +5088,16 @@ static int CmdHFMFPersonalize(const char *cmd) {
CLIParserContext *ctx;
CLIParserInit(&ctx, "hf mf personalize",
"Personalize the UID of a MIFARE Classic EV1 card. This is only possible if it is a 7Byte UID card and if it is not already personalized.",
"Usage:\n"
_YELLOW_("\thf mf personalize UIDF0") " -> double size UID according to ISO/IEC14443-3\n"
_YELLOW_("\thf mf personalize UIDF1") " -> double size UID according to ISO/IEC14443-3, optional usage of selection process shortcut\n"
_YELLOW_("\thf mf personalize UIDF2") " -> single size random ID according to ISO/IEC14443-3\n"
_YELLOW_("\thf mf personalize UIDF3") " -> single size NUID according to ISO/IEC14443-3\n"
_YELLOW_("\thf mf personalize -t B -k B0B1B2B3B4B5 UIDF3") " -> use key B = 0xB0B1B2B3B4B5 instead of default key A\n");
"hf mf personalize UIDF0 -> double size UID according to ISO/IEC14443-3\n"
"hf mf personalize UIDF1 -> double size UID according to ISO/IEC14443-3, optional usage of selection process shortcut\n"
"hf mf personalize UIDF2 -> single size random ID according to ISO/IEC14443-3\n"
"hf mf personalize UIDF3 -> single size NUID according to ISO/IEC14443-3\n"
"hf mf personalize -t B -k B0B1B2B3B4B5 UIDF3 -> use key B = 0xB0B1B2B3B4B5 instead of default key A");
void *argtable[] = {
arg_param_begin,
arg_str0("tT", "keytype", "<A|B>", "key type (A or B) to authenticate sector 0 (default: A)"),
arg_str0("kK", "key", "<key (hex 6 Bytes)>", "key to authenticate sector 0 (default: FFFFFFFFFFFF)"),
arg_str0("t", "keytype", "<A|B>", "key type (A or B) to authenticate sector 0 (default: A)"),
arg_str0("k", "key", "<key (hex 6 Bytes)>", "key to authenticate sector 0 (default: FFFFFFFFFFFF)"),
arg_str1(NULL, NULL, "<UIDF0|UIDF1|UIDF2|UIDF3>", "Personalization Option"),
arg_param_end
};