| 28 | |
| 29 | static hook::Hook<decltype(&CreateProcessW)> Old_CreateProcessW; |
| 30 | static BOOL WINAPI Hooked_CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, |
| 31 | LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, |
| 32 | BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, |
| 33 | LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) |
| 34 | { |
| 35 | bool is_renderer = wcsfindi(lpCommandLine, L"LeagueClientUxRender.exe") |
| 36 | && wcsfindi(lpCommandLine, L"--type=renderer"); |
| 37 | |
| 38 | if (is_renderer) |
| 39 | dwCreationFlags |= CREATE_SUSPENDED; |
| 40 | |
| 41 | BOOL success = Old_CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, |
| 42 | bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); |
| 43 | |
| 44 | if (success && is_renderer) |
| 45 | { |
| 46 | InjectThisDll(lpProcessInformation->hProcess); |
| 47 | ResumeThread(lpProcessInformation->hThread); |
| 48 | } |
| 49 | |
| 50 | return success; |
| 51 | } |
| 52 | |
| 53 | static void Initialize() |
| 54 | { |
nothing calls this directly
no test coverage detected