fix(hooks): return types (#1834)
fixes a bunch of return types that were seemingly copied from IDA without manual verification
This commit is contained in:
parent
e0f7482ce4
commit
13be3d3ab1
@ -70,7 +70,7 @@ namespace big
|
||||
static bool init_native_tables(rage::scrProgram* program);
|
||||
static rage::eThreadState script_vm(uint64_t* start_stack, uint64_t** scr_globals, rage::scrProgram* program, rage::scrThreadContext* ctx);
|
||||
|
||||
static void network_player_mgr_init(CNetworkPlayerMgr* _this, uint64_t a2, uint32_t a3, uint32_t a4[4]);
|
||||
static bool network_player_mgr_init(CNetworkPlayerMgr* _this, uint64_t a2, uint32_t a3, uint32_t a4[4]);
|
||||
static void network_player_mgr_shutdown(CNetworkPlayerMgr* _this);
|
||||
|
||||
static bool fragment_physics_crash_2(float* a1, float* a2);
|
||||
@ -82,21 +82,21 @@ namespace big
|
||||
static bool scripted_game_event(CScriptedGameEvent* scripted_game_event, CNetGamePlayer* player);
|
||||
|
||||
static bool receive_net_message(void* netConnectionManager, void* a2, rage::netConnection::InFrame* frame);
|
||||
static void get_network_event_data(int64_t unk, rage::CEventNetwork* net_event);
|
||||
static rage::CEventNetwork* get_network_event_data(int64_t unk, rage::CEventNetwork* net_event);
|
||||
|
||||
static void* assign_physical_index(CNetworkPlayerMgr* netPlayerMgr, CNetGamePlayer* player, uint8_t new_index);
|
||||
|
||||
//SYNC
|
||||
static bool received_clone_create(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, int32_t object_id, int32_t object_flag, rage::datBitBuffer* buffer, int32_t timestamp);
|
||||
static void received_clone_create(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, int32_t object_id, int32_t object_flag, rage::datBitBuffer* buffer, int32_t timestamp);
|
||||
static eAckCode received_clone_sync(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, uint16_t object_id, rage::datBitBuffer* bufer, uint16_t unk, uint32_t timestamp);
|
||||
static bool can_apply_data(rage::netSyncTree* tree, rage::netObject* object);
|
||||
|
||||
static void write_player_gamer_data_node(rage::netObject* player, CPlayerGamerDataNode* node);
|
||||
static bool write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node);
|
||||
static void write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node);
|
||||
|
||||
static void invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4);
|
||||
static uint64_t invalid_decal(uintptr_t a1, int a2);
|
||||
static uint64_t task_parachute_object_0x270(uint64_t _this, int a2, int a3);
|
||||
static void invalid_decal(uintptr_t a1, int a2);
|
||||
static int task_parachute_object_0x270(uint64_t _this, int a2, int a3);
|
||||
|
||||
static bool update_presence_attribute_int(void* presence_data, int profile_index, char* attr, uint64_t value);
|
||||
static bool update_presence_attribute_string(void* presence_data, int profile_index, char* attr, char* value);
|
||||
@ -122,13 +122,13 @@ namespace big
|
||||
|
||||
static int nt_query_virtual_memory(void* _this, HANDLE handle, PVOID base_addr, int info_class, MEMORY_BASIC_INFORMATION* info, int size, size_t* return_len);
|
||||
static void queue_dependency(void* dependency);
|
||||
static void prepare_metric_for_sending(rage::datBitBuffer* bit_buffer, int unk, int time, rage::rlMetric* metric);
|
||||
static bool prepare_metric_for_sending(rage::datBitBuffer* bit_buffer, int unk, int time, rage::rlMetric* metric);
|
||||
|
||||
static bool received_array_update(rage::netArrayHandlerBase* array, CNetGamePlayer* sender, rage::datBitBuffer* buffer, int size, int16_t cycle);
|
||||
|
||||
static bool receive_pickup(rage::netObject* netobject, void* unk, CPed* ped);
|
||||
|
||||
static bool write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node);
|
||||
static void write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node);
|
||||
|
||||
static rage::netGameEvent* send_player_card_stats(rage::netGameEvent* a1, CPlayerCardStats* stats);
|
||||
static void serialize_stats(CStatsSerializationContext* context, rage::joaat_t* stats, uint32_t stat_count);
|
||||
@ -136,7 +136,7 @@ namespace big
|
||||
static void write_player_creation_data_node(rage::netObject* player, CPlayerCreationDataNode* node);
|
||||
static void write_player_appearance_data_node(rage::netObject* player, CPlayerAppearanceDataNode* node);
|
||||
|
||||
static void task_jump_constructor(uint64_t a1, int a2);
|
||||
static __int64 task_jump_constructor(uint64_t a1, int a2);
|
||||
|
||||
static CBaseModelInfo* get_model_info(rage::joaat_t hash, uint32_t* a2);
|
||||
|
||||
@ -147,11 +147,11 @@ namespace big
|
||||
|
||||
static int netfilter_handle_message(__int64 filter, char* message, int flags);
|
||||
|
||||
static void log_error_message_box(rage::joaat_t joaated_error_code, char a2);
|
||||
static void log_error_message_box(rage::joaat_t joaated_error_code, bool a2);
|
||||
|
||||
static void send_non_physical_player_data(CNetGamePlayer* player, __int64 message, int flags, void* a4, CNetGamePlayer* a5);
|
||||
static bool send_non_physical_player_data(CNetGamePlayer* player, __int64 message, int flags, void* a4, CNetGamePlayer* a5);
|
||||
|
||||
static int64_t update_timecycle_keyframe_data(int64_t timecycleManager, TimecycleKeyframeData* timecycleKeyframeData);
|
||||
static void update_timecycle_keyframe_data(int64_t timecycleManager, TimecycleKeyframeData* timecycleKeyframeData);
|
||||
|
||||
static void* allocate_memory_reliable(rage::netConnection* cxn, int required_memory);
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace big
|
||||
return scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[player->id()].OrbitalBitset.IsSet(eOrbitalBitset::kOrbitalCannonActive);
|
||||
}
|
||||
|
||||
void hooks::get_network_event_data(int64_t unk, rage::CEventNetwork* net_event)
|
||||
rage::CEventNetwork* hooks::get_network_event_data(int64_t unk, rage::CEventNetwork* net_event)
|
||||
{
|
||||
switch (net_event->get_type())
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ namespace big
|
||||
static_assert(sizeof(json_serializer) == 0x1D);// size is actually 0x20
|
||||
#pragma pack(pop)
|
||||
|
||||
void hooks::prepare_metric_for_sending(rage::datBitBuffer* bit_buffer, int unk, int time, rage::rlMetric* metric)
|
||||
bool hooks::prepare_metric_for_sending(rage::datBitBuffer* bit_buffer, int unk, int time, rage::rlMetric* metric)
|
||||
{
|
||||
if (g.debug.logs.metric_logs)
|
||||
{
|
||||
@ -46,5 +46,7 @@ namespace big
|
||||
|
||||
LOG(INFO) << "METRIC: " << metric->get_name() << "; DATA: " << serializer.get_string();
|
||||
}
|
||||
|
||||
return g_hooking->get_original<prepare_metric_for_sending>()(bit_buffer, unk, time, metric);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
void hooks::log_error_message_box(rage::joaat_t joaated_error_code, char a2)
|
||||
void hooks::log_error_message_box(rage::joaat_t joaated_error_code, bool a2)
|
||||
{
|
||||
if (joaated_error_code == RAGE_JOAAT("ERR_NET_EVENT"))
|
||||
return;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
void hooks::task_jump_constructor(uint64_t a1, int a2)
|
||||
__int64 hooks::task_jump_constructor(uint64_t a1, int a2)
|
||||
{
|
||||
if (g.self.super_jump)
|
||||
a2 |= 1 << 15;
|
||||
|
@ -9,9 +9,9 @@ namespace big
|
||||
return rage::fvector4(color[0], color[1], color[2], color[3]);
|
||||
}
|
||||
|
||||
int64_t hooks::update_timecycle_keyframe_data(int64_t timecycleManager, TimecycleKeyframeData* timecycleKeyframeData)
|
||||
void hooks::update_timecycle_keyframe_data(int64_t timecycleManager, TimecycleKeyframeData* timecycleKeyframeData)
|
||||
{
|
||||
int64_t result = g_hooking->get_original<update_timecycle_keyframe_data>()(timecycleManager, timecycleKeyframeData);
|
||||
g_hooking->get_original<update_timecycle_keyframe_data>()(timecycleManager, timecycleKeyframeData);
|
||||
|
||||
if (g.vfx.enable_custom_sky_color)
|
||||
{
|
||||
@ -22,7 +22,5 @@ namespace big
|
||||
|
||||
timecycleKeyframeData->m_stars_iten = g.vfx.stars_intensity;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
@ -8,17 +8,19 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
void hooks::network_player_mgr_init(CNetworkPlayerMgr* _this, uint64_t a2, uint32_t a3, uint32_t a4[4])
|
||||
bool hooks::network_player_mgr_init(CNetworkPlayerMgr* _this, uint64_t a2, uint32_t a3, uint32_t a4[4])
|
||||
{
|
||||
if (g.notifications.network_player_mgr_init.log)
|
||||
LOG(INFO) << "CNetworkPlayerMgr#init got called, we're probably entering a session.";
|
||||
if (g.notifications.network_player_mgr_init.notify)
|
||||
g_notification_service->push("NETWORK_PLAYER_MGR"_T.data(), "NETWORK_PLAYER_MGR_INIT"_T.data());
|
||||
|
||||
g_hooking->get_original<hooks::network_player_mgr_init>()(_this, a2, a3, a4);
|
||||
bool result = g_hooking->get_original<hooks::network_player_mgr_init>()(_this, a2, a3, a4);
|
||||
|
||||
g_player_service->player_join(_this->m_local_net_player);
|
||||
g_lua_manager->trigger_event<menu_event::PlayerMgrInit>();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void hooks::network_player_mgr_shutdown(CNetworkPlayerMgr* _this)
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
uint64_t hooks::invalid_decal(uintptr_t a1, int a2)
|
||||
void hooks::invalid_decal(uintptr_t a1, int a2)
|
||||
{
|
||||
if (a1 && a2 == 2)
|
||||
//*(*(*(a1 + 0x48) + 0x30) + 0x2C8)
|
||||
if (const auto ptr = *reinterpret_cast<uintptr_t*>((a1 + 0x48)); ptr)
|
||||
if (const auto ptr2 = *reinterpret_cast<uintptr_t*>((ptr + 0x30)); ptr2)
|
||||
if (*reinterpret_cast<uintptr_t*>(ptr2 + 0x2C8) == 0)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
return g_hooking->get_original<hooks::invalid_decal>()(a1, a2);
|
||||
g_hooking->get_original<hooks::invalid_decal>()(a1, a2);
|
||||
}
|
||||
}
|
@ -4,20 +4,20 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::received_clone_create(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, int32_t object_id, int32_t object_flag, rage::datBitBuffer* buffer, int32_t timestamp)
|
||||
void hooks::received_clone_create(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, int32_t object_id, int32_t object_flag, rage::datBitBuffer* buffer, int32_t timestamp)
|
||||
{
|
||||
if (object_type < eNetObjType::NET_OBJ_TYPE_AUTOMOBILE || object_type > eNetObjType::NET_OBJ_TYPE_TRAIN)
|
||||
{
|
||||
notify::crash_blocked(src, "out of bounds object type");
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
auto plyr = g_player_service->get_by_id(src->m_player_id);
|
||||
|
||||
if (plyr && plyr->block_clone_create)
|
||||
return true;
|
||||
return;
|
||||
|
||||
g.m_syncing_player = src;
|
||||
return g_hooking->get_original<hooks::received_clone_create>()(mgr, src, dst, object_type, object_id, object_flag, buffer, timestamp);
|
||||
g_hooking->get_original<hooks::received_clone_create>()(mgr, src, dst, object_type, object_id, object_flag, buffer, timestamp);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
void hooks::send_non_physical_player_data(CNetGamePlayer* player, __int64 message, int flags, void* a4, CNetGamePlayer* a5)
|
||||
bool hooks::send_non_physical_player_data(CNetGamePlayer* player, __int64 message, int flags, void* a4, CNetGamePlayer* a5)
|
||||
{
|
||||
auto plyr = g_player_service->get_by_id(player->m_player_id);
|
||||
auto data = *(CNonPhysicalPlayerData**)(message + 0x10);
|
||||
@ -19,8 +19,10 @@ namespace big
|
||||
g_notification_service->push("BLOCK_JOIN"_T.data(), std::vformat("BLOCK_JOIN_PREVENT_PLAYER_JOIN"_T, std::make_format_args(plyr->get_name())));
|
||||
}
|
||||
|
||||
g_hooking->get_original<hooks::send_non_physical_player_data>()(player, message, flags, a4, a5);
|
||||
bool result = g_hooking->get_original<hooks::send_non_physical_player_data>()(player, message, flags, a4, a5);
|
||||
|
||||
data->m_bubble_id = old_bubble_id;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
uint64_t hooks::task_parachute_object_0x270(uint64_t _this, int a2, int a3)
|
||||
int hooks::task_parachute_object_0x270(uint64_t _this, int a2, int a3)
|
||||
{
|
||||
if (a2 == 1 && a3 == 1)// enter crash func
|
||||
{
|
||||
|
@ -7,9 +7,9 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node)
|
||||
void hooks::write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node)
|
||||
{
|
||||
auto ret = g_hooking->get_original<hooks::write_player_camera_data_node>()(player, node);
|
||||
g_hooking->get_original<hooks::write_player_camera_data_node>()(player, node);
|
||||
|
||||
if (g.spoofing.spoof_hide_spectate && g.player.spectating)
|
||||
{
|
||||
@ -17,7 +17,5 @@ namespace big
|
||||
node->m_free_cam_pos_y -= 50.0f;
|
||||
node->m_camera_x -= 50.0f;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ namespace big
|
||||
return globals::get_interior_from_player(id) != 0;
|
||||
}
|
||||
|
||||
bool hooks::write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node)
|
||||
void hooks::write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node)
|
||||
{
|
||||
auto ret = g_hooking->get_original<write_player_game_state_data_node>()(player, node);
|
||||
g_hooking->get_original<write_player_game_state_data_node>()(player, node);
|
||||
|
||||
if (g.spoofing.spoof_hide_god && !is_in_cutscene() && !is_in_interior())
|
||||
{
|
||||
@ -42,7 +42,5 @@ namespace big
|
||||
node->m_is_spectating = false;
|
||||
node->m_spectating_net_id = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user