From d7b16e78ac419773ed5ff3d4f7ebd3fc98507561 Mon Sep 17 00:00:00 2001 From: m Date: Wed, 2 Mar 2022 07:01:01 -0600 Subject: [PATCH] sp addresses + fix mp addresses stupid ida decompiler --- src/client/component/ui_scripting.cpp | 18 +++++++++--------- src/client/game/symbols.hpp | 20 ++++++++++---------- src/client/game/ui_scripting/lua/context.cpp | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index feb13ffb..421abf06 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -152,22 +152,22 @@ namespace ui_scripting void post_unpack() override { - if (!game::environment::is_mp()) + if (game::environment::is_dedi()) { return; } - hks_start_hook.create(0x140176A40, hks_start_stub); - hks_shutdown_hook.create(0x14016CA80, hks_shutdown_stub); - hksi_lual_error_hook.create(0x14011D4CC, hksi_lual_error_stub); - hksi_lual_error_hook2.create(0x1401366B0, hksi_lual_error_stub); - hks_allocator_hook.create(0x14012BB90, hks_allocator_stub); - hks_frame_hook.create(0x1401755B0, hks_frame_stub); + 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); + hksi_lual_error_hook2.create(SELECT_VALUE(0x1400A5EA0, 0x1401366B0), hksi_lual_error_stub); + hks_allocator_hook.create(SELECT_VALUE(0x14009B570, 0x14012BAC0), hks_allocator_stub); + hks_frame_hook.create(SELECT_VALUE(0x1400E37F0, 0x1401755B0), hks_frame_stub); command::add("lui_restart", []() { - utils::hook::invoke(0x14016CA95); - utils::hook::invoke(0x1401780D0); + utils::hook::invoke(SELECT_VALUE(0x1400DD3D0, 0x14016CA80)); + utils::hook::invoke(SELECT_VALUE(0x1400E6170, 0x1401780D0)); }); } }; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 5b832bb1..5d57dd0b 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -186,16 +186,16 @@ namespace game namespace hks { - WEAK symbol lua_state{0, 0x1426D3D08}; - WEAK symbol hksi_lua_pushlstring{0, 0x1400624F0}; - WEAK symbol hks_obj_getfield{0, 0x14012C600}; - WEAK symbol hks_obj_settable{0, 0x14012D820}; - WEAK symbol hks_obj_gettable{0, 0x14012CAE0}; - WEAK symbol vm_call_internal{0, 0x140159EB0}; - WEAK symbol Hashtable_Create{0, 0x14011B320}; + WEAK symbol lua_state{0x141E2C2F8, 0x1426D3D08}; + WEAK symbol hksi_lua_pushlstring{0x14004DA90, 0x1400624F0}; + WEAK symbol hks_obj_getfield{0x14009C0A0, 0x14012C600}; + WEAK symbol hks_obj_settable{0x14009D240, 0x14012D820}; + WEAK symbol hks_obj_gettable{0x14009C580, 0x14012CAE0}; + WEAK symbol vm_call_internal{0x14009D2D0, 0x140159EB0}; + WEAK symbol Hashtable_Create{0x14008B3B0, 0x14011B320}; WEAK symbol cclosure_Create{0, 0x14011B540}; - WEAK symbol hksi_luaL_ref{0, 0x140136D30}; - WEAK symbol hksi_luaL_unref{0, 0x14012F610}; + int internal_, int profilerTreatClosureAsFunc)> cclosure_Create{0x14008B5D0, 0x14011B540}; + WEAK symbol hksi_luaL_ref{0x1400A64D0, 0x140136D30}; + WEAK symbol hksi_luaL_unref{0x14009EF10, 0x14012F610}; } } diff --git a/src/client/game/ui_scripting/lua/context.cpp b/src/client/game/ui_scripting/lua/context.cpp index d6d05f1d..def427e0 100644 --- a/src/client/game/ui_scripting/lua/context.cpp +++ b/src/client/game/ui_scripting/lua/context.cpp @@ -74,7 +74,7 @@ namespace ui_scripting::lua userdata_type[sol::meta_function::new_index] = [](const userdata& userdata, const sol::this_state s, const sol::lua_value& key, const sol::lua_value& value) { - userdata.set(convert({s, key }), convert({s, value})); + userdata.set(convert({s, key}), convert({s, value})); }; auto table_type = state.new_usertype("table_");