Fixed hf mf restore - really skip strict ACLs unless --force

This commit is contained in:
Philippe Teuwen 2024-10-09 23:52:40 +02:00
commit 0b1c82a102
2 changed files with 7 additions and 3 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]
- Fixed `hf mf restore` - really skip strict ACLs unless --force (@doegox)
- Added `hf 14b setuid` - set uid on magic 14b tag (@iceman1001)
- Changed `hf 14b info` - now detect Tiananxin (@iceman1001)
- Fixed `lf em 410x brute` - better filehandling and memory handling (@iceman1001)

View file

@ -1535,9 +1535,9 @@ static int CmdHF14AMfRestore(const char *Cmd) {
uint8_t bldata[MFBLOCK_SIZE] = {0x00};
memcpy(bldata, dump, MFBLOCK_SIZE);
bool skip = false;
// if sector trailer
if (mfIsSectorTrailerBasedOnBlocks(s, b)) {
// keep the current keys on the card
if (use_keyfile_for_auth == false) {
// replace KEY A
@ -1561,7 +1561,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
// if --force isn't used, skip writing this block
if (force == false) {
PrintAndLogEx(INFO, "Skipping, use `" _YELLOW_("--force") "` to override and write this data");
continue;
skip = true;
}
}
}
@ -1571,6 +1571,9 @@ static int CmdHF14AMfRestore(const char *Cmd) {
dump += MFBLOCK_SIZE;
bytes_read -= MFBLOCK_SIZE;
}
if (skip) {
continue;
}
uint8_t wdata[26];
memcpy(wdata + 10, bldata, sizeof(bldata));
@ -1607,7 +1610,7 @@ static int CmdHF14AMfRestore(const char *Cmd) {
}
// write somehow failed. Lets determine why.
if (isOK == PM3_ETEAROFF) {
PrintAndLogEx(INFO, "Tear off triggerd. Recommendation is not to use tear-off with restore command");
PrintAndLogEx(INFO, "Tear off triggered. Recommendation is not to use tear-off with restore command");
goto out;
}