ec_main.c (ettercap-0.8.3) | : | ec_main.c (ettercap-0.8.3.1) | ||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
#include <ec_sslwrap.h> | #include <ec_sslwrap.h> | |||
#include <ec_utils.h> | #include <ec_utils.h> | |||
#ifdef HAVE_EC_LUA | #ifdef HAVE_EC_LUA | |||
#include <ec_lua.h> | #include <ec_lua.h> | |||
#endif | #endif | |||
/* global vars */ | /* global vars */ | |||
/* protos */ | /* protos */ | |||
static void time_check(void); | ||||
/*******************************************/ | /*******************************************/ | |||
int main(int argc, char *argv[]) | int main(int argc, char *argv[]) | |||
{ | { | |||
/* | /* | |||
* Alloc the global structures | * Alloc the global structures | |||
* We can access these structs via the macro in ec_globals.h | * We can access these structs via the macro in ec_globals.h | |||
*/ | */ | |||
libettercap_init(PROGRAM, EC_VERSION); | libettercap_init(PROGRAM, EC_VERSION); | |||
libettercap_load_conf(); | libettercap_load_conf(); | |||
DEBUG_MSG("main -- here we go !!"); | DEBUG_MSG("main -- here we go !!"); | |||
/* initialize the filter mutex */ | /* initialize the filter mutex */ | |||
filter_init_mutex(); | filter_init_mutex(); | |||
/* register the main thread as "init" */ | /* register the main thread as "init" */ | |||
ec_thread_register(EC_PTHREAD_SELF, "init", "initialization phase"); | ec_thread_register(ec_thread_getpid(NULL), "init", "initialization phase"); | |||
/* activate the signal handler */ | /* activate the signal handler */ | |||
signal_handler(); | signal_handler(); | |||
#ifdef OS_GNU | #ifdef OS_GNU | |||
fprintf(stdout,"%s is still not fully supported in this OS because of missing live capture support.", EC_GBL_PROGRAM); | fprintf(stdout,"%s is still not fully supported in this OS because of missing live capture support.", EC_GBL_PROGRAM); | |||
#endif | #endif | |||
/* ettercap copyright */ | /* ettercap copyright */ | |||
fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n ", | fprintf(stdout, "\n" EC_COLOR_BOLD "%s %s" EC_COLOR_END " copyright %s %s\n\n ", | |||
EC_GBL_PROGRAM, EC_GBL_VERSION, EC_COPYRIGHT, EC_AUTHORS); | EC_GBL_PROGRAM, EC_GBL_VERSION, EC_COPYRIGHT, EC_AUTHORS); | |||
/* getopt related parsing... */ | /* getopt related parsing... */ | |||
parse_options(argc, argv); | parse_options(argc, argv); | |||
/* check the date */ | ||||
time_check(); | ||||
/* | /* | |||
* get the list of available interfaces | * get the list of available interfaces | |||
* | * | |||
* this function will not return if the -I option was | * this function will not return if the -I option was | |||
* specified on command line. it will instead print the | * specified on command line. it will instead print the | |||
* list and exit | * list and exit | |||
*/ | */ | |||
capture_getifs(); | capture_getifs(); | |||
/* initialize the user interface */ | /* initialize the user interface */ | |||
skipping to change at line 198 | skipping to change at line 193 | |||
* we are interested only in the mitm attack i | * we are interested only in the mitm attack i | |||
* if entered, this function will not return... | * if entered, this function will not return... | |||
*/ | */ | |||
if (EC_GBL_OPTIONS->only_mitm) | if (EC_GBL_OPTIONS->only_mitm) | |||
only_mitm(); | only_mitm(); | |||
/* create the dispatcher thread */ | /* create the dispatcher thread */ | |||
ec_thread_new("top_half", "dispatching module", &top_half, NULL); | ec_thread_new("top_half", "dispatching module", &top_half, NULL); | |||
/* this thread becomes the UI then displays it */ | /* this thread becomes the UI then displays it */ | |||
ec_thread_register(EC_PTHREAD_SELF, EC_GBL_PROGRAM, "the user interface"); | ec_thread_register(ec_thread_getpid(NULL), EC_GBL_PROGRAM, "the user interfac e"); | |||
/* start unified sniffing for curses and GTK at startup */ | /* start unified sniffing for curses and GTK at startup */ | |||
if ((EC_GBL_UI->type == UI_CURSES || EC_GBL_UI->type == UI_GTK) && | if ((EC_GBL_UI->type == UI_CURSES || EC_GBL_UI->type == UI_GTK) && | |||
EC_GBL_CONF->sniffing_at_startup) | EC_GBL_CONF->sniffing_at_startup) | |||
EXECUTE(EC_GBL_SNIFF->start); | EXECUTE(EC_GBL_SNIFF->start); | |||
/* start the actual user interface */ | /* start the actual user interface */ | |||
libettercap_ui_start(); | libettercap_ui_start(); | |||
/******************************************** | /******************************************** | |||
skipping to change at line 220 | skipping to change at line 215 | |||
********************************************/ | ********************************************/ | |||
/* Call all the proper stop methods to ensure | /* Call all the proper stop methods to ensure | |||
* that no matter what UI was selected, everything is | * that no matter what UI was selected, everything is | |||
* turned off gracefully */ | * turned off gracefully */ | |||
clean_exit(0); | clean_exit(0); | |||
return 0; //Never reaches here | return 0; //Never reaches here | |||
} | } | |||
static void time_check(void) | ||||
{ | ||||
/* | ||||
* a nice easter egg... | ||||
* just to waste some time of code reviewers... ;) | ||||
* ALoR, keeping this for you buddy! :) | ||||
* | ||||
* trust me, it's not evil ;) only a boring afternoon, and nothing to do... | ||||
*/ | ||||
time_t K9=time(NULL);char G5P[1<<6],*o=G5P,*O;uint U4M, _,__=0; char dMG[]= | ||||
"\n*\n^1U4Mm\x04wW#K\x2e\x0e+X\x7f\f,N'U!I-L5?";struct{char X5T[7];int dMG; | ||||
int U4M;} X5T[]={{"N!WwFr", 0x414c6f52,0},{"S6FfUe", 0x4e614741,0}};sprintf | ||||
(G5P,"%s",ctime(&K9));o+=4;O=strchr(o+4,' ');*O=0; for(U4M=(1<<5)-(1<<2)+1; | ||||
U4M>0;U4M--){dMG[U4M]=dMG[U4M]^dMG[U4M-1];}for(U4M=0;U4M<sizeof(X5T)/sizeof | ||||
(*X5T);U4M++){for(_=(1<<2)+1; _>0;_--){X5T[U4M].X5T[_]=X5T[U4M].X5T[_]^X5T[ | ||||
U4M].X5T[_-1];}if(!strcmp(X5T[U4M].X5T,o)){char T0Q[]="\n\0O!M4\x14r\x1doO" | ||||
";T0Q(\bm\x19m\bz\x19x\b(A2\x12s\x1d=X5T=Q&G5Pp\x03l\n~\th\x1a\x7f_dMG\x06" | ||||
"hH-@" "!H$\x04s\x1av\x1a:X=\x1d|\f|\x0ek\ba\0t\x11u[u[{^-m\fb\x16\x7f\x19" | ||||
"v\x04oA\x2e\\;1;K9\\/\\|9w#f4\x1a\x34\x1a\x1a";for(_=(1<<7)-(1<<3)-(1<<2)+ | ||||
1;_>0;_--){T0Q[_]=T0Q[_]^T0Q[_-1];}write(1,dMG,1);while(__++<1<<5)printf("" | ||||
"%c",(1<<5)+(1<<3)+(1<<1));X5T[U4M].dMG=ntohl(X5T[U4M].dMG);printf(dMG,&X5T | ||||
[U4M].dMG);while(--__){printf("%c",(1<<6)-(1<<4)-(1<<3)+(1<<1));}printf(T0Q | ||||
,&X5T[U4M].dMG);getchar();break;}} | ||||
} | ||||
/* EOF */ | /* EOF */ | |||
// vim:ts=3:expandtab | // vim:ts=3:expandtab | |||
End of changes. 5 change blocks. | ||||
32 lines changed or deleted | 2 lines changed or added |