-
Notifications
You must be signed in to change notification settings - Fork 0
/
isfixload.c
28 lines (27 loc) · 816 Bytes
/
isfixload.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "detours.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
STARTUPINFOA sia = {0};
PROCESS_INFORMATION pi;
MSG msg;
char exename[MAX_PATH];
char *file;
PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE | PM_NOYIELD); // create message queue
sia.cb = sizeof(STARTUPINFOA);
sia.dwFlags = STARTF_USESHOWWINDOW;
sia.wShowWindow = nShowCmd;
GetModuleFileNameA(NULL, exename, MAX_PATH);
file = strrchr(exename, '\\');
if(!file) return -1;
strcpy(file, "\\isfix32.dll");
if(DetourCreateProcessWithDllExA(NULL, lpCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &sia, &pi, exename, NULL))
{
Sleep(200);
WaitForInputIdle(pi.hProcess, 30000);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}
return 0;
}