ROALoader.cpp
资源名称:ROA3.40.rar [点击查看]
上传用户:tianheyiqi
上传日期:2010-04-16
资源大小:282k
文件大小:3k
源码类别:
外挂编程
开发平台:
Visual C++
- // ROALoader.cpp : Defines the entry point for the application.
- //
- #include "stdafx.h"
- #include <stdio.h>
- #include <stdlib.h>
- #include <Tlhelp32.h>
- #include <shellapi.h>
- #include "detours.h"
- DWORD getROProcessId()
- {
- HANDLE toolhelp;
- PROCESSENTRY32 pe;
- pe.dwSize = sizeof(PROCESSENTRY32);
- toolhelp = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- SetLastError(0);
- if (Process32First(toolhelp,&pe)) {
- do {
- _strupr(pe.szExeFile);
- if (strstr(pe.szExeFile, "ROA.EXE") != 0) {
- CloseHandle(toolhelp);
- return pe.th32ProcessID;
- }
- } while (Process32Next(toolhelp,&pe));
- }
- CloseHandle(toolhelp);
- return 0;
- }
- enum
- {
- eUnknown,
- eRagexe,
- eSakexe,
- eSfExe
- };
- int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
- {
- // TODO: Place code here.
- //////////////////////////////////////////////////////////////////////////
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- CHAR szClient[1024];
- CHAR szParam[1024];
- CHAR szCommand[2048];
- CHAR szFullExe[1024] = "