From 8cddd4e9c97fc6e72fd85ace725900e8415a8f42 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 13 Oct 2024 21:40:17 +0200 Subject: [PATCH] Added option to wait for a card to hf 14a reader --- CHANGELOG.md | 1 + client/src/cmdhf14a.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d336192..e08dde6da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Added option to wait for a card to `hf 14a reader` (@doegox) - Added support for quick dump via backdoor auth to `hf mf ecfill` (@doegox) - Fixed `hf mf restore` - really skip strict ACLs unless --force (@doegox) - Added `hf 14b setuid` - set uid on magic 14b tag (@iceman1001) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index 686fb5067..45d801c6a 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -558,6 +558,7 @@ static int CmdHF14AReader(const char *Cmd) { arg_lit0(NULL, "ecp", "Use enhanced contactless polling"), arg_lit0(NULL, "mag", "Use Apple magsafe polling"), arg_lit0("@", NULL, "continuous reader mode"), + arg_lit0("w", "wait", "wait for card"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -589,8 +590,10 @@ static int CmdHF14AReader(const char *Cmd) { } bool continuous = arg_get_lit(ctx, 7); + bool wait = arg_get_lit(ctx, 8); CLIParserFree(ctx); + bool found = false; if (disconnectAfter == false) { cm |= ISO14A_NO_DISCONNECT; } @@ -628,6 +631,8 @@ static int CmdHF14AReader(const char *Cmd) { */ uint64_t select_status = resp.oldarg[0]; + found = (select_status != 0); + if (select_status == 0) { DropField(); res = PM3_ESOFT; @@ -682,7 +687,7 @@ plot: break; } - } while (continuous); + } while (continuous || (wait && (!found))); if (disconnectAfter == false) { if (silent == false) {