mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
feat(IncrementStatEvent): Added REPORT blocking
This commit is contained in:
parent
6d0d39a616
commit
ab2d2c9af7
@ -11,4 +11,6 @@ namespace big::functions
|
|||||||
|
|
||||||
using gta_thread_tick = __int64(GtaThread* a1, unsigned int a2);
|
using gta_thread_tick = __int64(GtaThread* a1, unsigned int a2);
|
||||||
using gta_thread_kill = __int64(GtaThread* a1);
|
using gta_thread_kill = __int64(GtaThread* a1);
|
||||||
|
|
||||||
|
using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,9 @@ namespace big
|
|||||||
m_convert_thread_to_fiber_hook("ConvertThreadToFiber", memory::module("kernel32.dll").get_export("ConvertThreadToFiber").as<void*>(), &hooks::convert_thread_to_fiber),
|
m_convert_thread_to_fiber_hook("ConvertThreadToFiber", memory::module("kernel32.dll").get_export("ConvertThreadToFiber").as<void*>(), &hooks::convert_thread_to_fiber),
|
||||||
|
|
||||||
m_gta_thread_tick_hook("GTA Thread Tick", g_pointers->m_gta_thread_tick, &hooks::gta_thread_tick),
|
m_gta_thread_tick_hook("GTA Thread Tick", g_pointers->m_gta_thread_tick, &hooks::gta_thread_tick),
|
||||||
m_gta_thread_kill_hook("GTA Thread Kill", g_pointers->m_gta_thread_kill, &hooks::gta_thread_kill)
|
m_gta_thread_kill_hook("GTA Thread Kill", g_pointers->m_gta_thread_kill, &hooks::gta_thread_kill),
|
||||||
|
|
||||||
|
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_present_index, &hooks::swapchain_present);
|
||||||
m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers);
|
m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers);
|
||||||
@ -68,6 +70,8 @@ namespace big
|
|||||||
m_gta_thread_kill_hook.enable();
|
m_gta_thread_kill_hook.enable();
|
||||||
m_gta_thread_tick_hook.enable();
|
m_gta_thread_tick_hook.enable();
|
||||||
|
|
||||||
|
m_increment_stat_hook.enable();
|
||||||
|
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,6 +79,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
m_enabled = false;
|
m_enabled = false;
|
||||||
|
|
||||||
|
m_increment_stat_hook.disable();
|
||||||
|
|
||||||
m_gta_thread_tick_hook.disable();
|
m_gta_thread_tick_hook.disable();
|
||||||
m_gta_thread_kill_hook.disable();
|
m_gta_thread_kill_hook.disable();
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ namespace big
|
|||||||
|
|
||||||
static rage::eThreadState gta_thread_tick(GtaThread* a1, unsigned int a2);
|
static rage::eThreadState gta_thread_tick(GtaThread* a1, unsigned int a2);
|
||||||
static rage::eThreadState gta_thread_kill(GtaThread* thread);
|
static rage::eThreadState gta_thread_kill(GtaThread* thread);
|
||||||
|
|
||||||
|
static bool increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct minhook_keepalive
|
struct minhook_keepalive
|
||||||
@ -55,6 +57,8 @@ namespace big
|
|||||||
|
|
||||||
detour_hook m_gta_thread_tick_hook;
|
detour_hook m_gta_thread_tick_hook;
|
||||||
detour_hook m_gta_thread_kill_hook;
|
detour_hook m_gta_thread_kill_hook;
|
||||||
|
|
||||||
|
detour_hook m_increment_stat_hook;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline hooking *g_hooking{};
|
inline hooking *g_hooking{};
|
||||||
|
32
BigBaseV2/src/hooks/increment_stat_event.cpp
Normal file
32
BigBaseV2/src/hooks/increment_stat_event.cpp
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include "gta/joaat.hpp"
|
||||||
|
#include "hooking.hpp"
|
||||||
|
#include "natives.hpp"
|
||||||
|
#include "util/notify.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
bool hooks::increment_stat_event(uint64_t net_event_struct, CNetGamePlayer* sender, int64_t a3)
|
||||||
|
{
|
||||||
|
Hash hash = *reinterpret_cast<DWORD*>(net_event_struct + 0x30);
|
||||||
|
Player sender_id = sender->player_id;
|
||||||
|
|
||||||
|
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, "~g~BLOCKED REPORT~s~\nFrom: <C>");
|
||||||
|
strcat(report, PLAYER::GET_PLAYER_NAME(sender_id));
|
||||||
|
strcat(report, "</C>");
|
||||||
|
|
||||||
|
notify::above_map(report);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return g_hooking->m_increment_stat_hook.get_original<decltype(&hooks::increment_stat_event) > ()(net_event_struct, sender, a3);
|
||||||
|
}
|
||||||
|
}
|
@ -123,6 +123,11 @@ namespace big
|
|||||||
m_gta_thread_kill = ptr.as<decltype(m_gta_thread_kill)>();
|
m_gta_thread_kill = ptr.as<decltype(m_gta_thread_kill)>();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
main_batch.add("Increment Stat Event", "", [this](memory::handle ptr)
|
||||||
|
{
|
||||||
|
m_increment_stat_event = ptr.as<decltype(m_increment_stat_event)>();
|
||||||
|
});
|
||||||
|
|
||||||
main_batch.run(memory::module(nullptr));
|
main_batch.run(memory::module(nullptr));
|
||||||
|
|
||||||
m_hwnd = FindWindowW(L"grcWindow", nullptr);
|
m_hwnd = FindWindowW(L"grcWindow", nullptr);
|
||||||
|
@ -43,6 +43,8 @@ namespace big
|
|||||||
|
|
||||||
functions::gta_thread_tick* m_gta_thread_tick{};
|
functions::gta_thread_tick* m_gta_thread_tick{};
|
||||||
functions::gta_thread_kill* m_gta_thread_kill{};
|
functions::gta_thread_kill* m_gta_thread_kill{};
|
||||||
|
|
||||||
|
functions::increment_stat_event* m_increment_stat_event{};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline pointers *g_pointers{};
|
inline pointers *g_pointers{};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user