diff --git a/README.md b/README.md index fd42336..497cb56 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Please note that the GameSpy protocol is old and does not meet modern password e | F.E.A.R. 2 | (Retail) (GOG) (Steam) | `version.dll` | n/a | | | FlatOut 2 | (Retail) (GOG) (Steam) | `dinput8.dll` | n/a | | | GangLand | (Retail) (GOG) | `dinput8.dll` | n/a | | +| Gene Troopers | (Retail) | `dinput8.dll` | n/a | [1] Requires [No-CD patch](https://taco.cab/files/games/gtroopers/Gene.Troopers.v1.0.NoCD.zip) to remove StarForce (V3) protection | | Global Operations | (Retail) | `version.dll` | n/a | [1] Requires latest [v2.0 update](https://taco.cab/files/games/glops/glopsus2_0.zip)
[2] Requires [No-CD patch](https://taco.cab/files/games/glops/GlobalOps.v2.0.NoCD.zip) to remove SafeDisc (V2) protection
| | Halo: Combat Evolved | (Retail) | `version.dll` | n/a | | | Heretic II | (Retail) | n/a | n/a | [1] No DLL, use [this configuration file](https://github.com/anzz1/openspy-client/files/12352143/H2-OpenSpy.zip) instead
[2] No in-game server browser, use the "gspylite" tool to connect to servers
| diff --git a/dllmain.c b/dllmain.c index 3d112db..ecee3ae 100644 --- a/dllmain.c +++ b/dllmain.c @@ -41,6 +41,7 @@ #include "include/game_dmntn.h" #include "include/game_xml2.h" #include "include/game_ts.h" + #include "include/game_gt.h" #endif // !_WIN64 #include "include/picoupnp.h" @@ -274,6 +275,8 @@ int __stdcall DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID lpReserved) { patch_xml2(); } else if (!__stricmp(p, "timeshift.exe")) { // TimeShift patch_ts(); + } else if (!__stricmp(p, "gt.exe")) { // Gene Troopers + patch_gt(); } else if (!__stricmp(p, "game.dat") && p2 && !__strcmp(p2, "RTS.exe")) { // Battle for Middle-earth II patch_bfme2(); } else if (!__stricmp(p, "serioussam.exe") || !__stricmp(p, "sam2.exe") || !__stricmp(p, "dedicatedserver.exe")) { // Serious Sam 1 & 2 diff --git a/include/game_gt.h b/include/game_gt.h new file mode 100644 index 0000000..9453f25 --- /dev/null +++ b/include/game_gt.h @@ -0,0 +1,24 @@ +// game_gt.h + +#ifndef __GAME_GT_H +#define __GAME_GT_H + +#include "include/global.h" +#include "iathook/iathook.h" + +int __stdcall hk_bind(SOCKET s, struct sockaddr* addr, int namelen); +LPHOSTENT __stdcall hk_gethostbyname(const char* name); + +__forceinline static void gt_hook_gs() { + HMODULE hmod = GetModuleHandleA("cloakntengine.dll"); + if (hmod) { + HOOK_FUNC(hmod, gethostbyname, hk_gethostbyname, "ws2_32.dll", 52, TRUE); + HOOK_FUNC(hmod, bind, hk_bind, "ws2_32.dll", 2, TRUE); + } +} + +__noinline static void patch_gt() { + gt_hook_gs(); +} + +#endif // __GAME_GT_H