Skip to content

Commit

Permalink
Splitting block 0 writing and other block writing, not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
gelotus committed Jun 25, 2020
1 parent 7b6ff73 commit 5a87f1f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions utils/nfc-mfclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,6 @@ write_card(int write_block_zero)
memset(mp.mpd.abtData, 0x00, sizeof(mp.mpd.abtData));
else
memcpy(mp.mpd.abtData, mtDump.amb[uiBlock].mbd.abtData, sizeof(mp.mpd.abtData));
// do not write a block 0 with incorrect BCC - card will be made invalid!
if (uiBlock == 0) {
if ((mp.mpd.abtData[0] ^ mp.mpd.abtData[1] ^ mp.mpd.abtData[2] ^ mp.mpd.abtData[3] ^ mp.mpd.abtData[4]) != 0x00 && !magic2) {
printf("!\nError: incorrect BCC in MFD file!\n");
printf("Expecting BCC=%02X\n", mp.mpd.abtData[0] ^ mp.mpd.abtData[1] ^ mp.mpd.abtData[2] ^ mp.mpd.abtData[3]);
return false;
}
}
if (!nfc_initiator_mifare_cmd(pnd, MC_WRITE, uiBlock, &mp)) {
bFailure = true;
printf("Failure to write to data block %i\n", uiBlock);
Expand Down

0 comments on commit 5a87f1f

Please sign in to comment.