diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index 24d20e60..20bf7e2f 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -10,6 +10,7 @@ namespace big::functions using fix_vectors_t = void(*)(rage::scrNativeCallContext*); using error_screen = void(char* entryHeader, char* entryLine1, int instructionalKey, char* entryLine2, BOOL p4, Any p5, Any* p6, Any* p7, BOOL background); + using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3); using get_player_name = char*(Player player); using sync_local_time_t = void(int h, int m); } diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index ac321b03..5534fd79 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -39,7 +39,8 @@ namespace big m_run_script_threads_hook("Script hook", g_pointers->m_run_script_threads, &hooks::run_script_threads), m_convert_thread_to_fiber_hook("ConvertThreadToFiber", memory::module("kernel32.dll").get_export("ConvertThreadToFiber").as(), &hooks::convert_thread_to_fiber), - m_error_screen_hook("Disable Warning/Error Screen", g_pointers->m_error_screen, &hooks::error_screen) + 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_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present); m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers); @@ -66,6 +67,7 @@ namespace big // New hooks enable m_error_screen_hook.enable(); + m_increment_stat_hook.enable(); m_enabled = true; } @@ -83,6 +85,7 @@ namespace big // New hooks disable m_error_screen_hook.disable(); + m_increment_stat_hook.disable(); } minhook_keepalive::minhook_keepalive() diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index d9cb69c7..aa8fa041 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -23,6 +23,7 @@ namespace big // New Hook Definitions 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); }; struct minhook_keepalive @@ -54,6 +55,7 @@ namespace big // New Detour Hook Definitions detour_hook m_error_screen_hook; + detour_hook m_increment_stat_hook; }; inline hooking *g_hooking{}; diff --git a/BigBaseV2/src/hooks/increment_stat_event.cpp b/BigBaseV2/src/hooks/increment_stat_event.cpp new file mode 100644 index 00000000..238ea5b3 --- /dev/null +++ b/BigBaseV2/src/hooks/increment_stat_event.cpp @@ -0,0 +1,31 @@ +#include "hooking.hpp" +#include "natives.hpp" +#include "features/notify.hpp" + +namespace big +{ + bool hooks::increment_stat_event(uint64_t net_event_struct, int64_t sender, int64_t a3) + { + Hash hash = *reinterpret_cast(net_event_struct + 0x30); + Player sender_id = *reinterpret_cast(sender + 0x2D); + + switch (hash) + { + case RAGE_JOAAT("MPPLY_GAME_EXPLOITS"): + case RAGE_JOAAT("MPPLY_VC_HATE"): + case RAGE_JOAAT("MPPLY_EXPLOITS"): + case RAGE_JOAAT("MPPLY_TC_ANNOYINGME"): + case RAGE_JOAAT("MPPLY_TC_HATE"): + char report[64]; + strcpy(report, "Blocked report from "); + strcat(report, PLAYER::GET_PLAYER_NAME(sender_id)); + strcat(report, ""); + + features::notify::above_map(report); + + return true; + } + + return g_hooking->m_increment_stat_hook.get_original()(net_event_struct, sender, a3); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index ab16820a..10cb842a 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -88,6 +88,11 @@ namespace big m_error_screen = ptr.as(); }); + main_batch.add("Increment Stat Event", "48 89 5C 24 ? 48 89 74 24 ? 55 57 41 55 41 56 41 57 48 8B EC 48 83 EC 60 8B 79 30", [this](memory::handle ptr) + { + m_increment_stat_event = ptr.as(); + }); + main_batch.run(memory::module(nullptr)); m_hwnd = FindWindowW(L"grcWindow", nullptr); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index fffad809..baa66010 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -37,6 +37,7 @@ namespace big functions::error_screen* m_error_screen{}; functions::get_player_name* m_get_player_name{}; + functions::increment_stat_event* m_increment_stat_event{}; functions::sync_local_time_t* m_sync_local_time{}; };