mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
style
This commit is contained in:
parent
50b9067173
commit
d99ec776c8
3 changed files with 15 additions and 15 deletions
|
@ -2358,7 +2358,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
tc1 = (card.ats[1] & 0x40) == 0x40;
|
tc1 = (card.ats[1] & 0x40) == 0x40;
|
||||||
int16_t fsci = card.ats[1] & 0x0f;
|
int16_t fsci = card.ats[1] & 0x0f;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " " _YELLOW_("%02X") "............ T0 TA1 is%s present, TB1 is%s present, "
|
PrintAndLogEx(INFO, " ..." _YELLOW_("%02X") "............ T0 TA1 is%s present, TB1 is%s present, "
|
||||||
"TC1 is%s present, FSCI is %d (FSC = %d)",
|
"TC1 is%s present, FSCI is %d (FSC = %d)",
|
||||||
card.ats[1],
|
card.ats[1],
|
||||||
(ta1 ? "" : _RED_(" NOT")),
|
(ta1 ? "" : _RED_(" NOT")),
|
||||||
|
@ -2380,7 +2380,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
if (card.ats[pos] & 0x04) strcat(dr, "8, ");
|
if (card.ats[pos] & 0x04) strcat(dr, "8, ");
|
||||||
if (strlen(ds) != 0) ds[strlen(ds) - 2] = '\0';
|
if (strlen(ds) != 0) ds[strlen(ds) - 2] = '\0';
|
||||||
if (strlen(dr) != 0) dr[strlen(dr) - 2] = '\0';
|
if (strlen(dr) != 0) dr[strlen(dr) - 2] = '\0';
|
||||||
PrintAndLogEx(INFO, " " _YELLOW_("%02X") "......... TA1 different divisors are%s supported, "
|
PrintAndLogEx(INFO, " ......" _YELLOW_("%02X") "......... TA1 different divisors are%s supported, "
|
||||||
"DR: [%s], DS: [%s]",
|
"DR: [%s], DS: [%s]",
|
||||||
card.ats[pos],
|
card.ats[pos],
|
||||||
((card.ats[pos] & 0x80) ? _RED_(" NOT") : ""),
|
((card.ats[pos] & 0x80) ? _RED_(" NOT") : ""),
|
||||||
|
@ -2395,7 +2395,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
uint32_t sfgi = card.ats[pos] & 0x0F;
|
uint32_t sfgi = card.ats[pos] & 0x0F;
|
||||||
uint32_t fwi = card.ats[pos] >> 4;
|
uint32_t fwi = card.ats[pos] >> 4;
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " " _YELLOW_("%02X") "...... TB1 SFGI = %d (SFGT = %s%d/fc), FWI = " _YELLOW_("%d") " (FWT = %d/fc)",
|
PrintAndLogEx(INFO, " ........." _YELLOW_("%02X") "...... TB1 SFGI = %d (SFGT = %s%d/fc), FWI = " _YELLOW_("%d") " (FWT = %d/fc)",
|
||||||
card.ats[pos],
|
card.ats[pos],
|
||||||
(sfgi),
|
(sfgi),
|
||||||
sfgi ? "" : "(not needed) ",
|
sfgi ? "" : "(not needed) ",
|
||||||
|
@ -2407,7 +2407,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tc1 && (card.ats_len > pos + 2)) {
|
if (tc1 && (card.ats_len > pos + 2)) {
|
||||||
PrintAndLogEx(INFO, " " _YELLOW_("%02X") "... TC1 NAD is%s supported, CID is%s supported",
|
PrintAndLogEx(INFO, " ............" _YELLOW_("%02X") "... TC1 NAD is%s supported, CID is%s supported",
|
||||||
card.ats[pos],
|
card.ats[pos],
|
||||||
(card.ats[pos] & 0x01) ? "" : _RED_(" NOT"),
|
(card.ats[pos] & 0x01) ? "" : _RED_(" NOT"),
|
||||||
(card.ats[pos] & 0x02) ? "" : _RED_(" NOT")
|
(card.ats[pos] & 0x02) ? "" : _RED_(" NOT")
|
||||||
|
@ -2546,11 +2546,8 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
, sprint_ascii(card.ats + pos, calen)
|
, sprint_ascii(card.ats + pos, calen)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(NORMAL, "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_aid_search) {
|
if (do_aid_search) {
|
||||||
|
|
|
@ -66,8 +66,6 @@ static uint8_t empty[PICOPASS_BLOCK_SIZE] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
static uint8_t zeros[PICOPASS_BLOCK_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
static uint8_t zeros[PICOPASS_BLOCK_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
static int CmdHelp(const char *Cmd);
|
static int CmdHelp(const char *Cmd);
|
||||||
static void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len);
|
|
||||||
|
|
||||||
static uint8_t iClass_Key_Table[ICLASS_KEYS_MAX][PICOPASS_BLOCK_SIZE] = {
|
static uint8_t iClass_Key_Table[ICLASS_KEYS_MAX][PICOPASS_BLOCK_SIZE] = {
|
||||||
{ 0xAE, 0xA6, 0x84, 0xA6, 0xDA, 0xB2, 0x32, 0x78 },
|
{ 0xAE, 0xA6, 0x84, 0xA6, 0xDA, 0xB2, 0x32, 0x78 },
|
||||||
{ 0xFD, 0xCB, 0x5A, 0x52, 0xEA, 0x8F, 0x30, 0x90 },
|
{ 0xFD, 0xCB, 0x5A, 0x52, 0xEA, 0x8F, 0x30, 0x90 },
|
||||||
|
@ -3184,7 +3182,7 @@ static void detect_credential(uint8_t *iclass_dump, size_t dump_len, bool *is_le
|
||||||
|
|
||||||
picopass_hdr_t *hdr = (picopass_hdr_t *)iclass_dump;
|
picopass_hdr_t *hdr = (picopass_hdr_t *)iclass_dump;
|
||||||
|
|
||||||
if (!memcmp(hdr->app_issuer_area, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", PICOPASS_BLOCK_SIZE)) {
|
if (memcmp(hdr->app_issuer_area, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", PICOPASS_BLOCK_SIZE) == 0) {
|
||||||
// Legacy AIA
|
// Legacy AIA
|
||||||
*is_legacy = true;
|
*is_legacy = true;
|
||||||
|
|
||||||
|
@ -3206,7 +3204,7 @@ static void detect_credential(uint8_t *iclass_dump, size_t dump_len, bool *is_le
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!memcmp(hdr->app_issuer_area, "\xFF\xFF\xFF\x00\x06\xFF\xFF\xFF", PICOPASS_BLOCK_SIZE)) {
|
} else if (memcmp(hdr->app_issuer_area, "\xFF\xFF\xFF\x00\x06\xFF\xFF\xFF", PICOPASS_BLOCK_SIZE) == 0) {
|
||||||
// SE AIA
|
// SE AIA
|
||||||
*is_se = true;
|
*is_se = true;
|
||||||
|
|
||||||
|
@ -3238,7 +3236,8 @@ static void detect_credential(uint8_t *iclass_dump, size_t dump_len, bool *is_le
|
||||||
}
|
}
|
||||||
|
|
||||||
// print ASN1 decoded array in TLV view
|
// print ASN1 decoded array in TLV view
|
||||||
static void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len) {
|
void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len, bool verbose) {
|
||||||
|
|
||||||
bool is_legacy, is_se, is_sr;
|
bool is_legacy, is_se, is_sr;
|
||||||
uint8_t *sio_start;
|
uint8_t *sio_start;
|
||||||
size_t sio_length;
|
size_t sio_length;
|
||||||
|
@ -3249,7 +3248,7 @@ static void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dump_len < sio_length + (sio_start - iclass_dump)) {
|
if (dump_len < sio_length + (sio_start - iclass_dump)) {
|
||||||
// SIO length exceeds the size of the dump we have, bail
|
// SIO length exceeds the size of the dump
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3257,9 +3256,11 @@ static void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len) {
|
||||||
PrintAndLogEx(INFO, "---------------------------- " _CYAN_("SIO - RAW") " ----------------------------");
|
PrintAndLogEx(INFO, "---------------------------- " _CYAN_("SIO - RAW") " ----------------------------");
|
||||||
print_hex_noascii_break(sio_start, sio_length, 32);
|
print_hex_noascii_break(sio_start, sio_length, 32);
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(INFO, "------------------------- " _CYAN_("SIO - ASN1 TLV") " --------------------------");
|
if (verbose) {
|
||||||
|
PrintAndLogEx(INFO, "----------------------- " _CYAN_("SIO - ASN1 TLV") " ---------------------------");
|
||||||
asn1_print(sio_start, sio_length, " ");
|
asn1_print(sio_start, sio_length, " ");
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void printIclassDumpContents(uint8_t *iclass_dump, uint8_t startblock, uint8_t endblock, size_t filesize, bool dense_output) {
|
void printIclassDumpContents(uint8_t *iclass_dump, uint8_t startblock, uint8_t endblock, size_t filesize, bool dense_output) {
|
||||||
|
@ -3457,8 +3458,9 @@ void printIclassDumpContents(uint8_t *iclass_dump, uint8_t startblock, uint8_t e
|
||||||
if (is_legacy)
|
if (is_legacy)
|
||||||
PrintAndLogEx(HINT, _YELLOW_("yellow") " = legacy credential");
|
PrintAndLogEx(HINT, _YELLOW_("yellow") " = legacy credential");
|
||||||
|
|
||||||
if (is_se)
|
if (is_se) {
|
||||||
PrintAndLogEx(HINT, _CYAN_("cyan") " = SIO / SE credential");
|
PrintAndLogEx(HINT, _CYAN_("cyan") " = SIO / SE credential");
|
||||||
|
}
|
||||||
|
|
||||||
if (is_sr)
|
if (is_sr)
|
||||||
PrintAndLogEx(HINT, _CYAN_("cyan") " = SIO / SR credential");
|
PrintAndLogEx(HINT, _CYAN_("cyan") " = SIO / SR credential");
|
||||||
|
|
|
@ -43,4 +43,5 @@ uint32_t picopass_elite_rng(void);
|
||||||
uint32_t picopass_elite_lcg(void);
|
uint32_t picopass_elite_lcg(void);
|
||||||
uint8_t picopass_elite_nextByte(void);
|
uint8_t picopass_elite_nextByte(void);
|
||||||
void generate_key_block_inverted(const uint8_t *startingKey, uint64_t index, uint8_t *keyBlock);
|
void generate_key_block_inverted(const uint8_t *startingKey, uint64_t index, uint8_t *keyBlock);
|
||||||
|
void print_iclass_sio(uint8_t *iclass_dump, size_t dump_len, bool verbose);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue