sp addresses + fix mp addresses

stupid ida decompiler
This commit is contained in:
m 2022-03-02 07:01:01 -06:00
parent 5793866b7f
commit d7b16e78ac
3 changed files with 20 additions and 20 deletions

View File

@ -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<void>(0x14016CA95);
utils::hook::invoke<void>(0x1401780D0);
utils::hook::invoke<void>(SELECT_VALUE(0x1400DD3D0, 0x14016CA80));
utils::hook::invoke<void>(SELECT_VALUE(0x1400E6170, 0x1401780D0));
});
}
};

View File

@ -186,16 +186,16 @@ namespace game
namespace hks
{
WEAK symbol<lua_State*> lua_state{0, 0x1426D3D08};
WEAK symbol<void(lua_State* s, const char* str, unsigned int l)> hksi_lua_pushlstring{0, 0x1400624F0};
WEAK symbol<HksObject*(HksObject* result, lua_State* s, const HksObject* table, const HksObject* key)> hks_obj_getfield{0, 0x14012C600};
WEAK symbol<void(lua_State* s, const HksObject* tbl, const HksObject* key, const HksObject* val)> hks_obj_settable{0, 0x14012D820};
WEAK symbol<HksObject* (HksObject* result, lua_State* s, const HksObject* table, const HksObject* key)> hks_obj_gettable{0, 0x14012CAE0};
WEAK symbol<void(lua_State* s, int nargs, int nresults, const unsigned int* pc)> vm_call_internal{0, 0x140159EB0};
WEAK symbol<HashTable*(lua_State* s, unsigned int arraySize, unsigned int hashSize)> Hashtable_Create{0, 0x14011B320};
WEAK symbol<lua_State*> lua_state{0x141E2C2F8, 0x1426D3D08};
WEAK symbol<void(lua_State* s, const char* str, unsigned int l)> hksi_lua_pushlstring{0x14004DA90, 0x1400624F0};
WEAK symbol<HksObject*(HksObject* result, lua_State* s, const HksObject* table, const HksObject* key)> hks_obj_getfield{0x14009C0A0, 0x14012C600};
WEAK symbol<void(lua_State* s, const HksObject* tbl, const HksObject* key, const HksObject* val)> hks_obj_settable{0x14009D240, 0x14012D820};
WEAK symbol<HksObject* (HksObject* result, lua_State* s, const HksObject* table, const HksObject* key)> hks_obj_gettable{0x14009C580, 0x14012CAE0};
WEAK symbol<void(lua_State* s, int nargs, int nresults, const unsigned int* pc)> vm_call_internal{0x14009D2D0, 0x140159EB0};
WEAK symbol<HashTable*(lua_State* s, unsigned int arraySize, unsigned int hashSize)> Hashtable_Create{0x14008B3B0, 0x14011B320};
WEAK symbol<cclosure*(lua_State* s, lua_function function, int num_upvalues,
int internal_, int profilerTreatClosureAsFunc)> cclosure_Create{0, 0x14011B540};
WEAK symbol<int(lua_State* s, int t)> hksi_luaL_ref{0, 0x140136D30};
WEAK symbol<void(lua_State* s, int t, int ref)> hksi_luaL_unref{0, 0x14012F610};
int internal_, int profilerTreatClosureAsFunc)> cclosure_Create{0x14008B5D0, 0x14011B540};
WEAK symbol<int(lua_State* s, int t)> hksi_luaL_ref{0x1400A64D0, 0x140136D30};
WEAK symbol<void(lua_State* s, int t, int ref)> hksi_luaL_unref{0x14009EF10, 0x14012F610};
}
}

View File

@ -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>("table_");