MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / Hooked_CreateProcessW

Function Hooked_CreateProcessW

core/src/dllmain.cc:30–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29static hook::Hook<decltype(&CreateProcessW)> Old_CreateProcessW;
30static 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
53static void Initialize()
54{

Callers

nothing calls this directly

Calls 2

wcsfindiFunction · 0.85
InjectThisDllFunction · 0.85

Tested by

no test coverage detected