From dc26db5db095e41c6d9db70f00f67ef55099d560 Mon Sep 17 00:00:00 2001 From: nyushiri Date: Fri, 18 Apr 2025 11:13:26 +0300 Subject: [PATCH] Added signatures for x64 CS:S (Thanks to rumour) Replaced executable for it --- bin/data/games/cstrike_steam.ini | 2 +- src/svr_standalone/game_search.cpp | 46 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/bin/data/games/cstrike_steam.ini b/bin/data/games/cstrike_steam.ini index a6b877e9..ec22450a 100644 --- a/bin/data/games/cstrike_steam.ini +++ b/bin/data/games/cstrike_steam.ini @@ -1,3 +1,3 @@ name=Counter-Strike: Source -steam_path=common\Counter-Strike Source\hl2.exe +steam_path=common\Counter-Strike Source\cstrike_win64.exe args=-game cstrike diff --git a/src/svr_standalone/game_search.cpp b/src/svr_standalone/game_search.cpp index cda33644..f7b24e21 100644 --- a/src/svr_standalone/game_search.cpp +++ b/src/svr_standalone/game_search.cpp @@ -238,6 +238,17 @@ GameFnProxy game_get_player_by_index_proxy_1() return px; } +// For x64 CS:S. TF2 proxy works for now. +GameFnProxy game_get_player_by_index_proxy_2() +{ + // Find UTIL_PlayerByIndex, use function (see Source 2013 SDK). + + GameFnProxy px; + px.target = game_scan_pattern("client.dll", "40 53 48 83 EC ?? 8B D1", NULL); + px.proxy = game_player_by_index_proxy_0; + return px; +} + // ---------------------------------------------------------------- // For x86 CS:S. @@ -262,6 +273,17 @@ GameFnProxy game_get_spec_target_proxy_1() return px; } +// For x64 CS:S. TF2 proxy works for now. +GameFnProxy game_get_spec_target_proxy_2() +{ + // Find GetSpectatorTarget, use function. + + GameFnProxy px; + px.target = game_scan_pattern("client.dll", "48 83 EC ?? E8 ?? ?? ?? ?? 48 85 C0 74 ?? 48 8B 10 48 8B C8 FF 92 ?? ?? ?? ?? 48 85 C0", NULL); + px.proxy = game_spec_target_proxy_0; + return px; +} + // ---------------------------------------------------------------- // For x86 CS:S. @@ -484,6 +506,27 @@ GameFnProxy game_get_local_player_proxy_1() return px; } +// For x64 CS:S. +GameFnProxy game_get_local_player_proxy_2() +{ + // Find C_BasePlayer::PostDataUpdate (or search "snd_soundmixer"), find global assignment to s_pLocalPlayer. + + u8* addr = (u8*)game_scan_pattern("client.dll", "48 89 05 ?? ?? ?? ?? 48 8D 15 ?? ?? ?? ?? 48 8B 05", NULL); + + if (addr == NULL) + { + return {}; + } + + addr += 3; + addr = (u8*)game_follow_displacement(addr, 4); + + GameFnProxy px; + px.target = addr; + px.proxy = game_local_player_proxy_1; + return px; +} + // ---------------------------------------------------------------- // For x86 CS:GO. @@ -889,12 +932,14 @@ GameProxyOpt GAME_PLAYER_BY_INDEX_PROXIES[] = { GameProxyOpt { SVR_IS_X86(), game_get_player_by_index_proxy_0, { "client.dll" }, 0 }, GameProxyOpt { SVR_IS_X64(), game_get_player_by_index_proxy_1, { "client.dll" }, 0 }, + GameProxyOpt { SVR_IS_X64(), game_get_player_by_index_proxy_2, { "client.dll" }, 0 }, }; GameProxyOpt GAME_SPEC_TARGET_PROXIES[] = { GameProxyOpt { SVR_IS_X86(), game_get_spec_target_proxy_0, { "client.dll" }, 0 }, GameProxyOpt { SVR_IS_X64(), game_get_spec_target_proxy_1, { "client.dll" }, 0 }, + GameProxyOpt { SVR_IS_X64(), game_get_spec_target_proxy_2, { "client.dll" }, 0 }, }; GameOverrideOpt GAME_END_MOVIE_OVERRIDES[] = @@ -933,6 +978,7 @@ GameProxyOpt GAME_LOCAL_PLAYER_PROXIES[] = { GameProxyOpt { SVR_IS_X86(), game_get_local_player_proxy_0, { "client.dll" }, 0 }, GameProxyOpt { SVR_IS_X64(), game_get_local_player_proxy_1, { "client.dll" }, 0 }, + GameProxyOpt { SVR_IS_X64(), game_get_local_player_proxy_2, { "client.dll" }, 0 }, }; GameProxyOpt GAME_SPEC_TARGET_OR_LOCAL_PLAYER_PROXIES[] =