diff --git a/CHANGELOG.md b/CHANGELOG.md index cfca6cc73..368bf10af 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] +- Change `lf t55xx restore` - now skips writing block0 if its all zeros (@iceman1001) - Added `HID Simplex Grinnell 36-bit` - Improved Simplex decoder (@datafx, @henrygab) - Change `lf search` - also test for chipset even if there was just signal noice (@iceman1001) - Added detection of PCF 7961 , thanks progman (@iceman1001) diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index 49e50902f..9b6062a2f 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -2755,9 +2755,17 @@ static int CmdT55xxRestore(const char *Cmd) { config.downlink_mode = downlink_mode; // Write the page 0 config - snprintf(wcmd, sizeof(wcmd), "-b 0 -d %08X %s", dump[0], pwdopt); - if (CmdT55xxWriteBlock(wcmd) != PM3_SUCCESS) { - PrintAndLogEx(WARNING, "Warning: error writing blk 0"); + // + // when running `lf t55xx dump` and user failed, the dump file will have a all zero block0 (ie: config block) + // writing this bad config block will brick the tag. + if (dump[0] != 0x00000000) { + snprintf(wcmd, sizeof(wcmd), "-b 0 -d %08X %s", dump[0], pwdopt); + if (CmdT55xxWriteBlock(wcmd) != PM3_SUCCESS) { + PrintAndLogEx(WARNING, "Warning: error writing blk 0"); + } + } else { + PrintAndLogEx(WARNING, "Warning: the dump file contains a all zero config block."); + PrintAndLogEx(HINT, "Make sure you dumped the card correct"); } free(dump); PrintAndLogEx(INFO, "Done!");