diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 455351ffd..b62f0e1c1 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -1921,7 +1921,7 @@ static int CmdHF14BRestore(const char *Cmd) { int blockno = 0; while (bytes_read) { - int status = write_sr_block(blockno, ST25TB_SR_BLOCK_SIZE, data+blockno*ST25TB_SR_BLOCK_SIZE); + int status = write_sr_block(blockno, ST25TB_SR_BLOCK_SIZE, data + blockno * ST25TB_SR_BLOCK_SIZE); if (status != PM3_SUCCESS) { PrintAndLogEx(FAILED, "Write failed"); free(data); @@ -1932,16 +1932,16 @@ static int CmdHF14BRestore(const char *Cmd) { uint8_t out[ST25TB_SR_BLOCK_SIZE] = {0}; status = read_sr_block(blockno, out); if (status == PM3_SUCCESS) { - if (memcmp(data+blockno*ST25TB_SR_BLOCK_SIZE, out, ST25TB_SR_BLOCK_SIZE) == 0) { + if (memcmp(data + blockno * ST25TB_SR_BLOCK_SIZE, out, ST25TB_SR_BLOCK_SIZE) == 0) { printf("\33[2K\r"); - PrintAndLogEx(INFO, "SRx write block %d/%d ( " _GREEN_("ok") " )" NOLF, blockno, block_cnt-1); - }else { + PrintAndLogEx(INFO, "SRx write block %d/%d ( " _GREEN_("ok") " )" NOLF, blockno, block_cnt - 1); + } else { printf("\n"); - PrintAndLogEx(INFO, "SRx write block %d/%d ( " _RED_("different") " )",blockno, block_cnt-1); + PrintAndLogEx(INFO, "SRx write block %d/%d ( " _RED_("different") " )", blockno, block_cnt - 1); } - }else{ + } else { printf("\n"); - PrintAndLogEx(INFO, "Verifying block %d/%d ( " _RED_("failed") " )",blockno, block_cnt-1); + PrintAndLogEx(INFO, "Verifying block %d/%d ( " _RED_("failed") " )", blockno, block_cnt - 1); } fflush(stdout); diff --git a/doc/commands.json b/doc/commands.json index e9e4a0fd0..c506362f9 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -1513,6 +1513,22 @@ ], "usage": "hf 14b reader [-hv@]" }, + "hf 14b restore": { + "command": "hf 14b restore", + "description": "Restore data from (bin/eml/json) dump file to tag If the dump file includes the special block at the end it will be ignored", + "notes": [ + "hf 14b restore --4k -f myfilename", + "hf 14b restore --512 -f myfilename" + ], + "offline": false, + "options": [ + "-h, --help This help", + "-f, --file (optional) filename, if no UID will be used as filename", + "--512 target SRI 512 tag", + "--4k target SRIX 4k tag (def)" + ], + "usage": "hf 14b restore [-h] [-f ] [--512] [--4k]" + }, "hf 14b sim": { "command": "hf 14b sim", "description": "Simulate a ISO/IEC 14443 type B tag with 4 byte UID / PUPI", @@ -1580,7 +1596,7 @@ "-b, --block block number", "-d, --data 4 hex bytes", "--512 target SRI 512 tag", - "--4k target SRIX 4k tag", + "--4k target SRIX 4k tag (def)", "--sb special block write at end of memory (0xFF)", "--force overrides block range checks" ], @@ -12497,8 +12513,8 @@ } }, "metadata": { - "commands_extracted": 721, + "commands_extracted": 722, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2024-02-21T16:14:11" + "extracted_on": "2024-02-21T21:49:16" } } diff --git a/doc/commands.md b/doc/commands.md index 0ccc98fe3..a394b4e4c 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -216,6 +216,7 @@ Check column "offline" for their availability. |`hf 14b raw `|N |`Send raw hex data to tag` |`hf 14b rdbl `|N |`Read SRI512/SRIX4 block` |`hf 14b reader `|N |`Act as a ISO-14443-B reader to identify a tag` +|`hf 14b restore `|N |`Restore from file to all memory pages of an ISO-14443-B tag` |`hf 14b sim `|N |`Fake ISO ISO-14443-B tag` |`hf 14b sniff `|N |`Eavesdrop ISO-14443-B` |`hf 14b wrbl `|N |`Write data to a SRI512/SRIX4 tag`