-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |