mirror of
https://github.com/a0rtega/pafish
synced 2024-11-22 06:11:18 +03:00
Merge pull request #18 from nilp0inter/unattended_and_retval2
Unattended analysis and return value. (Fixed)
This commit is contained in:
commit
226200924d
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
int analysis_result = 0;
|
||||||
|
|
||||||
void init_cmd_colors() {
|
void init_cmd_colors() {
|
||||||
HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE);
|
HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
||||||
@ -27,6 +29,7 @@ void print_traced() {
|
|||||||
SetConsoleTextAttribute(handler, 207);
|
SetConsoleTextAttribute(handler, 207);
|
||||||
printf("traced!\n");
|
printf("traced!\n");
|
||||||
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
||||||
|
analysis_result = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_not_traced() {
|
void print_not_traced() {
|
||||||
@ -41,6 +44,9 @@ void print_suspicious() {
|
|||||||
SetConsoleTextAttribute(handler, 207);
|
SetConsoleTextAttribute(handler, 207);
|
||||||
printf("suspicious\n");
|
printf("suspicious\n");
|
||||||
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
|
||||||
|
if (analysis_result == 0) {
|
||||||
|
analysis_result = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_log(char msg[]) {
|
void write_log(char msg[]) {
|
||||||
|
@ -16,4 +16,6 @@ void write_log(char msg[]);
|
|||||||
|
|
||||||
void write_trace(char product[]);
|
void write_trace(char product[]);
|
||||||
|
|
||||||
|
extern int analysis_result;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -362,6 +362,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
write_log("End");
|
write_log("End");
|
||||||
|
|
||||||
fflush(stdin); getchar();
|
fflush(stdin);
|
||||||
return 0;
|
if (argc != 2 || strncmp(argv[1], "-q", 2) != 0) {
|
||||||
|
getchar();
|
||||||
|
}
|
||||||
|
return analysis_result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user