diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index a56881c9..0bafcddd 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -17,6 +17,11 @@ namespace big looped::system_update_pointers(); }QUEUE_JOB_END_CLAUSE + QUEUE_JOB_BEGIN_CLAUSE() + { + looped::protections_replay_interface(); + }QUEUE_JOB_END_CLAUSE + QUEUE_JOB_BEGIN_CLAUSE() { looped::tunables_disable_phone(); diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index 1847dabd..7674f930 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -10,6 +10,8 @@ namespace big static void player_specate(); + static void protections_replay_interface(); + static void self_frame_flags(); static void self_godmode(); static void self_off_radar(); diff --git a/BigBaseV2/src/backend/looped/protections/replay_interface.cpp b/BigBaseV2/src/backend/looped/protections/replay_interface.cpp new file mode 100644 index 00000000..29605558 --- /dev/null +++ b/BigBaseV2/src/backend/looped/protections/replay_interface.cpp @@ -0,0 +1,45 @@ +#include "backend/looped/looped.hpp" +#include "gta/replay.hpp" +#include "pointers.hpp" +#include "natives.hpp" +#include "util/entity.hpp" + +namespace big +{ + static bool busy = false; + + void looped::protections_replay_interface() + { + if (busy) return; + busy = true; + + Ped player = PLAYER::PLAYER_PED_ID(); + + rage::CReplayInterface* replay_interface = *g_pointers->m_replay_interface; + rage::CObjectInterface* object_interface = replay_interface->m_object_interface; + + const int max_obj = object_interface->m_max_objects; + for (int i = 0; i < max_obj; i++) + { + rage::CObject* obj = object_interface->get_object(i); + if (obj == nullptr) continue; + + Object ent = g_pointers->m_ptr_to_handle(obj); + + if (g.protections.replay_interface.attach) + { + if (ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(player, ent) || ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(PED::GET_VEHICLE_PED_IS_IN(player, true), ent)) + { + entity::delete_entity(ent); + } + } + + if (g.protections.replay_interface.cage && obj->m_model_info->m_model == RAGE_JOAAT("prop_gold_cont_01")) + entity::delete_entity(ent); + + script::get_current()->yield(); + } + + busy = false; + } +} \ No newline at end of file diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 2cd1acca..fce8d063 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -22,23 +22,33 @@ struct globals { }; struct protections { - bool bounty = true; - bool ceo_ban = true; - bool ceo_kick = true; - bool ceo_money = true; - bool clear_wanted_level = true; - bool fake_deposit = true; - bool force_mission = true; - bool force_teleport = true; - bool gta_banner = true; - bool personal_vehicle_destroyed = true; - bool remote_off_radar = true; - bool send_to_cutscene = true; - bool send_to_island = true; - bool sound_spam = true; - bool spectate = true; - bool transaction_error = true; - bool vehicle_kick = true; + struct replay_interface { + bool attach = false; + bool cage = true; + }; + + struct script_events { + bool bounty = true; + bool ceo_ban = true; + bool ceo_kick = true; + bool ceo_money = true; + bool clear_wanted_level = true; + bool fake_deposit = true; + bool force_mission = true; + bool force_teleport = true; + bool gta_banner = true; + bool personal_vehicle_destroyed = true; + bool remote_off_radar = true; + bool send_to_cutscene = true; + bool send_to_island = true; + bool sound_spam = true; + bool spectate = true; + bool transaction_error = true; + bool vehicle_kick = true; + }; + + replay_interface replay_interface{}; + script_events script_events{}; }; struct self { @@ -104,23 +114,23 @@ struct globals { void from_json(const nlohmann::json& j) { - this->protections.bounty = j["protections"]["bounty"]; - this->protections.ceo_ban = j["protections"]["ceo_ban"]; - this->protections.ceo_kick = j["protections"]["ceo_kick"]; - this->protections.ceo_money = j["protections"]["ceo_money"]; - this->protections.clear_wanted_level = j["protections"]["clear_wanted_level"]; - this->protections.fake_deposit = j["protections"]["fake_deposit"]; - this->protections.force_mission = j["protections"]["force_mission"]; - this->protections.force_teleport = j["protections"]["force_teleport"]; - this->protections.gta_banner = j["protections"]["gta_banner"]; - this->protections.personal_vehicle_destroyed = j["protections"]["personal_vehicle_destroyed"]; - this->protections.remote_off_radar = j["protections"]["remote_off_radar"]; - this->protections.send_to_cutscene = j["protections"]["send_to_cutscene"]; - this->protections.send_to_island = j["protections"]["send_to_island"]; - this->protections.sound_spam = j["protections"]["sound_spam"]; - this->protections.spectate = j["protections"]["spectate"]; - this->protections.transaction_error = j["protections"]["transaction_error"]; - this->protections.vehicle_kick = j["protections"]["vehicle_kick"]; + this->protections.script_events.bounty = j["protections"]["script_events"]["bounty"]; + this->protections.script_events.ceo_ban = j["protections"]["script_events"]["ceo_ban"]; + this->protections.script_events.ceo_kick = j["protections"]["script_events"]["ceo_kick"]; + this->protections.script_events.ceo_money = j["protections"]["script_events"]["ceo_money"]; + this->protections.script_events.clear_wanted_level = j["protections"]["script_events"]["clear_wanted_level"]; + this->protections.script_events.fake_deposit = j["protections"]["script_events"]["fake_deposit"]; + this->protections.script_events.force_mission = j["protections"]["script_events"]["force_mission"]; + this->protections.script_events.force_teleport = j["protections"]["script_events"]["force_teleport"]; + this->protections.script_events.gta_banner = j["protections"]["script_events"]["gta_banner"]; + this->protections.script_events.personal_vehicle_destroyed = j["protections"]["script_events"]["personal_vehicle_destroyed"]; + this->protections.script_events.remote_off_radar = j["protections"]["script_events"]["remote_off_radar"]; + this->protections.script_events.send_to_cutscene = j["protections"]["script_events"]["send_to_cutscene"]; + this->protections.script_events.send_to_island = j["protections"]["script_events"]["send_to_island"]; + this->protections.script_events.sound_spam = j["protections"]["script_events"]["sound_spam"]; + this->protections.script_events.spectate = j["protections"]["script_events"]["spectate"]; + this->protections.script_events.transaction_error = j["protections"]["script_events"]["transaction_error"]; + this->protections.script_events.vehicle_kick = j["protections"]["script_events"]["vehicle_kick"]; this->tunables.disable_phone = j["tunables"]["disable_phone"]; this->tunables.no_idle_kick = j["tunables"]["no_idle_kick"]; @@ -154,24 +164,35 @@ struct globals { { return nlohmann::json{ { - "protections", { - { "bounty", this->protections.bounty }, - { "ceo_ban", this->protections.ceo_ban }, - { "ceo_kick", this->protections.ceo_kick }, - { "ceo_money", this->protections.ceo_money }, - { "clear_wanted_level", this->protections.clear_wanted_level }, - { "fake_deposit", this->protections.fake_deposit }, - { "force_mission", this->protections.force_mission }, - { "force_teleport", this->protections.force_teleport }, - { "gta_banner", this->protections.gta_banner }, - { "personal_vehicle_destroyed", this->protections.personal_vehicle_destroyed }, - { "remote_off_radar", this->protections.remote_off_radar }, - { "send_to_cutscene", this->protections.send_to_cutscene }, - { "send_to_island", this->protections.send_to_island }, - { "sound_spam", this->protections.sound_spam }, - { "spectate", this->protections.spectate }, - { "transaction_error", this->protections.transaction_error }, - { "vehicle_kick", this->protections.vehicle_kick } + "protections", + { + { + "replay_interface", { + { "attach", this->protections.replay_interface.attach }, + { "cage", this->protections.replay_interface.cage } + } + }, + { + "script_events", { + { "bounty", this->protections.script_events.bounty }, + { "ceo_ban", this->protections.script_events.ceo_ban }, + { "ceo_kick", this->protections.script_events.ceo_kick }, + { "ceo_money", this->protections.script_events.ceo_money }, + { "clear_wanted_level", this->protections.script_events.clear_wanted_level }, + { "fake_deposit", this->protections.script_events.fake_deposit }, + { "force_mission", this->protections.script_events.force_mission }, + { "force_teleport", this->protections.script_events.force_teleport }, + { "gta_banner", this->protections.script_events.gta_banner }, + { "personal_vehicle_destroyed", this->protections.script_events.personal_vehicle_destroyed }, + { "remote_off_radar", this->protections.script_events.remote_off_radar }, + { "send_to_cutscene", this->protections.script_events.send_to_cutscene }, + { "send_to_island", this->protections.script_events.send_to_island }, + { "sound_spam", this->protections.script_events.sound_spam }, + { "spectate", this->protections.script_events.spectate }, + { "transaction_error", this->protections.script_events.transaction_error }, + { "vehicle_kick", this->protections.script_events.vehicle_kick } + } + } } }, { diff --git a/BigBaseV2/src/function_types.hpp b/BigBaseV2/src/function_types.hpp index 749a034c..94298957 100644 --- a/BigBaseV2/src/function_types.hpp +++ b/BigBaseV2/src/function_types.hpp @@ -3,6 +3,7 @@ #include "gta/fwddec.hpp" #include "gta/player.hpp" #include "gta/natives.hpp" +#include "gta/replay.hpp" namespace big::functions { @@ -21,6 +22,8 @@ namespace big::functions using increment_stat_event = bool(uint64_t net_event_struct, int64_t sender, int64_t a3); + using ptr_to_handle = Object(rage::CObject* object); + // Received Event Signatures START using read_bitbuf_array = bool(rage::datBitBuffer* buffer, PVOID read, int bits, int); using read_bitbuf_dword = bool(rage::datBitBuffer* buffer, PVOID read, int bits); diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index c5bfd380..31418cdf 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -16,87 +16,87 @@ namespace big switch (hash) { case RemoteEvent::Bounty: - if (g.protections.bounty) + if (g.protections.script_events.bounty) strcpy(type, "Bounty"); break; case RemoteEvent::CeoBan: - if (g.protections.ceo_ban) + if (g.protections.script_events.ceo_ban) strcpy(type, "Ceo Ban"); break; case RemoteEvent::CeoKick: - if (g.protections.ceo_kick) + if (g.protections.script_events.ceo_kick) strcpy(type, "Ceo Kick"); break; case RemoteEvent::CeoMoney: - if (g.protections.ceo_money) + if (g.protections.script_events.ceo_money) strcpy(type, "Ceo Money"); break; case RemoteEvent::ClearWantedLevel: - if (g.protections.clear_wanted_level) + if (g.protections.script_events.clear_wanted_level) strcpy(type, "Clear Wanted Level"); break; case RemoteEvent::FakeDeposit: - if (g.protections.fake_deposit) + if (g.protections.script_events.fake_deposit) strcpy(type, "Deposit"); break; case RemoteEvent::ForceMission: - if (g.protections.force_mission) + if (g.protections.script_events.force_mission) strcpy(type, "Force Mission"); break; case RemoteEvent::GtaBanner: - if (g.protections.gta_banner) + if (g.protections.script_events.gta_banner) strcpy(type, "GTA Banner"); break; case RemoteEvent::PersonalVehicleDestroyed: - if (g.protections.personal_vehicle_destroyed) + if (g.protections.script_events.personal_vehicle_destroyed) strcpy(type, "Personal Vehicle Destroyed"); break; case RemoteEvent::RemoteOffradar: - if (g.protections.remote_off_radar) + if (g.protections.script_events.remote_off_radar) strcpy(type, "Remote Off Radar"); break; case RemoteEvent::SendToCutscene: - if (g.protections.send_to_cutscene) + if (g.protections.script_events.send_to_cutscene) strcpy(type, "Send To Cutscene"); break; case RemoteEvent::SendToIsland: - if (g.protections.send_to_island) + if (g.protections.script_events.send_to_island) strcpy(type, "Send To Island"); break; case RemoteEvent::SoundSpam: - if (g.protections.sound_spam) + if (g.protections.script_events.sound_spam) strcpy(type, "Sound Spam"); break; case RemoteEvent::Spectate: - if (g.protections.spectate) + if (g.protections.script_events.spectate) strcpy(type, "Specate"); break; case RemoteEvent::Teleport: - if (g.protections.force_teleport) + if (g.protections.script_events.force_teleport) strcpy(type, "Force Teleport"); break; case RemoteEvent::TransactionError: - if (g.protections.transaction_error) + if (g.protections.script_events.transaction_error) strcpy(type, "Transaction Error"); break; case RemoteEvent::VehicleKick: - if (g.protections.vehicle_kick) + if (g.protections.script_events.vehicle_kick) strcpy(type, "Vehicle Kick"); break; diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 044fe8a4..cf05fb06 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -185,6 +185,18 @@ namespace big { m_get_net_game_player = ptr.as(); }); + + // Replay Interface + main_batch.add("RI", "48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D", [this](memory::handle ptr) + { + m_replay_interface = ptr.add(3).rip().as(); + }); + + // Pointer to Handle + main_batch.add("PTH", "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 8B 15 ? ? ? ? 48 8B F9 48 83 C1 10 33 DB", [this](memory::handle ptr) + { + m_ptr_to_handle = ptr.as(); + }); main_batch.run(memory::module(nullptr)); diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index e683bdd6..039403bb 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -2,6 +2,7 @@ #include "common.hpp" #include "gta/fwddec.hpp" #include "gta/enums.hpp" +#include "gta/replay.hpp" #include "function_types.hpp" namespace big @@ -20,6 +21,9 @@ namespace big CPedFactory **m_ped_factory{}; CNetworkPlayerMgr **m_network_player_mgr{}; + rage::CReplayInterface** m_replay_interface{}; + functions::ptr_to_handle* m_ptr_to_handle{}; + rage::scrNativeRegistrationTable *m_native_registration_table{}; functions::get_native_handler_t m_get_native_handler{}; functions::fix_vectors_t m_fix_vectors{};