diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f84700e6..be95a700d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] - - Add colour to `lf hid` commands in cmdlfhid.c + - Add colour to `hf 14a` and `hf mfu` commands (@dunderhay) + - Add colour to `lf hid` commands (@dunderhay) - Change `script run hf_bruteforce -s start_id -e end_id -t timeout -x mifare_card_type` - The hf_bruteforce card script now requires Mifare type (mfc or mfu) (@dunderhay) - Updated `hf_bruteforce.lua` script - added support for brute forcing Mifare Ultralight EV1 cards (@dunderhay) - Added `hf mf personlize` - personalize the UID of a Mifare Classic EV1 card (@pwpiwi) diff --git a/armsrc/lfops.c b/armsrc/lfops.c index b7b928ff2..84bddc192 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -1291,7 +1291,7 @@ void CmdHIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) cardnum = (lo >> 1) & 0x7FFFF; fac = ((hi & 0xF) << 12) | (lo >> 20); } - Dbprintf("TAG ID: " _YELLOW_("%x%08x (%d)") "- Format Len: " _YELLOW_("%d") "bit - FC: " _YELLOW_("%d") "- Card: "_YELLOW_("%d"), + Dbprintf("TAG ID: " _GREEN_("%x%08x (%d)") "- Format Len: " _GREEN_("%d") "bit - FC: " _GREEN_("%d") "- Card: "_GREEN_("%d"), hi, lo, (lo >> 1) & 0xFFFF, diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index c611caa1f..6d52f25e7 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -189,9 +189,9 @@ static int usage_hf_14a_sim(void) { PrintAndLogEx(NORMAL, " e : (Optional) Fill simulator keys from found keys"); PrintAndLogEx(NORMAL, " v : (Optional) Verbose"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf 14a sim t 1 u 11223344 x"); - PrintAndLogEx(NORMAL, " hf 14a sim t 1 u 11223344"); - PrintAndLogEx(NORMAL, " hf 14a sim t 1 u 11223344556677"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf 14a sim t 1 u 11223344 x")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf 14a sim t 1 u 11223344")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf 14a sim t 1 u 11223344556677")); // PrintAndLogEx(NORMAL, " hf 14a sim t 1 u 11223445566778899AA\n"); return 0; } @@ -202,7 +202,7 @@ static int usage_hf_14a_sniff(void) { PrintAndLogEx(NORMAL, "c - triggered by first data from card"); PrintAndLogEx(NORMAL, "r - triggered by first 7-bit request from reader (REQ,WUP,...)"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf 14a sniff c r"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf 14a sniff c r")); return 0; } static int usage_hf_14a_raw(void) { @@ -261,7 +261,7 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) { return 1; } - PrintAndLogEx(SUCCESS, " UID: %s", sprint_hex(card->uid, card->uidlen)); + PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card->uid, card->uidlen)); PrintAndLogEx(SUCCESS, "ATQA: %02x %02x", card->atqa[1], card->atqa[0]); PrintAndLogEx(SUCCESS, " SAK: %02x [%" PRIu64 "]", card->sak, resp.oldarg[0]); if (card->ats_len < 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes @@ -335,17 +335,17 @@ static int CmdHF14AReader(const char *Cmd) { if (select_status == 3) { PrintAndLogEx(INFO, "Card doesn't support standard iso14443-3 anticollision"); - PrintAndLogEx(SUCCESS, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]); + PrintAndLogEx(SUCCESS, "ATQA: %02x %02x", card.atqa[1], card.atqa[0]); DropField(); return 1; } - PrintAndLogEx(SUCCESS, " UID : %s", sprint_hex(card.uid, card.uidlen)); - PrintAndLogEx(SUCCESS, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]); - PrintAndLogEx(SUCCESS, " SAK : %02x [%" PRIu64 "]", card.sak, resp.oldarg[0]); + PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen)); + PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02x %02x"), card.atqa[1], card.atqa[0]); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02x [%" PRIu64 "]"), card.sak, resp.oldarg[0]); if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes - PrintAndLogEx(SUCCESS, " ATS : %s", sprint_hex(card.ats, card.ats_len)); + PrintAndLogEx(SUCCESS, " ATS: " _GREEN_("%s"), sprint_hex(card.ats, card.ats_len)); } if (!disconnectAfter) { @@ -354,7 +354,7 @@ static int CmdHF14AReader(const char *Cmd) { } if (disconnectAfter) { - if (!silent) PrintAndLogEx(SUCCESS, "field dropped."); + if (!silent) PrintAndLogEx(INFO, "field dropped."); } return 0; @@ -467,7 +467,7 @@ int CmdHF14ASim(const char *Cmd) { break; } if (!errors) { - PrintAndLogEx(SUCCESS, "Emulating ISO/IEC 14443 type A tag with %d byte UID (%s)", uidlen, sprint_hex(uid, uidlen)); + PrintAndLogEx(SUCCESS, "Emulating " _YELLOW_("ISO/IEC 14443 type A tag")"with " _GREEN_("%d byte UID (%s)"), uidlen, sprint_hex(uid, uidlen)); useUIDfromEML = false; } cmdp += 2; @@ -485,7 +485,7 @@ int CmdHF14ASim(const char *Cmd) { cmdp++; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -511,7 +511,7 @@ int CmdHF14ASim(const char *Cmd) { SendCommandNG(CMD_HF_ISO14443A_SIMULATE, (uint8_t *)&payload, sizeof(payload)); PacketResponseNG resp; - PrintAndLogEx(SUCCESS, "press pm3-button to abort simulation"); + PrintAndLogEx(INFO, "Press pm3-button to abort simulation"); bool keypress = kbd_enter_pressed(); while (!keypress) { @@ -1276,14 +1276,14 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { if (select_status == 3) { PrintAndLogEx(INFO, "Card doesn't support standard iso14443-3 anticollision"); - PrintAndLogEx(SUCCESS, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]); + PrintAndLogEx(SUCCESS, "ATQA: %02x %02x", card.atqa[1], card.atqa[0]); DropField(); return select_status; } - PrintAndLogEx(SUCCESS, " UID : %s", sprint_hex(card.uid, card.uidlen)); - PrintAndLogEx(SUCCESS, "ATQA : %02x %02x", card.atqa[1], card.atqa[0]); - PrintAndLogEx(SUCCESS, " SAK : %02x [%" PRIu64 "]", card.sak, resp.oldarg[0]); + PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen)); + PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02x %02x"), card.atqa[1], card.atqa[0]); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02x [%" PRIu64 "]"), card.sak, resp.oldarg[0]); bool isMifareClassic = true; switch (card.sak) { @@ -1364,7 +1364,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { // Double & triple sized UID, can be mapped to a manufacturer. if (card.uidlen > 4) { - PrintAndLogEx(SUCCESS, "MANUFACTURER : %s", getTagInfo(card.uid[0])); + PrintAndLogEx(SUCCESS, "MANUFACTURER: " _GREEN_("%s"), getTagInfo(card.uid[0])); } // try to request ATS even if tag claims not to support it @@ -1608,4 +1608,3 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { return select_status; } - diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index c57055e4b..859df4a23 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -1142,4 +1142,3 @@ int readHF14B(bool verbose) { if (verbose) PrintAndLogEx(FAILED, "no 14443-B tag found"); return 0; } - diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index 120db2a9c..ccc749708 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -53,9 +53,10 @@ static int usage_hf_mfu_info(void) { PrintAndLogEx(NORMAL, " l : (optional) swap entered key's endianness"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu info"); - PrintAndLogEx(NORMAL, " hf mfu info k 00112233445566778899AABBCCDDEEFF"); - PrintAndLogEx(NORMAL, " hf mfu info k AABBCCDD"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu info")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu info k 00112233445566778899AABBCCDDEEFF")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu info k AABBCCDD")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -73,10 +74,11 @@ static int usage_hf_mfu_dump(void) { PrintAndLogEx(NORMAL, " q : number of Pages to manually set how many pages to dump"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu dump"); - PrintAndLogEx(NORMAL, " hf mfu dump f myfile"); - PrintAndLogEx(NORMAL, " hf mfu dump k 00112233445566778899AABBCCDDEEFF"); - PrintAndLogEx(NORMAL, " hf mfu dump k AABBCCDD\n"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu dump")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu dump f myfile")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu dump k 00112233445566778899AABBCCDDEEFF")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu dump k AABBCCDD")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -92,9 +94,10 @@ static int usage_hf_mfu_restore(void) { PrintAndLogEx(NORMAL, " f : " _YELLOW_("filename w .bin") "to restore"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu restore s f myfile"); - PrintAndLogEx(NORMAL, " hf mfu restore k AABBCCDD s f myfile\n"); - PrintAndLogEx(NORMAL, " hf mfu restore k AABBCCDD s e r f myfile\n"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu restore s f myfile")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu restore k AABBCCDD s f myfile")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu restore k AABBCCDD s e r f myfile")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -107,9 +110,10 @@ static int usage_hf_mfu_rdbl(void) { PrintAndLogEx(NORMAL, " l : (optional) swap entered key's endianness"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu rdbl b 0"); - PrintAndLogEx(NORMAL, " hf mfu rdbl b 0 k 00112233445566778899AABBCCDDEEFF"); - PrintAndLogEx(NORMAL, " hf mfu rdbl b 0 k AABBCCDD\n"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu rdbl b 0")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu rdbl b 0 k 00112233445566778899AABBCCDDEEFF")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu rdbl b 0 k AABBCCDD")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -123,8 +127,9 @@ static int usage_hf_mfu_wrbl(void) { PrintAndLogEx(NORMAL, " l : (optional) swap entered key's endianness"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu wrbl b 0 d 01234567"); - PrintAndLogEx(NORMAL, " hf mfu wrbl b 0 d 01234567 k AABBCCDD\n"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu wrbl b 0 d 01234567")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu wrbl b 0 d 01234567 k AABBCCDD")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -138,8 +143,10 @@ static int usage_hf_mfu_eload(void) { PrintAndLogEx(NORMAL, " [filename] : without `.eml` (required)"); PrintAndLogEx(NORMAL, " numblocks : number of blocks to load from eml file (optional)"); PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(NORMAL, " sample: hf mfu eload u filename"); - PrintAndLogEx(NORMAL, " hf mfu eload u filename 57"); + PrintAndLogEx(NORMAL, "Examples:"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu eload u filename")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu eload u filename 57")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -153,8 +160,9 @@ static int usage_hf_mfu_sim(void) { PrintAndLogEx(NORMAL, " u : 4 or 7 byte UID (optional)"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu sim t 7"); - PrintAndLogEx(NORMAL, " hf mfu sim t 7 u 1122344556677\n"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu sim t 7")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu sim t 7 u 1122344556677")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -168,8 +176,9 @@ static int usage_hf_mfu_ucauth(void) { PrintAndLogEx(NORMAL, " 5 : all 0xff key"); PrintAndLogEx(NORMAL, " 6 : 0x00-0xFF key"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu cauth k"); - PrintAndLogEx(NORMAL, " hf mfu cauth k 3"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu cauth k")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu cauth k 3")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -179,7 +188,7 @@ static int usage_hf_mfu_ucsetpwd(void) { PrintAndLogEx(NORMAL, " [password] - (32 hex symbols)"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu setpwd 000102030405060708090a0b0c0d0e0f"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu setpwd 000102030405060708090a0b0c0d0e0f")); PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -191,7 +200,7 @@ static int usage_hf_mfu_ucsetuid(void) { PrintAndLogEx(NORMAL, "This only works for " _BLUE_("Magic Ultralight") "tags."); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu setuid 11223344556677"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu setuid 11223344556677")); PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -203,8 +212,8 @@ static int usage_hf_mfu_gendiverse(void) { PrintAndLogEx(NORMAL, " r : read uid from tag"); PrintAndLogEx(NORMAL, " : 4 byte UID (optional)"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu gen r"); - PrintAndLogEx(NORMAL, " hf mfu gen 11223344"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu gen r")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu gen 11223344")); PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -217,9 +226,9 @@ static int usage_hf_mfu_pwdgen(void) { PrintAndLogEx(NORMAL, " r : read uid from tag"); PrintAndLogEx(NORMAL, " : 7 byte UID (optional)"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu pwdgen r"); - PrintAndLogEx(NORMAL, " hf mfu pwdgen 11223344556677"); - PrintAndLogEx(NORMAL, " hf mfu pwdgen t"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu pwdgen r")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu pwdgen 11223344556677")); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu pwdgen t")); PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -230,7 +239,8 @@ static int usage_hf_mfu_otp_tearoff(void) { PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h : this help"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " hf mfu otptear"); + PrintAndLogEx(NORMAL, _YELLOW_(" hf mfu otptear")); + PrintAndLogEx(NORMAL, ""); return PM3_SUCCESS; } @@ -529,43 +539,43 @@ static int ul_print_default(uint8_t *data) { uid[5] = data[6]; uid[6] = data[7]; - PrintAndLogEx(NORMAL, " UID : " _YELLOW_("%s"), sprint_hex(uid, 7)); - PrintAndLogEx(NORMAL, " UID[0] : %02X, %s", uid[0], getTagInfo(uid[0])); + PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(uid, 7)); + PrintAndLogEx(SUCCESS, " UID[0]: %02X, %s", uid[0], getTagInfo(uid[0])); if (uid[0] == 0x05 && ((uid[1] & 0xf0) >> 4) == 2) { // is infineon and 66RxxP uint8_t chip = (data[8] & 0xC7); // 11000111 mask, bit 3,4,5 RFU switch (chip) { case 0xC2: - PrintAndLogEx(NORMAL, " IC type : SLE 66R04P 770 Bytes"); + PrintAndLogEx(SUCCESS, " IC type: SLE 66R04P 770 Bytes"); break; //77 pages case 0xC4: - PrintAndLogEx(NORMAL, " IC type : SLE 66R16P 2560 Bytes"); + PrintAndLogEx(SUCCESS, " IC type: SLE 66R16P 2560 Bytes"); break; //256 pages case 0xC6: - PrintAndLogEx(NORMAL, " IC type : SLE 66R32P 5120 Bytes"); + PrintAndLogEx(SUCCESS, " IC type: SLE 66R32P 5120 Bytes"); break; //512 pages /2 sectors } } // CT (cascade tag byte) 0x88 xor SN0 xor SN1 xor SN2 int crc0 = 0x88 ^ uid[0] ^ uid[1] ^ uid[2]; if (data[3] == crc0) - PrintAndLogEx(NORMAL, " BCC0 : %02X ( " _GREEN_("ok") ")", data[3]); + PrintAndLogEx(SUCCESS, " BCC0: %02X ( " _GREEN_("ok") ")", data[3]); else - PrintAndLogEx(NORMAL, " BCC0 : %02X, crc should be %02X", data[3], crc0); + PrintAndLogEx(NORMAL, " BCC0: %02X, crc should be %02X", data[3], crc0); int crc1 = uid[3] ^ uid[4] ^ uid[5] ^ uid[6]; if (data[8] == crc1) - PrintAndLogEx(NORMAL, " BCC1 : %02X ( " _GREEN_("ok") ")", data[8]); + PrintAndLogEx(SUCCESS, " BCC1: %02X ( " _GREEN_("ok") ")", data[8]); else - PrintAndLogEx(NORMAL, " BCC1 : %02X, crc should be %02X", data[8], crc1); + PrintAndLogEx(NORMAL, " BCC1: %02X, crc should be %02X", data[8], crc1); - PrintAndLogEx(NORMAL, " Internal : %02X ( %s)", data[9], (data[9] == 0x48) ? _GREEN_("default") : _RED_("not default") ); + PrintAndLogEx(SUCCESS, " Internal: %02X ( %s)", data[9], (data[9] == 0x48) ? _GREEN_("default") : _RED_("not default") ); - PrintAndLogEx(NORMAL, " Lock : %s - %s", + PrintAndLogEx(SUCCESS, " Lock: %s - %s", sprint_hex(data + 10, 2), sprint_bin(data + 10, 2) ); - PrintAndLogEx(NORMAL, "OneTimePad : %s - %s\n", + PrintAndLogEx(SUCCESS, "OneTimePad : %s - %s\n", sprint_hex(data + 12, 4), sprint_bin(data + 12, 4) ); @@ -669,57 +679,57 @@ int ul_print_type(uint32_t tagtype, uint8_t spaces) { char *spacer = spc + (10 - spaces); if (tagtype & UL) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight (MF0ICU1) %s", spacer, (tagtype & MAGIC) ? "" : ""); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("MIFARE Ultralight (MF0ICU1) %s"), spacer, (tagtype & MAGIC) ? "" : ""); else if (tagtype & UL_C) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight C (MF0ULC) %s", spacer, (tagtype & MAGIC) ? "" : ""); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("MIFARE Ultralight C (MF0ULC) %s"), spacer, (tagtype & MAGIC) ? "" : ""); else if (tagtype & UL_NANO_40) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight Nano 40bytes (MF0UNH00)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("MIFARE Ultralight Nano 40bytes (MF0UNH00)"), spacer); else if (tagtype & UL_EV1_48) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight EV1 48bytes (MF0UL1101)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("MIFARE Ultralight EV1 48bytes (MF0UL1101)"), spacer); else if (tagtype & UL_EV1_128) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight EV1 128bytes (MF0UL2101)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("MIFARE Ultralight EV1 128bytes (MF0UL2101)"), spacer); else if (tagtype & UL_EV1) - PrintAndLogEx(NORMAL, "%sTYPE : MIFARE Ultralight EV1 UNKNOWN", spacer); + PrintAndLogEx(NORMAL, "%sTYPE: " _YELLOW_("MIFARE Ultralight EV1 UNKNOWN"), spacer); else if (tagtype & NTAG) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG UNKNOWN", spacer); + PrintAndLogEx(NORMAL, "%sTYPE: " _YELLOW_("NTAG UNKNOWN"), spacer); else if (tagtype & NTAG_203) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 203 144bytes (NT2H0301F0DT)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 203 144bytes (NT2H0301F0DT)"), spacer); else if (tagtype & NTAG_210) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 210 48bytes (NT2L1011G0DU)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 210 48bytes (NT2L1011G0DU)"), spacer); else if (tagtype & NTAG_212) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 212 128bytes (NT2L1211G0DU)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 212 128bytes (NT2L1211G0DU)"), spacer); else if (tagtype & NTAG_213) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 213 144bytes (NT2H1311G0DU)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 213 144bytes (NT2H1311G0DU)"), spacer); else if (tagtype & NTAG_213_F) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 213F 144bytes (NT2H1311F0DTL)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 213F 144bytes (NT2H1311F0DTL)"), spacer); else if (tagtype & NTAG_215) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 215 504bytes (NT2H1511G0DU)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 215 504bytes (NT2H1511G0DU)"), spacer); else if (tagtype & NTAG_216) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 216 888bytes (NT2H1611G0DU)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 216 888bytes (NT2H1611G0DU)"), spacer); else if (tagtype & NTAG_216_F) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG 216F 888bytes (NT2H1611F0DTL)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG 216F 888bytes (NT2H1611F0DTL)"), spacer); else if (tagtype & NTAG_I2C_1K) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG I2C 888bytes (NT3H1101FHK)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG I2C 888bytes (NT3H1101FHK)"), spacer); else if (tagtype & NTAG_I2C_2K) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG I2C 1904bytes (NT3H1201FHK)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG I2C 1904bytes (NT3H1201FHK)"), spacer); else if (tagtype & NTAG_I2C_1K_PLUS) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG I2C plus 888bytes (NT3H2111FHK)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG I2C plus 888bytes (NT3H2111FHK)"), spacer); else if (tagtype & NTAG_I2C_2K_PLUS) - PrintAndLogEx(NORMAL, "%sTYPE : NTAG I2C plus 1912bytes (NT3H2211FHK)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("NTAG I2C plus 1912bytes (NT3H2211FHK)"), spacer); else if (tagtype & MY_D) - PrintAndLogEx(NORMAL, "%sTYPE : INFINEON my-d\x99 (SLE 66RxxS)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("INFINEON my-d\x99 (SLE 66RxxS)"), spacer); else if (tagtype & MY_D_NFC) - PrintAndLogEx(NORMAL, "%sTYPE : INFINEON my-d\x99 NFC (SLE 66RxxP)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("INFINEON my-d\x99 NFC (SLE 66RxxP)"), spacer); else if (tagtype & MY_D_MOVE) - PrintAndLogEx(NORMAL, "%sTYPE : INFINEON my-d\x99 move (SLE 66R01P)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("INFINEON my-d\x99 move (SLE 66R01P)"), spacer); else if (tagtype & MY_D_MOVE_NFC) - PrintAndLogEx(NORMAL, "%sTYPE : INFINEON my-d\x99 move NFC (SLE 66R01P)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("INFINEON my-d\x99 move NFC (SLE 66R01P)"), spacer); else if (tagtype & MY_D_MOVE_LEAN) - PrintAndLogEx(NORMAL, "%sTYPE : INFINEON my-d\x99 move lean (SLE 66R01L)", spacer); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("INFINEON my-d\x99 move lean (SLE 66R01L)"), spacer); else if (tagtype & FUDAN_UL) - PrintAndLogEx(NORMAL, "%sTYPE : FUDAN Ultralight Compatible (or other compatible) %s", spacer, (tagtype & MAGIC) ? "" : ""); + PrintAndLogEx(SUCCESS, "%sTYPE: " _GREEN_("FUDAN Ultralight Compatible (or other compatible) %s"), spacer, (tagtype & MAGIC) ? "" : ""); else - PrintAndLogEx(NORMAL, "%sTYPE : Unknown %06x", spacer, tagtype); + PrintAndLogEx(NORMAL, "%sTYPE: " _YELLOW_("Unknown %06x"), spacer, tagtype); return PM3_SUCCESS; } @@ -896,14 +906,14 @@ static int ulev1_print_signature(TagTypeUL_t tagtype, uint8_t *uid, uint8_t *sig static int ulev1_print_version(uint8_t *data) { PrintAndLogEx(NORMAL, "\n--- Tag Version"); - PrintAndLogEx(NORMAL, " Raw bytes : %s", sprint_hex(data, 8)); - PrintAndLogEx(NORMAL, " Vendor ID : %02X, %s", data[1], getTagInfo(data[1])); - PrintAndLogEx(NORMAL, " Product type : %s", getProductTypeStr(data[2])); - PrintAndLogEx(NORMAL, " Product subtype : %02X, %s", data[3], (data[3] == 1) ? "17 pF" : "50pF"); - PrintAndLogEx(NORMAL, " Major version : %02X", data[4]); - PrintAndLogEx(NORMAL, " Minor version : %02X", data[5]); - PrintAndLogEx(NORMAL, " Size : %s", getUlev1CardSizeStr(data[6])); - PrintAndLogEx(NORMAL, " Protocol type : %02X %s", data[7], (data[7] == 0x3) ? "(ISO14443-3 Compliant)" : ""); + PrintAndLogEx(NORMAL, " Raw bytes: %s", sprint_hex(data, 8)); + PrintAndLogEx(NORMAL, " Vendor ID: %02X, %s", data[1], getTagInfo(data[1])); + PrintAndLogEx(NORMAL, " Product type: %s", getProductTypeStr(data[2])); + PrintAndLogEx(NORMAL, " Product subtype: %02X, %s", data[3], (data[3] == 1) ? "17 pF" : "50pF"); + PrintAndLogEx(NORMAL, " Major version: %02X", data[4]); + PrintAndLogEx(NORMAL, " Minor version: %02X", data[5]); + PrintAndLogEx(NORMAL, " Size: %s", getUlev1CardSizeStr(data[6])); + PrintAndLogEx(NORMAL, " Protocol type: %02X %s", data[7], (data[7] == 0x3) ? "(ISO14443-3 Compliant)" : ""); return PM3_SUCCESS; } @@ -1112,7 +1122,7 @@ static int CmdHF14AMfUInfo(const char *Cmd) { cmdp++; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -1273,7 +1283,8 @@ static int CmdHF14AMfUInfo(const char *Cmd) { // 1-7 = limit. No automatic tries then. // hasAuthKey, if we was called with key, skip test. if (!authlim && !hasAuthKey) { - PrintAndLogEx(NORMAL, "\n--- Known EV1/NTAG passwords."); + PrintAndLogEx(NORMAL, ""); + PrintAndLogEx(SUCCESS, _GREEN_("--- Known EV1/NTAG passwords ---")); // test pwd gen A num_to_bytes(ul_ev1_pwdgenA(card.uid), 4, key); len = ulev1_requestAuthentication(key, pack, sizeof(pack)); @@ -1324,7 +1335,7 @@ static int CmdHF14AMfUInfo(const char *Cmd) { if (ul_auth_select(&card, tagtype, hasAuthKey, authkeyptr, pack, sizeof(pack)) == PM3_ESOFT) return PM3_ESOFT; } } - if (len < 1) PrintAndLogEx(WARNING, "password not known"); + if (len < 1) PrintAndLogEx(WARNING, _YELLOW_("password not known")); } } out: @@ -1397,7 +1408,7 @@ static int CmdHF14AMfUWrBl(const char *Cmd) { cmdp += 2; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -1511,7 +1522,7 @@ static int CmdHF14AMfURdBl(const char *Cmd) { cmdp++; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -1781,7 +1792,7 @@ static int CmdHF14AMfUDump(const char *Cmd) { manualPages = true; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -2022,7 +2033,7 @@ static int CmdHF14AMfURestore(const char *Cmd) { read_key = true; break; default: - PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); + PrintAndLogEx(WARNING, "Unknown parameter: " _RED_("'%c'"), param_getchar(Cmd, cmdp)); errors = true; break; } @@ -2673,4 +2684,3 @@ int CmdHFMFUltra(const char *Cmd) { clearCommandBuffer(); return CmdsParse(CommandTable, Cmd); } - diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index ea76d3fd2..b5d449623 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -50,7 +50,7 @@ static int usage_lf_hid_watch(void) { PrintAndLogEx(NORMAL, "Usage: lf hid watch"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " lf hid watch"); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid watch")); return PM3_SUCCESS; } static int usage_lf_hid_sim(void) { @@ -62,11 +62,11 @@ static int usage_lf_hid_sim(void) { PrintAndLogEx(NORMAL, " h - This help"); PrintAndLogEx(NORMAL, " ID - HID id"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " lf hid sim 2006ec0c86"); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid sim 2006ec0c86")); return PM3_SUCCESS; } static int usage_lf_hid_clone(void) { - PrintAndLogEx(NORMAL, "Clone HID to T55x7. Tag must be on antenna. "); + PrintAndLogEx(NORMAL, "Clone HID to T55x7. " _BLUE_("Tag must be on antenna!")); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Usage: lf hid clone [h] [l] ID"); PrintAndLogEx(NORMAL, "Options:"); @@ -74,8 +74,8 @@ static int usage_lf_hid_clone(void) { PrintAndLogEx(NORMAL, " l - 84bit ID"); PrintAndLogEx(NORMAL, " ID - HID id"); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " lf hid clone 2006ec0c86"); - PrintAndLogEx(NORMAL, " lf hid clone l 2006ec0c86"); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid clone 2006ec0c86")); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid clone l 2006ec0c86")); return PM3_SUCCESS; } static int usage_lf_hid_brute(void) { @@ -97,9 +97,9 @@ static int usage_lf_hid_brute(void) { PrintAndLogEx(NORMAL, " down : direction to decrement card number. (default is both directions)"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); - PrintAndLogEx(NORMAL, " lf hid brute w H10301 f 224"); - PrintAndLogEx(NORMAL, " lf hid brute w H10301 f 21 d 2000"); - PrintAndLogEx(NORMAL, " lf hid brute v w H10301 f 21 c 200 d 2000"); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid brute w H10301 f 224")); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid brute w H10301 f 21 d 2000")); + PrintAndLogEx(NORMAL, _YELLOW_(" lf hid brute v w H10301 f 21 c 200 d 2000")); return PM3_SUCCESS; } @@ -268,6 +268,8 @@ static int CmdHIDWatch(const char *Cmd) { if (ctmp == 'h') return usage_lf_hid_watch(); clearCommandBuffer(); SendCommandNG(CMD_LF_HID_DEMOD, NULL, 0); + PrintAndLogEx(SUCCESS, "Watching for new HID cards - place tag on antenna"); + PrintAndLogEx(INFO, "Press pm3-button to stop reading new cards"); return PM3_SUCCESS; } @@ -299,7 +301,7 @@ static int CmdHIDSim(const char *Cmd) { hi2 = 0; } - PrintAndLogEx(SUCCESS, "Press pm3-button to abort simulation"); + PrintAndLogEx(INFO, "Press pm3-button to abort simulation"); payload.hi2 = hi2; payload.hi = hi;