mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-07 18:03:34 +08:00
feat(Hooks): Removed useless REPORT MYSELF and REPORT CASH SPAWN events
This commit is contained in:
parent
8931db7d4b
commit
f95a390310
@ -41,8 +41,4 @@ 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_myself_event_sender = void(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4);
|
||||
}
|
||||
|
@ -59,13 +59,8 @@ namespace big
|
||||
// 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 Myself Event Sender
|
||||
m_report_myself_event_sender_hook("RMES", g_pointers->m_report_myself_sender, &hooks::report_myself_event_handler),
|
||||
|
||||
// Scripted Game Event Hook
|
||||
m_scripted_game_event_hook("SGEH", g_pointers->m_scripted_game_event, &hooks::scripted_game_event)
|
||||
m_scripted_game_event_hook("SGEH", g_pointers->m_scripted_game_event, &hooks::scripted_game_event),
|
||||
{
|
||||
m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present);
|
||||
m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers);
|
||||
@ -99,9 +94,6 @@ namespace big
|
||||
|
||||
m_received_event_hook.enable();
|
||||
|
||||
m_report_cash_spawn_event_hook.enable();
|
||||
m_report_myself_event_sender_hook.enable();
|
||||
|
||||
m_scripted_game_event_hook.enable();
|
||||
|
||||
m_enabled = true;
|
||||
@ -113,9 +105,6 @@ namespace big
|
||||
|
||||
m_scripted_game_event_hook.disable();
|
||||
|
||||
m_report_myself_event_sender_hook.disable();
|
||||
m_report_cash_spawn_event_hook.disable();
|
||||
|
||||
m_received_event_hook.disable();
|
||||
|
||||
m_error_screen_hook.disable();
|
||||
|
@ -42,9 +42,6 @@ namespace big
|
||||
int64_t bit_buffer
|
||||
);
|
||||
|
||||
static bool report_cash_spawn_handler(__int64 creport_cash_spawn_event, CNetGamePlayer* source_player);
|
||||
static void report_myself_event_handler(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4);
|
||||
|
||||
static bool scripted_game_event(CScriptedGameEvent* scripted_game_event, CNetGamePlayer* player);
|
||||
};
|
||||
|
||||
@ -87,9 +84,6 @@ namespace big
|
||||
|
||||
detour_hook m_received_event_hook;
|
||||
|
||||
detour_hook m_report_cash_spawn_event_hook;
|
||||
detour_hook m_report_myself_event_sender_hook;
|
||||
|
||||
detour_hook m_scripted_game_event_hook;
|
||||
};
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
#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::GET_PLAYER_INDEX())
|
||||
{
|
||||
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<decltype(&hooks::report_cash_spawn_handler)>()(creport_cash_spawn_event, source_player);
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#include "hooking.hpp"
|
||||
#include "natives.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void hooks::report_myself_event_handler(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4)
|
||||
{
|
||||
LOG(INFO) << "Blocked REPORT_MYSELF_EVENT";
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
@ -168,12 +168,6 @@ namespace big
|
||||
m_spectate_player = ptr.as<decltype(m_spectate_player)>();
|
||||
});
|
||||
|
||||
// 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<decltype(m_report_cash_spawn)>();
|
||||
});
|
||||
|
||||
// Scripted Game Event Handler
|
||||
main_batch.add("SGEH", "40 53 48 81 EC ? ? ? ? 44 8B 81 ? ? ? ? 4C 8B CA 41 8D 40 FF 3D ? ? ? ? 77 42", [this](memory::handle ptr)
|
||||
{
|
||||
@ -198,12 +192,6 @@ namespace big
|
||||
m_ptr_to_handle = ptr.as<decltype(m_ptr_to_handle)>();
|
||||
});
|
||||
|
||||
// Report Myself Event Sender
|
||||
main_batch.add("RMES", "E8 ? ? ? ? 41 8B 47 0C 39 43 20", [this](memory::handle ptr)
|
||||
{
|
||||
m_report_myself_sender = ptr.as<decltype(m_report_myself_sender)>();
|
||||
});
|
||||
|
||||
// Blame Explode
|
||||
main_batch.add("BE", "0F 85 ? ? ? ? 48 8B 05 ? ? ? ? 48 8B 48 08 E8", [this](memory::handle ptr)
|
||||
{
|
||||
|
@ -63,10 +63,6 @@ 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_myself_event_sender* m_report_myself_sender{};
|
||||
};
|
||||
|
||||
inline pointers *g_pointers{};
|
||||
|
Loading…
x
Reference in New Issue
Block a user