re #25 fixes linux compilation

This commit is contained in:
Alberto Ortega 2015-05-09 16:58:58 +02:00
parent 725f83e704
commit 8f45c4343e
5 changed files with 28 additions and 7 deletions

View File

@ -6,8 +6,8 @@ OBJ = Objects/MingW/main.o Objects/MingW/common.o Objects/MingW/utils.o Ob
Objects/MingW/vbox.o Objects/MingW/gensandbox.o Objects/MingW/wine.o Objects/MingW/vmware.o \
Objects/MingW/qemu.o Objects/MingW/hooks.o Objects/MingW/cpu.o Objects/MingW/pafish_private.res
LINKOBJ = $(OBJ)
LIBS = -L"C:/MinGW32/lib" -lwsock32 -liphlpapi -lsetupapi -lmpr -s
INCS = -I"C:/MinGW32/include"
LIBS = -lwsock32 -liphlpapi -lsetupapi -lmpr -s
INCS =
BIN = Output/MingW/pafish.exe
CFLAGS = $(INCS) -Wall -Wextra -O0

View File

@ -47,6 +47,13 @@ void print_not_traced() {
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
}
void print_warning(char * msg) {
HANDLE handler = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(handler, 224);
printf("%s\n", msg);
SetConsoleTextAttribute(handler, FOREGROUND_INTENSITY);
}
void write_log(char msg[]) {
FILE *log;
char logstr[1024];

View File

@ -12,6 +12,8 @@ void print_traced();
void print_not_traced();
void print_warning(char * msg);
void write_log(char msg[]);
void write_trace(char product[]);

View File

@ -312,12 +312,19 @@ int main(void)
else print_not_traced();
printf("[*] Looking for a MAC address starting with 08:00:27 ... ");
if (vbox_mac() == TRUE) {
write_log("VirtualBox traced using MAC address starting with 08:00:27");
print_traced();
write_trace("hi_virtualbox");
switch (vbox_mac()) {
case TRUE:
write_log("VirtualBox traced using MAC address starting with 08:00:27");
print_traced();
write_trace("hi_virtualbox");
break;
case FALSE:
print_not_traced();
break;
case -1:
print_warning("NOT BUILT");
break;
}
else print_not_traced();
printf("[*] Looking for pseudo devices ... ");
if (vbox_devices(TRUE) == TRUE) {

View File

@ -152,6 +152,7 @@ int vbox_sysfile2(int writelogs) {
* NIC MAC check
**/
int vbox_mac() {
#if defined(_IPTYPES_H) && defined(_IPHLPAPI_H)
WSADATA WSD;
int res = FALSE;
@ -180,6 +181,10 @@ int vbox_mac() {
WSACleanup();
}
return res;
#else
#warning "vbox_mac() function was not built in!"
return -1;
#endif
}
/**