2
* Phishing detection automated testing & tools.
4
* Copyright (C) 2006 Torok Edvin <edwintorok@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25
#include "whitelist.h"
26
void show_time(struct timeval tv1,struct timeval tv2)
29
diff.tv_sec = tv2.tv_sec-tv1.tv_sec;
30
diff.tv_usec = tv2.tv_usec-tv1.tv_usec;
32
diff.tv_sec += diff.tv_usec/1000000;
33
diff.tv_usec %= 1000000;
36
int x = diff.tv_usec/1000000;//<0
38
diff.tv_usec -= (x-1)*1000000;
40
printf("%d.%06d,",diff.tv_sec,diff.tv_usec);
42
int main(int argc,char* argv[])
46
FILE* f=fopen("whitelist.wdb","rb");
48
printf("%d,",load_whitelist(f));
49
struct timeval tv0,tv01;
50
gettimeofday(&tv0,NULL);
52
gettimeofday(&tv01,NULL);
55
FILE* f2=fopen(argv[1],"rb");
59
char* x = malloc(p+1);
60
if(fread(x,p,1,f2)!=1)
64
struct timeval tv1,tv2,diff;
65
gettimeofday(&tv1,NULL);
66
int rc=whitelist_match(x,"test",0);
67
gettimeofday(&tv2,NULL);
72
/* const char* real = "http://pics.ebaystatic.com/";
73
const char* display = "http://www.ebay.com/";
74
printf("%d\n",whitelist_match(real,display,0));*/