hf felica litedump: skip blocks that require Read After Authentication

This commit is contained in:
q0jt 2025-07-19 15:42:00 +09:00
commit 95759a13ba
No known key found for this signature in database

View file

@ -1881,10 +1881,16 @@ static uint16_t PrintFliteBlock(uint16_t tracepos, uint8_t *trace, uint16_t trac
uint8_t status1 = trace[1]; uint8_t status1 = trace[1];
uint8_t status2 = trace[2]; uint8_t status2 = trace[2];
bool error = (status1 != 0x00 && (status2 == 0xB1 || status2 == 0xB2));
char line[110] = {0}; char line[110] = {0};
for (int j = 0; j < 16; j++) { for (int j = 0; j < 16; j++) {
if (error) {
snprintf(line + (j * 4), sizeof(line) - 1 - (j * 4), "?? ");
} else {
snprintf(line + (j * 4), sizeof(line) - 1 - (j * 4), "%02x ", trace[j + 3]); snprintf(line + (j * 4), sizeof(line) - 1 - (j * 4), "%02x ", trace[j + 3]);
} }
}
PrintAndLogEx(NORMAL, "block number %02x, status: %02x %02x", blocknum, status1, status2); PrintAndLogEx(NORMAL, "block number %02x, status: %02x %02x", blocknum, status1, status2);
switch (blocknum) { switch (blocknum) {
@ -1937,8 +1943,12 @@ static uint16_t PrintFliteBlock(uint16_t tracepos, uint8_t *trace, uint16_t trac
for (int j = 0; j < 8; j++) for (int j = 0; j < 8; j++)
snprintf(line + (j * 2), sizeof(line) - 1 - (j * 2), "%02x", trace[j + 11]); snprintf(line + (j * 2), sizeof(line) - 1 - (j * 2), "%02x", trace[j + 11]);
if (error) {
PrintAndLogEx(NORMAL, "REG: regA: ???????? regB: ???????? regC: ???????????????? ");
} else {
PrintAndLogEx(NORMAL, "REG: regA: %d regB: %d regC: %s ", regA, regB, line); PrintAndLogEx(NORMAL, "REG: regA: %d regB: %d regC: %s ", regA, regB, line);
} }
}
break; break;
case 0x80: case 0x80:
PrintAndLogEx(NORMAL, "Random Challenge, WO: %s ", line); PrintAndLogEx(NORMAL, "Random Challenge, WO: %s ", line);