From 972d30474d9908905d50ce57f7986c0dd0bfe81b Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 5 Sep 2018 20:31:10 +0200 Subject: [PATCH] Add 'rem' - new command that adds a line to the log file (@didierStevens) --- CHANGELOG.md | 4 ++++ client/cmdmain.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e731a2a..d384e8a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ 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 'proxmark3 client threading' - remake from official repo (@micolous) + - Add 'rem' - new command that adds a line to the log file (@didierStevens) + - Fix 'EM410xdemod empty tag id in lfops.c' (@Defensor7) - Fix 'usb device descriptor' - some android phones will enumerate better when iSerialnumber isn't a multiple of 8 (@micolous, @megabug) - Fix 'StandaloneMode LF' - when collecting signal, justNoise detection is needed (@didierStevens, @Megabug) - Fix 'StandAloneMode Colin' - mifare1ksim called with right params (@cjbrigato) diff --git a/client/cmdmain.c b/client/cmdmain.c index ea118a2f0..7c8e3839e 100644 --- a/client/cmdmain.c +++ b/client/cmdmain.c @@ -13,6 +13,7 @@ static int CmdHelp(const char *Cmd); static int CmdQuit(const char *Cmd); static int CmdRev(const char *Cmd); +static int CmdRem(const char *Cmd); //For storing command that are received from the device static UsbCommand cmdBuffer[CMD_BUFFER_SIZE]; @@ -33,6 +34,7 @@ static command_t CommandTable[] = { {"hf", CmdHF, 1, "{ High Frequency commands... }"}, {"hw", CmdHW, 1, "{ Hardware commands... }"}, {"lf", CmdLF, 1, "{ Low Frequency commands... }"}, + {"rem", CmdRem, 1, "{ Add text to row in log file }"}, {"reveng", CmdRev, 1, "{ Crc calculations from the software reveng 1.53... }"}, {"script", CmdScript, 1, "{ Scripting commands }"}, {"trace", CmdTrace, 1, "{ Trace manipulation... }"}, @@ -51,6 +53,18 @@ command_t* getTopLevelCommandTable() { return CommandTable; } +int CmdRem(const char *Cmd) { + char buf[22]; + + memset(buf, 0x00, sizeof(buf)); + struct tm *curTime; + time_t now = time(0); + curTime = gmtime(&now); + strftime (buf, sizeof(buf), "%Y-%m-%dT%H:%M:%SZ", curTime); // ISO8601 + PrintAndLogEx(NORMAL, "%s remark: %s", buf, Cmd); + return 0; +} + int CmdHelp(const char *Cmd) { CmdsHelp(CommandTable); return 0;