added nosave parameter to lf em 4x05 dump

This commit is contained in:
iceman1001 2023-10-22 18:56:19 +02:00
parent a2fdab98b5
commit fd121bab4f
2 changed files with 10 additions and 0 deletions

View file

@ -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)

View file

@ -514,6 +514,7 @@ int CmdEM4x05Dump(const char *Cmd) {
arg_param_begin,
arg_str0("p", "pwd", "<hex>", "password (00000000)"),
arg_str0("f", "file", "<fn>", "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) {