From 689c9bd216f31cfc3b652c19363c43b49e9c4927 Mon Sep 17 00:00:00 2001 From: mentolixite Date: Sat, 28 May 2022 17:42:48 +0200 Subject: [PATCH] feat(ScriptEventHandler): Block known malicious script events (#219) --- BigBaseV2/src/core/enums.hpp | 8 ++++- BigBaseV2/src/hooks/script_event_handler.cpp | 37 +++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index 3dc42fe3..b9dc9419 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -140,7 +140,13 @@ namespace big Spectate = -1113591308, Teleport = 603406648, TransactionError = -1704141512, - VehicleKick = 578856274 + VehicleKick = 578856274, + Unknown1 = -145306724, + Unknown2 = -581037897, + Unknown3 = 1757755807, + Unknown4 = 436475575, + Unknown5 = 990606644, + Unknown6 = 69874647 }; enum class eSessionType diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index 3a39a91d..db425a3b 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -130,6 +130,11 @@ namespace big } break; case eRemoteEvent::RotateCam: + if (g->protections.script_events.crash && args[2] == 537560473) { + format_string(player_name, "Crash - Rotate Cam", notify.crash.log, notify.crash.notify); + return true; + } + if (g->protections.script_events.rotate_cam) { if (CNetworkPlayerMgr* player_mgr = gta_util::get_network_player_mgr(); player_mgr != nullptr) @@ -195,6 +200,36 @@ namespace big return true; } break; + case eRemoteEvent::Unknown1: + if (g->protections.script_events.crash && args[2] >= 32) { + format_string(player_name, "Crash - #" + args[0], notify.crash.log, notify.crash.notify); + return true; + } + break; + case eRemoteEvent::Unknown2: + if (g->protections.script_events.crash && (args[2] >= 62 || args[3] >= 32)) { + format_string(player_name, "Crash - #" + args[0], notify.crash.log, notify.crash.notify); + return true; + } + break; + case eRemoteEvent::Unknown3: + if (g->protections.script_events.crash && args[2] >= 62) { + format_string(player_name, "Crash - #" + args[0], notify.crash.log, notify.crash.notify); + return true; + } + break; + case eRemoteEvent::Unknown4: + case eRemoteEvent::Unknown5: + if (g->protections.script_events.crash && args[2] >= 20) { + format_string(player_name, "Crash - #" + args[0], notify.crash.log, notify.crash.notify); + return true; + } + break; + case eRemoteEvent::Unknown6: + if (g->protections.script_events.crash) { + format_string(player_name, "Crash - #" + args[0], notify.crash.log, notify.crash.notify); + return true; + } } if (g->debug.script_event_logging) @@ -211,4 +246,4 @@ namespace big return false; } -} \ No newline at end of file +}