Skip to content

Commit

Permalink
add 'Gene Troopers' support
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 authored Oct 9, 2023
1 parent bf730ea commit ed8b99e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Please note that the GameSpy protocol is old and does not meet modern password e
| F.E.A.R. 2 | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture>&nbsp;<a href="https://www.gog.com/en/game/fear_2_project_origin_reborn"><img src="./.github/img/gog.png" title="GOG" alt="(GOG)" /></a>&nbsp;<a href="https://store.steampowered.com/app/16450/FEAR_2_Project_Origin/"><img src="./.github/img/steam.png" title="Steam" alt="(Steam)" /></a> | `version.dll` | n/a | |
| FlatOut 2 | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture>&nbsp;<a href="https://www.gog.com/en/game/flatout_2"><img src="./.github/img/gog.png" title="GOG" alt="(GOG)" /></a>&nbsp;<a href="https://store.steampowered.com/app/2990/FlatOut_2/"><img src="./.github/img/steam.png" title="Steam" alt="(Steam)" /></a> | `dinput8.dll` | n/a | |
| GangLand | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture>&nbsp;<a href="https://www.gog.com/en/game/gangland"><img src="./.github/img/gog.png" title="GOG" alt="(GOG)" /></a> | `dinput8.dll` | n/a | |
| Gene Troopers | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture> | `dinput8.dll` | n/a | <sub><sup>[1]</sup> Requires [No-CD patch](https://taco.cab/files/games/gtroopers/Gene.Troopers.v1.0.NoCD.zip) to remove StarForce (V3) protection</sub> |
| Global Operations | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture> | `version.dll` | n/a | <sub><sup>[1]</sup> Requires latest [v2.0 update](https://taco.cab/files/games/glops/glopsus2_0.zip)<br><sup>[2]</sup> Requires [No-CD patch](https://taco.cab/files/games/glops/GlobalOps.v2.0.NoCD.zip) to remove SafeDisc (V2) protection</sub> |
| Halo: Combat Evolved | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture> | `version.dll` | n/a | |
| Heretic II | <picture><img src="./.github/img/disc.png" title="Retail" alt="(Retail)" /></picture> | n/a | n/a | <sub><sup>[1]</sup> No DLL, use [this configuration file](https://github.com/anzz1/openspy-client/files/12352143/H2-OpenSpy.zip) instead<br><sup>[2]</sup> No in-game server browser, use the "gspylite" tool to connect to servers</sub> |
Expand Down
3 changes: 3 additions & 0 deletions dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions include/game_gt.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ed8b99e

Please sign in to comment.