diff --git a/client/cmdanalyse.c b/client/cmdanalyse.c index 9b326f961..892312cfa 100644 --- a/client/cmdanalyse.c +++ b/client/cmdanalyse.c @@ -555,10 +555,10 @@ int CmdAnalyseA(const char *Cmd) PrintAndLogEx(NORMAL, "got ack. Status %d", resp.arg[0]); return 0; - PrintAndLogEx(NORMAL, "-- " _BLUE_(its my message) "\n"); - PrintAndLogEx(NORMAL, "-- " _RED_(its my message) "\n"); - PrintAndLogEx(NORMAL, "-- " _YELLOW_(its my message) "\n"); - PrintAndLogEx(NORMAL, "-- " _GREEN_(its my message) "\n"); + PrintAndLogEx(NORMAL, "-- " _BLUE_("its my message") "\n"); + PrintAndLogEx(NORMAL, "-- " _RED_("its my message") "\n"); + PrintAndLogEx(NORMAL, "-- " _YELLOW_("its my message") "\n"); + PrintAndLogEx(NORMAL, "-- " _GREEN_("its my message") "\n"); //uint8_t syncBit = 99; // The start bit is one ore more Sequence Y followed by a Sequence Z (... 11111111 00x11111). We need to distinguish from @@ -911,12 +911,12 @@ int CmdAnalyseNuid(const char *Cmd) generate4bNUID(uid, nuid); bool test1 = (0 == memcmp(nuid, "\x8f\x43\x0f\xef", 4)); - PrintAndLogEx(SUCCESS, "Selftest1 %s\n", test1 ? _GREEN_(OK) : _RED_(Fail)); + PrintAndLogEx(SUCCESS, "Selftest1 %s\n", test1 ? _GREEN_("OK") : _RED_("Fail")); memcpy(uid, "\x04\x18\x3f\x09\x32\x1b\x85", 7); generate4bNUID(uid, nuid); bool test2 = (0 == memcmp(nuid, "\x4f\x50\x5d\x7d", 4)); - PrintAndLogEx(SUCCESS, "Selftest2 %s\n", test2 ? _GREEN_(OK) : _RED_(Fail)); + PrintAndLogEx(SUCCESS, "Selftest2 %s\n", test2 ? _GREEN_("OK") : _RED_("Fail")); return 0; } diff --git a/client/cmddata.c b/client/cmddata.c index 1fd01a3ae..2877ca0c8 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -1605,14 +1605,14 @@ int CmdTuneSamples(const char *Cmd) memset(judgement, 0, sizeof(judgement)); // LF evaluation if (peakv < LF_UNUSABLE_V) - sprintf(judgement, _RED_(UNUSABLE)); + sprintf(judgement, _RED_("UNUSABLE")); else if (peakv < LF_MARGINAL_V) - sprintf(judgement, _YELLOW_(MARGINAL)); + sprintf(judgement, _YELLOW_("MARGINAL")); else - sprintf(judgement, _GREEN_(OK)); + sprintf(judgement, _GREEN_("OK")); PrintAndLogEx(NORMAL, "%sLF antenna is %s \n" - , (peakv < LF_UNUSABLE_V) ? _CYAN_([!]) : _GREEN_([+]) + , (peakv < LF_UNUSABLE_V) ? _CYAN_("[!]") : _GREEN_("[+]") , judgement ); @@ -1623,14 +1623,14 @@ int CmdTuneSamples(const char *Cmd) memset(judgement, 0, sizeof(judgement)); if (v_hf < HF_UNUSABLE_V) - sprintf(judgement, _RED_(UNUSABLE)); + sprintf(judgement, _RED_("UNUSABLE")); else if (v_hf < HF_MARGINAL_V) - sprintf(judgement, _YELLOW_(MARGINAL)); + sprintf(judgement, _YELLOW_("MARGINAL")); else - sprintf(judgement, _GREEN_(OK)); + sprintf(judgement, _GREEN_("OK")); PrintAndLogEx(NORMAL, "%sHF antenna is %s" - , (v_hf < HF_UNUSABLE_V) ? _CYAN_([!]) : _GREEN_([+]) + , (v_hf < HF_UNUSABLE_V) ? _CYAN_("[!]") : _GREEN_("[+]") , judgement ); diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 009ca4f8c..89e88232b 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -651,11 +651,11 @@ int CmdHF14AInfo(const char *Cmd) if (isMifareClassic) { int res = detect_classic_prng(); if (res == 1) - PrintAndLogEx(SUCCESS, "Prng detection: " _GREEN_(WEAK)); + PrintAndLogEx(SUCCESS, "Prng detection: " _GREEN_("WEAK")); else if (res == 0) - PrintAndLogEx(SUCCESS, "Prng detection: " _YELLOW_(HARD)); + PrintAndLogEx(SUCCESS, "Prng detection: " _YELLOW_("HARD")); else - PrintAndLogEx(FAILED, "prng detection: " _RED_(failed)); + PrintAndLogEx(FAILED, "prng detection: " _RED_("failed")); if (do_nack_test) detect_classic_nackbug(silent); diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 3a2fe28f0..193290297 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -723,7 +723,7 @@ int CmdHF15Dump(const char *Cmd) } // detect blocksize from card :) - PrintAndLogEx(NORMAL, "Reading memory from tag UID " _YELLOW_( % s), sprintUID(NULL, uid)); + PrintAndLogEx(NORMAL, "Reading memory from tag UID " _YELLOW_("%s"), sprintUID(NULL, uid)); int blocknum = 0; uint8_t *recv = NULL; diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index 0fc95a586..fa3fe9515 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -654,7 +654,7 @@ int CmdHFiClassELoad(const char *Cmd) FILE *f = fopen(filename, "rb"); if (!f) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return 1; } @@ -2325,7 +2325,7 @@ int LoadDictionaryKeyFile(char *filename, uint8_t **keys, int *keycnt) int keyitems = 0; if (!(f = fopen(filename, "r"))) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return 1; } @@ -2363,7 +2363,7 @@ int LoadDictionaryKeyFile(char *filename, uint8_t **keys, int *keycnt) memset(buf, 0, sizeof(buf)); } fclose(f); - PrintAndLogEx(SUCCESS, "Loaded " _GREEN_( % 2d) " keys from %s", *keycnt, filename); + PrintAndLogEx(SUCCESS, "Loaded " _GREEN_("%2d") " keys from %s", *keycnt, filename); return 0; } diff --git a/client/cmdhflist.c b/client/cmdhflist.c index 09de4d1ec..bd78c543b 100644 --- a/client/cmdhflist.c +++ b/client/cmdhflist.c @@ -1079,7 +1079,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes PrintAndLogEx(NORMAL, " | | * |%49s %012"PRIx64" prng %s | |", "key", mfLastKey, - validate_prng_nonce(AuthData.nt) ? _GREEN_(WEAK) : _YELLOW_(HARD)); + validate_prng_nonce(AuthData.nt) ? _GREEN_("WEAK") : _YELLOW_("HARD")); AuthData.first_auth = false; diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 387f11538..648bd0988 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -803,7 +803,7 @@ int CmdHF14AMfDump(const char *Cmd) } if ((f = fopen(keyFilename, "rb")) == NULL) { - PrintAndLogEx(WARNING, "Could not find file " _YELLOW_( % s), keyFilename); + PrintAndLogEx(WARNING, "Could not find file " _YELLOW_("%s"), keyFilename); return 1; } @@ -1013,7 +1013,7 @@ int CmdHF14AMfRestore(const char *Cmd) } if ((fkeys = fopen(keyFilename, "rb")) == NULL) { - PrintAndLogEx(WARNING, "Could not find file " _YELLOW_( % s), keyFilename); + PrintAndLogEx(WARNING, "Could not find file " _YELLOW_("%s"), keyFilename); return 1; } @@ -1021,7 +1021,7 @@ int CmdHF14AMfRestore(const char *Cmd) for (sectorNo = 0; sectorNo < numSectors; sectorNo++) { bytes_read = fread(keyA[sectorNo], 1, 6, fkeys); if (bytes_read != 6) { - PrintAndLogEx(WARNING, "File reading error " _YELLOW_( % s), keyFilename); + PrintAndLogEx(WARNING, "File reading error " _YELLOW_("%s"), keyFilename); fclose(fkeys); return 2; } @@ -1030,7 +1030,7 @@ int CmdHF14AMfRestore(const char *Cmd) for (sectorNo = 0; sectorNo < numSectors; sectorNo++) { bytes_read = fread(keyB[sectorNo], 1, 6, fkeys); if (bytes_read != 6) { - PrintAndLogEx(WARNING, "File reading error " _YELLOW_( % s), keyFilename); + PrintAndLogEx(WARNING, "File reading error " _YELLOW_("%s"), keyFilename); fclose(fkeys); return 2; } @@ -1047,10 +1047,10 @@ int CmdHF14AMfRestore(const char *Cmd) } if ((fdump = fopen(dataFilename, "rb")) == NULL) { - PrintAndLogEx(WARNING, "Could not find file " _YELLOW_( % s), dataFilename); + PrintAndLogEx(WARNING, "Could not find file " _YELLOW_("%s"), dataFilename); return 1; } - PrintAndLogEx(INFO, "Restoring " _YELLOW_( % s)" to card", dataFilename); + PrintAndLogEx(INFO, "Restoring " _YELLOW_("%s")" to card", dataFilename); for (sectorNo = 0; sectorNo < numSectors; sectorNo++) { for (blockNo = 0; blockNo < NumBlocksPerSector(sectorNo); blockNo++) { @@ -1058,7 +1058,7 @@ int CmdHF14AMfRestore(const char *Cmd) memcpy(c.d.asBytes, key, 6); bytes_read = fread(bldata, 1, 16, fdump); if (bytes_read != 16) { - PrintAndLogEx(WARNING, "File reading error " _YELLOW_( % s), dataFilename); + PrintAndLogEx(WARNING, "File reading error " _YELLOW_("%s"), dataFilename); fclose(fdump); fdump = NULL; return 2; @@ -1334,12 +1334,12 @@ int CmdHF14AMfNested(const char *Cmd) } if ((fkeys = fopen(fptr, "wb")) == NULL) { - PrintAndLogEx(WARNING, "could not create file " _YELLOW_( % s), fptr); + PrintAndLogEx(WARNING, "could not create file " _YELLOW_("%s"), fptr); free(e_sector); return 1; } - PrintAndLogEx(SUCCESS, "saving keys to binary file " _YELLOW_( % s), fptr); + PrintAndLogEx(SUCCESS, "saving keys to binary file " _YELLOW_("%s"), fptr); for (i = 0; i < SectorsCnt; i++) { if (e_sector[i].foundKey[0]) { num_to_bytes(e_sector[i].Key[0], 6, tempkey); @@ -1654,7 +1654,7 @@ int CmdHF14AMfChk_fast(const char *Cmd) f = fopen(filename, "r"); if (!f) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); continue; } @@ -1668,7 +1668,7 @@ int CmdHF14AMfChk_fast(const char *Cmd) if (buf[0] == '#') continue; //The line start with # is comment, skip if (!isxdigit(buf[0])) { - PrintAndLogEx(FAILED, "File content error. '" _YELLOW_( % s)"' must include 12 HEX symbols", buf); + PrintAndLogEx(FAILED, "File content error. '" _YELLOW_("%s")"' must include 12 HEX symbols", buf); continue; } @@ -1690,7 +1690,7 @@ int CmdHF14AMfChk_fast(const char *Cmd) memset(buf, 0, sizeof(buf)); } fclose(f); - PrintAndLogEx(SUCCESS, "Loaded %2d keys from " _YELLOW_( % s), keycnt, filename); + PrintAndLogEx(SUCCESS, "Loaded %2d keys from " _YELLOW_("%s"), keycnt, filename); } } @@ -1794,12 +1794,12 @@ out: FILE *fkeys = fopen(fptr, "wb"); if (fkeys == NULL) { - PrintAndLogEx(WARNING, "Could not create file " _YELLOW_( % s), fptr); + PrintAndLogEx(WARNING, "Could not create file " _YELLOW_("%s"), fptr); free(keyBlock); free(e_sector); return 1; } - PrintAndLogEx(SUCCESS, "Printing keys to binary file " _YELLOW_( % s)"...", fptr); + PrintAndLogEx(SUCCESS, "Printing keys to binary file " _YELLOW_("%s")"...", fptr); for (i = 0; i < sectorsCnt; i++) { num_to_bytes(e_sector[i].Key[0], 6, tempkey); @@ -1812,7 +1812,7 @@ out: } fclose(fkeys); - PrintAndLogEx(SUCCESS, "Found keys have been dumped to " _YELLOW_( % s)" --> 0xffffffffffff has been inserted for unknown keys.", fptr); + PrintAndLogEx(SUCCESS, "Found keys have been dumped to " _YELLOW_("%s")" --> 0xffffffffffff has been inserted for unknown keys.", fptr); } } @@ -1914,7 +1914,7 @@ int CmdHF14AMfChk(const char *Cmd) f = fopen(filename, "r"); if (!f) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); continue; } @@ -1929,7 +1929,7 @@ int CmdHF14AMfChk(const char *Cmd) // codesmell, only checks first char? if (!isxdigit(buf[0])) { - PrintAndLogEx(FAILED, "File content error. '" _YELLOW_( % s)"' must include 12 HEX symbols", buf); + PrintAndLogEx(FAILED, "File content error. '" _YELLOW_("%s")"' must include 12 HEX symbols", buf); continue; } @@ -1952,7 +1952,7 @@ int CmdHF14AMfChk(const char *Cmd) memset(buf, 0, sizeof(buf)); } fclose(f); - PrintAndLogEx(SUCCESS, "Loaded %2d keys from " _YELLOW_( % s), keycnt, filename); + PrintAndLogEx(SUCCESS, "Loaded %2d keys from " _YELLOW_("%s"), keycnt, filename); } } @@ -2086,12 +2086,12 @@ out: FILE *fkeys = fopen(fptr, "wb"); if (fkeys == NULL) { - PrintAndLogEx(WARNING, "Could not create file " _YELLOW_( % s), fptr); + PrintAndLogEx(WARNING, "Could not create file " _YELLOW_("%s"), fptr); free(keyBlock); free(e_sector); return 1; } - PrintAndLogEx(INFO, "Printing keys to binary file " _YELLOW_( % s)"...", fptr); + PrintAndLogEx(INFO, "Printing keys to binary file " _YELLOW_("%s")"...", fptr); for (i = 0; i < SectorsCnt; i++) { num_to_bytes(e_sector[i].Key[0], 6, tempkey); @@ -2102,7 +2102,7 @@ out: fwrite(tempkey, 1, 6, fkeys); } fclose(fkeys); - PrintAndLogEx(SUCCESS, "Found keys have been dumped to file " _YELLOW_( % s)". 0xffffffffffff has been inserted for unknown keys.", fptr); + PrintAndLogEx(SUCCESS, "Found keys have been dumped to file " _YELLOW_("%s")". 0xffffffffffff has been inserted for unknown keys.", fptr); } free(keyBlock); @@ -2645,7 +2645,7 @@ int CmdHF14AMfELoad(const char *Cmd) return 4; } } - PrintAndLogEx(SUCCESS, "Loaded %d blocks from file: " _YELLOW_( % s), blockNum, filename); + PrintAndLogEx(SUCCESS, "Loaded %d blocks from file: " _YELLOW_("%s"), blockNum, filename); free(data); return 0; } @@ -3272,7 +3272,7 @@ int CmdHF14AMfice(const char *Cmd) PrintAndLogEx(NORMAL, "Collecting %u nonces \n", limit); if ((fnonces = fopen(filename, "wb")) == NULL) { - PrintAndLogEx(WARNING, "Could not create file " _YELLOW_( % s), filename); + PrintAndLogEx(WARNING, "Could not create file " _YELLOW_("%s"), filename); return 3; } diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index efc1f4f2a..e925efe6b 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -2119,7 +2119,7 @@ int CmdHF14AMfURestore(const char *Cmd) if (errors || cmdp == 0) return usage_hf_mfu_restore(); if ((f = fopen(filename, "rb")) == NULL) { - PrintAndLogEx(WARNING, "Could not find file " _YELLOW_( % s), filename); + PrintAndLogEx(WARNING, "Could not find file " _YELLOW_("%s"), filename); return 1; } @@ -2149,7 +2149,7 @@ int CmdHF14AMfURestore(const char *Cmd) return 1; } - PrintAndLogEx(INFO, "Restoring " _YELLOW_( % s)" to card", filename); + PrintAndLogEx(INFO, "Restoring " _YELLOW_("%s")" to card", filename); mfu_dump_t *mem = (mfu_dump_t *)dump; uint8_t pages = (bytes_read - 48) / 4; diff --git a/client/cmdlf.c b/client/cmdlf.c index 30ad0cdc2..02d020b53 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -853,7 +853,7 @@ bool CheckChipType(bool getDeviceData) uint32_t word = 0; if (EM4x05IsBlock0(&word)) { PrintAndLogEx(SUCCESS, "\nValid EM4x05/EM4x69 Chip Found"); - PrintAndLogEx(SUCCESS, "Try " _YELLOW_(`lf em 4x05`) " commands"); + PrintAndLogEx(SUCCESS, "Try " _YELLOW_("`lf em 4x05`") " commands"); retval = true; goto out; } @@ -861,7 +861,7 @@ bool CheckChipType(bool getDeviceData) //check for t55xx chip... if (tryDetectP1(true)) { PrintAndLogEx(SUCCESS, "\nValid T55xx Chip Found"); - PrintAndLogEx(SUCCESS, "Try " _YELLOW_(`lf t55xx`)" commands"); + PrintAndLogEx(SUCCESS, "Try " _YELLOW_("`lf t55xx`")" commands"); retval = true; goto out; } @@ -896,7 +896,7 @@ int CmdLFfind(const char *Cmd) PrintAndLogEx(INFO, "NOTE: some demods output possible binary"); PrintAndLogEx(INFO, "if it finds something that looks like a tag"); - PrintAndLogEx(INFO, "False Positives " _YELLOW_(ARE) "possible\n"); + PrintAndLogEx(INFO, "False Positives " _YELLOW_("ARE") "possible\n"); PrintAndLogEx(INFO, "\nChecking for known tags:\n"); // only run these tests if device is online diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index 011299b68..343b669ec 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -788,7 +788,7 @@ uint32_t OutputEM4x50_Block(uint8_t *BitStream, size_t size, bool verbose, bool ); } - PrintAndLogEx(SUCCESS, "Parity checks | %s", (pTest) ? _GREEN_(Passed) : _RED_(Failed)); + PrintAndLogEx(SUCCESS, "Parity checks | %s", (pTest) ? _GREEN_("Passed") : _RED_("Failed")); } return code; } @@ -978,7 +978,7 @@ int EM4x50Read(const char *Cmd, bool verbose) //print full code: if (verbose || g_debugMode || AllPTest) { if (!complete) { - PrintAndLogEx(NORMAL, _RED_(* **Warning!)); + PrintAndLogEx(NORMAL, _RED_("* **Warning!")); PrintAndLogEx(NORMAL, "Partial data - no end found!"); PrintAndLogEx(NORMAL, "Try again with more samples."); } @@ -988,10 +988,10 @@ int EM4x50Read(const char *Cmd, bool verbose) PrintAndLogEx(NORMAL, "Block %d: %08x", block, Code[block]); } - PrintAndLogEx(NORMAL, "Parities checks | %s", (AllPTest) ? _GREEN_(Passed) : _RED_(Failed)); + PrintAndLogEx(NORMAL, "Parities checks | %s", (AllPTest) ? _GREEN_("Passed") : _RED_("Failed")); if (AllPTest == 0) { - PrintAndLogEx(NORMAL, "Try cleaning the read samples with " _YELLOW_('data askedge')); + PrintAndLogEx(NORMAL, "Try cleaning the read samples with " _YELLOW_("'data askedge'")); } } @@ -1223,7 +1223,7 @@ int CmdEM4x05Dump(const char *Cmd) if (usePwd) { PrintAndLogEx(NORMAL, " %02u | %08X", addr, pwd, word); } else { - PrintAndLogEx(NORMAL, " 02 | " _RED_(cannot read)); + PrintAndLogEx(NORMAL, " 02 | " _RED_("cannot read")); } } else { success &= EM4x05ReadWord_ext(addr, pwd, usePwd, &word); @@ -1260,7 +1260,7 @@ int CmdEM4x05Read(const char *Cmd) if (isOk) PrintAndLogEx(NORMAL, "Address %02d | %08X - %s", addr, word, (addr > 13) ? "Lock" : ""); else - PrintAndLogEx(NORMAL, "Read Address %02d | " _RED_(failed), addr); + PrintAndLogEx(NORMAL, "Read Address %02d | " _RED_("failed"), addr); return isOk; } @@ -1307,9 +1307,9 @@ int CmdEM4x05Write(const char *Cmd) uint32_t dummy = 0; int isOk = demodEM4x05resp(&dummy); if (isOk) - PrintAndLogEx(NORMAL, "Write " _GREEN_(Verified)); + PrintAndLogEx(NORMAL, "Write " _GREEN_("Verified")); else - PrintAndLogEx(NORMAL, "Write could " _RED_(not) "be verified"); + PrintAndLogEx(NORMAL, "Write could " _RED_("not") "be verified"); return isOk; } diff --git a/client/cmdlffdx.c b/client/cmdlffdx.c index c697a59eb..83998bcc0 100644 --- a/client/cmdlffdx.c +++ b/client/cmdlffdx.c @@ -223,9 +223,9 @@ int CmdFDXBdemodBI(const char *Cmd) PrintAndLogEx(SUCCESS, "CountryCode: %04u", countryCode); PrintAndLogEx(SUCCESS, "Reserved/RFU: %u", reservedCode); - PrintAndLogEx(SUCCESS, "Animal Tag: %s", animalBit ? _YELLOW_(True) : "False"); - PrintAndLogEx(SUCCESS, "Has extended data: %s [0x%X]", dataBlockBit ? _YELLOW_(True) : "False", extended); - PrintAndLogEx(SUCCESS, "CRC: 0x%04X - [%04X] - %s", crc16, calcCrc, (calcCrc == crc16) ? _GREEN_(Passed) : "Failed"); + PrintAndLogEx(SUCCESS, "Animal Tag: %s", animalBit ? _YELLOW_("True") : "False"); + PrintAndLogEx(SUCCESS, "Has extended data: %s [0x%X]", dataBlockBit ? _YELLOW_("True") : "False", extended); + PrintAndLogEx(SUCCESS, "CRC: 0x%04X - [%04X] - %s", crc16, calcCrc, (calcCrc == crc16) ? _GREEN_("Passed") : "Failed"); if (g_debugMode) { PrintAndLogEx(DEBUG, "Start marker %d; Size %d", preambleIndex, size); @@ -292,9 +292,9 @@ int CmdFdxDemod(const char *Cmd) PrintAndLogEx(SUCCESS, "National Code %012" PRIu64 " (0x%" PRIx64 ")", NationalCode, NationalCode); PrintAndLogEx(SUCCESS, "Country Code %04u", countryCode); PrintAndLogEx(SUCCESS, "Reserved/RFU %u (0x04%X)", reservedCode, reservedCode); - PrintAndLogEx(SUCCESS, "Animal Tag %s", animalBit ? _YELLOW_(True) : "False"); - PrintAndLogEx(SUCCESS, "Has extended data %s [0x%X]", dataBlockBit ? _YELLOW_(True) : "False", extended); - PrintAndLogEx(SUCCESS, "CRC-16 0x%04X - 0x%04X [%s]", crc16, calcCrc, (calcCrc == crc16) ? _GREEN_(Ok) : "Failed"); + PrintAndLogEx(SUCCESS, "Animal Tag %s", animalBit ? _YELLOW_("True") : "False"); + PrintAndLogEx(SUCCESS, "Has extended data %s [0x%X]", dataBlockBit ? _YELLOW_("True") : "False", extended); + PrintAndLogEx(SUCCESS, "CRC-16 0x%04X - 0x%04X [%s]", crc16, calcCrc, (calcCrc == crc16) ? _GREEN_("Ok") : "Failed"); if (g_debugMode) { PrintAndLogEx(DEBUG, "Start marker %d; Size %d", preambleIndex, size); diff --git a/client/cmdlfjablotron.c b/client/cmdlfjablotron.c index 77e625ff8..16fd3db9b 100644 --- a/client/cmdlfjablotron.c +++ b/client/cmdlfjablotron.c @@ -139,7 +139,7 @@ int CmdJablotronDemod(const char *Cmd) uint8_t chksum = raw2 & 0xFF; PrintAndLogEx(INFO, "Checksum: %02X [%s]", chksum, - (chksum == jablontron_chksum(DemodBuffer)) ? _GREEN_(OK) : _RED_(FAIL) + (chksum == jablontron_chksum(DemodBuffer)) ? _GREEN_("OK") : _RED_("FAIL") ); id = DEC2BCD(id); diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 039d69c07..cfa1a5a5c 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -988,9 +988,9 @@ int printConfiguration(t55xx_conf_block_t b) PrintAndLogEx(NORMAL, "Chip Type : %s", (b.Q5) ? "T5555(Q5)" : "T55x7"); PrintAndLogEx(NORMAL, "Modulation : %s", GetSelectedModulationStr(b.modulation)); PrintAndLogEx(NORMAL, "Bit Rate : %s", GetBitRateStr(b.bitrate, (b.block0 & T55x7_X_MODE && (b.block0 >> 28 == 6 || b.block0 >> 28 == 9)))); - PrintAndLogEx(NORMAL, "Inverted : %s", (b.inverted) ? _GREEN_(Yes) : "No"); + PrintAndLogEx(NORMAL, "Inverted : %s", (b.inverted) ? _GREEN_("Yes") : "No"); PrintAndLogEx(NORMAL, "Offset : %d", b.offset); - PrintAndLogEx(NORMAL, "Seq. Term. : %s", (b.ST) ? _GREEN_(Yes) : "No"); + PrintAndLogEx(NORMAL, "Seq. Term. : %s", (b.ST) ? _GREEN_("Yes") : "No"); PrintAndLogEx(NORMAL, "Block0 : 0x%08X", b.block0); PrintAndLogEx(NORMAL, ""); return 0; @@ -1347,7 +1347,7 @@ int CmdT55xxInfo(const char *Cmd) si += 1; if (config.Q5) - PrintAndLogEx(NORMAL, _RED_(* **Warning ***) " Config Info read off a Q5 will not display as expected"); + PrintAndLogEx(NORMAL, _RED_("* **Warning ***") " Config Info read off a Q5 will not display as expected"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "-- T55x7 Configuration & Tag Information --------------------"); @@ -1355,17 +1355,17 @@ int CmdT55xxInfo(const char *Cmd) PrintAndLogEx(NORMAL, " Safer key : %s", GetSaferStr(safer)); PrintAndLogEx(NORMAL, " reserved : %d", resv); PrintAndLogEx(NORMAL, " Data bit rate : %s", GetBitRateStr(dbr, extend)); - PrintAndLogEx(NORMAL, " eXtended mode : %s", (extend) ? _YELLOW_(Yes - Warning) : "No"); + PrintAndLogEx(NORMAL, " eXtended mode : %s", (extend) ? _YELLOW_("Yes - Warning") : "No"); PrintAndLogEx(NORMAL, " Modulation : %s", GetModulationStr(datamod)); PrintAndLogEx(NORMAL, " PSK clock frequency : %d", pskcf); - PrintAndLogEx(NORMAL, " AOR - Answer on Request : %s", (aor) ? _GREEN_(Yes) : "No"); - PrintAndLogEx(NORMAL, " OTP - One Time Pad : %s", (otp) ? _YELLOW_(Yes - Warning) : "No"); + PrintAndLogEx(NORMAL, " AOR - Answer on Request : %s", (aor) ? _GREEN_("Yes") : "No"); + PrintAndLogEx(NORMAL, " OTP - One Time Pad : %s", (otp) ? _YELLOW_("Yes - Warning") : "No"); PrintAndLogEx(NORMAL, " Max block : %d", maxblk); - PrintAndLogEx(NORMAL, " Password mode : %s", (pwd) ? _GREEN_(Yes) : "No"); - PrintAndLogEx(NORMAL, " Sequence Start Terminator : %s", (sst) ? _GREEN_(Yes) : "No"); - PrintAndLogEx(NORMAL, " Fast Write : %s", (fw) ? _GREEN_(Yes) : "No"); - PrintAndLogEx(NORMAL, " Inverse data : %s", (inv) ? _GREEN_(Yes) : "No"); - PrintAndLogEx(NORMAL, " POR-Delay : %s", (por) ? _GREEN_(Yes) : "No"); + PrintAndLogEx(NORMAL, " Password mode : %s", (pwd) ? _GREEN_("Yes") : "No"); + PrintAndLogEx(NORMAL, " Sequence Start Terminator : %s", (sst) ? _GREEN_("Yes") : "No"); + PrintAndLogEx(NORMAL, " Fast Write : %s", (fw) ? _GREEN_("Yes") : "No"); + PrintAndLogEx(NORMAL, " Inverse data : %s", (inv) ? _GREEN_("Yes") : "No"); + PrintAndLogEx(NORMAL, " POR-Delay : %s", (por) ? _GREEN_("Yes") : "No"); PrintAndLogEx(NORMAL, "-------------------------------------------------------------"); PrintAndLogEx(NORMAL, " Raw Data - Page 0"); PrintAndLogEx(NORMAL, " Block 0 : 0x%08X %s", block0, sprint_bin(DemodBuffer + config.offset, 32)); @@ -1751,7 +1751,7 @@ int CmdT55xxChkPwds(const char *Cmd) FILE *f = fopen(filename, "r"); if (!f) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); free(keyBlock); return 1; } diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index a373fee39..2908ab9c6 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -614,7 +614,7 @@ int CmdSmartUpgrade(const char *Cmd) // load file f = fopen(filename, "rb"); if (!f) { - PrintAndLogEx(FAILED, "File: " _YELLOW_( % s) ": not found or locked.", filename); + PrintAndLogEx(FAILED, "File: " _YELLOW_("%s") ": not found or locked.", filename); return 1; } diff --git a/client/comms.c b/client/comms.c index 53f52d7a5..e854362d8 100644 --- a/client/comms.c +++ b/client/comms.c @@ -313,7 +313,7 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode) if (!wait_for_port) { sp = uart_open(portname); } else { - PrintAndLogEx(SUCCESS, "Waiting for Proxmark to appear on " _YELLOW_( % s), portname); + PrintAndLogEx(SUCCESS, "Waiting for Proxmark to appear on " _YELLOW_("%s"), portname); fflush(stdout); int openCount = 0; do { @@ -327,12 +327,12 @@ bool OpenProxmark(void *port, bool wait_for_port, int timeout, bool flash_mode) // check result of uart opening if (sp == INVALID_SERIAL_PORT) { - PrintAndLogEx(WARNING, _RED_(ERROR:) "invalid serial port"); + PrintAndLogEx(WARNING, _RED_("ERROR:") "invalid serial port"); sp = NULL; serial_port_name = NULL; return false; } else if (sp == CLAIMED_SERIAL_PORT) { - PrintAndLogEx(WARNING, _RED_(ERROR:) "serial port is claimed by another process"); + PrintAndLogEx(WARNING, _RED_("ERROR:") "serial port is claimed by another process"); sp = NULL; serial_port_name = NULL; return false; diff --git a/client/emv/emv_roca.c b/client/emv/emv_roca.c index 9dcc55b11..f7a16bb3e 100644 --- a/client/emv/emv_roca.c +++ b/client/emv/emv_roca.c @@ -158,10 +158,10 @@ int roca_self_test(void) if (emv_rocacheck(keyp, 64, false)) { - PrintAndLogEx(SUCCESS, "Weak modulus [ %s]", _GREEN_(PASS)); + PrintAndLogEx(SUCCESS, "Weak modulus [ %s]", _GREEN_("PASS")); } else { ret++; - PrintAndLogEx(FAILED, "Weak modulus [ %s]", _RED_(FAIL)); + PrintAndLogEx(FAILED, "Weak modulus [ %s]", _RED_("FAIL")); } // negative @@ -172,9 +172,9 @@ int roca_self_test(void) if (emv_rocacheck(keyn, 64, false)) { ret++; - PrintAndLogEx(FAILED, "Strong modulus [ %s]", _RED_(FAIL)); + PrintAndLogEx(FAILED, "Strong modulus [ %s]", _RED_("FAIL")); } else { - PrintAndLogEx(SUCCESS, "Strong modulus [ %s]", _GREEN_(PASS)); + PrintAndLogEx(SUCCESS, "Strong modulus [ %s]", _GREEN_("PASS")); } return ret; diff --git a/client/emv/test/cryptotest.c b/client/emv/test/cryptotest.c index e5259f417..d4c8a96da 100644 --- a/client/emv/test/cryptotest.c +++ b/client/emv/test/cryptotest.c @@ -98,9 +98,9 @@ int ExecuteCryptoTests(bool verbose) PrintAndLog("\n--------------------------"); if (TestFail) - PrintAndLogEx(FAILED, "\tTest(s) [ %s ]", _RED_(FAIL)); + PrintAndLogEx(FAILED, "\tTest(s) [ %s ]", _RED_("FAIL")); else - PrintAndLogEx(SUCCESS, "\tTest(s) [ %s ]", _GREEN_(OK)); + PrintAndLogEx(SUCCESS, "\tTest(s) [ %s ]", _GREEN_("OK")); return TestFail; } diff --git a/client/flash.c b/client/flash.c index 21eabe8e3..2e655ff5d 100644 --- a/client/flash.c +++ b/client/flash.c @@ -190,12 +190,12 @@ int flash_load(flash_file_t *ctx, const char *name, int can_write_bl) fd = fopen(name, "rb"); if (!fd) { - fprintf(stderr, _RED_(Could not open file) "%s >>> ", name); + fprintf(stderr, _RED_("Could not open file") "%s >>> ", name); perror(NULL); goto fail; } - fprintf(stdout, _BLUE_(Loading ELF file) "%s\n", name); + fprintf(stdout, _BLUE_("Loading ELF file") "%s\n", name); if (fread(&ehdr, sizeof(ehdr), 1, fd) != 1) { fprintf(stderr, "Error while reading ELF file header\n"); @@ -284,7 +284,7 @@ static int get_proxmark_state(uint32_t *state) *state = resp.arg[0]; break; default: - fprintf(stderr, _RED_(Error:) "Couldn't get proxmark state, bad response type: 0x%04" PRIx64 "\n", resp.cmd); + fprintf(stderr, _RED_("Error:") "Couldn't get proxmark state, bad response type: 0x%04" PRIx64 "\n", resp.cmd); return -1; break; } @@ -304,7 +304,7 @@ static int enter_bootloader(char *serial_port_name) return 0; if (state & DEVICE_INFO_FLAG_CURRENT_MODE_OS) { - fprintf(stdout, _BLUE_(Entering bootloader...) "\n"); + fprintf(stdout, _BLUE_("Entering bootloader...") "\n"); UsbCommand c; memset(&c, 0, sizeof(c)); @@ -326,15 +326,15 @@ static int enter_bootloader(char *serial_port_name) bool opened = OpenProxmark(serial_port_name, true, 60, true); if (opened) { - fprintf(stdout, " " _GREEN_(Found) "\n"); + fprintf(stdout, " " _GREEN_("Found") "\n"); return 0; } else { - fprintf(stdout, _RED_(Error:) "Proxmark not found.\n"); + fprintf(stdout, _RED_("Error:") "Proxmark not found.\n"); return -1; } } - fprintf(stderr, _RED_(Error:) "Unknown Proxmark mode\n"); + fprintf(stderr, _RED_("Error:") "Unknown Proxmark mode\n"); return -1; } @@ -380,8 +380,8 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name) SendCommand(&c); return wait_for_ack(&c); } else { - fprintf(stderr, _RED_(Note: Your bootloader does not understand the new START_FLASH command) "\n"); - fprintf(stderr, _RED_(It is recommended that you update your bootloader) "\n\n"); + fprintf(stderr, _RED_("Note: Your bootloader does not understand the new START_FLASH command") "\n"); + fprintf(stderr, _RED_("It is recommended that you update your bootloader") "\n\n"); } return 0; } @@ -443,7 +443,7 @@ int flash_write(flash_file_t *ctx) fprintf(stdout, "."); fflush(stdout); } - fprintf(stdout, _GREEN_(OK) "\n"); + fprintf(stdout, _GREEN_("OK") "\n"); fflush(stdout); } return 0; @@ -470,4 +470,4 @@ int flash_stop_flashing(void) SendCommand(&c); msleep(100); return 0; -} \ No newline at end of file +} diff --git a/client/flasher.c b/client/flasher.c index 90965322d..3a784bc08 100644 --- a/client/flasher.c +++ b/client/flasher.c @@ -85,17 +85,17 @@ int main(int argc, char **argv) char *serial_port_name = argv[1]; if (!OpenProxmark(serial_port_name, true, 60, true)) { - fprintf(stderr, "Could not find Proxmark on " _RED_( % s) ".\n\n", serial_port_name); + fprintf(stderr, "Could not find Proxmark on " _RED_("%s") ".\n\n", serial_port_name); return -1; } else { - fprintf(stderr, _GREEN_(Found) "\n"); + fprintf(stderr, _GREEN_("Found") "\n"); } res = flash_start_flashing(can_write_bl, serial_port_name); if (res < 0) return -1; - fprintf(stdout, "\n" _BLUE_(Flashing...)"\n"); + fprintf(stdout, "\n" _BLUE_("Flashing...")"\n"); for (int i = 0; i < num_files; i++) { res = flash_write(&files[i]); @@ -105,7 +105,7 @@ int main(int argc, char **argv) fprintf(stdout, "\n"); } - fprintf(stdout, _BLUE_(Resetting hardware...) "\n"); + fprintf(stdout, _BLUE_("Resetting hardware...") "\n"); res = flash_stop_flashing(); if (res < 0) @@ -113,6 +113,6 @@ int main(int argc, char **argv) CloseProxmark(); - fprintf(stdout, _BLUE_(All done.) "\n\nHave a nice day!\n"); + fprintf(stdout, _BLUE_("All done.") "\n\nHave a nice day!\n"); return 0; } diff --git a/client/hardnested/hardnested_bruteforce.c b/client/hardnested/hardnested_bruteforce.c index 320c20f70..43494bc11 100644 --- a/client/hardnested/hardnested_bruteforce.c +++ b/client/hardnested/hardnested_bruteforce.c @@ -173,7 +173,7 @@ crack_states_thread(void *x) char progress_text[80]; char keystr[19]; sprintf(keystr, "%012" PRIx64 " ", key); - sprintf(progress_text, "Brute force phase completed. Key found: " _YELLOW_( % s), keystr); + sprintf(progress_text, "Brute force phase completed. Key found: " _YELLOW_("%s"), keystr); hardnested_print_progress(thread_arg->num_acquired_nonces, progress_text, 0.0, 0); break; } else if (keys_found) { diff --git a/client/loclass/fileutils.c b/client/loclass/fileutils.c index 0ce761548..6136d2836 100644 --- a/client/loclass/fileutils.c +++ b/client/loclass/fileutils.c @@ -73,14 +73,14 @@ int saveFile(const char *preferredName, const char *suffix, const void *data, si /*Opening file for writing in binary mode*/ FILE *f = fopen(fileName, "wb"); if (!f) { - PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_( % s)"'", fileName); + PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_("%s")"'", fileName); free(fileName); return 1; } fwrite(data, 1, datalen, f); fflush(f); fclose(f); - PrintAndLogDevice(SUCCESS, "saved %u bytes to binary file " _YELLOW_( % s), datalen, fileName); + PrintAndLogDevice(SUCCESS, "saved %u bytes to binary file " _YELLOW_("%s"), datalen, fileName); free(fileName); return 0; } @@ -110,7 +110,7 @@ int saveFileEML(const char *preferredName, const char *suffix, uint8_t *data, si /*Opening file for writing in text mode*/ FILE *f = fopen(fileName, "w+"); if (!f) { - PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_( % s)"'", fileName); + PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_("%s")"'", fileName); retval = 1; goto out; } @@ -133,7 +133,7 @@ int saveFileEML(const char *preferredName, const char *suffix, uint8_t *data, si } fflush(f); fclose(f); - PrintAndLogDevice(SUCCESS, "saved %d blocks to text file " _YELLOW_( % s), blocks, fileName); + PrintAndLogDevice(SUCCESS, "saved %d blocks to text file " _YELLOW_("%s"), blocks, fileName); out: free(fileName); @@ -244,12 +244,12 @@ int saveFileJSON(const char *preferredName, const char *suffix, JSONFileType fty int res = json_dump_file(root, fileName, JSON_INDENT(2)); if (res) { - PrintAndLogDevice(FAILED, "error: can't save the file: " _YELLOW_( % s), fileName); + PrintAndLogDevice(FAILED, "error: can't save the file: " _YELLOW_("%s"), fileName); json_decref(root); retval = 200; goto out; } - PrintAndLogDevice(SUCCESS, "saved to json file " _YELLOW_( % s), fileName); + PrintAndLogDevice(SUCCESS, "saved to json file " _YELLOW_("%s"), fileName); json_decref(root); out: @@ -271,7 +271,7 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t * FILE *f = fopen(fileName, "rb"); if (!f) { - PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_( % s)"'", fileName); + PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_("%s")"'", fileName); free(fileName); return 1; } @@ -306,7 +306,7 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t * memcpy((data), dump, bytes_read); free(dump); - PrintAndLogDevice(SUCCESS, "loaded %d bytes from binary file " _YELLOW_( % s), bytes_read, fileName); + PrintAndLogDevice(SUCCESS, "loaded %d bytes from binary file " _YELLOW_("%s"), bytes_read, fileName); *datalen = bytes_read; @@ -332,7 +332,7 @@ int loadFileEML(const char *preferredName, const char *suffix, void *data, size_ FILE *f = fopen(fileName, "r"); if (!f) { - PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_( % s)"'", fileName); + PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_("%s")"'", fileName); retval = 1; goto out; } @@ -363,7 +363,7 @@ int loadFileEML(const char *preferredName, const char *suffix, void *data, size_ } } fclose(f); - PrintAndLogDevice(SUCCESS, "loaded %d bytes from text file " _YELLOW_( % s), counter, fileName); + PrintAndLogDevice(SUCCESS, "loaded %d bytes from text file " _YELLOW_("%s"), counter, fileName); if (datalen) *datalen = counter; @@ -391,13 +391,13 @@ int loadFileJSON(const char *preferredName, const char *suffix, void *data, size root = json_load_file(fileName, 0, &error); if (!root) { - PrintAndLog("ERROR: json " _YELLOW_( % s) " error on line %d: %s", fileName, error.line, error.text); + PrintAndLog("ERROR: json " _YELLOW_("%s") " error on line %d: %s", fileName, error.line, error.text); retval = 2; goto out; } if (!json_is_object(root)) { - PrintAndLog("ERROR: Invalid json " _YELLOW_( % s) " format. root must be an object.", fileName); + PrintAndLog("ERROR: Invalid json " _YELLOW_("%s") " format. root must be an object.", fileName); retval = 3; goto out; } @@ -455,7 +455,7 @@ int loadFileJSON(const char *preferredName, const char *suffix, void *data, size } - PrintAndLog("loaded from JSON file " _YELLOW_( % s), fileName); + PrintAndLog("loaded from JSON file " _YELLOW_("%s"), fileName); out: json_decref(root); free(fileName); @@ -490,7 +490,7 @@ int loadFileDICTIONARY(const char *preferredName, const char *suffix, void *data FILE *f = fopen(fileName, "r"); if (!f) { - PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_( % s)"'", fileName); + PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_("%s")"'", fileName); retval = 1; goto out; } @@ -511,7 +511,7 @@ int loadFileDICTIONARY(const char *preferredName, const char *suffix, void *data continue; if (!isxdigit(line[0])) { - PrintAndLogEx(FAILED, "file content error. '%s' must include " _BLUE_( % 2d) "HEX symbols", line, keylen); + PrintAndLogEx(FAILED, "file content error. '%s' must include " _BLUE_("%2d") "HEX symbols", line, keylen); continue; } @@ -523,7 +523,7 @@ int loadFileDICTIONARY(const char *preferredName, const char *suffix, void *data counter += (keylen >> 1); } fclose(f); - PrintAndLogDevice(SUCCESS, "loaded " _GREEN_( % 2d) "keys from dictionary file " _YELLOW_( % s), *keycnt, fileName); + PrintAndLogDevice(SUCCESS, "loaded " _GREEN_("%2d") "keys from dictionary file " _YELLOW_("%s"), *keycnt, fileName); if (datalen) *datalen = counter; diff --git a/client/mifare/mifarehost.c b/client/mifare/mifarehost.c index 080ecbe77..3cdad9ca5 100644 --- a/client/mifare/mifarehost.c +++ b/client/mifare/mifarehost.c @@ -1017,10 +1017,10 @@ int detect_classic_nackbug(bool verbose) return 2; } case 2 : - PrintAndLogEx(SUCCESS, _GREEN_(always leak NACK detected)); + PrintAndLogEx(SUCCESS, _GREEN_("always leak NACK detected")); return 3; case 1 : - PrintAndLogEx(SUCCESS, _GREEN_(NACK bug detected)); + PrintAndLogEx(SUCCESS, _GREEN_("NACK bug detected")); return 1; case 0 : PrintAndLogEx(SUCCESS, "No NACK bug detected"); @@ -1048,14 +1048,14 @@ void detect_classic_magic(void) switch (isGeneration) { case 1: - PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 1a): " _GREEN_(YES)); + PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 1a): " _GREEN_("YES")); break; case 2: - PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 1b): " _GREEN_(YES)); + PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 1b): " _GREEN_("YES")); break; - //case 4: PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 2): " _GREEN_(YES)); break; + //case 4: PrintAndLogEx(SUCCESS, "Answers to magic commands (GEN 2): " _GREEN_("YES")); break; default: - PrintAndLogEx(INFO, "Answers to magic commands: " _YELLOW_(NO)); + PrintAndLogEx(INFO, "Answers to magic commands: " _YELLOW_("NO")); break; } -} \ No newline at end of file +} diff --git a/client/ui.c b/client/ui.c index 022c03a4a..79e4140db 100644 --- a/client/ui.c +++ b/client/ui.c @@ -61,19 +61,19 @@ void PrintAndLogEx(logLevel_t level, char *fmt, ...) switch (level) { case ERR: - strncpy(prefix, _RED_([!!]), sizeof(prefix) - 1); + strncpy(prefix, _RED_("[!!]"), sizeof(prefix) - 1); break; case FAILED: - strncpy(prefix, _RED_([-]), sizeof(prefix) - 1); + strncpy(prefix, _RED_("[-]"), sizeof(prefix) - 1); break; case DEBUG: - strncpy(prefix, _BLUE_([#]), sizeof(prefix) - 1); + strncpy(prefix, _BLUE_("[#]"), sizeof(prefix) - 1); break; case SUCCESS: - strncpy(prefix, _GREEN_([+]), sizeof(prefix) - 1); + strncpy(prefix, _GREEN_("[+]"), sizeof(prefix) - 1); break; case WARNING: - strncpy(prefix, _CYAN_([!]), sizeof(prefix) - 1); + strncpy(prefix, _CYAN_("[!]"), sizeof(prefix) - 1); break; default: strncpy(prefix, prefixes[level], sizeof(prefix) - 1); diff --git a/client/util.h b/client/util.h index 0edeae5f0..9c68900e7 100644 --- a/client/util.h +++ b/client/util.h @@ -137,39 +137,39 @@ #endif #if defined(__linux__) || (__APPLE__) -# define _BLUE_(s) "\x1b[34m" #s "\x1b[0m " +# define _BLUE_(s) "\x1b[34m" s "\x1b[0m " #else -# define _BLUE_(s) #s " " +# define _BLUE_(s) s " " #endif #if defined(__linux__) || (__APPLE__) -# define _RED_(s) "\x1b[31m" #s "\x1b[0m " +# define _RED_(s) "\x1b[31m" s "\x1b[0m " #else -# define _RED_(s) #s " " +# define _RED_(s) s " " #endif #if defined(__linux__) || (__APPLE__) -# define _GREEN_(s) "\x1b[32m" #s "\x1b[0m " +# define _GREEN_(s) "\x1b[32m" s "\x1b[0m " #else -# define _GREEN_(s) #s " " +# define _GREEN_(s) s " " #endif #if defined(__linux__) || (__APPLE__) -# define _YELLOW_(s) "\x1b[33m" #s "\x1b[0m " +# define _YELLOW_(s) "\x1b[33m" s "\x1b[0m " #else -# define _YELLOW_(s) #s " " +# define _YELLOW_(s) s " " #endif #if defined(__linux__) || (__APPLE__) -# define _MAGENTA_(s) "\x1b[35m" #s "\x1b[0m " +# define _MAGENTA_(s) "\x1b[35m" s "\x1b[0m " #else -# define _MAGENTA_(s) #s " " +# define _MAGENTA_(s) s " " #endif #if defined(__linux__) || (__APPLE__) -# define _CYAN_(s) "\x1b[36m" #s "\x1b[0m " +# define _CYAN_(s) "\x1b[36m" s "\x1b[0m " #else -# define _CYAN_(s) #s " " +# define _CYAN_(s) s " " #endif #ifndef DropField