From 09b2a079ba713ca25c1b12d7726965d029f0d3d7 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 6 Feb 2018 19:21:47 +0100 Subject: [PATCH] chg: enable ansi-colors for OSX --- client/mifarehost.c | 4 ++-- client/proxmark3.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/mifarehost.c b/client/mifarehost.c index ab1bc1b1d..6497c3e41 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -904,7 +904,7 @@ int detect_classic_nackbug(bool verbose){ // for nice animation bool term = !isatty(STDIN_FILENO); -#if defined(__linux__) +#if defined(__linux__) || (__APPLE__) char star[] = {'-', '\\', '|', '/'}; uint8_t staridx = 0; #endif @@ -915,7 +915,7 @@ int detect_classic_nackbug(bool verbose){ printf("."); } else { printf( - #if defined(__linux__) + #if defined(__linux__) || (__APPLE__) "\e[32m\e[s%c\e[u\e[0m", star[ (staridx++ % 4) ] #else "." diff --git a/client/proxmark3.c b/client/proxmark3.c index 93a7309b1..027a18b3d 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -69,7 +69,7 @@ struct receiver_arg { int run; }; -#if defined(__linux__) +#if defined(__linux__) || (__APPLE__) static void showBanner(void){ printf("\n\n"); printf("\e[34m██████╗ ███╗ ███╗ ████╗\e[0m ...iceman fork\n"); @@ -186,7 +186,7 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) { sf = fopen(script_cmds_file, "r"); if (sf) - printf("executing commands from file: %s\n", script_cmds_file); + printf("[+] executing commands from file: %s\n", script_cmds_file); } read_history(".history"); @@ -243,7 +243,7 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) { if (stdinOnPipe) { memset(script_cmd_buf, 0, sizeof(script_cmd_buf)); if (!fgets(script_cmd_buf, sizeof(script_cmd_buf), stdin)) { - printf("\nstdin end, exit...\n"); + printf("\n[!] stdin end, exit...\n"); break; } strcleanrn(script_cmd_buf, sizeof(script_cmd_buf)); @@ -436,7 +436,7 @@ int main(int argc, char* argv[]) { } } - printf("Execute command from commandline: %s\n", script_cmd); + printf("[+] execute command from commandline: %s\n", script_cmd); } } else { script_cmds_file = argv[argc - 1]; @@ -445,11 +445,11 @@ int main(int argc, char* argv[]) { // check command if (executeCommand && (!script_cmd || strlen(script_cmd) == 0)){ - printf("ERROR: execute command: command not found.\n"); + printf("[!] ERROR: execute command: command not found.\n"); return 2; } -#if defined(__linux__) +#if defined(__linux__) || (__APPLE__) // ascii art doesn't work well on mingw :( bool stdinOnPipe = !isatty(STDIN_FILENO); @@ -464,7 +464,7 @@ int main(int argc, char* argv[]) { if (!waitCOMPort) { sp = uart_open(argv[1]); } else { - printf("Waiting for Proxmark to appear on %s ", argv[1]); + printf("[+] waiting for Proxmark to appear on %s ", argv[1]); fflush(stdout); int openCount = 0; do { @@ -472,17 +472,17 @@ int main(int argc, char* argv[]) { msleep(1000); printf("."); fflush(stdout); - } while(++openCount < 20 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT)); + } while (++openCount < 20 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT)); printf("\n"); } // check result of uart opening if (sp == INVALID_SERIAL_PORT) { - printf("ERROR: invalid serial port\n"); + printf("[!] ERROR: invalid serial port\n"); usb_present = false; offline = 1; } else if (sp == CLAIMED_SERIAL_PORT) { - printf("ERROR: serial port is claimed by another process\n"); + printf("[!] ERROR: serial port is claimed by another process\n"); usb_present = false; offline = 1; } else { @@ -517,4 +517,4 @@ int main(int argc, char* argv[]) { pthread_mutex_destroy(&print_lock); exit(0); -} +} \ No newline at end of file