@@ -35,6 +35,9 @@ DownloadCache_PersistToDiskFn oDownloadCache_PersistToDisk;
35
35
DecompressBZipToDiskFn oDecompressBZipToDisk;
36
36
BZ2_bzreadFn oBZ2_bzread;
37
37
38
+ typedef void (__thiscall* CHostState_OnClientConnectedFn)(void *);
39
+ CHostState_OnClientConnectedFn oCHostState_OnClientConnected;
40
+
38
41
// NOTE: __thiscall for the typedefs so the original function is called correctly.
39
42
// __fastcall for the hook function because... reasons?
40
43
// TODO check if we can just thiscall those...
@@ -310,6 +313,12 @@ int __stdcall Hooked_BZ2_bzread(int a, int b, int c)
310
313
return x;
311
314
}
312
315
316
+ void __fastcall Hooked_CHostState_OnClientConnected (void * thisptr)
317
+ {
318
+ oCHostState_OnClientConnected (thisptr);
319
+ FlashWindow (FindWindowA (" Valve001" , NULL ), TRUE );
320
+ }
321
+
313
322
BOOL IsProcessRunning (DWORD processID)
314
323
{
315
324
HANDLE process = OpenProcess (SYNCHRONIZE, FALSE , processID);
@@ -360,6 +369,8 @@ DWORD InjectionEntryPoint(DWORD processID)
360
369
oDecompressBZipToDisk = (DecompressBZipToDiskFn)(FindPattern (" engine.dll" , " 55 8B EC B8 14 03 01 00" ));
361
370
oBZ2_bzread = (BZ2_bzreadFn)(FindPattern (" engine.dll" , " 55 8B EC 8B 45 ? 83 B8 ? ? ? ? 04" ));
362
371
372
+ oCHostState_OnClientConnected = (CHostState_OnClientConnectedFn)(FindPattern (" engine.dll" , " 55 8B EC 83 EC 0C 56 8B F1 80 BE ? ? ? ? 00 0F 84" ));
373
+
363
374
uintptr_t tier = (uintptr_t )GetModuleHandleA (" tier0.dll" );
364
375
ConMsg = (ConMsgFn)(uintptr_t )GetProcAddress ((HMODULE)tier, " ?ConMsg@@YAXPBDZZ" );
365
376
Plat_FloatTime = (Plat_FloatTimeFn)(uintptr_t )GetProcAddress ((HMODULE)tier, " Plat_FloatTime" );
@@ -403,6 +414,7 @@ DWORD InjectionEntryPoint(DWORD processID)
403
414
DetourAttach (&(PVOID&)oDownloadCache_PersistToDisk, Hooked_DownloadCache_PersistToDisk);
404
415
DetourAttach (&(PVOID&)oDecompressBZipToDisk, Hooked_DecompressBZipToDisk);
405
416
DetourAttach (&(PVOID&)oBZ2_bzread, Hooked_BZ2_bzread);
417
+ DetourAttach (&(PVOID&)oCHostState_OnClientConnected, Hooked_CHostState_OnClientConnected);
406
418
DetourTransactionCommit ();
407
419
408
420
bool jumpPredPatched = true ;
@@ -480,6 +492,7 @@ DWORD InjectionEntryPoint(DWORD processID)
480
492
DetourDetach (&(PVOID&)oDownloadCache_PersistToDisk, Hooked_DownloadCache_PersistToDisk);
481
493
DetourDetach (&(PVOID&)oDecompressBZipToDisk, Hooked_DecompressBZipToDisk);
482
494
DetourDetach (&(PVOID&)oBZ2_bzread, Hooked_BZ2_bzread);
495
+ DetourDetach (&(PVOID&)oCHostState_OnClientConnected, Hooked_CHostState_OnClientConnected);
483
496
DetourTransactionCommit ();
484
497
485
498
ExitThread (0 );
0 commit comments