diff --git a/pafish.exe b/pafish.exe index a78b644..5eb621b 100644 Binary files a/pafish.exe and b/pafish.exe differ diff --git a/pafish/common.c b/pafish/common.c index d4a1eda..a409821 100644 --- a/pafish/common.c +++ b/pafish/common.c @@ -6,6 +6,8 @@ #include "common.h" +int analysis_result = 0; + void init_cmd_colors() { HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY); @@ -27,6 +29,7 @@ void print_traced() { SetConsoleTextAttribute(handler, 207); printf("traced!\n"); SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY); + analysis_result = 2; } void print_not_traced() { @@ -41,6 +44,9 @@ void print_suspicious() { SetConsoleTextAttribute(handler, 207); printf("suspicious\n"); SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY); + if (analysis_result == 0) { + analysis_result = 1; + } } void write_log(char msg[]) { diff --git a/pafish/common.h b/pafish/common.h index 0bc7d4f..4545e50 100644 --- a/pafish/common.h +++ b/pafish/common.h @@ -16,4 +16,6 @@ void write_log(char msg[]); void write_trace(char product[]); +extern int analysis_result; + #endif diff --git a/pafish/main.c b/pafish/main.c index 479514c..1326a7f 100644 --- a/pafish/main.c +++ b/pafish/main.c @@ -355,6 +355,9 @@ int main(int argc, char *argv[]) write_log("End"); - fflush(stdin); getchar(); - return 0; + fflush(stdin); + if (argc != 2 || strncmp(argv[1], "-q", 2) != 0) { + getchar(); + } + return analysis_result; }