From efc8c0b8ab10e657290c392f915b70f4d3e20040 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 25 Jan 2024 10:21:36 +0100 Subject: [PATCH] added a interactive flag for hf14asniff, and unified text across the project --- CHANGELOG.md | 1 + armsrc/iso14443a.c | 4 +++- armsrc/iso14443b.c | 4 +++- armsrc/iso15693.c | 5 +++-- client/src/cmdhf.c | 2 +- client/src/cmdhf14a.c | 13 +++++++++++-- client/src/cmdhf15.c | 2 +- client/src/cmdhffelica.c | 6 +++--- client/src/cmdhfjooki.c | 2 +- client/src/cmdhflegic.c | 2 +- client/src/cmdhfthinfilm.c | 2 +- client/src/cmdhw.c | 2 +- client/src/cmdlfawid.c | 2 +- client/src/cmdlfem4x50.c | 2 +- client/src/cmdlfem4x70.c | 2 +- client/src/cmdlfhid.c | 2 +- client/src/cmdlfindala.c | 2 +- 17 files changed, 35 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8198cd15b..81418ba59 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] + - Changed `hf 14a sniff -i` - now supports the interactive flag (@iceman1001) - Added `HF_15SIM` standalone mode that dump then simulate iso15 tags (@lnv42) - Changed `iso15 simulation`, reworked, added support for lot of features (@lnv42) - Changed `hf 15 sniff` quality while low signal (@lnv42) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index f1980723a..772126ede 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -683,7 +683,9 @@ void RAMFUNC SniffIso14443a(uint8_t param) { // Set up the demodulator for the reader -> tag commands Uart14aInit(receivedCmd, receivedCmdPar); - Dbprintf("Starting to sniff. Press PM3 Button to stop."); + if (g_dbglevel >= DBG_ERROR) { + DbpString("Press " _GREEN_("pm3 button") " to abort sniffing"); + } // The DMA buffer, used to stream samples from the FPGA dmabuf8_t *dma = get_dma8(); diff --git a/armsrc/iso14443b.c b/armsrc/iso14443b.c index 9bbdbd5c7..8f68890e5 100644 --- a/armsrc/iso14443b.c +++ b/armsrc/iso14443b.c @@ -2375,7 +2375,9 @@ void SniffIso14443b(void) { FpgaDownloadAndGo(FPGA_BITSTREAM_HF); - DbpString("Starting to sniff. Press PM3 Button to stop."); + if (g_dbglevel >= DBG_ERROR) { + DbpString("Press " _GREEN_("pm3 button") " to abort sniffing"); + } BigBuf_free(); clear_trace(); diff --git a/armsrc/iso15693.c b/armsrc/iso15693.c index bd2d1c345..e8d15d090 100644 --- a/armsrc/iso15693.c +++ b/armsrc/iso15693.c @@ -1633,8 +1633,9 @@ void SniffIso15693(uint8_t jam_search_len, uint8_t *jam_search_string, bool icla FpgaDownloadAndGo(FPGA_BITSTREAM_HF_15); - DbpString("Starting to sniff. Press to stop"); - + if (g_dbglevel >= DBG_ERROR) { + DbpString("Press " _GREEN_("pm3 button") " to abort sniffing"); + } BigBuf_free(); clear_trace(); set_tracing(true); diff --git a/client/src/cmdhf.c b/client/src/cmdhf.c index 0c047a817..af79c3b81 100644 --- a/client/src/cmdhf.c +++ b/client/src/cmdhf.c @@ -313,7 +313,7 @@ int CmdHFTune(const char *Cmd) { style = STYLE_VALUE; PrintAndLogEx(INFO, "Measuring HF antenna"); - PrintAndLogEx(INFO, "click " _GREEN_("pm3 button") " or press " _GREEN_("") " to exit"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to exit"); PacketResponseNG resp; clearCommandBuffer(); diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index b1ddb427c..64b1ee55b 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -877,13 +877,14 @@ int CmdHF14ASniff(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf 14a sniff", "Collect data from the field and save into command buffer.\n" - "Buffer accessible from command 'hf 14a list'", + "Buffer accessible from command `hf 14a list`\n", " hf 14a sniff -c -r"); void *argtable[] = { arg_param_begin, arg_lit0("c", "card", "triggered by first data from card"), - arg_lit0("r", "reader", "triggered by first 7-bit request from reader (REQ,WUP,...)"), + arg_lit0("r", "reader", "triggered by first 7-bit request from reader (REQ, WUP)"), + arg_lit0("i", "interactive", "Console will not be returned until sniff finishes or is aborted"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -898,10 +899,18 @@ int CmdHF14ASniff(const char *Cmd) { param |= 0x02; } + bool interactive = arg_get_lit(ctx, 3); CLIParserFree(ctx); clearCommandBuffer(); SendCommandNG(CMD_HF_ISO14443A_SNIFF, (uint8_t *)¶m, sizeof(uint8_t)); + + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " to abort sniffing"); + if (interactive) { + PacketResponseNG resp; + WaitForResponse(CMD_HF_ISO14443A_SNIFF, &resp); + PrintAndLogEx(INFO, "Done!"); + } return PM3_SUCCESS; } diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index 2edf605a1..3cdd256ef 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -1495,7 +1495,7 @@ static int CmdHF15FindAfi(const char *Cmd) { bool fast = (arg_get_lit(ctx, 1) == false); CLIParserFree(ctx); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to exit"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to exit"); struct p { uint32_t flags; diff --git a/client/src/cmdhffelica.c b/client/src/cmdhffelica.c index c2f8743b3..6b077af8f 100644 --- a/client/src/cmdhffelica.c +++ b/client/src/cmdhffelica.c @@ -1787,7 +1787,7 @@ static int CmdHFFelicaSniff(const char *Cmd) { PrintAndLogEx(INFO, "Sniff Felica, getting first %" PRIu32 " frames, skipping after %" PRIu32 " triggers", payload.samples, payload.triggers); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort sniffing"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort sniffing"); clearCommandBuffer(); SendCommandNG(CMD_HF_FELICA_SNIFF, (uint8_t *)&payload, sizeof(payload)); PacketResponseNG resp; @@ -1834,7 +1834,7 @@ static int CmdHFFelicaSimLite(const char *Cmd) { CLIParserFree(ctx); PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); clearCommandBuffer(); SendCommandNG(CMD_HF_FELICALITE_SIMULATE, payload.uid, sizeof(payload)); @@ -2039,7 +2039,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) { SendCommandNG(CMD_HF_FELICALITE_DUMP, NULL, 0); PacketResponseNG resp; - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort dumping"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort dumping"); uint8_t timeout = 0; while (WaitForResponseTimeout(CMD_ACK, &resp, 2000) == false) { diff --git a/client/src/cmdhfjooki.c b/client/src/cmdhfjooki.c index 763f398e5..8538bfc4d 100644 --- a/client/src/cmdhfjooki.c +++ b/client/src/cmdhfjooki.c @@ -575,7 +575,7 @@ static int CmdHF14AJookiSim(const char *Cmd) { PrintAndLogEx(NORMAL, ""); PrintAndLogEx(SUCCESS, "Starting simulating"); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); for (;;) { if (kbd_enter_pressed()) { SendCommandNG(CMD_BREAK_LOOP, NULL, 0); diff --git a/client/src/cmdhflegic.c b/client/src/cmdhflegic.c index f7c44ecbc..df690537c 100644 --- a/client/src/cmdhflegic.c +++ b/client/src/cmdhflegic.c @@ -556,7 +556,7 @@ static int CmdLegicSim(const char *Cmd) { SendCommandNG(CMD_HF_LEGIC_SIMULATE, (uint8_t *)&payload, sizeof(payload)); PacketResponseNG resp; - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); for (;;) { if (kbd_enter_pressed()) { SendCommandNG(CMD_BREAK_LOOP, NULL, 0); diff --git a/client/src/cmdhfthinfilm.c b/client/src/cmdhfthinfilm.c index 40e43519e..74a76e788 100644 --- a/client/src/cmdhfthinfilm.c +++ b/client/src/cmdhfthinfilm.c @@ -193,7 +193,7 @@ int CmdHfThinFilmSim(const char *Cmd) { PrintAndLogEx(INFO, "Client side interrupted"); PrintAndLogEx(WARNING, "Simulation still running on Proxmark3 till next command or button press"); } else { - PrintAndLogEx(INFO, "Done"); + PrintAndLogEx(INFO, "Done!"); } return PM3_SUCCESS; } diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index b5036208c..58bce9532 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -554,7 +554,7 @@ static int CmdDetectReader(const char *Cmd) { else if (hf) arg = 2; - PrintAndLogEx(INFO, "press pm3 button to change modes and finally exit"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " to change modes and exit"); clearCommandBuffer(); SendCommandNG(CMD_LISTEN_READER_FIELD, (uint8_t *)&arg, sizeof(arg)); return PM3_SUCCESS; diff --git a/client/src/cmdlfawid.c b/client/src/cmdlfawid.c index bdb8d008e..81556b357 100644 --- a/client/src/cmdlfawid.c +++ b/client/src/cmdlfawid.c @@ -524,7 +524,7 @@ static int CmdAWIDBrute(const char *Cmd) { } PrintAndLogEx(SUCCESS, "Bruteforceing AWID %d reader", fmtlen); - PrintAndLogEx(SUCCESS, "Press " _GREEN_("pm3 button") " to abort simulation or press " _GREEN_("")); + PrintAndLogEx(SUCCESS, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); uint16_t up = cn; uint16_t down = cn; diff --git a/client/src/cmdlfem4x50.c b/client/src/cmdlfem4x50.c index 39510c27b..e7bbe9ea3 100644 --- a/client/src/cmdlfem4x50.c +++ b/client/src/cmdlfem4x50.c @@ -1237,7 +1237,7 @@ int CmdEM4x50Sim(const char *Cmd) { clearCommandBuffer(); SendCommandNG(CMD_LF_EM4X50_SIM, (uint8_t *)&password, sizeof(password)); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); PacketResponseNG resp; // init to ZERO diff --git a/client/src/cmdlfem4x70.c b/client/src/cmdlfem4x70.c index ecead7cf3..5a821c985 100644 --- a/client/src/cmdlfem4x70.c +++ b/client/src/cmdlfem4x70.c @@ -282,7 +282,7 @@ int CmdEM4x70Brute(const char *Cmd) { return PM3_EINVARG; } - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to exit"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to exit"); clearCommandBuffer(); PacketResponseNG resp; SendCommandNG(CMD_LF_EM4X70_BRUTE, (uint8_t *)&etd, sizeof(etd)); diff --git a/client/src/cmdlfhid.c b/client/src/cmdlfhid.c index 150df44c1..39c2b84a4 100644 --- a/client/src/cmdlfhid.c +++ b/client/src/cmdlfhid.c @@ -592,7 +592,7 @@ static int CmdHIDBrute(const char *Cmd) { } PrintAndLogEx(NORMAL, ""); PrintAndLogEx(INFO, "Started bruteforcing HID Prox reader"); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); PrintAndLogEx(NORMAL, ""); // copy values to low. card_low = card_hi; diff --git a/client/src/cmdlfindala.c b/client/src/cmdlfindala.c index ec61b938a..a0a997577 100644 --- a/client/src/cmdlfindala.c +++ b/client/src/cmdlfindala.c @@ -1015,7 +1015,7 @@ static int CmdIndalaBrute(const char *Cmd) { } PrintAndLogEx(NORMAL, ""); PrintAndLogEx(INFO, "Started brute-forcing INDALA Prox reader"); - PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or press " _GREEN_("") " to abort simulation"); + PrintAndLogEx(INFO, "Press " _GREEN_("pm3 button") " or " _GREEN_("") " to abort simulation"); PrintAndLogEx(NORMAL, ""); // main loop