feat(ScriptEventHandler): Block known malicious script events (#219)

This commit is contained in:
mentolixite 2022-05-28 17:42:48 +02:00 committed by GitHub
parent d3d231375c
commit 689c9bd216
2 changed files with 43 additions and 2 deletions

View File

@ -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

View File

@ -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;
}
}
}