mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
iclass tear on device side , moved around debug printing not to disturb timings between reading and writing tag during stabilize weak bit phase
This commit is contained in:
parent
359469c0a5
commit
749c23a6b5
1 changed files with 37 additions and 35 deletions
|
@ -2368,44 +2368,10 @@ void iClass_TearBlock(iclass_tearblock_req_t *msg) {
|
||||||
|
|
||||||
if (req.blockno == 1) {
|
if (req.blockno == 1) {
|
||||||
|
|
||||||
if (data_read[0] != data_read_orig[0]) {
|
|
||||||
DbpString("");
|
|
||||||
Dbprintf("Application limit changed, from "_YELLOW_("%u")" to "_YELLOW_("%u"), data_read_orig[0], data_read[0]);
|
|
||||||
isok = PM3_SUCCESS;
|
|
||||||
goto_out = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data_read[7] != data_read_orig[7]) {
|
|
||||||
DbpString("");
|
|
||||||
Dbprintf("Fuse changed, from "_YELLOW_("%02x")" to "_YELLOW_("%02x"), data_read_orig[7], data_read[7]);
|
|
||||||
|
|
||||||
const char *flag_names[8] = {
|
|
||||||
"RA",
|
|
||||||
"Fprod0",
|
|
||||||
"Fprod1",
|
|
||||||
"Crypt0 (*1)",
|
|
||||||
"Crypt1 (*0)",
|
|
||||||
"Coding0",
|
|
||||||
"Coding1",
|
|
||||||
"Fpers (*1)"
|
|
||||||
};
|
|
||||||
Dbprintf(_YELLOW_("%-10s %-10s %-10s"), "Fuse", "Original", "Changed");
|
|
||||||
Dbprintf("---------------------------------------");
|
|
||||||
for (int i = 7; i >= 0; --i) {
|
|
||||||
int bit1 = (data_read_orig[7] >> i) & 1;
|
|
||||||
int bit2 = (data_read[7] >> i) & 1;
|
|
||||||
Dbprintf("%-11s %-10d %-10d", flag_names[i], bit1, bit2);
|
|
||||||
}
|
|
||||||
|
|
||||||
isok = PM3_SUCCESS;
|
|
||||||
goto_out = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if more OTP bits set..
|
// if more OTP bits set..
|
||||||
if (data_read[1] > data_read_orig[1] ||
|
if (data_read[1] > data_read_orig[1] ||
|
||||||
data_read[2] > data_read_orig[2]) {
|
data_read[2] > data_read_orig[2]) {
|
||||||
DbpString("");
|
|
||||||
DbpString("More OTP bits got set!!!");
|
|
||||||
|
|
||||||
// step 4 if bits changed attempt to write the new bits to the tag
|
// step 4 if bits changed attempt to write the new bits to the tag
|
||||||
if (data_read[7] == 0xBC) {
|
if (data_read[7] == 0xBC) {
|
||||||
|
@ -2455,6 +2421,9 @@ void iClass_TearBlock(iclass_tearblock_req_t *msg) {
|
||||||
|
|
||||||
switch_off();
|
switch_off();
|
||||||
|
|
||||||
|
DbpString("");
|
||||||
|
DbpString("More OTP bits got set!!!");
|
||||||
|
|
||||||
Iso15693InitReader();
|
Iso15693InitReader();
|
||||||
|
|
||||||
// select tag, during which we read block1
|
// select tag, during which we read block1
|
||||||
|
@ -2471,6 +2440,39 @@ void iClass_TearBlock(iclass_tearblock_req_t *msg) {
|
||||||
isok = PM3_SUCCESS;
|
isok = PM3_SUCCESS;
|
||||||
goto_out = true;
|
goto_out = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data_read[0] != data_read_orig[0]) {
|
||||||
|
DbpString("");
|
||||||
|
Dbprintf("Application limit changed, from "_YELLOW_("%u")" to "_YELLOW_("%u"), data_read_orig[0], data_read[0]);
|
||||||
|
isok = PM3_SUCCESS;
|
||||||
|
goto_out = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data_read[7] != data_read_orig[7]) {
|
||||||
|
DbpString("");
|
||||||
|
Dbprintf("Fuse changed, from "_YELLOW_("%02x")" to "_YELLOW_("%02x"), data_read_orig[7], data_read[7]);
|
||||||
|
|
||||||
|
const char *flag_names[8] = {
|
||||||
|
"RA",
|
||||||
|
"Fprod0",
|
||||||
|
"Fprod1",
|
||||||
|
"Crypt0 (*1)",
|
||||||
|
"Crypt1 (*0)",
|
||||||
|
"Coding0",
|
||||||
|
"Coding1",
|
||||||
|
"Fpers (*1)"
|
||||||
|
};
|
||||||
|
Dbprintf(_YELLOW_("%-10s %-10s %-10s"), "Fuse", "Original", "Changed");
|
||||||
|
Dbprintf("---------------------------------------");
|
||||||
|
for (int i = 7; i >= 0; --i) {
|
||||||
|
int bit1 = (data_read_orig[7] >> i) & 1;
|
||||||
|
int bit2 = (data_read[7] >> i) & 1;
|
||||||
|
Dbprintf("%-11s %-10d %-10d", flag_names[i], bit1, bit2);
|
||||||
|
}
|
||||||
|
|
||||||
|
isok = PM3_SUCCESS;
|
||||||
|
goto_out = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goto_out) {
|
if (goto_out) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue