mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-11-23 04:39:40 +00:00
hf mf brute: read the options right and report the transfer
The options were read one position further on in the argument table: --1k selected a Mini, --emu a 4K with no transfer, --dump the transfer, and --1k with --emu was refused. With --emu the command ignored the results of the transfer and of FastDumpWithEcFill() and returned success. It now reads positions 1-6 and handles both results as hf mf fchk does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2bc04ba6c2
commit
eae6f7dd9b
2 files changed
+22
-11
No files matched your search
@@ -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]
|
||||
- Fixed `hf mf brute` - options read at their own positions (`--1k` ran a Mini), `--emu` reports keys and dumps not transferred to emulator memory (@matrix)
|
||||
- Update Amiibo database (@tpglitch)
|
||||
- Changed `lf pcf7931 write` - write is verified via the tag's read after write, retried up to 3 times, failures are reported (@GiacoBot)
|
||||
- Changed `lf pcf7931 reader` - prints blocks 0-7 in order and decodes PAC, password, write protection and selection; handles partial selections, new `--rfb` param (@GiacoBot)
|
||||
|
||||
+21
-11
@@ -4350,6 +4350,8 @@ out2:
|
||||
|
||||
static int CmdHF14AMfSmartBrute(const char *Cmd) {
|
||||
CLIParserContext *ctx;
|
||||
// the result of an emulator memory transfer the command was asked for
|
||||
int eml_res = PM3_SUCCESS;
|
||||
CLIParserInit(&ctx, "hf mf brute",
|
||||
"This is a smart bruteforce, exploiting common patterns, bugs and bad designs in key generators.",
|
||||
"hf mf brute --mini --> Key recovery against MIFARE Mini\n"
|
||||
@@ -4372,13 +4374,13 @@ static int CmdHF14AMfSmartBrute(const char *Cmd) {
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||
|
||||
|
||||
bool m0 = arg_get_lit(ctx, 2);
|
||||
bool m1 = arg_get_lit(ctx, 3);
|
||||
bool m2 = arg_get_lit(ctx, 4);
|
||||
bool m4 = arg_get_lit(ctx, 5);
|
||||
bool m0 = arg_get_lit(ctx, 1);
|
||||
bool m1 = arg_get_lit(ctx, 2);
|
||||
bool m2 = arg_get_lit(ctx, 3);
|
||||
bool m4 = arg_get_lit(ctx, 4);
|
||||
|
||||
bool transferToEml = arg_get_lit(ctx, 6);
|
||||
bool createDumpFile = arg_get_lit(ctx, 7);
|
||||
bool transferToEml = arg_get_lit(ctx, 5);
|
||||
bool createDumpFile = arg_get_lit(ctx, 6);
|
||||
|
||||
CLIParserFree(ctx);
|
||||
|
||||
@@ -4534,12 +4536,20 @@ out:
|
||||
// Disable fast mode on last packet
|
||||
g_conn.block_after_ACK = false;
|
||||
}
|
||||
mf_elm_set_mem(block, b, 1);
|
||||
eml_res = mf_elm_set_mem(block, b, 1);
|
||||
if (eml_res != PM3_SUCCESS) {
|
||||
g_conn.block_after_ACK = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, "Found keys have been transferred to the emulator memory");
|
||||
if (eml_res == PM3_SUCCESS) {
|
||||
PrintAndLogEx(SUCCESS, "Found keys have been transferred to the emulator memory");
|
||||
|
||||
if (found_keys == (sectorsCnt << 1)) {
|
||||
FastDumpWithEcFill(sectorsCnt);
|
||||
if (found_keys == (sectorsCnt << 1)) {
|
||||
eml_res = FastDumpWithEcFill(sectorsCnt);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(FAILED, "Found keys have not been transferred to the emulator memory");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4557,7 +4567,7 @@ out:
|
||||
free(keyBlock);
|
||||
free(e_sector);
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
return PM3_SUCCESS;
|
||||
return eml_res;
|
||||
}
|
||||
|
||||
static int CmdHF14AMfChk(const char *Cmd) {
|
||||
|
||||
Reference in new issue
Block a user