diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index fd7e84e8..58765332 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -41,8 +41,8 @@ namespace branding if (game::environment::is_mp()) { - //localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER\n"); - //localized_strings::override("MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER"); + localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER\n"); + localized_strings::override("MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER"); } //dvars::override::set_string("version", utils::string::va("H1-Mod %s", VERSION)); diff --git a/src/client/component/colors.cpp b/src/client/component/colors.cpp index aa2631cb..ec563b89 100644 --- a/src/client/component/colors.cpp +++ b/src/client/component/colors.cpp @@ -96,7 +96,7 @@ namespace colors const size_t unk, const size_t unk2) { // CL_GetClientName (CL_GetClientNameAndClantag?) - const auto result = utils::hook::invoke(0x14025BAA0, local_client_num, index, buf, size, unk, unk2); + const auto result = utils::hook::invoke(0x343BA0_b, local_client_num, index, buf, size, unk, unk2); utils::string::strip(buf, buf, size); @@ -109,11 +109,11 @@ namespace colors if (index == '8') { - *color = *reinterpret_cast(SELECT_VALUE(0x14F142FF8, 0x14FE70634)); // H1(1.4) + *color = *reinterpret_cast(SELECT_VALUE(0x0, 0xEA749B4_b)); // 1.15 } else if (index == '9') { - *color = *reinterpret_cast(SELECT_VALUE(0x14F142FFC, 0x14FE70638)); // H1(1.4) + *color = *reinterpret_cast(SELECT_VALUE(0x0, 0xEA749B8_b)); // 1.15 } else if (index == ':') { @@ -121,7 +121,7 @@ namespace colors } else if (index == ';') { - *color = *reinterpret_cast(SELECT_VALUE(0x14F143004, 0x14FE70640)); // H1(1.4) + *color = *reinterpret_cast(SELECT_VALUE(0x0, 0xEA749C0_b)); // 1.15 } else if (index == '<') { @@ -147,17 +147,17 @@ namespace colors if (!game::environment::is_sp()) { // allows colored name in-game - utils::hook::jump(0x140503810, com_clean_name_stub); // H1(1.4) + utils::hook::jump(0x5AEDF0_b, com_clean_name_stub); // 1.15 // don't apply colors to overhead names - utils::hook::call(0x1400AB416, get_client_name_stub); // H1(1.4) + utils::hook::call(0xF7B85_b, get_client_name_stub); // 1.15 // patch I_CleanStr - utils::hook::jump(0x140503D00, i_clean_str_stub); // H1(1.4) + utils::hook::jump(0x5AF2E0_b, i_clean_str_stub); // 1.15 } // force new colors - utils::hook::jump(SELECT_VALUE(0x140524BD0, 0x1406206A0), rb_lookup_color_stub); // H1(1.4) + utils::hook::jump(SELECT_VALUE(0x0, 0x6C9460_b), rb_lookup_color_stub); // 1.15 // add colors add(0, 0, 0); // 0 - Black @@ -179,4 +179,4 @@ namespace colors }; } -//REGISTER_COMPONENT(colors::component) +REGISTER_COMPONENT(colors::component) diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 78ed8422..39f3f9dd 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -28,7 +28,6 @@ namespace console while (true) { std::getline(std::cin, cmd); - } return 0; @@ -47,11 +46,7 @@ namespace console void dispatch_message(const int type, const std::string& message) { - //if (native_console()) - //{ printf("%s\n", message.data()); - // return; - //} //game_console::print(type, message); //messages.access([&message](message_queue& msgs) diff --git a/src/client/component/input.cpp b/src/client/component/input.cpp index ea2fa309..023a317b 100644 --- a/src/client/component/input.cpp +++ b/src/client/component/input.cpp @@ -66,10 +66,10 @@ namespace input return; } - cl_char_event_hook.create(SELECT_VALUE(0x1401871A0, 0x14024E810), cl_char_event_stub); - cl_key_event_hook.create(SELECT_VALUE(0x1401874D0, 0x14024EA60), cl_key_event_stub); + cl_char_event_hook.create(SELECT_VALUE(0x0, 0x12C8F0_b), cl_char_event_stub); + cl_key_event_hook.create(SELECT_VALUE(0x0, 0x135A70_b), cl_key_event_stub); } }; } -//REGISTER_COMPONENT(input::component) +REGISTER_COMPONENT(input::component) diff --git a/src/client/component/localized_strings.cpp b/src/client/component/localized_strings.cpp index cd9d4718..e66fc692 100644 --- a/src/client/component/localized_strings.cpp +++ b/src/client/component/localized_strings.cpp @@ -49,4 +49,4 @@ namespace localized_strings }; } -//REGISTER_COMPONENT(localized_strings::component) +REGISTER_COMPONENT(localized_strings::component) diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index d1212d81..88d5ccb7 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -60,11 +60,11 @@ namespace network // Command handled a.popad64(); a.mov(al, 1); - a.jmp(0x140252AF8); + a.jmp(0x12FCAA_b); a.bind(return_unhandled); a.popad64(); - a.jmp(0x14025234C); + a.jmp(0x12F3AC_b); } int net_compare_base_address(const game::netadr_s* a1, const game::netadr_s* a2) @@ -110,7 +110,7 @@ namespace network if (net_interface && net_interface != "localhost"s) { // Sys_StringToSockaddr - utils::hook::invoke(0x1404F6580, net_interface, &address); + utils::hook::invoke(0x59E810_b, net_interface, &address); } address.sin_family = AF_INET; @@ -229,53 +229,52 @@ namespace network } // redirect dw_sendto to raw socket - //utils::hook::jump(0x1404D850A, reinterpret_cast(0x1404D849A)); - utils::hook::call(0x140513467, dw_send_to_stub); + utils::hook::call(0x5BDB47_b, dw_send_to_stub); utils::hook::jump(game::Sys_SendPacket, dw_send_to_stub); // intercept command handling - utils::hook::jump(0x140252327, utils::hook::assemble(handle_command_stub), true); + utils::hook::jump(0x12F387_b, utils::hook::assemble(handle_command_stub), true); // handle xuid without secure connection - utils::hook::nop(0x140486AAF, 6); + utils::hook::nop(0x554222_b, 6); - utils::hook::jump(0x140424F20, net_compare_address); - utils::hook::jump(0x140424F70, net_compare_base_address); + utils::hook::jump(0x4F1800_b, net_compare_address); + utils::hook::jump(0x4F1850_b, net_compare_base_address); // don't establish secure conenction - utils::hook::set(0x14027EA4D, 0xEB); - utils::hook::set(0x14027EB1E, 0xEB); - utils::hook::set(0x14027EF8D, 0xEB); - utils::hook::set(0x14025081F, 0xEB); + utils::hook::set(0x358C8D_b, 0xEB); + utils::hook::set(0x358D5E_b, 0xEB); + utils::hook::set(0x3591CD_b, 0xEB); + utils::hook::set(0x12CD0F_b, 0xEB); // ignore unregistered connection - utils::hook::jump(0x140480F46, 0x140480EE5); - utils::hook::set(0x140480F3B, 0xEB); + utils::hook::jump(0x54E2D1_b, 0x54E270_b); + utils::hook::set(0x54E2C6_b, 0xEB); // disable xuid verification - utils::hook::set(0x14005B62D, 0xEB); - utils::hook::set(0x14005B649, 0xEB); + utils::hook::set(0x728BF_b, 0xEB); + //utils::hook::set(0x14005B649, 0xEB); // not found // disable xuid verification - utils::hook::nop(0x14048382C, 2); - utils::hook::set(0x140483889, 0xEB); + utils::hook::nop(0x5509D9_b, 2); + utils::hook::set(0x550A36_b, 0xEB); // ignore configstring mismatch - utils::hook::set(0x1402591C9, 0xEB); + //utils::hook::set(0x1402591C9, 0xEB); // not found // ignore dw handle in SV_PacketEvent - utils::hook::set(0x1404898E2, 0xEB); - utils::hook::call(0x1404898D6, &net_compare_address); + utils::hook::set(0x1CBC22_b, 0xEB); + utils::hook::call(0x1CBC16_b, &net_compare_address); // ignore dw handle in SV_FindClientByAddress - utils::hook::set(0x140488EFD, 0xEB); - utils::hook::call(0x140488EF1, &net_compare_address); + utils::hook::set(0x1CB24D_b, 0xEB); + utils::hook::call(0x1CB241_b, &net_compare_address); // ignore dw handle in SV_DirectConnect - utils::hook::set(0x140480C58, 0xEB); - utils::hook::set(0x140480E6F, 0xEB); - utils::hook::call(0x140480C4B, &net_compare_address); - utils::hook::call(0x140480E62, &net_compare_address); + utils::hook::set(0x54DFE8_b, 0xEB); + utils::hook::set(0x54E1FD_b, 0xEB); + utils::hook::call(0x54DFDB_b, &net_compare_address); + utils::hook::call(0x54E1F0_b, &net_compare_address); // increase cl_maxpackets dvars::override::register_int("cl_maxpackets", 1000, 1, 1000, game::DVAR_FLAG_SAVED); @@ -284,31 +283,31 @@ namespace network dvars::override::register_int("sv_remote_client_snapshot_msec", 33, 33, 100, game::DVAR_FLAG_NONE); // ignore impure client - utils::hook::jump(0x140481B58, 0x140481BEE); + utils::hook::jump(0x54EDD3_b, 0x54EE69_b); // don't send checksum - utils::hook::set(0x1404F6398, 0); + utils::hook::set(0x59E628_b, 0); // don't read checksum - utils::hook::set(0x1404F6620, 0xC301B0); + utils::hook::set(0x59E8B0_b, 0xC301B0); // don't try to reconnect client - utils::hook::call(0x140480DFF, reconnect_migratated_client); - utils::hook::nop(0x140480DDB, 4); // this crashes when reconnecting for some reason + utils::hook::call(0x54E18C_b, reconnect_migratated_client); + utils::hook::nop(0x54E168_b, 4); // this crashes when reconnecting for some reason // allow server owner to modify net_port before the socket bind - utils::hook::call(0x140512BE5, register_netport_stub); - utils::hook::call(0x140512D20, register_netport_stub); + utils::hook::call(0x5BD2B5_b, register_netport_stub); + utils::hook::call(0x5BD3F0_b, register_netport_stub); // increase allowed packet size const auto max_packet_size = 0x20000; - utils::hook::set(0x1404255F1, max_packet_size); - utils::hook::set(0x140425630, max_packet_size); - utils::hook::set(0x140425522, max_packet_size); - utils::hook::set(0x140425545, max_packet_size); + utils::hook::set(0x4F1ED1_b, max_packet_size); + utils::hook::set(0x4F1F10_b, max_packet_size); + utils::hook::set(0x4F1E02_b, max_packet_size); + utils::hook::set(0x4F1E25_b, max_packet_size); // ignore built in "print" oob command and add in our own - utils::hook::set(0x14025280E, 0xEB); + utils::hook::set(0x12F817_b, 0xEB); on("print", [](const game::netadr_s&, const std::string_view& data) { const std::string message{data}; @@ -317,7 +316,7 @@ namespace network // Use our own socket since the game's socket doesn't work with non localhost addresses // why? no idea - utils::hook::jump(0x140512B40, create_socket); + utils::hook::jump(0x5BD210_b, create_socket); } } }; diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index f4dffb32..46bf5332 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -185,22 +185,22 @@ namespace ui_scripting scheduler::loop(ui_scripting::lua::engine::run_frame, scheduler::pipeline::lui); - hks_start_hook.create(SELECT_VALUE(0x1400E4B40, 0x140176A40), hks_start_stub); - hks_shutdown_hook.create(SELECT_VALUE(0x1400DD3D0, 0x14016CA80), hks_shutdown_stub); - hksi_lual_error_hook.create(SELECT_VALUE(0x1400A5EA0, 0x14012F300), hksi_lual_error_stub); - hks_allocator_hook.create(SELECT_VALUE(0x14009B570, 0x14012BAC0), hks_allocator_stub); - lui_error_hook.create(SELECT_VALUE(0x14007D7D0, 0x14010C9E0), lui_error_stub); - hksi_hks_error_hook.create(SELECT_VALUE(0x14009DD80, 0x14012E390), hksi_hks_error_stub); + hks_start_hook.create(SELECT_VALUE(0x0, 0x27A790_b), hks_start_stub); // 1.15 + hks_shutdown_hook.create(SELECT_VALUE(0x0, 0x2707C0_b), hks_shutdown_stub); // 1.15 + hksi_lual_error_hook.create(SELECT_VALUE(0x0, 0x22F930_b), hksi_lual_error_stub); // 1.15 + hks_allocator_hook.create(SELECT_VALUE(0x0, 0x22C010_b), hks_allocator_stub); // 1.15 + lui_error_hook.create(SELECT_VALUE(0x0, 0x20BA80_b), lui_error_stub); // 1.15 + hksi_hks_error_hook.create(SELECT_VALUE(0x0, 0x22EA10_b), hksi_hks_error_stub); // 1.15 if (game::environment::is_mp()) { - hksi_lual_error_hook2.create(0x1401366B0, hksi_lual_error_stub); + hksi_lual_error_hook2.create(0x2365E0_b, hksi_lual_error_stub); // 1.15 } command::add("lui_restart", []() { - utils::hook::invoke(SELECT_VALUE(0x1400DD3D0, 0x14016CA80)); - utils::hook::invoke(SELECT_VALUE(0x1400E6170, 0x1401780D0)); + utils::hook::invoke(SELECT_VALUE(0x0, 0x2707C0_b)); // 1.15 + utils::hook::invoke(SELECT_VALUE(0x0, 0x27BEC0_b)); // 1.15 }); } }; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 83ba3e8d..75bd2671 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -8,66 +8,66 @@ namespace game * Functions **************************************************************/ - WEAK symbol AddRefToValue{0x0, 0x0}; - WEAK symbol RemoveRefToValue{0x0, 0x0}; - WEAK symbol AddRefToObject{0x0, 0x0}; - WEAK symbol RemoveRefToObject{0x0, 0x0}; - WEAK symbol AllocThread{0x0, 0x0}; + WEAK symbol AddRefToValue{0x0, 0x5090E0}; + WEAK symbol RemoveRefToValue{0x0, 0x50ABF0}; + WEAK symbol AddRefToObject{0x0, 0x5090D0}; + WEAK symbol RemoveRefToObject{0x0, 0x50AAE0}; + WEAK symbol AllocThread{0x0, 0x509440}; WEAK symbol AllocVariable{0x0, 0x0}; - WEAK symbol Cbuf_AddText{0x0, 0x1CF480}; // 1.15 + WEAK symbol Cbuf_AddText{0x0, 0x1CF480}; WEAK symbol Cbuf_ExecuteBufferInternal{0x0, 0x0}; + void (int, int, const char*))> Cbuf_ExecuteBufferInternal{0x0, 0x155BC0}; WEAK symbol Conbuf_AppendText{0x0, 0x0}; - WEAK symbol ConcatArgs{0x0, 0x0}; + WEAK symbol ConcatArgs{0x0, 0x413050}; WEAK symbol Cmd_ExecuteSingleCommand{0x0, 0x0}; - WEAK symbol Cmd_AddCommandInternal{0x0, 0x0}; - WEAK symbol Cmd_RemoveCommand{0x0, 0x0}; + WEAK symbol Cmd_AddCommandInternal{0x0, 0x156880}; + WEAK symbol Cmd_RemoveCommand{0x0, 0x157690}; WEAK symbol Cmd_TokenizeString{0x0, 0x0}; WEAK symbol Cmd_EndTokenizeString{0x0, 0x0}; - WEAK symbol AimAssist_AddToTargetList{0x0, 0x0}; + WEAK symbol AimAssist_AddToTargetList{0x0, 0xE66C0}; WEAK symbol BG_GetWeaponNameComplete{0x0, 0x0}; + char* output, unsigned int maxStringLen)> BG_GetWeaponNameComplete{0x0, 0x2E2500}; WEAK symbol Com_Frame_Try_Block_Function{0x0, 0x0}; - WEAK symbol Com_GetCurrentCoDPlayMode{0x0, 0x0}; - WEAK symbol Com_InFrontend{0x0, 0x0}; - WEAK symbol Com_SetSlowMotion{0x0, 0x0}; + WEAK symbol Com_GetCurrentCoDPlayMode{0x0, 0x5AEF80}; + WEAK symbol Com_InFrontend{0x0, 0x76A40}; + WEAK symbol Com_SetSlowMotion{0x0, 0x17E5F0}; WEAK symbol Com_Error{0x0, 0x0}; - WEAK symbol Com_Quit_f{0x0, 0x0}; + WEAK symbol Com_Quit_f{0x0, 0x1F9280}; WEAK symbol Com_Shutdown{0x0, 0x0}; - WEAK symbol Quit{0x0, 0x0}; + WEAK symbol Quit{0x0, 0x1F9280}; - WEAK symbol CG_GameMessage{0x0, 0x0}; - WEAK symbol CG_GameMessageBold{0x0, 0x0}; + WEAK symbol CG_GameMessage{0x0, 0x316210}; + WEAK symbol CG_GameMessageBold{0x0, 0x3122F0}; WEAK symbol CG_SetClientDvarFromServer{0x0, 0x0}; WEAK symbol CG_GetWeaponDisplayName{0x0, 0x0}; - WEAK symbol CL_IsCgameInitialized{0x0, 0x0}; + WEAK symbol CL_IsCgameInitialized{0x0, 0x76A40}; WEAK symbol CL_VirtualLobbyShutdown{0x0, 0x0}; - WEAK symbol Dvar_SetCommand{0x0, 0x0}; - WEAK symbol Dvar_FindVar{0x0, 0x0}; + WEAK symbol Dvar_SetCommand{0x0, 0x1857D0}; + WEAK symbol Dvar_FindVar{0x0, 0x183EB0}; WEAK symbol Dvar_ClearModified{0x0, 0x0}; - WEAK symbol Dvar_GetCombinedString{0x0, 0x0}; + WEAK symbol Dvar_GetCombinedString{0x0, 0x4EA020}; WEAK symbol Dvar_ValueToString{0x0, 0x0}; - WEAK symbol Dvar_Reset{0x0, 0x0}; + WEAK symbol Dvar_Reset{0x0, 0x185390}; WEAK symbol Dvar_SetFromStringByNameFromSource{0x0, 0x0}; + DvarSetSource)> Dvar_SetFromStringByNameFromSource{0x0, 0x185BD0}; WEAK symbol Dvar_RegisterBool{0x0, 0x0}; + unsigned int flags)> Dvar_RegisterBool{0x0, 0x182340}; WEAK symbol Dvar_RegisterInt{0x0, 0x0}; + unsigned int flags)> Dvar_RegisterInt{0x0, 0x182A10}; WEAK symbol Dvar_RegisterFloat{0x0, 0x0}; + float max, unsigned int flags)> Dvar_RegisterFloat{0x0, 0x182900}; WEAK symbol Dvar_RegisterString{0x0, 0x0}; + unsigned int flags)> Dvar_RegisterString{0x0, 0x182AF0}; WEAK symbol Dvar_RegisterVec4{0x0, 0x0}; @@ -103,7 +103,7 @@ namespace game WEAK symbol Live_SyncOnlineDataFlags{0x0, 0x0}; - WEAK symbol Material_RegisterHandle{0x0, 0x0}; + WEAK symbol Material_RegisterHandle{0x0, 0x692360}; WEAK symbol NetadrToSockadr{0x0, 0x0}; WEAK symbol NET_OutOfBandPrint{0x0, 0x0}; @@ -112,15 +112,15 @@ namespace game WEAK symbol R_AddCmdDrawStretchPic{0x0, 0x0}; - WEAK symbol R_RegisterFont{0x0, 0x67F630}; // 1.15 + WEAK symbol R_RegisterFont{0x0, 0x67F630}; WEAK symbol R_TextWidth{0x0, 0x0}; - WEAK symbol R_GetFontHeight{0x0, 0x67F710}; // 1.15 - WEAK symbol R_DrawSomething{0x0, 0x67ECE0}; // 1.15 + WEAK symbol R_GetFontHeight{0x0, 0x67F710}; + WEAK symbol R_DrawSomething{0x0, 0x67ECE0}; WEAK symbol R_SyncRenderThread{0x0, 0x0}; WEAK symbol H1_AddBaseDrawTextCmd{0x0, 0x6A3080}; // 1.15 + void* style_unk)> H1_AddBaseDrawTextCmd{0x0, 0x6A3080}; #define R_AddCmdDrawText(TXT, MC, F, X, Y, XS, YS, R, C, S) \ H1_AddBaseDrawTextCmd(TXT, MC, F, game::R_GetFontHeight(F), X, Y, XS, YS, R, C, S,-1, 0, game::R_DrawSomething(S)) @@ -220,7 +220,7 @@ namespace game WEAK symbol gameEntityId{0x0, 0x0}; WEAK symbol command_whitelist{0x0, 0x0}; - WEAK symbol cmd_functions{0x0, 0x344DF18}; // 1.15 + WEAK symbol cmd_functions{0x0, 0x344DF18}; WEAK symbol cmd_args{0x0, 0x0}; WEAK symbol g_poolSize{0x0, 0x0}; @@ -238,7 +238,7 @@ namespace game WEAK symbol DB_XAssetPool{0x0, 0x0}; WEAK symbol g_assetNames{0x0, 0x0}; - WEAK symbol keyCatchers{0x0, 0x0}; + WEAK symbol keyCatchers{0x0, 0x2EC82C4}; WEAK symbol playerKeys{0x0, 0x0}; WEAK symbol query_socket{0x0, 0x0}; @@ -247,7 +247,7 @@ namespace game namespace mp { - WEAK symbol g_entities{0x0, 0x71F19E0}; // 1.15 + WEAK symbol g_entities{0x0, 0x71F19E0}; WEAK symbol svs_clients{0x0, 0x0}; WEAK symbol svs_numclients{0x0, 0x0}; WEAK symbol gameTime{0x0, 0x0};