feat(Hooks): Added snend net info to lobby hook

This commit is contained in:
Yimura 2021-01-29 18:56:17 +01:00
parent 8fe7981e07
commit ae742543be
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682
5 changed files with 23 additions and 2 deletions

View File

@ -42,7 +42,8 @@ namespace big
m_get_event_data("Get Event Data", g_pointers->m_get_event_data, &hooks::get_event_data),
m_error_screen_hook("Disable Warning/Error Screen", g_pointers->m_error_screen, &hooks::error_screen),
m_increment_stat_hook("Increment Stat Event", g_pointers->m_increment_stat_event, &hooks::increment_stat_event),
m_script_event_hook("Script Event Handler", g_pointers->m_script_event_handler, &hooks::script_event_handler)
m_script_event_hook("Script Event Handler", g_pointers->m_script_event_handler, &hooks::script_event_handler),
m_send_net_info_to_lobby_hook("Send Net Info to Lobby", g_pointers->m_send_net_info_to_lobby, &hooks::send_net_info_to_lobby)
{
m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present);
m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers);

View File

@ -24,8 +24,9 @@ namespace big
// New Hook Definitions
static bool get_event_data(int32_t eventGroup, int32_t eventIndex, int64_t* args, uint32_t argCount);
static void error_screen(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background);
static bool increment_stat_event(uint64_t net_event_struct, int64_t sender, int64_t a3);
static bool increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3);
static bool script_event_handler(std::int64_t NetEventStruct, std::int64_t CNetGamePlayer);
static bool send_net_info_to_lobby(rage::netPlayerData* local_player, int64_t a2, int64_t a3, DWORD* a4);
};
struct minhook_keepalive
@ -60,6 +61,7 @@ namespace big
detour_hook m_error_screen_hook;
detour_hook m_increment_stat_hook;
detour_hook m_script_event_hook;
detour_hook m_send_net_info_to_lobby_hook;
};
inline hooking *g_hooking{};

View File

@ -0,0 +1,12 @@
#include "hooking.hpp"
namespace big
{
bool hooks::send_net_info_to_lobby(rage::netPlayerData* local_player, int64_t a2, int64_t a3, DWORD* a4)
{
const char name[20] = "How dare you!";
memcpy(local_player->m_name, name, sizeof(name));
return g_hooking->m_send_net_info_to_lobby_hook.get_original<decltype(&send_net_info_to_lobby)>()(local_player, a2, a3, a4);
}
}

View File

@ -132,6 +132,11 @@ namespace big
{
m_ptr_to_handle = ptr.as<decltype(m_ptr_to_handle)>();
});
main_batch.add("Send Info To Lobby", "44 8D 47 78 48 8D 54 24 ? 48 8B CB E8", [this](memory::handle ptr)
{
m_send_net_info_to_lobby = ptr.add(13).rip().as<PVOID>();
});
main_batch.run(memory::module(nullptr));

View File

@ -36,6 +36,7 @@ namespace big
IDXGISwapChain **m_swapchain{};
PVOID m_model_spawn_bypass;
PVOID m_send_net_info_to_lobby;
functions::error_screen* m_error_screen{};
functions::get_event_data* m_get_event_data{};