mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07: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
|
// for nice animation
|
||||||
bool term = !isatty(STDIN_FILENO);
|
bool term = !isatty(STDIN_FILENO);
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || (__APPLE__)
|
||||||
char star[] = {'-', '\\', '|', '/'};
|
char star[] = {'-', '\\', '|', '/'};
|
||||||
uint8_t staridx = 0;
|
uint8_t staridx = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -915,7 +915,7 @@ int detect_classic_nackbug(bool verbose){
|
||||||
printf(".");
|
printf(".");
|
||||||
} else {
|
} else {
|
||||||
printf(
|
printf(
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || (__APPLE__)
|
||||||
"\e[32m\e[s%c\e[u\e[0m", star[ (staridx++ % 4) ]
|
"\e[32m\e[s%c\e[u\e[0m", star[ (staridx++ % 4) ]
|
||||||
#else
|
#else
|
||||||
"."
|
"."
|
||||||
|
|
|
@ -69,7 +69,7 @@ struct receiver_arg {
|
||||||
int run;
|
int run;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || (__APPLE__)
|
||||||
static void showBanner(void){
|
static void showBanner(void){
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
printf("\e[34m██████╗ ███╗ ███╗ ████╗\e[0m ...iceman fork\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");
|
sf = fopen(script_cmds_file, "r");
|
||||||
|
|
||||||
if (sf)
|
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");
|
read_history(".history");
|
||||||
|
@ -243,7 +243,7 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
|
||||||
if (stdinOnPipe) {
|
if (stdinOnPipe) {
|
||||||
memset(script_cmd_buf, 0, sizeof(script_cmd_buf));
|
memset(script_cmd_buf, 0, sizeof(script_cmd_buf));
|
||||||
if (!fgets(script_cmd_buf, sizeof(script_cmd_buf), stdin)) {
|
if (!fgets(script_cmd_buf, sizeof(script_cmd_buf), stdin)) {
|
||||||
printf("\nstdin end, exit...\n");
|
printf("\n[!] stdin end, exit...\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strcleanrn(script_cmd_buf, sizeof(script_cmd_buf));
|
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 {
|
} else {
|
||||||
script_cmds_file = argv[argc - 1];
|
script_cmds_file = argv[argc - 1];
|
||||||
|
@ -445,11 +445,11 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
// check command
|
// check command
|
||||||
if (executeCommand && (!script_cmd || strlen(script_cmd) == 0)){
|
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;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || (__APPLE__)
|
||||||
// ascii art doesn't work well on mingw :(
|
// ascii art doesn't work well on mingw :(
|
||||||
|
|
||||||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||||
|
@ -464,7 +464,7 @@ int main(int argc, char* argv[]) {
|
||||||
if (!waitCOMPort) {
|
if (!waitCOMPort) {
|
||||||
sp = uart_open(argv[1]);
|
sp = uart_open(argv[1]);
|
||||||
} else {
|
} else {
|
||||||
printf("Waiting for Proxmark to appear on %s ", argv[1]);
|
printf("[+] waiting for Proxmark to appear on %s ", argv[1]);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
int openCount = 0;
|
int openCount = 0;
|
||||||
do {
|
do {
|
||||||
|
@ -478,11 +478,11 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
// check result of uart opening
|
// check result of uart opening
|
||||||
if (sp == INVALID_SERIAL_PORT) {
|
if (sp == INVALID_SERIAL_PORT) {
|
||||||
printf("ERROR: invalid serial port\n");
|
printf("[!] ERROR: invalid serial port\n");
|
||||||
usb_present = false;
|
usb_present = false;
|
||||||
offline = 1;
|
offline = 1;
|
||||||
} else if (sp == CLAIMED_SERIAL_PORT) {
|
} 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;
|
usb_present = false;
|
||||||
offline = 1;
|
offline = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue