-
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.
fix 'No One Lives Forever' dedicated server
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
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_nolf.h | ||
|
||
#ifndef __GAME_NOLF_H | ||
#define __GAME_NOLF_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 nolf_srv_hook_gs() { | ||
HMODULE mod = GetModuleHandleA("server.dll"); | ||
if (mod) { | ||
HOOK_FUNC(mod, gethostbyname, hk_gethostbyname, "wsock32.dll", 52, TRUE); | ||
HOOK_FUNC(mod, bind, hk_bind, "wsock32.dll", 2, TRUE); | ||
} | ||
} | ||
|
||
__noinline static void patch_nolf_srv() { | ||
nolf_srv_hook_gs(); | ||
} | ||
|
||
#endif // __GAME_NOLF_H |