From fd121bab4ffd02516ae0921171968d7f94b8caad Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 22 Oct 2023 18:56:19 +0200 Subject: [PATCH] added nosave parameter to lf em 4x05 dump --- CHANGELOG.md | 1 + client/src/cmdlfem4x05.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 084441cc8..7b5156d96 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 `lf em 4x05 dump` - now supports the `--ns` nosave parameter (@iceman1001) - Added new command `data bmap` - breaks down a hexvalue to a binary template (@iceman1001) - Changed aid_desfire.json - added entreis from the Metrodroid project (@iceman1001) - Changed mad.json - added entries from the Metrodroid project (@iceman1001) diff --git a/client/src/cmdlfem4x05.c b/client/src/cmdlfem4x05.c index f548d98e3..423afbab7 100644 --- a/client/src/cmdlfem4x05.c +++ b/client/src/cmdlfem4x05.c @@ -514,6 +514,7 @@ int CmdEM4x05Dump(const char *Cmd) { arg_param_begin, arg_str0("p", "pwd", "", "password (00000000)"), arg_str0("f", "file", "", "override filename prefix (optional). Default is based on UID"), + arg_lit0(NULL, "ns", "no save to file"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -522,6 +523,7 @@ int CmdEM4x05Dump(const char *Cmd) { int fnlen = 0; char filename[FILE_PATH_SIZE] = {0}; CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen); + bool nosave = arg_get_lit(ctx, 3); CLIParserFree(ctx); uint8_t addr = 0; @@ -693,6 +695,13 @@ int CmdEM4x05Dump(const char *Cmd) { } else { } + if (nosave) { + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(INFO, "Called with no save option"); + PrintAndLogEx(NORMAL, ""); + return PM3_SUCCESS; + } + // all ok save dump to file if (success == PM3_SUCCESS) {