feat(Protections): Added network group override protection

This commit is contained in:
Yimura 2022-05-13 18:26:15 +02:00
parent 0c0a99cf45
commit 286960ac18
5 changed files with 34 additions and 3 deletions

View File

@ -37,7 +37,11 @@ namespace big
// Network Player Mgr Shutdown
m_network_player_mgr_shutdown_hook("NPMS", g_pointers->m_network_player_mgr_shutdown, &hooks::network_player_mgr_shutdown),
m_net_array_handler_hook("net_array_handler", g_pointers->m_net_array_handler, &hooks::net_array_handler),
// Network Group Override
m_network_group_override("NGO", g_pointers->m_network_group_override, &hooks::network_group_override),
// Net Array Handler
m_net_array_handler_hook("NAH", g_pointers->m_net_array_handler, &hooks::net_array_handler),
// Increment Stat Event
m_increment_stat_hook("ISE", g_pointers->m_increment_stat_event, &hooks::increment_stat_event),

View File

@ -42,6 +42,8 @@ namespace big
static void network_player_mgr_shutdown(CNetworkPlayerMgr* _this);
static void network_group_override(std::int64_t a1, std::int64_t a2, std::int64_t a3);
static bool net_array_handler(__int64 netArrayHandlerBaseMgr, CNetGamePlayer* a2, rage::datBitBuffer* datbitbuffer, unsigned int bytes_to_read, __int16 a5);
static void player_join(CNetworkObjectMgr* _this, CNetGamePlayer* net_player);
@ -101,6 +103,8 @@ namespace big
detour_hook m_network_player_mgr_shutdown_hook;
detour_hook m_network_group_override;
detour_hook m_net_array_handler_hook;
detour_hook m_player_has_joined_hook;

View File

@ -0,0 +1,18 @@
#include "hooking.hpp"
namespace big
{
// thanks ellisdudes :P
void hooks::network_group_override(std::int64_t a1, std::int64_t a2, std::int64_t a3)
{
if (a2 == 0 && (a3 == 103 || a3 == 0))
{
LOG(WARNING) << "Received SCRIPT_WORLD_STATE_EVENT crash from unknown attacker...";
return;
}
// original
return g_hooking->m_network_group_override.get_original<decltype(&network_group_override)>()(a1, a2, a3);
}
}

View File

@ -248,6 +248,12 @@ namespace big
{
m_net_array_handler = ptr.sub(0x3C).as<PVOID>();
});
// Network Group Override
main_batch.add("NGO", "44 89 81 ? ? ? ? 89 91 ? ? ? ? C6 05", [this](memory::handle ptr)
{
m_network_group_override = ptr.as<PVOID>();
});
main_batch.run(memory::module(nullptr));

View File

@ -44,12 +44,11 @@ namespace big
int* m_resolution_x;
int* m_resolution_y;
std::uint16_t* m_some_anticheat_thing{};
PVOID m_blame_explode;
PVOID m_model_spawn_bypass;
PVOID m_native_return;
PVOID m_is_dlc_present;
PVOID m_network_group_override;
PVOID m_error_screen{};