mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-27 10:34:08 +08:00
chg: enable ansi-colors for OSX
This commit is contained in:
parent
88becf8b09
commit
09b2a079ba
2 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
"."
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue