text
This commit is contained in:
1 parent
812722ed81
commit
f48250d51f
1 file changed
+4
-4
@@ -35,10 +35,9 @@ static int CmdHelp(const char *Cmd);
|
||||
// https://github.com/nfc-tools/libnfc/blob/master/utils/nfc-barcode.c
|
||||
static int print_barcode(uint8_t *barcode, const size_t barcode_len, bool verbose) {
|
||||
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
// remove start bit
|
||||
uint8_t mb = barcode[0] & ~0x80;
|
||||
PrintAndLogEx(SUCCESS, " Manufacturer : "_YELLOW_("%s") "[0x%02X]", getTagInfo(mb), mb);
|
||||
PrintAndLogEx(SUCCESS, " Manufacturer : "_YELLOW_("%s")" ( %02X )", getTagInfo(mb), mb);
|
||||
|
||||
if (verbose) {
|
||||
PrintAndLogEx(SUCCESS, " Data format : "_YELLOW_("%02X"), barcode[1]);
|
||||
@@ -52,9 +51,10 @@ static int print_barcode(uint8_t *barcode, const size_t barcode_len, bool verbos
|
||||
PrintAndLogEx(SUCCESS, " Checksum : "_YELLOW_("too few data for checksum")" - " _RED_("fail"));
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, " Data len (bits) : "_YELLOW_("%zu")" ( %s )", barcode_len * 8, (barcode_len == 16 || barcode_len == 32) ? _GREEN_("ok") : _YELLOW_("warning"));
|
||||
PrintAndLogEx(SUCCESS, " Raw data : "_YELLOW_("%s"), sprint_hex(barcode, barcode_len));
|
||||
if (barcode_len < 4) // too few to go to next decoding stages
|
||||
PrintAndLogEx(SUCCESS, " Raw data : "_YELLOW_("%s"), sprint_hex_inrow(barcode, barcode_len));
|
||||
if (barcode_len < 4) { // too few to go to next decoding stages
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
}
|
||||
|
||||
char s[45];
|
||||
|
||||
Reference in new issue
Block a user