From a51c45168e8489a44ac558c74c4f6ebdc7f73ae2 Mon Sep 17 00:00:00 2001 From: tcprst Date: Sun, 20 Dec 2020 21:20:47 -0500 Subject: [PATCH] hf legic info - now use cliparser --- client/src/cmdhflegic.c | 21 +++++++++------------ doc/cliparser_todo.txt | 1 - 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/client/src/cmdhflegic.c b/client/src/cmdhflegic.c index a09946d43..d53c68e5e 100644 --- a/client/src/cmdhflegic.c +++ b/client/src/cmdhflegic.c @@ -38,16 +38,6 @@ static int usage_legic_reader(void) { PrintAndLogEx(NORMAL, _YELLOW_(" hf legic reader")); return PM3_SUCCESS; } -static int usage_legic_info(void) { - PrintAndLogEx(NORMAL, "Reads information from a LEGIC Prime tag like systemarea, user areas etc\n"); - PrintAndLogEx(NORMAL, "Usage: hf legic info [h]\n"); - PrintAndLogEx(NORMAL, "Options:"); - PrintAndLogEx(NORMAL, " h : this help"); - PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, _YELLOW_(" hf legic info")); - return PM3_SUCCESS; -} static int usage_legic_dump(void) { PrintAndLogEx(NORMAL, "Read all memory from LEGIC Prime MIM22, MIM256, MIM1024"); PrintAndLogEx(NORMAL, "and saves bin/eml/json dump file"); @@ -146,9 +136,16 @@ static bool legic_xor(uint8_t *data, uint16_t cardsize) { * by Henryk Ploetz and Karsten Nohl at 26c3 */ static int CmdLegicInfo(const char *Cmd) { + CLIParserContext *ctx; + CLIParserInit(&ctx, "hf legic info", + "Gets information from a LEGIC Prime tag like systemarea, user areas, etc", + "hf legic info"); - char cmdp = tolower(param_getchar(Cmd, 0)); - if (cmdp == 'h') return usage_legic_info(); + void *argtable[] = { + arg_param_begin, + arg_param_end + }; + CLIExecWithReturn(ctx, Cmd, argtable, true); int i = 0, k = 0, segmentNum = 0, segment_len = 0, segment_flag = 0; int crc = 0, wrp = 0, wrc = 0; diff --git a/doc/cliparser_todo.txt b/doc/cliparser_todo.txt index d181f93e6..212029e2c 100644 --- a/doc/cliparser_todo.txt +++ b/doc/cliparser_todo.txt @@ -79,7 +79,6 @@ hf felica litesim hf felica litedump hf fido info hf legic reader -hf legic info hf legic dump hf legic restore hf legic eload