From e7bfb4a8f16f4b00fa786f458fc122695790b53f Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 27 Jul 2022 14:39:22 +0200 Subject: [PATCH] Update menu for 1.61 (#360) --- .../looped/hud/hud_transition_state.cpp | 2 +- BigBaseV2/src/backend/looped/self/noclip.cpp | 10 +- .../backend/looped/tunables/disable_phone.cpp | 2 +- .../backend/looped/tunables/no_idle_kick.cpp | 4 +- .../backend/looped/vehicle/despawn_bypass.cpp | 2 +- .../src/backend/looped/vehicle/ls_customs.cpp | 10 +- BigBaseV2/src/core/enums.hpp | 71 ++++----- BigBaseV2/src/gta/script_thread.hpp | 23 +-- BigBaseV2/src/gta/tls_context.hpp | 9 +- BigBaseV2/src/hooking.cpp | 7 - BigBaseV2/src/hooking.hpp | 4 - .../hooks/protections/net_array_handler.cpp | 23 --- .../protections/script_event_handler.cpp | 147 +----------------- .../src/native_hooks/shop_controller.hpp | 2 +- BigBaseV2/src/pointers.cpp | 32 ++-- BigBaseV2/src/pointers.hpp | 1 - BigBaseV2/src/util/globals.hpp | 7 +- BigBaseV2/src/util/mobile.hpp | 19 ++- BigBaseV2/src/util/session.hpp | 2 +- BigBaseV2/src/util/vehicle.hpp | 4 +- BigBaseV2/src/views/self/view_teleport.cpp | 5 +- BigBaseV2/src/views/vehicle/view_vehicle.cpp | 5 +- vendor/GTAV-Classes | 2 +- 23 files changed, 104 insertions(+), 289 deletions(-) delete mode 100644 BigBaseV2/src/hooks/protections/net_array_handler.cpp diff --git a/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp b/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp index b2101380..ad54f75a 100644 --- a/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp +++ b/BigBaseV2/src/backend/looped/hud/hud_transition_state.cpp @@ -77,7 +77,7 @@ namespace big "DLC Intro Bink", }; - auto transition_state = script_global(1574988); + auto transition_state = script_global(1574991); eTransitionState last_state = eTransitionState::TRANSITION_STATE_EMPTY; void looped::hud_transition_state() { diff --git a/BigBaseV2/src/backend/looped/self/noclip.cpp b/BigBaseV2/src/backend/looped/self/noclip.cpp index d553335e..4bb582f1 100644 --- a/BigBaseV2/src/backend/looped/self/noclip.cpp +++ b/BigBaseV2/src/backend/looped/self/noclip.cpp @@ -2,7 +2,6 @@ #include "fiber_pool.hpp" #include "gta/enums.hpp" #include "natives.hpp" -#include "script.hpp" #include "util/entity.hpp" namespace big @@ -36,10 +35,10 @@ namespace big void looped::self_noclip() { - bool bNoclip = g->self.noclip; + const auto bNoclip = g->self.noclip; - Vector3 location = self::pos; - Entity ent = self::veh != NULL ? self::veh : self::ped; + const auto location = self::pos; + const Entity ent = (self::veh != 0 && g_local_player->m_ped_task_flag & (int)ePedTask::TASK_DRIVING) ? self::veh : self::ped; // cleanup when changing entities if (prev != ent) @@ -53,7 +52,6 @@ namespace big if (bNoclip) { Vector3 vel = { 0.f, 0.f, 0.f }; - float heading = 0.f; // Left Shift if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_SPRINT)) @@ -91,7 +89,7 @@ namespace big ENTITY::FREEZE_ENTITY_POSITION(ent, false); - Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f); + const auto offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ent, vel.x, vel.y, 0.f); vel.x = offset.x - location.x; vel.y = offset.y - location.y; diff --git a/BigBaseV2/src/backend/looped/tunables/disable_phone.cpp b/BigBaseV2/src/backend/looped/tunables/disable_phone.cpp index f32aa9a4..b47c599a 100644 --- a/BigBaseV2/src/backend/looped/tunables/disable_phone.cpp +++ b/BigBaseV2/src/backend/looped/tunables/disable_phone.cpp @@ -5,6 +5,6 @@ namespace big { void looped::tunables_disable_phone() { - *script_global(19937).as() = g->tunables.disable_phone; + *script_global(20249).as() = g->tunables.disable_phone; } } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/tunables/no_idle_kick.cpp b/BigBaseV2/src/backend/looped/tunables/no_idle_kick.cpp index 4b9b0fae..9b4dda6b 100644 --- a/BigBaseV2/src/backend/looped/tunables/no_idle_kick.cpp +++ b/BigBaseV2/src/backend/looped/tunables/no_idle_kick.cpp @@ -7,8 +7,8 @@ namespace big { if (g->tunables.no_idle_kick) { - *script_global(1644218).at(1149).as() = 0; - *script_global(1644218).at(1165).as() = 0; + *script_global(1648034).at(1156).as() = 0; + *script_global(1648034).at(1172).as() = 0; } } } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/vehicle/despawn_bypass.cpp b/BigBaseV2/src/backend/looped/vehicle/despawn_bypass.cpp index 98e67743..abd41e12 100644 --- a/BigBaseV2/src/backend/looped/vehicle/despawn_bypass.cpp +++ b/BigBaseV2/src/backend/looped/vehicle/despawn_bypass.cpp @@ -6,6 +6,6 @@ namespace big // allows for spawning unreleased vehicles in online and online vehicles in single player void looped::vehicle_despawn_bypass() { - *script_global(4533757).as() = true; + *script_global(4539659).as() = true; } } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp b/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp index 554dc027..089fd666 100644 --- a/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp +++ b/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp @@ -20,12 +20,12 @@ namespace big if ( auto carmod_shop_thread = gta_util::find_script_thread(hash); carmod_shop_thread && - *script_local(carmod_shop_thread, 726).at(11).as() != 4 + *script_local(carmod_shop_thread, 728).at(11).as() != 4 ) { g->vehicle.ls_customs = false; - *script_local(carmod_shop_thread, 726).as() = 1; // cleanup + *script_local(carmod_shop_thread, 728).as() = 1; // cleanup } } @@ -55,10 +55,10 @@ namespace big { if (auto carmod_shop_thread = gta_util::find_script_thread(hash); carmod_shop_thread) { - *script_local(carmod_shop_thread, 726).at(406).as() = veh; - *script_local(carmod_shop_thread, 2110).as() = false; // skips cutscene that's invisible + *script_local(carmod_shop_thread, 728).at(406).as() = veh; + *script_local(carmod_shop_thread, 2149).as() = false; // skips cutscene that's invisible - *script_local(carmod_shop_thread, 726).at(11).as() = 4; + *script_local(carmod_shop_thread, 728).at(11).as() = 4; } } } diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index 67a06808..999c8379 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -126,50 +126,39 @@ namespace big TASK_UNK = 1 << 5, TASK_DRIVING = 1 << 6 }; - + enum class eRemoteEvent { - Bounty = 1294995624, - CeoBan = -764524031, - CeoKick = 248967238, - CeoMoney = 1890277845, - ClearWantedLevel = -91354030, - Crash = -1386010354, - FakeDeposit = 677240627, - ForceMission = 2020588206, - GtaBanner = 1572255940, - MCTeleport = 962740265, - NetworkBail = 1228916411, - PersonalVehicleDestroyed = 802133775, - RemoteOffradar = -391633760, - RotateCam = 801199324, - SendToCutscene = 1068259786, - SendToCayoPerico = -621279188, - SendToLocation = 1463943751, - SoundSpam = 1132878564, - Spectate = -1113591308, - Teleport = 603406648, - TransactionError = -1704141512, - VehicleKick = 578856274, - Unknown1 = -145306724, - Unknown2 = -581037897, - Unknown3 = 1757755807, - Unknown4 = 436475575, - Unknown5 = 990606644, - Unknown6 = 69874647, + Bounty = 1294995624, // (137, "FM_TXT_BNTY0", iVar1, PLAYER::GET_PLAYER_NAME(Var2.f_1), "", 5000, Var2.f_6); + CeoBan = 1240068495, // mpply_vipgameplaydisabledtimer + CeoKick = -1425016400, // BGDISMISSED + CeoMoney = 547083265, // Goon_Paid_Large + ClearWantedLevel = 1449852136, + FakeDeposit = -1529596656, // TICK_ATTVAN + ForceMission = -283041276, // ), Var0.f_2, 1)) + ForceMission2 = -1908874529, + GtaBanner = 145637109, // NETWORK::NETWORK_IS_SCRIPT_ACTIVE("BUSINESS_BATTLES", -1, true, 0) second one + NetworkBail = 1674887089, // NETWORK::NETWORK_BAIL(16, 0, 0); xref func + PersonalVehicleDestroyed = -1838276770, // PLYVEH_INS_DES1 + RemoteOffradar = -1973627888, // NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), Var0.f_2) + RotateCam = -1388926377, // CnCTG_IN_BF + SendToCutscene = 2131601101, // (bVar3, bVar4, 125f, 1) + SendToCayoPerico = 1361475530, // CELL_HI_INV + SendToLocation = 1214823473, // &Var222, 11); + SHKick = 1037001637, + SoundSpam = 1111927333, // CELL_APTINVYACHT + Spectate = -2131157870, // SPEC_TCK1 + Teleport = -1390976345, // Mission_Pass_Notify + TransactionError = -768108950, // NETWORK_RECEIVE_PLAYER_JOBSHARE_CASH + VehicleKick = -714268990, // PIM_RFMOC + Kick = 1674887089, + GiveCollectible = -1178972880, // DLC_SUM20_HIDDEN_COLLECTIBLES xref + ChangeMCRole = 656530441, // _PLAYSTATS_CHANGE_MC_ROLE + DisableRecording = 867047895, // GET_FINAL_RENDERED_CAM_COORD + MCTeleport = -555356783, // NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(PLAYER::PLAYER_ID()) == (first one) - SEC3 = -2113023004, - SEC6 = 704979198, - SEC7 = -1715193475, - SEC8 = 1258808115, - SEC9 = 2112408256, - SEC10 = 998716537, - SEC11 = 163598572, - SEC12 = -1970125962, - SEC13 = -1056683619, - Spaghettios = -393294520, - ForceMission2 = -1525161016, - SHKick = -786546101 + Crash = -1386010354, // SET_NO_LOADING_SCREEN, xref it + Crash2 = 1348481963, }; enum class eSessionType diff --git a/BigBaseV2/src/gta/script_thread.hpp b/BigBaseV2/src/gta/script_thread.hpp index d9308a2f..09d5dde4 100644 --- a/BigBaseV2/src/gta/script_thread.hpp +++ b/BigBaseV2/src/gta/script_thread.hpp @@ -37,25 +37,28 @@ namespace rage { public: virtual ~scrThread() = default; // 0 (0x00) - virtual void reset(std::uint32_t script_hash, void *args, std::uint32_t arg_count) = 0; // 1 (0x08) + virtual void reset(std::uint32_t script_hash, void* args, std::uint32_t arg_count) = 0; // 1 (0x08) virtual eThreadState run() = 0; // 2 (0x10) virtual eThreadState tick(std::uint32_t ops_to_execute) = 0; // 3 (0x18) virtual void kill() = 0; // 4 (0x20) - static scrThread* get() + inline static scrThread* get() { return rage::tlsContext::get()->m_script_thread; } public: scrThreadContext m_context; // 0x08 - void *m_stack; // 0xB0 - char m_padding[0x10]; // 0xB8 - const char *m_exit_message; // 0xC8 - char m_name[0x40]; // 0xD0 - scriptHandler *m_handler; // 0x110 - scriptHandlerNetComponent *m_net_component; // 0x118 + void* m_stack; // 0xB0 + char m_padding[0x4]; // 0xB8 + uint32_t m_arg_size; // 0xBC + uint32_t m_arg_loc; // 0xC0 + char m_padding2[0x4]; // 0xC4 + const char* m_exit_message; // 0xC8 + char m_pad[0x4]; + char m_name[0x40]; // 0xD4 + scriptHandler* m_handler; // 0x114 + scriptHandlerNetComponent* m_net_component; // 0x11C }; - static_assert(sizeof(scrThread) == 0x120); } class GtaThread : public rage::scrThread @@ -75,4 +78,4 @@ public: char m_padding7[0x0F]; // 0x149 }; -static_assert(sizeof(GtaThread) == 0x158); +static_assert(sizeof(GtaThread) == 0x160); diff --git a/BigBaseV2/src/gta/tls_context.hpp b/BigBaseV2/src/gta/tls_context.hpp index d1ced43b..dd4b2a41 100644 --- a/BigBaseV2/src/gta/tls_context.hpp +++ b/BigBaseV2/src/gta/tls_context.hpp @@ -9,14 +9,15 @@ namespace rage public: char m_padding1[0xC8]; // 0x00 sysMemAllocator* m_allocator; // 0xC8 - char m_padding2[0x758]; // 0xD0 - scrThread* m_script_thread; // 0x828 - bool m_is_script_thread_active; // 0x830 + char m_padding2[0x770]; // 0xD0 + scrThread* m_script_thread; // 0x840 + bool m_is_script_thread_active; // 0x848 static tlsContext* get() { return *reinterpret_cast(__readgsqword(0x58)); } }; - static_assert(sizeof(tlsContext) == 0x838); + + static_assert(sizeof(tlsContext) == 0x850); } diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 1c84569b..0f230884 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -35,9 +35,6 @@ namespace big // 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), // Is DLC Present m_is_dlc_present_hook("IDP", g_pointers->m_is_dlc_present, &hooks::is_dlc_present), @@ -88,8 +85,6 @@ namespace big m_network_player_mgr_init_hook.enable(); m_network_player_mgr_shutdown_hook.enable(); - m_net_array_handler_hook.enable(); - m_player_has_joined_hook.enable(); m_player_has_left_hook.enable(); @@ -121,8 +116,6 @@ namespace big m_player_has_joined_hook.disable(); m_player_has_left_hook.disable(); - m_net_array_handler_hook.disable(); - m_network_player_mgr_init_hook.disable(); m_network_player_mgr_shutdown_hook.disable(); diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index db0dcadc..c73cc914 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -29,8 +29,6 @@ namespace big 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); static void player_leave(CNetworkObjectMgr* _this, CNetGamePlayer* net_player); @@ -93,8 +91,6 @@ namespace big detour_hook m_network_group_override; - detour_hook m_net_array_handler_hook; - detour_hook m_player_has_joined_hook; detour_hook m_player_has_left_hook; diff --git a/BigBaseV2/src/hooks/protections/net_array_handler.cpp b/BigBaseV2/src/hooks/protections/net_array_handler.cpp deleted file mode 100644 index c830c835..00000000 --- a/BigBaseV2/src/hooks/protections/net_array_handler.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "hooking.hpp" - -namespace big -{ - // in this hook we rebuild how the game reads data from the datBitBuffer - // we specifically recreate what the game uses to "detect" the NET_ARRAY_ERROR - // then if we find such a crash we just return false; - bool hooks::net_array_handler(long long netArrayHandlerBaseMgr, CNetGamePlayer* a2, rage::datBitBuffer* datbitbuffer, unsigned int bytes_to_read, short a5) - { - if (datbitbuffer->m_bitsRead + bytes_to_read > datbitbuffer->m_curBit) - { - if (g->notifications.net_array_error.log) - LOG(WARNING) << "Received NET_ARRAY_ERROR crash from " << a2->get_name(); - - if (g->notifications.net_array_error.notify) - g_notification_service->push_warning("Protections", fmt::format("Detected NET_ARRAY_ERROR crash from {}", a2->get_name())); - - return false; - } - - return g_hooking->m_net_array_handler_hook.get_original()(netArrayHandlerBaseMgr, a2, datbitbuffer, bytes_to_read, a5); - } -} \ No newline at end of file diff --git a/BigBaseV2/src/hooks/protections/script_event_handler.cpp b/BigBaseV2/src/hooks/protections/script_event_handler.cpp index 70c69d93..6fcad9ac 100644 --- a/BigBaseV2/src/hooks/protections/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/protections/script_event_handler.cpp @@ -66,6 +66,7 @@ namespace big } break; case eRemoteEvent::Crash: + case eRemoteEvent::Crash2: if (g->protections.script_events.crash) { format_string(player_name, "TSE Crash", notify.crash.log, notify.crash.notify); @@ -238,152 +239,6 @@ namespace big return true; } break; - case eRemoteEvent::Unknown1: - if (g->protections.script_events.crash && args[2] >= 32) { - format_string(player_name, "Crash - #" + std::to_string(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 - #" + std::to_string(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 - #" + std::to_string(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 - #" + std::to_string(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 - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC3: - if ( - g->protections.script_events.crash && - ( - (args[2] <= 115831 || args[2] >= 9999449) || - (args[3] <= -1 || args[3] >= 1) || - (args[4] <= -1 || args[4] >= 3) || - (args[5] <= -1 || args[5] >= 101) || - (args[6] <= -1 || args[6] >= 3) || - (args[7] <= -1 || args[7] >= 1) - ) - ) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC6: - if ( - g->protections.script_events.crash && - ( - (args[2] <= -1 || args[2] >= 1) || - (args[3] <= -2 || args[3] >= 0) || - (args[4] <= 3 || args[4] >= 5) || - (args[5] <= 172 || args[5] >= 174) || - (args[6] <= 20 || args[6] >= 510) || - (args[7] <= 62 || args[7] >= 64) || - (args[11] <= -1 || args[11] >= 1) || - (args[12] <= -1 || args[12] >= 1) || - (args[13] <= -1 || args[13] >= 1) - ) - ) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC7: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC8: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC9: - if ( - g->protections.script_events.crash && - ( - (args[2] <= -1986324736 || args[2] >= 1747413822) || - (args[2] > -9999999 || args[2] < 77777777) || - (args[3] <= -1986324736 || args[3] >= 1777712108) || - (args[3] > -9999999 || args[3] < 77777777) || - (args[4] <= -1673857408 || args[4] >= 1780088064) || - (args[4] > -9999999 || args[4] < 77777777) || - (args[6] <= (0LL - 2588888790LL) || args[6] >= 2100146067) - ) - ) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC10: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC11: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC12: - if ( - g->protections.script_events.crash && - ( - (args[2] <= -1 || args[2] >= 50) || - (args[3] <= -1 || args[3] >= 50) - ) - ) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::SEC13: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; - case eRemoteEvent::Spaghettios: - if (g->protections.script_events.crash) { - format_string(player_name, "Crash - #" + std::to_string(args[0]), notify.crash.log, notify.crash.notify); - - return true; - } - break; case eRemoteEvent::ForceMission2: if (g->protections.script_events.force_mission) { diff --git a/BigBaseV2/src/native_hooks/shop_controller.hpp b/BigBaseV2/src/native_hooks/shop_controller.hpp index 41b2b3e9..c81e4991 100644 --- a/BigBaseV2/src/native_hooks/shop_controller.hpp +++ b/BigBaseV2/src/native_hooks/shop_controller.hpp @@ -15,7 +15,7 @@ namespace big if (g->notifications.transaction_rate_limit.notify) g_notification_service->push_warning("Transaction Rate Limit", "You're receiving transaction rate limits, whatever you're doing do it less."); - *script_global(4529830).as() = 0; + *script_global(4535606).as() = 0; return; } diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 7ac60a8e..eb0b86bf 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -30,6 +30,8 @@ namespace big main_batch.add("PF", "48 8B 05 ? ? ? ? 48 8B 48 08 48 85 C9 74 52 8B 81", [this](memory::handle ptr) { m_ped_factory = ptr.add(3).rip().as(); + + LOG(G3LOG_DEBUG) << "CPedFactory => [" << HEX_TO_UPPER(m_ped_factory) << "]"; }); // Network Player Manager @@ -68,6 +70,8 @@ namespace big main_batch.add("SG", "48 8D 15 ? ? ? ? 4C 8B C0 E8 ? ? ? ? 48 85 FF 48 89 1D", [this](memory::handle ptr) { m_script_globals = ptr.add(3).rip().as(); + + LOG(G3LOG_DEBUG) << "ScriptGlobals => [" << HEX_TO_UPPER(m_script_globals) << "]"; }); // Game Script Handle Manager @@ -206,7 +210,9 @@ namespace big // Replay Interface main_batch.add("RI", "0F B7 44 24 ? 66 89 44 4E", [this](memory::handle ptr) { - m_replay_interface = ptr.add(0x1F).rip().as(); + m_replay_interface = ptr.add(0x1F).rip().as(); + + LOG(G3LOG_DEBUG) << "rage::CReplayInterface => [" << HEX_TO_UPPER(m_replay_interface) << "]"; }); // Pointer to Handle @@ -264,9 +270,11 @@ namespace big }); // FriendRegistry - main_batch.add("FR", "3B 0D ? ? ? ? 73 13 48 63 C9", [this](memory::handle ptr) + main_batch.add("FR", "3B 0D ? ? ? ? 73 17", [this](memory::handle ptr) { m_friend_registry = ptr.add(2).rip().as(); + + LOG(G3LOG_DEBUG) << "FriendRegistry => [" << HEX_TO_UPPER(m_friend_registry) << "]"; }); // GET_SCREEN_COORDS_FROM_WORLD_COORDS @@ -287,12 +295,6 @@ namespace big m_give_pickup_rewards = ptr.sub(0x28).as(); }); - // Net Array Handler - Version mismatch patch - main_batch.add("NAH", "44 8B E0 89 45 F4 48 8B 03 48 8B CB FF 90", [this](memory::handle ptr) - { - m_net_array_handler = ptr.sub(0x3C).as(); - }); - // Network Group Override main_batch.add("NGO", "44 89 81 ? ? ? ? 89 91 ? ? ? ? C6 05", [this](memory::handle ptr) { @@ -306,19 +308,19 @@ namespace big }); // Get Network Event Data - main_batch.add("GNED", "E9 ? ? ? ? E9 ? ? ? ? E9 ? ? ? ? E9 ? ? ? ? E9 ? ? ? ? CC FF 50 28", [this](memory::handle ptr) + main_batch.add("GNED", "53 43 52 49 50 54 5F 4E 45 54 57 4F 52 4B", [this](memory::handle ptr) { - m_get_network_event_data = ptr.as(); + m_get_network_event_data = *ptr.sub(0x38).as(); }); // Received clone sync & Get sync tree for type & Get net object for player & Get sync type info & Get net object - main_batch.add("RCS/GSTFT/GNOFP/GNO/GSTI", "4C 8B F2 41 0F B7 D1 45 0F B7 E1", [this](memory::handle ptr) + main_batch.add("RCS/GSTFT/GNOFP/GNO/GSTI", "4C 8B FA 41 0F B7 D1", [this](memory::handle ptr) { m_received_clone_sync = ptr.sub(0x1D).as(); m_get_sync_tree_for_type = ptr.add(0x14).rip().as(); // 0F B7 CA 83 F9 07 .as() - m_get_net_object_for_player = ptr.add(0x4C).rip().as(); // 41 80 78 ? FF 74 2D 41 0F B6 40 .as() - m_get_net_object = ptr.add(0x62).rip().as(); // E8 ? ? ? ? 0F B7 53 7C .add(1).rip().as() - m_get_sync_type_info = ptr.add(0x78).rip().as(); // 44 0F B7 C1 4C 8D 0D .as() + m_get_net_object_for_player = ptr.add(0x60).rip().as(); // 41 80 78 ? FF 74 2D 41 0F B6 40 .as() + m_get_net_object = ptr.add(0x76).rip().as(); // E8 ? ? ? ? 0F B7 53 7C .add(1).rip().as() + m_get_sync_type_info = ptr.add(0x8C).rip().as(); // 44 0F B7 C1 4C 8D 0D .as() }); // Model Hash Table @@ -326,6 +328,8 @@ namespace big { m_model_table = ptr.add(3).rip().as*>(); + LOG(G3LOG_DEBUG) << "HashTable => [" << HEX_TO_UPPER(m_model_table) << "]"; + // sample code to iterator models /*for (int i = 0; i < m_model_table->m_size; ++i) { diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 03892361..bb58f034 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -62,7 +62,6 @@ namespace big PVOID m_network_player_mgr_init; PVOID m_network_player_mgr_shutdown; - PVOID m_net_array_handler; PVOID m_player_has_joined{}; PVOID m_player_has_left{}; diff --git a/BigBaseV2/src/util/globals.hpp b/BigBaseV2/src/util/globals.hpp index 448f2f30..e882e331 100644 --- a/BigBaseV2/src/util/globals.hpp +++ b/BigBaseV2/src/util/globals.hpp @@ -4,18 +4,13 @@ namespace big::globals { - inline Vehicle get_personal_vehicle() - { - return *script_global(2810701).at(298).as(); - } - inline void clear_wanted_player(Player target) { constexpr size_t arg_count = 3; int64_t args[arg_count] = { static_cast(eRemoteEvent::ClearWantedLevel), self::id, - *script_global(1893551).at(target, 599).at(510).as() + *script_global(1892703).at(target, 599).at(510).as() }; g_pointers->m_trigger_script_event(1, args, arg_count, 1 << target); diff --git a/BigBaseV2/src/util/mobile.hpp b/BigBaseV2/src/util/mobile.hpp index 7309fed3..e5778da0 100644 --- a/BigBaseV2/src/util/mobile.hpp +++ b/BigBaseV2/src/util/mobile.hpp @@ -12,9 +12,9 @@ namespace big::mobile { - inline auto player_global = script_global(2689224); - inline auto mechanic_global = script_global(2810701); - inline auto vehicle_global = script_global(1585853); + inline auto player_global = script_global(2689235); + inline auto mechanic_global = script_global(2815059); + inline auto vehicle_global = script_global(1585857); namespace util { @@ -37,8 +37,8 @@ namespace big::mobile { inline void off_radar(bool toggle) { - *player_global.at(PLAYER::GET_PLAYER_INDEX(), 451).at(207).as() = toggle; - *script_global(2703660).at(56).as() = NETWORK::GET_NETWORK_TIME() + 1; + *player_global.at(PLAYER::GET_PLAYER_INDEX(), 453).at(208).as() = toggle; + *script_global(2703735).at(56).as() = NETWORK::GET_NETWORK_TIME() + 1; } } @@ -84,6 +84,11 @@ namespace big::mobile namespace mechanic { + inline Vehicle get_personal_vehicle() + { + return *mechanic_global.at(298).as(); + } + inline void summon_vehicle_by_index(int veh_idx) { if (*mechanic_global.at(958).as() != -1) @@ -107,14 +112,14 @@ namespace big::mobile GtaThread* freemode_thread = gta_util::find_script_thread(RAGE_JOAAT("freemode")); if (freemode_thread) - *script_local(freemode_thread, 18196).at(176).as() = 0; // spawn vehicle instantly + *script_local(freemode_thread, 18399).at(176).as() = 0; // spawn vehicle instantly // blocking call till vehicle is delivered notify::busy_spinner("Delivering vehicle...", mechanic_global.at(958).as(), -1); if (g->clone_pv.spawn_inside) { - big::vehicle::bring(globals::get_personal_vehicle(), self::pos, true); + big::vehicle::bring(get_personal_vehicle(), self::pos, true); } } } diff --git a/BigBaseV2/src/util/session.hpp b/BigBaseV2/src/util/session.hpp index c578bba6..12952d6e 100644 --- a/BigBaseV2/src/util/session.hpp +++ b/BigBaseV2/src/util/session.hpp @@ -11,7 +11,7 @@ namespace big::session if (session.id == eSessionType::LEAVE_ONLINE) *script_global(1574589).at(2).as() = -1; else - *script_global(1575012).as() = (int)session.id; + *script_global(1575015).as() = (int)session.id; *script_global(1574589).as() = 1; script::get_current()->yield(200ms); diff --git a/BigBaseV2/src/util/vehicle.hpp b/BigBaseV2/src/util/vehicle.hpp index 3ef9c422..df450c78 100644 --- a/BigBaseV2/src/util/vehicle.hpp +++ b/BigBaseV2/src/util/vehicle.hpp @@ -12,11 +12,11 @@ namespace big::vehicle { - inline auto spawn_global = script_global(2725269); + inline auto spawn_global = script_global(2725439); inline void go_into_personal_vehicle() { - *script_global(2671447).at(8).as() = 1; + *script_global(2671449).at(8).as() = 1; } inline float mps_to_speed(float mps, SpeedUnit speed_unit) diff --git a/BigBaseV2/src/views/self/view_teleport.cpp b/BigBaseV2/src/views/self/view_teleport.cpp index 154a21b6..5d8d44fe 100644 --- a/BigBaseV2/src/views/self/view_teleport.cpp +++ b/BigBaseV2/src/views/self/view_teleport.cpp @@ -1,6 +1,7 @@ #include "views/view.hpp" #include "fiber_pool.hpp" #include "util/globals.hpp" +#include "util/mobile.hpp" #include "util/teleport.hpp" #include "util/vehicle.hpp" @@ -34,14 +35,14 @@ namespace big components::button("Bring Personal Vehicle", [] { - Vehicle veh = globals::get_personal_vehicle(); + Vehicle veh = mobile::mechanic::get_personal_vehicle(); vehicle::bring(veh, self::pos); }); components::button("Teleport to Personal Vehicle", [] { - Vehicle veh = globals::get_personal_vehicle(); + Vehicle veh = mobile::mechanic::get_personal_vehicle(); teleport::into_vehicle(veh); }); diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index 1b8727f7..19439ec9 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -1,6 +1,5 @@ #include "fiber_pool.hpp" #include "gui/handling/handling_tabs.hpp" -#include "script.hpp" #include "util/vehicle.hpp" #include "views/view.hpp" #include "util/mobile.hpp" @@ -24,12 +23,12 @@ namespace big ImGui::Separator(); components::button("Teleport in PV", [] { - Vehicle veh = globals::get_personal_vehicle(); + Vehicle veh = mobile::mechanic::get_personal_vehicle(); teleport::into_vehicle(veh); }); ImGui::SameLine(); components::button("Bring PV", [] { - Vehicle veh = globals::get_personal_vehicle(); + Vehicle veh = mobile::mechanic::get_personal_vehicle(); vehicle::bring(veh, self::pos, true); }); ImGui::SameLine(); diff --git a/vendor/GTAV-Classes b/vendor/GTAV-Classes index ebe11599..d3cb0c38 160000 --- a/vendor/GTAV-Classes +++ b/vendor/GTAV-Classes @@ -1 +1 @@ -Subproject commit ebe115994c379391a96c818f957ac61939dee457 +Subproject commit d3cb0c38a4763ee585afb8e65745e4049ec6ca16