This commit is contained in:
iceman1001 2024-01-26 14:22:48 +01:00
parent 6b9dde1ff7
commit 3a1c3510ae

View file

@ -952,19 +952,24 @@ static int CmdHF15Info(const char *Cmd) {
packet->raw[packet->rawlen++] = arg_get_raw_flag(uidlen, unaddressed, scan, add_option); packet->raw[packet->rawlen++] = arg_get_raw_flag(uidlen, unaddressed, scan, add_option);
packet->raw[packet->rawlen++] = ISO15693_GET_SYSTEM_INFO; packet->raw[packet->rawlen++] = ISO15693_GET_SYSTEM_INFO;
if (scan) { if (unaddressed == false) {
if (getUID(true, false, uid) != PM3_SUCCESS) { if (scan) {
PrintAndLogEx(WARNING, "no tag found"); PrintAndLogEx(INFO, "Using scan mode");
free(packet); if (getUID(false, false, uid) != PM3_SUCCESS) {
return PM3_EINVARG; PrintAndLogEx(WARNING, "no tag found");
free(packet);
return PM3_EINVARG;
}
uidlen = HF15_UID_LENGTH;
} }
uidlen = HF15_UID_LENGTH;
}
if (uidlen == HF15_UID_LENGTH) { if (uidlen == HF15_UID_LENGTH) {
// add UID (scan, uid) // add UID (scan, uid)
memcpy(packet->raw + packet->rawlen, uid, uidlen); memcpy(packet->raw + packet->rawlen, uid, uidlen);
packet->rawlen += uidlen; packet->rawlen += uidlen;
}
} else {
PrintAndLogEx(INFO, "Using unaddressed mode");
} }
AddCrc15(packet->raw, packet->rawlen); AddCrc15(packet->raw, packet->rawlen);
@ -998,36 +1003,36 @@ static int CmdHF15Info(const char *Cmd) {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " ---------------------------"); PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " ---------------------------");
PrintAndLogEx(SUCCESS, "TYPE...... " _YELLOW_("%s"), getTagInfo_15(d + 2));
PrintAndLogEx(SUCCESS, "UID....... " _GREEN_("%s"), iso15693_sprintUID(NULL, uid)); PrintAndLogEx(SUCCESS, "UID....... " _GREEN_("%s"), iso15693_sprintUID(NULL, uid));
PrintAndLogEx(SUCCESS, "TYPE...... " _YELLOW_("%s"), getTagInfo_15(d + 2));
PrintAndLogEx(SUCCESS, "SYSINFO... %s", sprint_hex(d, resp.length - 2)); PrintAndLogEx(SUCCESS, "SYSINFO... %s", sprint_hex(d, resp.length - 2));
// DSFID // DSFID
if (d[1] & 0x01) if (d[1] & 0x01)
PrintAndLogEx(SUCCESS, " - DSFID supported [0x%02X]", d[10]); PrintAndLogEx(SUCCESS, " - DSFID.......... 0x%02X", d[10]);
else else
PrintAndLogEx(SUCCESS, " - DSFID not supported"); PrintAndLogEx(SUCCESS, " - DSFID not supported");
// AFI // AFI
if (d[1] & 0x02) if (d[1] & 0x02)
PrintAndLogEx(SUCCESS, " - AFI supported [0x%02X]", d[11]); PrintAndLogEx(SUCCESS, " - AFI............ 0x%02X", d[11]);
else else
PrintAndLogEx(SUCCESS, " - AFI not supported"); PrintAndLogEx(SUCCESS, " - AFI not supported");
// IC reference // IC reference
if (d[1] & 0x08) if (d[1] & 0x08)
PrintAndLogEx(SUCCESS, " - IC reference supported [0x%02X]", d[14]); PrintAndLogEx(SUCCESS, " - IC reference... 0x%02X", d[14]);
else else
PrintAndLogEx(SUCCESS, " - IC reference not supported"); PrintAndLogEx(SUCCESS, " - IC reference not supported");
// memory // memory
if (d[1] & 0x04) { if (d[1] & 0x04) {
PrintAndLogEx(SUCCESS, " - Tag provides info on memory layout (vendor dependent)"); PrintAndLogEx(SUCCESS, " - Tag memory layout (vendor dependent)");
uint8_t blocks = d[12] + 1; uint8_t blocks = d[12] + 1;
uint8_t size = (d[13] & 0x1F); uint8_t size = (d[13] & 0x1F);
PrintAndLogEx(SUCCESS, " %u (or %u) bytes/blocks x %u blocks", size + 1, size, blocks); PrintAndLogEx(SUCCESS, " " _YELLOW_("%u") " ( or " _YELLOW_("%u") " ) bytes/blocks x " _YELLOW_("%u") " blocks", size + 1, size, blocks);
} else { } else {
PrintAndLogEx(SUCCESS, " - Tag does not provide information on memory layout"); PrintAndLogEx(SUCCESS, " - N/A");
} }
// Check if SLIX2 and attempt to get NXP System Information // Check if SLIX2 and attempt to get NXP System Information
@ -1325,34 +1330,16 @@ static void print_blocks_15693(iso15_tag_t *tag, bool dense_output) {
} }
static void print_tag_15693(iso15_tag_t *tag, bool dense_output, bool verbose) { static void print_tag_15693(iso15_tag_t *tag, bool dense_output, bool verbose) {
/*
[=] --- Tag Information ------------------------
[+] UID... E0 16 78 01 10 20 67 E1
[+] TYPE.. EM-Marin SA (Skidata); EM4425 Echo V (du
[+] - DSFID.......... 0x00
[+] - AFI............ 0x00
[+] - IC reference... 0x1E
[+] - Tag memory layout
[+] 8 bytes/blocks x 98 blocks
[=] ----------- Tag Memory ---------------
[=] -----+-------------------------+---+----------
*/
if (verbose) { if (verbose) {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " --%.*s", (tag->bytesPerPage * 3), dashes); PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " --%.*s", (tag->bytesPerPage * 3), dashes);
PrintAndLogEx(SUCCESS, "UID... " _GREEN_("%s"), iso15693_sprintUID(NULL, tag->uid)); PrintAndLogEx(SUCCESS, "UID... " _GREEN_("%s"), iso15693_sprintUID(NULL, tag->uid));
PrintAndLogEx(SUCCESS, "TYPE.. " _YELLOW_("%s"), getTagInfo_15(tag->uid)); PrintAndLogEx(SUCCESS, "TYPE.. " _YELLOW_("%s"), getTagInfo_15(tag->uid));
PrintAndLogEx(SUCCESS, " - DSFID.......... 0x%02X", tag->dsfid); PrintAndLogEx(SUCCESS, " - DSFID.......... 0x%02X", tag->dsfid);
PrintAndLogEx(SUCCESS, " - AFI............ 0x%02X", tag->afi); PrintAndLogEx(SUCCESS, " - AFI............ 0x%02X", tag->afi);
PrintAndLogEx(SUCCESS, " - IC reference... 0x%02X", tag->ic); PrintAndLogEx(SUCCESS, " - IC reference... 0x%02X", tag->ic);
PrintAndLogEx(SUCCESS, " - Tag memory layout"); PrintAndLogEx(SUCCESS, " - Tag memory layout (vendor dependent)");
PrintAndLogEx(SUCCESS, " " _YELLOW_("%u") " bytes/blocks x " _YELLOW_("%u") " blocks", tag->bytesPerPage, tag->pagesCount); PrintAndLogEx(SUCCESS, " " _YELLOW_("%u") " bytes/blocks x " _YELLOW_("%u") " blocks", tag->bytesPerPage, tag->pagesCount);
} }
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");