From e016582e1fd9f408bb39efcb371668c6a02a130c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 18 Oct 2020 00:15:09 +0200 Subject: [PATCH] textual --- client/src/cmdhf15.c | 2 +- client/src/cmdhficlass.c | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index da433a010..73a7778a8 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -1073,7 +1073,7 @@ static int CmdHF15Sniff(const char *Cmd) { static int CmdHF15Reader(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf 15 reader", - "This command continues loops and tries to identify ISO 15693 tags\n", + "Act as a ISO15693 reader. Look for ISO15693 tags until Enter or the pm3 button is pressed\n", "hf 15 reader\n" "hf 15 reader -1"); diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index bd5254c1b..4e065090c 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -272,17 +272,6 @@ static int usage_hf_iclass_managekeys(void) { PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } -static int usage_hf_iclass_reader(void) { - PrintAndLogEx(NORMAL, "Act as a iCLASS reader. Look for iCLASS tags until Enter or the pm3 button is pressed\n"); - PrintAndLogEx(NORMAL, "Usage: hf iclass reader [h] [1]\n"); - PrintAndLogEx(NORMAL, "Options:"); - PrintAndLogEx(NORMAL, " h Show this help"); - PrintAndLogEx(NORMAL, " 1 read only 1 tag"); - PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, _YELLOW_("\thf iclass reader 1")); - PrintAndLogEx(NORMAL, ""); - return PM3_SUCCESS; -} static int usage_hf_iclass_loclass(void) { PrintAndLogEx(NORMAL, "Execute the offline part of loclass attack"); PrintAndLogEx(NORMAL, " An iclass dumpfile is assumed to consist of an arbitrary number of"); @@ -875,10 +864,25 @@ int read_iclass_csn(bool loop, bool verbose) { } static int CmdHFiClassReader(const char *Cmd) { - char cmdp = tolower(param_getchar(Cmd, 0)); - if (cmdp == 'h') return usage_hf_iclass_reader(); - bool loop_read = (cmdp == '1') ? false : true; + CLIParserContext *ctx; + CLIParserInit(&ctx, "hf iclass reader", + "Act as a iCLASS reader. Look for iCLASS tags until Enter or the pm3 button is pressed\n", + "hf iclass reader\n" + "hf iclass reader -1"); + + void *argtable[] = { + arg_param_begin, + arg_lit0("", NULL, "read once"), + arg_param_end + }; + CLIExecWithReturn(ctx, Cmd, argtable, true); + bool loop_read = arg_get_lit(ctx, 1); + CLIParserFree(ctx); + + + PrintAndLogEx(INFO, "Starting iCLASS reader mode"); + PrintAndLogEx(INFO, "press " _YELLOW_("`enter`") " to cancel"); return read_iclass_csn(loop_read, true); }