From 0e5c8f7cfb5b6f0e1bb60098e97247db387d7752 Mon Sep 17 00:00:00 2001 From: maybegreat48 <96936658+maybegreat48@users.noreply.github.com> Date: Thu, 30 May 2024 17:45:43 +0000 Subject: [PATCH] Break game and protections (#3203) --- .../commands/player/toxic/break_game.cpp | 29 +++++++++++++++++++ src/hooks/protections/receive_net_message.cpp | 28 ++++++++++++++++++ src/views/players/player/player_toxic.cpp | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 src/backend/commands/player/toxic/break_game.cpp diff --git a/src/backend/commands/player/toxic/break_game.cpp b/src/backend/commands/player/toxic/break_game.cpp new file mode 100644 index 00000000..63cf0612 --- /dev/null +++ b/src/backend/commands/player/toxic/break_game.cpp @@ -0,0 +1,29 @@ +#include "backend/player_command.hpp" +#include "natives.hpp" +#include "packet.hpp" +#include "pointers.hpp" + +namespace big +{ + class break_game : player_command + { + using player_command::player_command; + + virtual CommandAccessLevel get_access_level() override + { + return CommandAccessLevel::AGGRESSIVE; + } + + virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr ctx) override + { + packet pack; + pack.write_message(rage::eNetMessage::MsgRoamingJoinBubbleAck); + pack.write(0, 2); + pack.write(10, 4); + pack.write(0, 6); + pack.send(player->get_net_game_player()->m_msg_id); + } + }; + + break_game g_break_game("breakgame", "BREAK_GAME", "BREAK_GAME_DESC", 0); +} \ No newline at end of file diff --git a/src/hooks/protections/receive_net_message.cpp b/src/hooks/protections/receive_net_message.cpp index a1da6907..7b2c601b 100644 --- a/src/hooks/protections/receive_net_message.cpp +++ b/src/hooks/protections/receive_net_message.cpp @@ -101,6 +101,10 @@ namespace big if (!get_msg_type(msgType, buffer)) return g_hooking->get_original()(netConnectionManager, a2, frame); + + if (msgType == rage::eNetMessage::MsgRoamingJoinBubbleAck) + return true; + if (player) { switch (msgType) @@ -233,6 +237,11 @@ namespace big break; } + case rage::eNetMessage::MsgRoamingInitialBubble: + { + LOG(WARNING) << "Shouldn't get this again"; + return true; + } } } else @@ -255,6 +264,25 @@ namespace big } break; } + case rage::eNetMessage::MsgNonPhysicalData: + { + buffer.Read(7); // size + int bubble = buffer.Read(4); + int player = buffer.Read(6); + + + if (g_player_service->get_self() && g_player_service->get_self()->id() == player) + { + LOG(WARNING) << "We're being replaced"; + return true; + } + + if (bubble != 0) + { + LOG(WARNING) << "Wrong bubble: " << bubble; + } + break; + } } } diff --git a/src/views/players/player/player_toxic.cpp b/src/views/players/player/player_toxic.cpp index d840eed1..d462df75 100644 --- a/src/views/players/player/player_toxic.cpp +++ b/src/views/players/player/player_toxic.cpp @@ -25,6 +25,8 @@ namespace big ImGui::SameLine(); components::player_command_button<"mission">(g_player_service->get_selected(), {}); + components::player_command_button<"breakgame">(g_player_service->get_selected(), {}); + ImGui::SameLine(); components::player_command_button<"error">(g_player_service->get_selected(), {}); ImGui::SameLine(); components::player_command_button<"ceoraid">(g_player_service->get_selected(), {});