when running dump command and its a bad read, we usually get an all zeros config block. this block we should not try to write to the clone target card when restoring....
This commit is contained in:
1 parent
71621470bd
commit
05ef23e322
2 files changed
+12
-3
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]
|
||||
- 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)
|
||||
|
||||
+11
-3
@@ -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!");
|
||||
|
||||
Reference in new issue
Block a user