diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index a192bbb1..a528006a 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -35,4 +35,8 @@ namespace big::functions // Received Event Signatures END using spectate_player = bool(bool toggle, Ped player); + + // Net Event Handlers + using report_cash_spawn = bool(__int64 creport_cash_spawn_event, CNetGamePlayer* source_player); + using report_cheating = void(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4); } diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 04d3d048..f33b2e76 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -54,7 +54,12 @@ namespace big m_error_screen_hook("ES", g_pointers->m_error_screen, &hooks::disable_error_screen), // Received Event - m_received_event_hook("RE", g_pointers->m_received_event, &hooks::received_event) + m_received_event_hook("RE", g_pointers->m_received_event, &hooks::received_event), + + // Report Cash Spawn Event + m_report_cash_spawn_event_hook("RCSE", g_pointers->m_report_cash_spawn, &hooks::report_cash_spawn_handler), + // Report Cheating Hook + m_report_cheating_hook("RC", g_pointers->m_report_cheating, &hooks::report_cheating_handler) { m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present); m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers); @@ -88,6 +93,9 @@ namespace big m_received_event_hook.enable(); + m_report_cash_spawn_event_hook.enable(); + m_report_cheating_hook.enable(); + m_enabled = true; } @@ -95,6 +103,9 @@ namespace big { m_enabled = false; + m_report_cheating_hook.disable(); + m_report_cash_spawn_event_hook.disable(); + m_received_event_hook.disable(); m_error_screen_hook.disable(); diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index e3910ba7..51f3e312 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -40,6 +40,9 @@ namespace big int64_t bit_buffer_size, int64_t bit_buffer ); + + static bool report_cash_spawn_handler(__int64 creport_cash_spawn_event, CNetGamePlayer* source_player); + static void report_cheating_handler(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4); }; struct minhook_keepalive @@ -77,6 +80,9 @@ namespace big detour_hook m_increment_stat_hook; detour_hook m_received_event_hook; + + detour_hook m_report_cash_spawn_event_hook; + detour_hook m_report_cheating_hook; }; inline hooking *g_hooking{}; diff --git a/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp b/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp new file mode 100644 index 00000000..405f06e8 --- /dev/null +++ b/BigBaseV2/src/hooks/report_cash_spawn_handler.cpp @@ -0,0 +1,19 @@ +#include "hooking.hpp" +#include "natives.hpp" + +namespace big +{ + bool hooks::report_cash_spawn_handler(__int64 creport_cash_spawn_event, CNetGamePlayer* source_player) + { + if (source_player->player_id == PLAYER::PLAYER_ID()) + { + LOG(INFO) << "Blocked self report for spawning modded cash"; + + return false; + } + + LOG(INFO) << "Reported " << source_player->get_name() << " for spawning modded cash."; + + return g_hooking->m_report_cash_spawn_event_hook.get_original()(creport_cash_spawn_event, source_player); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/hooks/report_cheating_handler.cpp b/BigBaseV2/src/hooks/report_cheating_handler.cpp new file mode 100644 index 00000000..76bedf1f --- /dev/null +++ b/BigBaseV2/src/hooks/report_cheating_handler.cpp @@ -0,0 +1,15 @@ +#include "hooking.hpp" +#include "util/notify.hpp" + +namespace big +{ + void hooks::report_cheating_handler(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4) + { + LOG(INFO) << "Caught game trying to report self."; + notify::above_map("Game tried to snitch."); + + return; + + //return g_hooking->m_report_cheating_hook.get_original()(a1, a2, a3, a4); + } +} \ No newline at end of file diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index dde312b0..ff906195 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -90,36 +90,6 @@ namespace big m_native_return = ptr.add(0).as(); }); - // Event Registry - main_batch.add("ER", "48 83 EC 28 E8 ? ? ? ? 48 8B 0D ? ? ? ? 4C 8D 0D ? ? ? ? 4C 8D 05 ? ? ? ? BA 03", [this](memory::handle ptr) - { - m_event_register = ptr.as(); - - if (m_event_register) - { - const char* pattern = "\x4C\x8D\x05"; - for (int i = 0, x = 0, found = 0, matches = 0; found < event_count; i++) - { - if (m_event_register[i] == pattern[x]) - { - if (++matches == 3) - { - m_event_ptr.push_back((void*)(reinterpret_cast(m_event_register + i - x) + *reinterpret_cast(m_event_register + i + 1) + 7)); - - found++; - x = matches = 0; - } - - x++; - - continue; - } - - x = matches = 0; - } - } - }); - // Incompatible Version Fix main_batch.add("IVF", "48 89 5C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 33 FF 48 8B DA", [this](memory::handle ptr) { @@ -197,6 +167,18 @@ namespace big { m_spectate_player = ptr.as(); }); + + // Report Cash Spawn Handler + main_batch.add("RCSH", "40 53 48 83 EC 20 48 8B D9 48 85 D2 74 29", [this](memory::handle ptr) + { + m_report_cash_spawn = ptr.as(); + }); + + // Report Myself Handler + main_batch.add("RMH", "E8 ? ? ? ? 41 8B 47 0C 39 43 20", [this](memory::handle ptr) + { + m_report_cheating = ptr.as(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index f87848b4..4b59bb09 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -36,11 +36,6 @@ namespace big PVOID m_model_spawn_bypass; PVOID m_native_return; - static const int event_count = 87; - std::vector m_event_ptr; - unsigned char m_event_restore[event_count]; - char* m_event_register; - functions::error_screen* m_error_screen{}; functions::gta_thread_tick* m_gta_thread_tick{}; @@ -58,6 +53,10 @@ namespace big // Received Event Signatures END functions::spectate_player* m_spectate_player{}; + + // Net Event Handlers + functions::report_cash_spawn* m_report_cash_spawn{}; + functions::report_cheating* m_report_cheating{}; }; inline pointers *g_pointers{};