remove unused stuff for block 0 writing
This commit is contained in:
parent
709ef8381f
commit
f7b9b0eafa
1 changed files with 0 additions and 19 deletions
|
@ -440,14 +440,6 @@ write_card(int write_block_zero)
|
||||||
if (write_block_zero) {
|
if (write_block_zero) {
|
||||||
uiBlock = 0;
|
uiBlock = 0;
|
||||||
is_first_block(0);
|
is_first_block(0);
|
||||||
if (bFailure) {
|
|
||||||
// When a failure occured we need to redo the anti-collision
|
|
||||||
if (nfc_initiator_select_passive_target(pnd, nmMifare, NULL, 0, &nt) <= 0) {
|
|
||||||
printf("!\nError: tag was removed\n");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bFailure = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
// Try to authenticate for the current sector
|
// Try to authenticate for the current sector
|
||||||
|
@ -461,12 +453,7 @@ write_card(int write_block_zero)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure a earlier write did not fail
|
|
||||||
if (!bFailure) {
|
|
||||||
// Try to write the data block
|
// Try to write the data block
|
||||||
if (bFormatCard && uiBlock)
|
|
||||||
memset(mp.mpd.abtData, 0x00, sizeof(mp.mpd.abtData));
|
|
||||||
else
|
|
||||||
memcpy(mp.mpd.abtData, mtDump.amb[uiBlock].mbd.abtData, sizeof(mp.mpd.abtData));
|
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!
|
// do not write a block 0 with incorrect BCC - card will be made invalid!
|
||||||
if ((mp.mpd.abtData[0] ^ mp.mpd.abtData[1] ^ mp.mpd.abtData[2] ^ mp.mpd.abtData[3] ^ mp.mpd.abtData[4]) != 0x00 && !magic2) {
|
if ((mp.mpd.abtData[0] ^ mp.mpd.abtData[1] ^ mp.mpd.abtData[2] ^ mp.mpd.abtData[3] ^ mp.mpd.abtData[4]) != 0x00 && !magic2) {
|
||||||
|
@ -478,12 +465,6 @@ write_card(int write_block_zero)
|
||||||
bFailure = true;
|
bFailure = true;
|
||||||
printf("Failure to write to data block 0\n");
|
printf("Failure to write to data block 0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
printf("Failure during write process.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show if the write went well for block 0
|
// Show if the write went well for block 0
|
||||||
print_success_or_failure(bFailure, &uiWriteBlocks);
|
print_success_or_failure(bFailure, &uiWriteBlocks);
|
||||||
if ((!bTolerateFailures) && bFailure)
|
if ((!bTolerateFailures) && bFailure)
|
||||||
|
|
Loading…
Reference in a new issue