int APIENTRY WinMainA(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char Path[255] = { 0 };
char DllPath[255] = { 0 };
//得到widnows 系统路径
GetSystemDirectory(Path, sizeof(Path));
//0x00截断字符,得到盘符
Path[3] = 0x00;
//得到IE 带路径文件名
strcat(Path, "Program Files\\Internet Explorer\\iexplore.exe");
//启动IE,为了防止系统中没有 IE进程
WinExec(Path, SW_HIDE);
//暂停两秒,等待IE 启动
Sleep(2000);//得到IE 进程
DWORD Pid = GetProcessID("iexplore.exe");
//得到程序自身路径
GetCurrentDirectory(sizeof(DllPath), DllPath);
//得到DLL 带路径文件名
strcat(DllPath, "\\test.dll");
//注入IE 进程
InjectDll(DllPath, Pid);
return 0;
}
GetSystemDirectory
最新推荐文章于 2023-09-06 09:59:59 发布