mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
thinfilm partial info when verbose
This commit is contained in:
parent
10c949a47e
commit
85c0f3e9e3
2 changed files with 18 additions and 8 deletions
|
@ -30,13 +30,19 @@ static int print_barcode(uint8_t *barcode, const size_t barcode_len, bool verbos
|
||||||
PrintAndLogEx(SUCCESS, " Manufacturer : "_YELLOW_("%s") "[0x%02X]", (barcode[0] == 0xB7) ? "Thinfilm" : "unknown", barcode[0]);
|
PrintAndLogEx(SUCCESS, " Manufacturer : "_YELLOW_("%s") "[0x%02X]", (barcode[0] == 0xB7) ? "Thinfilm" : "unknown", barcode[0]);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
|
PrintAndLogEx(SUCCESS, " Data format : "_YELLOW_("%02X"), barcode[1]);
|
||||||
|
if (barcode_len > 2) {
|
||||||
uint8_t b1, b2;
|
uint8_t b1, b2;
|
||||||
compute_crc(CRC_14443_A, barcode, barcode_len - 2, &b1, &b2);
|
compute_crc(CRC_14443_A, barcode, barcode_len - 2, &b1, &b2);
|
||||||
bool isok = (barcode[barcode_len - 1] == b1 && barcode[barcode_len - 2] == b2);
|
bool isok = (barcode[barcode_len - 1] == b1 && barcode[barcode_len - 2] == b2);
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, " Data format : "_YELLOW_("%02X"), barcode[1]);
|
|
||||||
PrintAndLogEx(SUCCESS, " checksum : "_YELLOW_("%02X %02X")"- %s", b2, b1, (isok) ? _GREEN_("OK") : _RED_("fail"));
|
PrintAndLogEx(SUCCESS, " checksum : "_YELLOW_("%02X %02X")"- %s", b2, b1, (isok) ? _GREEN_("OK") : _RED_("fail"));
|
||||||
|
} else {
|
||||||
|
PrintAndLogEx(SUCCESS, " checksum : "_YELLOW_("too few data for checksum")"- " _RED_("fail"));
|
||||||
|
}
|
||||||
PrintAndLogEx(SUCCESS, " Raw data : "_YELLOW_("%s"), sprint_hex(barcode, barcode_len));
|
PrintAndLogEx(SUCCESS, " Raw data : "_YELLOW_("%s"), sprint_hex(barcode, barcode_len));
|
||||||
|
if (barcode_len < 4) // too few to go to next decoding stages
|
||||||
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
char s[45];
|
char s[45];
|
||||||
|
@ -59,6 +65,10 @@ static int print_barcode(uint8_t *barcode, const size_t barcode_len, bool verbos
|
||||||
snprintf(s, sizeof(s), "https://");
|
snprintf(s, sizeof(s), "https://");
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
if (barcode_len < 16) {
|
||||||
|
PrintAndLogEx(WARNING, "EPC: (partial data) %s", sprint_hex(barcode + 2, barcode_len - 2));
|
||||||
|
return PM3_ESOFT;
|
||||||
|
}
|
||||||
PrintAndLogEx(SUCCESS, "EPC: %s", sprint_hex(barcode + 2, 12));
|
PrintAndLogEx(SUCCESS, "EPC: %s", sprint_hex(barcode + 2, 12));
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
default:
|
default:
|
||||||
|
@ -118,7 +128,7 @@ int infoThinFilm(bool verbose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp.status == PM3_SUCCESS) {
|
if (resp.status == PM3_SUCCESS) {
|
||||||
if (resp.length == 16 || resp.length == 32) {
|
if (resp.length == 16 || resp.length == 32 || verbose) {
|
||||||
print_barcode(resp.data.asBytes, resp.length, verbose);
|
print_barcode(resp.data.asBytes, resp.length, verbose);
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "Response is wrong length. (%d)", resp.length);
|
PrintAndLogEx(WARNING, "Response is wrong length. (%d)", resp.length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue