From b274a499d057c9a6e643c04806976207f2f7ba5b Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:42:31 +0100 Subject: [PATCH 01/15] Update network --- src/client/component/network.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index ebe2a124..77847a20 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -237,22 +237,22 @@ namespace network { void post_unpack() override { - utils::hook::nop(game::select(0x142332E76, 0x140596DF6), 4); // don't increment data pointer to optionally skip socket byte - utils::hook::call(game::select(0x142332E43, 0x140596DC3), read_socket_byte_stub); // optionally read socket byte - utils::hook::call(game::select(0x142332E81, 0x140596E01), verify_checksum_stub); // skip checksum verification - utils::hook::set(game::select(0x14233305E, 0x140596F2E), 0); // don't add checksum to packet + utils::hook::nop(game::select(0x1423322B6, 0x140596DF6), 4); // don't increment data pointer to optionally skip socket byte + utils::hook::call(game::select(0x142332283, 0x140596DC3), read_socket_byte_stub); // optionally read socket byte + utils::hook::call(game::select(0x1423322C1, 0x140596E01), verify_checksum_stub); // skip checksum verification + utils::hook::set(game::select(0x14233249E, 0x140596F2E), 0); // don't add checksum to packet utils::hook::set(game::select(0x14134C6E0, 0x14018E574), 5); // set initial connection state to challenging // intercept command handling utils::hook::call(game::select(0x14134D146, 0x14018EED0), utils::hook::assemble(handle_command_stub)); - utils::hook::set(game::select(0x14224E90D, 0x1405315F9), 0xEB); // don't kick clients without dw handle + utils::hook::set(game::select(0x14224DEAD, 0x1405315F9), 0xEB); // don't kick clients without dw handle // Skip DW stuff in NetAdr_ToString - utils::hook::set(game::select(0x142173952, 0x140515881), 0xEB); + utils::hook::set(game::select(0x142172EF2, 0x140515881), 0xEB); // NA_IP -> NA_RAWIP in NetAdr_ToString - utils::hook::set(game::select(0x142173934, 0x140515864), game::NA_RAWIP); + utils::hook::set(game::select(0x142172ED4, 0x140515864), game::NA_RAWIP); if (game::is_server()) { @@ -264,9 +264,9 @@ namespace network scheduler::once(create_ip_socket, scheduler::main); // Kill lobby system - handle_packet_internal_hook.create(game::select(0x141EF8030, 0x1404A5B90), &handle_packet_internal_stub); + handle_packet_internal_hook.create(game::select(0x141EF7FE0, 0x1404A5B90), &handle_packet_internal_stub); } }; } -REGISTER_COMPONENT(network::component) +REGISTER_COMPONENT_WORKING(network::component) From 70e405f0c45e6780a5729a57fd6cd81081dabe82 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:42:44 +0100 Subject: [PATCH 02/15] Update party --- src/client/component/party.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/component/party.cpp b/src/client/component/party.cpp index e7490803..3fa172ea 100644 --- a/src/client/component/party.cpp +++ b/src/client/component/party.cpp @@ -90,7 +90,7 @@ namespace party { const auto LobbyJoin_Begin = reinterpret_cast(0x141ED9540_g); + game::LobbyType targetLobbyType)>(0x141ED94D0_g); if (!LobbyJoin_Begin(0, game::CONTROLLER_INDEX_FIRST, game::LOBBY_TYPE_PRIVATE, game::LOBBY_TYPE_PRIVATE)) { @@ -205,7 +205,7 @@ namespace party game::netadr_t get_connected_server() { constexpr auto local_client_num = 0ull; - const auto address = *reinterpret_cast(0x1453DABB8_g) + (0x25780 * local_client_num) + 0x10; + const auto address = *reinterpret_cast(0x1453D8BB8_g) + (0x25780 * local_client_num) + 0x10; return *reinterpret_cast(address); } @@ -297,7 +297,7 @@ namespace party { void post_unpack() override { - utils::hook::jump(0x141EE6030_g, &connect_stub); + utils::hook::jump(0x141EE5FE0_g, &connect_stub); network::on("infoResponse", handle_info_response); scheduler::loop(cleanup_queried_servers, scheduler::async, 200ms); @@ -313,4 +313,4 @@ namespace party }; } -REGISTER_COMPONENT(party::component) +REGISTER_COMPONENT_WORKING(party::component) From eee4fc5cd1e0a0ca4228ea4c54b6a0a81a25f256 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:42:53 +0100 Subject: [PATCH 03/15] Update patches --- src/client/component/patches.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/patches.cpp b/src/client/component/patches.cpp index abe3c552..54ce700c 100644 --- a/src/client/component/patches.cpp +++ b/src/client/component/patches.cpp @@ -33,4 +33,4 @@ namespace patches }; } -REGISTER_COMPONENT(patches::component) +REGISTER_COMPONENT_WORKING(patches::component) From 128df546f137385ad61cf0b9ed7b71f457dbbbef Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:55:41 +0100 Subject: [PATCH 04/15] Update scheduler --- src/client/component/scheduler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/component/scheduler.cpp b/src/client/component/scheduler.cpp index 8b5ae514..fd6f7acf 100644 --- a/src/client/component/scheduler.cpp +++ b/src/client/component/scheduler.cpp @@ -168,12 +168,12 @@ namespace scheduler { if (!game::is_server()) { - r_end_frame_hook.create(0x142273560_g, r_end_frame_stub); + r_end_frame_hook.create(0x142272B00_g, r_end_frame_stub); // some func called before R_EndFrame, maybe SND_EndFrame? } //g_run_frame_hook.create(0x14065C360_g, server_frame_stub); // GlassSv_Update - main_frame_hook.create(game::select(0x1420F9860, 0x1405020E0), main_frame_stub); + main_frame_hook.create(game::select(0x1420F8E00, 0x1405020E0), main_frame_stub); // Com_Frame_Try_Block_Function } @@ -188,4 +188,4 @@ namespace scheduler }; } -REGISTER_COMPONENT(scheduler::component) +REGISTER_COMPONENT_WORKING(scheduler::component) From aa1ed82eda0d8aa86b24a7e6dfcf92e24e7a2904 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:03:27 +0100 Subject: [PATCH 05/15] Forgot an address in party.cpp --- src/client/component/party.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/party.cpp b/src/client/component/party.cpp index 3fa172ea..4065c3ef 100644 --- a/src/client/component/party.cpp +++ b/src/client/component/party.cpp @@ -44,7 +44,7 @@ namespace party { scheduler::once([=] { - const auto local_client = *reinterpret_cast(0x14342355C_g); + const auto local_client = *reinterpret_cast(0x14342155C_g); const auto current_mode = game::Com_SessionMode_GetMode(); game::Com_SwitchMode(local_client, current_mode, mode, 6); }, scheduler::main); From abde1e009f0201613f0ca61998dbcbdc2118c139 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:18:37 +0100 Subject: [PATCH 06/15] Update branding --- src/client/component/branding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index dc8a48d6..c5539723 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -34,4 +34,4 @@ namespace branding }; } -REGISTER_COMPONENT(branding::component) +REGISTER_COMPONENT_WORKING(branding::component) From e1d1400737403a275fe2d15daaeeaf2d675e8ae4 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:24:09 +0100 Subject: [PATCH 07/15] Update command --- src/client/component/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index 767e328e..c5d8b35b 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -71,7 +71,7 @@ namespace command void post_unpack() override { // Disable whitelist - utils::hook::jump(game::select(0x1420EF190, 0x1404F9CD0), update_whitelist_stub); + utils::hook::jump(game::select(0x1420EE860, 0x1404F9CD0), update_whitelist_stub); } }; @@ -194,4 +194,4 @@ namespace command } } -REGISTER_COMPONENT(command::component) +REGISTER_COMPONENT_WORKING(command::component) From 149ac1a2191cf46c110b72b68066ce2d62e83bae Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:29:40 +0100 Subject: [PATCH 08/15] Update client_patches --- src/client/component/client_patches.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/client_patches.cpp b/src/client/component/client_patches.cpp index 0a2cf29d..e2f71ebc 100644 --- a/src/client/component/client_patches.cpp +++ b/src/client/component/client_patches.cpp @@ -79,11 +79,11 @@ namespace client_patches fix_amd_cpu_stuttering(); // Kill microphones for now - utils::hook::set(0x15AAEB254_g, mixer_open_stub); + utils::hook::set(0x15AAE9254_g, mixer_open_stub); preload_map_hook.create(0x14135A1E0_g, preload_map_stub); } }; } -REGISTER_COMPONENT(client_patches::component) +REGISTER_COMPONENT_WORKING(client_patches::component) From 89e14e8bbb13152d7e611d8ad2a93250eca66a74 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:41:31 +0100 Subject: [PATCH 09/15] Update dvars --- src/client/component/dvars.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/component/dvars.cpp b/src/client/component/dvars.cpp index 5d06b85a..c8173948 100644 --- a/src/client/component/dvars.cpp +++ b/src/client/component/dvars.cpp @@ -202,23 +202,23 @@ namespace dvars if (!game::is_server()) { scheduler::once(read_archive_dvars, scheduler::pipeline::main); - dvar_set_variant_hook.create(0x1422C9A90_g, dvar_set_variant_stub); + dvar_set_variant_hook.create(0x1422C9030_g, dvar_set_variant_stub); // Show all known dvars in console - utils::hook::jump(0x1422BD890_g, dvar_for_each_name_stub); - utils::hook::jump(0x1422BD7E0_g, dvar_for_each_name_client_num_stub); + utils::hook::jump(0x1422BCE30_g, dvar_for_each_name_stub); + utils::hook::jump(0x1422BCD80_g, dvar_for_each_name_client_num_stub); } scheduler::once(copy_dvar_names_to_pool, scheduler::pipeline::main); // All dvars are recognized as command - utils::hook::nop(game::select(0x14215297A, 0x14050949A), 2); + utils::hook::nop(game::select(0x142151F1A, 0x14050949A), 2); // Show all dvars in dvarlist command - utils::hook::nop(game::select(0x142152C87, 0x140509797), 6); + utils::hook::nop(game::select(0x142152227, 0x140509797), 6); // Show all dvars in dvardump command - utils::hook::nop(game::select(0x142152659, 0x140509179), 6); + utils::hook::nop(game::select(0x142151BF9, 0x140509179), 6); } }; } -REGISTER_COMPONENT(dvars::component) +REGISTER_COMPONENT_WORKING(dvars::component) From dc3278e0711d3c3a7003cadbe5cfcd89c2f39885 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 16:50:42 +0100 Subject: [PATCH 10/15] Update getinfo --- src/client/component/getinfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/component/getinfo.cpp b/src/client/component/getinfo.cpp index 5478d56a..36c34aab 100644 --- a/src/client/component/getinfo.cpp +++ b/src/client/component/getinfo.cpp @@ -24,7 +24,7 @@ namespace getinfo int get_client_count() { int count = 0; - const auto client_states = *reinterpret_cast(game::select(0x1576FB318, 0x14A178E98)); + const auto client_states = *reinterpret_cast(game::select(0x1576F9318, 0x14A178E98)); if (!client_states) { return 0; @@ -46,7 +46,7 @@ namespace getinfo int get_bot_count() { - const auto client_states = *reinterpret_cast(game::select(0x1576FB318, 0x14A178E98)); + const auto client_states = *reinterpret_cast(game::select(0x1576F9318, 0x14A178E98)); if (!client_states) { return 0; @@ -69,7 +69,7 @@ namespace getinfo { int Com_SessionMode_GetGameMode() { - return *reinterpret_cast(game::select(0x1568EF7F4, 0x14948DB04)) << 14 >> 28; + return *reinterpret_cast(game::select(0x1568ED7F4, 0x14948DB04)) << 14 >> 28; } } @@ -119,4 +119,4 @@ namespace getinfo }; } -REGISTER_COMPONENT(getinfo::component) +REGISTER_COMPONENT_WORKING(getinfo::component) From 8b57c4794ac3a200b088f710aa73b55e57874860 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:05:55 +0100 Subject: [PATCH 11/15] Update loot --- src/client/component/loot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/component/loot.cpp b/src/client/component/loot.cpp index 928abbe6..b675cc62 100644 --- a/src/client/component/loot.cpp +++ b/src/client/component/loot.cpp @@ -62,9 +62,9 @@ namespace loot dvar_cg_unlockall_loot = game::Dvar_RegisterBool(game::Dvar_GenerateHash("cg_unlockall_loot"), "cg_unlockall_loot", false, (game::dvarFlags_e)0x0, "Unlocks blackmarket loot"); dvar_cg_unlockall_loot->debugName = "cg_unlockall_loot"; - loot_getitemquantity_hook.create(0x141E82C90_g, loot_getitemquantity_stub); - liveinventory_getitemquantity_hook.create(0x141E090C0_g, liveinventory_getitemquantity_stub); - liveinventory_areextraslotspurchased_hook.create(0x141E089E0_g, liveinventory_areextraslotspurchased_stub); + loot_getitemquantity_hook.create(0x141E82C00_g, loot_getitemquantity_stub); + liveinventory_getitemquantity_hook.create(0x141E09030_g, liveinventory_getitemquantity_stub); + liveinventory_areextraslotspurchased_hook.create(0x141E08950_g, liveinventory_areextraslotspurchased_stub); scheduler::once([]() { if (dvar_cg_unlockall_loot->current.enabled) @@ -76,4 +76,4 @@ namespace loot }; }; -REGISTER_COMPONENT(loot::component) +REGISTER_COMPONENT_WORKING(loot::component) From 68c2459b9cf9f11bce4a4b4d1a061e3d49baec59 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:08:19 +0100 Subject: [PATCH 12/15] Update script --- src/client/component/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index 7bdc3241..b32c4b19 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -134,4 +134,4 @@ namespace script }; }; -REGISTER_COMPONENT(script::component) +REGISTER_COMPONENT_WORKING(script::component) From daa32e9080ea59657cdefce7db1cf8b4c14d2d3f Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 17:34:04 +0100 Subject: [PATCH 13/15] Update bots --- src/client/component/bots.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/bots.cpp b/src/client/component/bots.cpp index 23ca2bc5..e07aa9b8 100644 --- a/src/client/component/bots.cpp +++ b/src/client/component/bots.cpp @@ -118,7 +118,7 @@ namespace bots void post_unpack() override { utils::hook::jump(game::select(0x141653B70, 0x1402732E0), get_bot_name); - utils::hook::call(game::select(0x142249AF7, 0x14052E53A), format_bot_string); + utils::hook::call(game::select(0x142249097, 0x14052E53A), format_bot_string); if (!game::is_server()) { @@ -157,4 +157,4 @@ namespace bots }; } -REGISTER_COMPONENT(bots::component) +REGISTER_COMPONENT_WORKING(bots::component) From a1d46ba5944a758288aef89b5e170f280796a8b4 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:09:39 +0100 Subject: [PATCH 14/15] Update ui_scripting --- src/client/component/ui_scripting.cpp | 10 +++++----- src/client/game/symbols.hpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index baa565b9..b52d8136 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -454,10 +454,10 @@ namespace ui_scripting utils::hook::call(game::select(0x141D4979A, 0x1403F233A), hks_load_stub); hks_package_require_hook.create(game::select(0x141D28EF0, 0x1403D7FC0), hks_package_require_stub); - ui_cod_init_hook.create(game::select(0x141F298B0, 0x1404A0A50), ui_cod_init_stub); - ui_cod_lobbyui_init_hook.create(game::select(0x141F2C620, 0x1404A1F50), ui_cod_lobbyui_init_stub); - ui_shutdown_hook.create(game::select(0x14270E9C0, 0x1404A1280), ui_shutdown_stub); - lua_cod_getrawfile_hook.create(game::select(0x141F0F880, 0x1404BCB70), lua_cod_getrawfile_stub); + ui_cod_init_hook.create(game::UI_CoD_Init, ui_cod_init_stub); + ui_cod_lobbyui_init_hook.create(game::UI_CoD_LobbyUI_Init, ui_cod_lobbyui_init_stub); + ui_shutdown_hook.create(game::UI_CoD_Shutdown, ui_shutdown_stub); + lua_cod_getrawfile_hook.create(game::select(0x141F0EFE0, 0x1404BCB70), lua_cod_getrawfile_stub); if (game::is_server()) { @@ -507,4 +507,4 @@ namespace ui_scripting }; } -REGISTER_COMPONENT(ui_scripting::component) +REGISTER_COMPONENT_WORKING(ui_scripting::component) diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 63ce0ff6..48f8b4bd 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -99,9 +99,9 @@ namespace game }; // UI - WEAK symbol UI_CoD_Init{0x141F29010, 0x0}; - WEAK symbol UI_CoD_LobbyUI_Init{0x141F2BD80, 0x0}; - WEAK symbol UI_CoD_Shutdown{0x141F32E10, 0x0}; + WEAK symbol UI_CoD_Init{0x141F29010, 0x1404A0A50}; + WEAK symbol UI_CoD_LobbyUI_Init{0x141F2BD80, 0x1404A1F50}; + WEAK symbol UI_CoD_Shutdown{0x141F32E10, 0x1404A1280}; WEAK symbol UI_AddMenu{0x1427018F0, 0x0}; WEAK symbol UI_CoD_GetRootNameForController{0x141F28940, 0x0}; WEAK symbol Lua_CoD_LoadLuaFile{0x141F11A20, 0x0}; From 025dc6d94547cb6ce61811f11a05333c75226cf2 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:11:14 +0100 Subject: [PATCH 15/15] Remove comment --- src/client/component/scheduler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/component/scheduler.cpp b/src/client/component/scheduler.cpp index fd6f7acf..b22dc659 100644 --- a/src/client/component/scheduler.cpp +++ b/src/client/component/scheduler.cpp @@ -172,7 +172,6 @@ namespace scheduler // some func called before R_EndFrame, maybe SND_EndFrame? } - //g_run_frame_hook.create(0x14065C360_g, server_frame_stub); // GlassSv_Update main_frame_hook.create(game::select(0x1420F8E00, 0x1405020E0), main_frame_stub); // Com_Frame_Try_Block_Function }