improve text output in hf iclass tear

This commit is contained in:
iceman1001
2026-03-28 12:17:59 +07:00
parent d11d008a42
commit ee63e0bc2d
2 changed files with 10 additions and 1 deletions
+3
View File
@@ -944,6 +944,9 @@ int do_iclass_simulation(int simulationMode, uint8_t *reader_mac_buf) {
goto send;
} else if (cmd == ICLASS_CMD_DETECT) { // 0x0F
// if EAS byte in config block, (normally 0xFF, but 0x7F)
// MSB = 1 , don't answe with CSN
// MSB = 0 == enabled , answer with CSN
// not supported yet, ignore
// } else if (cmd == 0x26 && len == 5) {
// standard ISO15693 INVENTORY command. Ignore.
+7 -1
View File
@@ -4215,7 +4215,13 @@ static int CmdHFiClass_TearBlock(const char *Cmd) {
for (int i = 7; i >= 0; --i) {
int bit1 = (data_read_orig[7] >> i) & 1;
int bit2 = (data_read[7] >> i) & 1;
PrintAndLogEx(INFO, "%-11s %-10d %-10d", flag_names[i], bit1, bit2);
// if bit flipped, mark it with color
if (bit1 != bit2) {
PrintAndLogEx(SUCCESS, "%-11s %-10d " _GREEN_("%-10d"), flag_names[i], bit1, bit2);
} else {
PrintAndLogEx(INFO, "%-11s %-10d %-10d", flag_names[i], bit1, bit2);
}
}
isok = PM3_SUCCESS;