This commit is contained in:
Aure7138 2022-11-12 04:01:10 +08:00 committed by GitHub
parent 532cf59b4f
commit 75424bfb1d
5 changed files with 23 additions and 6 deletions

View File

@ -60,6 +60,8 @@ namespace big
detour_hook_helper::add<hooks::format_metric_for_sending>("FMFS", g_pointers->m_format_metric_for_sending);
detour_hook_helper::add<hooks::invalid_mods_crash_detour>("IMCD", g_pointers->m_invalid_mods_crash_detour);
g_hooking = this;
}

View File

@ -65,6 +65,8 @@ namespace big
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 invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4);
};
class minhook_keepalive

View File

@ -0,0 +1,11 @@
#include "hooking.hpp"
namespace big
{
void hooks::invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4)
{
if(!*(int64_t*)(a1 + 0xD8))
return;
g_hooking->get_original<hooks::invalid_mods_crash_detour>()(a1, a2, a3, a4);
}
}

View File

@ -398,12 +398,6 @@ namespace big
m_fipackfile_unmount = ptr.add(1).rip().as<functions::fipackfile_unmount>();
});
// fidevice unmount
main_batch.add("FPFUM", "E8 ? ? ? ? 84 C0 74 37 80 3D", [this](memory::handle ptr)
{
m_fipackfile_unmount = ptr.add(1).rip().as<functions::fipackfile_unmount>();
});
// game version + online version
main_batch.add("GVOV", "8B C3 33 D2 C6 44 24 20", [this](memory::handle ptr)
{
@ -411,6 +405,12 @@ namespace big
m_online_version = ptr.add(0x24).rip().add(0x20).as<const char*>();
});
// Invalid Mods Crash Detour
main_batch.add("IMCD", "E8 ? ? ? ? 40 88 7C 24 ? 49 89 9C 24", [this](memory::handle ptr)
{
m_invalid_mods_crash_detour = ptr.add(1).rip().as<PVOID>();
});
// Format Metric For Sending
main_batch.add("FMFS", "48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 4C 89 70 ? 55 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 48 83 3D", [this](memory::handle ptr)
{

View File

@ -132,6 +132,8 @@ namespace big
const char* m_game_version;
const char* m_online_version;
PVOID m_invalid_mods_crash_detour{};
};
inline pointers* g_pointers{};