Update to 1.67 (#1407)

This commit is contained in:
maybegreat48 2023-06-14 21:29:25 +00:00 committed by GitHub
parent 131544e538
commit 0ff99ececc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 262 additions and 486 deletions

View File

@ -1,6 +1,6 @@
{
"game": {
"online": "1.66",
"build": "2845"
"online": "1.67",
"build": "2944"
}
}

View File

@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
gtav_classes
GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git
GIT_TAG 9de17746d2e7492725d2e7430ad0f27c05b6c2f0
GIT_TAG 7b8bfba701d70e6a503c0767a5bc3b6c4c0294b8
GIT_PROGRESS TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View File

@ -23,7 +23,7 @@ namespace big
rage::snMsgRemoveGamersFromSessionCmd cmd{};
cmd.m_session_id = gta_util::get_network()->m_game_session_ptr->m_rline_session.m_session_id;
cmd.m_num_peers = 1;
cmd.m_peer_ids[0] = player->get_session_peer()->m_peer_data.m_peer_id_2;
cmd.m_handles[0] = player->get_net_data()->m_gamer_handle;
if (g.session.show_cheating_message)
cmd.m_unk = 19;
@ -39,7 +39,7 @@ namespace big
if (plyr->id() != player->id())
g_pointers->m_gta.m_send_remove_gamer_cmd(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
g_pointers->m_gta.m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
(int)plyr->get_session_player()->m_player_data.m_peer_id_2),
plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier,
&cmd,
0x1000000);
@ -55,7 +55,7 @@ namespace big
{
g_pointers->m_gta.m_send_remove_gamer_cmd(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
g_pointers->m_gta.m_get_connection_peer(gta_util::get_network()->m_game_session_ptr->m_net_connection_mgr,
(int)plyr->get_session_player()->m_player_data.m_peer_id_2),
plyr->get_session_player()->m_player_data.m_peer_id_2),
gta_util::get_network()->m_game_session_ptr->m_connection_identifier,
&cmd,
0x1000000);

View File

@ -3,6 +3,8 @@
#include "natives.hpp"
#include "pointers.hpp"
#include <script/globals/GPBD_FM_3.hpp>
namespace big
{
class ceo_kick : player_command
@ -16,7 +18,7 @@ namespace big
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
auto leader = *scr_globals::gpbd_fm_3.at(player->id(), scr_globals::size::gpbd_fm_3).at(10).as<int*>();
auto leader = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].BossGoon.Boss;
if (leader == -1)
return;

View File

@ -9,6 +9,7 @@
#include "util/scripts.hpp"
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -134,8 +135,12 @@ namespace big
int64_t args[arg_count]{
(int64_t)eRemoteEvent::KickFromInterior,
(int64_t)self::id,
*scr_globals::globalplayer_bd.at(player->id(), scr_globals::size::globalplayer_bd).at(321).at(7).as<int64_t*>(),
*scr_globals::globalplayer_bd.at(player->id(), scr_globals::size::globalplayer_bd).at(321).at(8).as<int64_t*>(),
(int64_t)scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()
->Entries[player->id()]
.SimpleInteriorData.Index,
(int64_t)scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()
->Entries[player->id()]
.SimpleInteriorData.InstanceId,
};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());

View File

@ -1,30 +0,0 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
namespace big
{
class send_to_island : player_command
{
using player_command::player_command;
virtual CommandAccessLevel get_access_level()
{
return CommandAccessLevel::AGGRESSIVE;
}
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
const size_t arg_count = 2;
int64_t args[arg_count] = {
(int64_t)eRemoteEvent::SendToCayoPerico,
(int64_t)self::id,
};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id());
}
};
send_to_island g_send_to_island("cayotp", "TP_TO_CAYO", "TP_TO_CAYO_DESC", 0);
}

View File

@ -45,12 +45,12 @@ namespace big
};
start_script<20> g_start_tutorial("tutorial", "Start Tutorial", "Plays that unskippable cutscene used in the tutorial", 0);
start_script<193> g_start_golf("golf", "Start Golf", "Starts golf", 0);
start_script<196> g_start_flight_school("flightschool", "Start Flight School", "Teleports player to the airport and starts flight school", 0);
start_script<192> g_start_darts("darts", "Start Darts", "Starts darts in a Sandy Shores bar", 0);
start_script<211> g_start_badlands("badlands", "Start Badlands Revenge II", "Starts the arcade game Badlands Revenge II in fullscreen", 0);
start_script<216> g_start_space_monkey("spacemonkey", "Start Space Monkey 3", "Starts the arcade game Space Monkey 3 in fullscreen", 0);
start_script<216> g_start_wizards_ruin("wizard", "Start The Wizard's Ruin", "Starts the arcade game The Wizard's Ruin in fullscreen", 0);
start_script<217> g_start_qub3d("qub3d", "Start Qub3D", "Starts the arcade game Qub3D in fullscreen", 0);
start_script<218> g_start_camhedz("camhedz", "Start Camhedz", "Starts the arcade game Camhedz in fullscreen", 0);
start_script<200> g_start_golf("golf", "Start Golf", "Starts golf", 0);
start_script<203> g_start_flight_school("flightschool", "Start Flight School", "Teleports player to the airport and starts flight school", 0);
start_script<9> g_start_darts("darts", "Start Darts", "Starts darts in a Sandy Shores bar", 0);
start_script<218> g_start_badlands("badlands", "Start Badlands Revenge II", "Starts the arcade game Badlands Revenge II in fullscreen", 0);
start_script<223> g_start_space_monkey("spacemonkey", "Start Space Monkey 3", "Starts the arcade game Space Monkey 3 in fullscreen", 0);
start_script<219> g_start_wizards_ruin("wizard", "Start The Wizard's Ruin", "Starts the arcade game The Wizard's Ruin in fullscreen", 0);
start_script<224> g_start_qub3d("qub3d", "Start Qub3D", "Starts the arcade game Qub3D in fullscreen", 0);
start_script<225> g_start_camhedz("camhedz", "Start Camhedz", "Starts the arcade game Camhedz in fullscreen", 0);
}

View File

@ -67,9 +67,6 @@ namespace big
if (g.self.dance_mode && g.m_dance_thread->m_handler)
{
*script_global(1950102).as<bool*>() = true;
misc::set_bit(scr_globals::gpbd_fm_1.at(self::id, scr_globals::size::gpbd_fm_1).at(267).at(310).at(7).as<int*>(), 0);
misc::set_bit(scr_globals::gpbd_fm_1.at(self::id, scr_globals::size::gpbd_fm_1).at(267).at(310).at(7).as<int*>(), 1);
misc::set_bit(scr_globals::gpbd_fm_1.at(self::id, scr_globals::size::gpbd_fm_1).at(267).at(310).at(7).as<int*>(), 2);
scr_functions::dance_loop.call(g.m_dance_thread, g.m_dance_program, {});
}
}

View File

@ -2,6 +2,8 @@
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
class off_radar : looped_command
@ -10,13 +12,13 @@ namespace big
virtual void on_tick() override
{
*scr_globals::globalplayer_bd.at(PLAYER::GET_PLAYER_INDEX(), scr_globals::size::globalplayer_bd).at(210).as<int*>() = true;
*script_global(2672505).at(57).as<int*>() = NETWORK::GET_NETWORK_TIME() + 1;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = true;
*scr_globals::offradar_time.at(57).as<int*>() = NETWORK::GET_NETWORK_TIME() + 1;
}
virtual void on_disable() override
{
*scr_globals::globalplayer_bd.at(PLAYER::GET_PLAYER_INDEX(), scr_globals::size::globalplayer_bd).at(210).as<int*>() = false;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = false;
}
};

View File

@ -11,13 +11,8 @@ namespace big
{
void looped::system_desync_kick_protection()
{
if (!g.protections.desync_kick)
return;
if (g_player_service->get_self()->is_valid() && g_player_service->get_self()->is_host())
return;
memset(&gta_util::get_network()->m_game_complaint_mgr.m_host_tokens_complained, 0, 64 * sizeof(std::uint64_t));
if (!g_player_service->m_player_to_use_complaint_kick
|| !g_player_service->m_player_to_use_complaint_kick->get()->get_net_data())
gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained = 0;
@ -30,25 +25,11 @@ namespace big
auto old = gta_util::get_network()->m_game_complaint_mgr.m_host_token;
if (gta_util::get_network()->m_game_session_state > 3 && gta_util::get_network()->m_game_session_state < 6)
if (gta_util::get_network()->m_game_session_state > 3 && gta_util::get_network()->m_game_session_state < 6
&& g_player_service->m_player_to_use_complaint_kick && g_player_service->get_self()->is_valid()
&& !g_player_service->get_self()->is_host())
{
for (auto& [_, plyr] : g_player_service->players())
{
if (plyr->get_net_data())
{
gta_util::get_network()->m_game_complaint_mgr.m_host_token = plyr->get_net_data()->m_host_token;
g_pointers->m_gta.m_reset_network_complaints(&gta_util::get_network()->m_game_complaint_mgr);
}
}
if (g_player_service->get_self() && g_player_service->get_self()->get_net_data())
{
gta_util::get_network()->m_game_complaint_mgr.m_host_token =
g_player_service->get_self()->get_net_data()->m_host_token;
g_pointers->m_gta.m_reset_network_complaints(&gta_util::get_network()->m_game_complaint_mgr);
}
}
gta_util::get_network()->m_game_complaint_mgr.m_host_token = old;
}
}

View File

@ -10,12 +10,12 @@ namespace big
virtual void on_tick() override
{
*script_global(20366).as<bool*>() = true;
*script_global(20483).as<bool*>() = true;
}
virtual void on_disable() override
{
*script_global(20366).as<bool*>() = false;
*script_global(20483).as<bool*>() = false;
}
};

View File

@ -51,8 +51,8 @@ namespace big
g_script_patcher_service->update();
scr_functions::setup_modshop.call_latent(g.m_modshop_thread, gta_util::find_script_program(RAGE_JOAAT("carmod_shop")), {45, 0, 18, 0}, bModshopReady);
*script_local(g.m_modshop_thread->m_stack, 730).at(446).as<int*>() = 2;
*script_local(g.m_modshop_thread->m_stack, 2237).as<ControllerInputs*>() = ControllerInputs::INPUT_FRONTEND_LT;
*script_local(g.m_modshop_thread->m_stack, 731).at(446).as<int*>() = 2;
*script_local(g.m_modshop_thread->m_stack, 2238).as<ControllerInputs*>() = ControllerInputs::INPUT_FRONTEND_LT;
}
});
bLastLsCustoms = true;
@ -82,18 +82,18 @@ namespace big
{
PAD::DISABLE_CONTROL_ACTION(0, (int)ControllerInputs::INPUT_VEH_CIN_CAM, true);
if (*script_local(g.m_modshop_thread->m_stack, 2466).as<bool*>() && PAD::IS_CONTROL_JUST_PRESSED(2, (int)ControllerInputs::INPUT_FRONTEND_ACCEPT))
if (*script_local(g.m_modshop_thread->m_stack, 2467).as<bool*>() && PAD::IS_CONTROL_JUST_PRESSED(2, (int)ControllerInputs::INPUT_FRONTEND_ACCEPT))
g.vehicle.ls_customs = false;
}
if (g.vehicle.ls_customs && bModshopReady && g.m_modshop_thread && g.m_modshop_thread->m_stack)
{
*script_local(g.m_modshop_thread->m_stack, 2418).as<bool*>() = false;
*script_local(g.m_modshop_thread->m_stack, 730).at(638).as<int*>() = -1;
*script_local(g.m_modshop_thread->m_stack, 730).at(409).as<Vehicle*>() = self::veh;
*script_local(g.m_modshop_thread->m_stack, 2419).as<bool*>() = false;
*script_local(g.m_modshop_thread->m_stack, 731).at(638).as<int*>() = -1;
*script_local(g.m_modshop_thread->m_stack, 731).at(409).as<Vehicle*>() = self::veh;
if (*script_local(g.m_modshop_thread->m_stack, 730).at(446).as<int*>() == 0)
*script_local(g.m_modshop_thread->m_stack, 730).at(446).as<int*>() = 2;
if (*script_local(g.m_modshop_thread->m_stack, 731).at(446).as<int*>() == 0)
*script_local(g.m_modshop_thread->m_stack, 731).at(446).as<int*>() = 2;
scr_functions::modshop_loop.call(g.m_modshop_thread, gta_util::find_script_program(RAGE_JOAAT("carmod_shop")), {});
}

View File

@ -10,7 +10,7 @@ namespace big
{
g_script_patcher_service->add_patch(
{RAGE_JOAAT("freemode"), "2D 01 08 00 ? 38 00 5D ? ? ? 2A 06", 5, {0x71, 0x2E, 0x01, 0x01}, &g.session.decloak_players});
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 04 00 ? 2C ? ? ? 5D ? ? ? 71 57 ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr});// script host kick
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 04 00 ? 2C ? ? ? 5D ? ? ? 71 57 ? ? 2C", 5, {0x2E, 0x01, 0x00}, nullptr}); // script host kick
g_script_patcher_service->add_patch(
{RAGE_JOAAT("freemode"), "2D 00 03 00 00 5D ? ? ? 71 08", 5, {0x2E, 0x00, 0x00}, &g.tunables.no_idle_kick});
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"),
@ -18,19 +18,19 @@ namespace big
5,
{0x72, 0x2E, 0x00, 0x01},
&g.tunables.no_idle_kick});
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "5D ? ? ? 76 57 ? ? 5D ? ? ? 76", 0, {0x2E, 0x00, 0x00}, nullptr});// end session kick protection
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 09 00 00 5D ? ? ? 56 ? ? 2E", 5, {0x2E, 0x01, 0x00}, nullptr});// disable death when undermap/spectating
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "71 2E ? ? 55 ? ? 61 ? ? ? 47 ? ? 63", 0, {0x72}, nullptr});// load island even if stranded animal IPL choice is not set
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 00 07 00 00 7B", 5, {0x2E, 0x00, 0x00}, nullptr});// disable population load balancing
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "5D ? ? ? 76 57 ? ? 5D ? ? ? 76", 0, {0x2E, 0x00, 0x00}, nullptr}); // end session kick protection
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 01 09 00 00 5D ? ? ? 56 ? ? 2E", 5, {0x2E, 0x01, 0x00}, nullptr}); // disable death when undermap/spectating
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "71 2E ? ? 55 ? ? 61 ? ? ? 47 ? ? 63", 0, {0x72}, nullptr}); // load island even if stranded animal IPL choice is not set
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 00 07 00 00 7B", 5, {0x2E, 0x00, 0x00}, nullptr}); // disable population load balancing
g_script_patcher_service->add_patch(
{RAGE_JOAAT("freemode"), "2D 02 08 00 00 38 01 56", 5, {0x2E, 0x02, 0x00}, &g.session.block_muggers});
g_script_patcher_service->add_patch({RAGE_JOAAT("freemode"), "2D 00 CF 00 00", 5, {0x2E, 0x00, 0x00}, &g.session.block_ceo_raids});
g_script_patcher_service->add_patch(
{RAGE_JOAAT("freemode"), "06 56 ? ? 38 02 2C ? ? ? 71 71", 0, {0x2B, 0x55}, &g.spoofing.spoof_blip});// prevent normal blip update
{RAGE_JOAAT("freemode"), "06 56 ? ? 38 02 2C ? ? ? 71 71", 0, {0x2B, 0x55}, &g.spoofing.spoof_blip}); // prevent normal blip update
g_script_patcher_service->add_patch(
{RAGE_JOAAT("freemode"), "2C ? ? ? 55 ? ? 71 2C ? ? ? 61", 7, std::vector<uint8_t>(16, 0x0), &g.spoofing.spoof_blip});// prevent normal blip update 2
g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "2D 01 04 00 00 2C ? ? ? 56 ? ? 71", 5, {0x71, 0x2E, 0x01, 0x01}, nullptr});// despawn bypass
g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "38 00 5D ? ? ? 38 00 5D ? ? ? 38 00 41", 0, std::vector<uint8_t>(12, 0x0), nullptr});// godmode/invisibility detection bypass
{RAGE_JOAAT("freemode"), "2C ? ? ? 55 ? ? 71 2C ? ? ? 61", 7, std::vector<uint8_t>(16, 0x0), &g.spoofing.spoof_blip}); // prevent normal blip update 2
g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "2D 01 04 00 00 2C ? ? ? 56 ? ? 71", 5, {0x71, 0x2E, 0x01, 0x01}, nullptr}); // despawn bypass
g_script_patcher_service->add_patch({RAGE_JOAAT("shop_controller"), "38 00 5D ? ? ? 38 00 5D ? ? ? 38 00 41", 0, std::vector<uint8_t>(12, 0x0), nullptr}); // godmode/invisibility detection bypass
g_script_patcher_service->add_patch({RAGE_JOAAT("am_mp_nightclub"),
"2D 01 03 00 00 2C ? ? ? 56 ? ? 72 2E ? ? 38 00",
5,
@ -45,17 +45,17 @@ namespace big
&g.self.invisibility});
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "2D 01 0A 00 00 4F ? ? 40 ? 41 ? 39 03", 5, {0x2E, 0x01, 0x00}, &g.vehicle.ls_customs});// disable camera
{RAGE_JOAAT("carmod_shop"), "2D 01 0A 00 00 4F ? ? 40 ? 41 ? 39 03", 5, {0x2E, 0x01, 0x00}, &g.vehicle.ls_customs}); // disable camera
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "2D 02 10 00 00 2C", 5, {0x71, 0x2E, 0x02, 0x01}, &g.vehicle.ls_customs});
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "2D 00 B8 00 00", 5, {0x2E, 0x00, 0x00}, &g.vehicle.ls_customs});
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "06 1F 56 ? ? 62 ? ? ? 56", 0, {0x2B, 0x2B, 0x55}, &g.vehicle.ls_customs});// buy mods for free in SP
{RAGE_JOAAT("carmod_shop"), "06 1F 56 ? ? 62 ? ? ? 56", 0, {0x2B, 0x2B, 0x55}, &g.vehicle.ls_customs}); // buy mods for free in SP
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs});// allow all vehicles
{RAGE_JOAAT("carmod_shop"), "2D 03 16 00 00 5D", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs}); // allow all vehicles
g_script_patcher_service->add_patch(
{RAGE_JOAAT("carmod_shop"), "2D 03 07 00 00 71 38 02", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs});// allow all vehicles 2
{RAGE_JOAAT("carmod_shop"), "2D 03 07 00 00 71 38 02", 5, {0x72, 0x2E, 0x03, 0x01}, &g.vehicle.ls_customs}); // allow all vehicles 2
for (auto& entry : *g_pointers->m_gta.m_script_program_table)
{

View File

@ -38,10 +38,6 @@ namespace big
// Disable cheat activated netevent when creator warping
memory::byte_patch::make(g_pointers->m_gta.m_creator_warp_cheat_triggered_patch.as<uint8_t*>(), 0xEB)->apply();
// PapiSysCallService VFT hook
memory::byte_patch::make(g_pointers->m_gta.m_ntqvm_caller.add(4).rip().sub(32).as<uint64_t*>(), (uint64_t)&hooks::nt_query_virtual_memory)
->apply();
// Setup inline hook for sound overload crash protection
g_sound_overload_ret_addr = g_pointers->m_gta.m_sound_overload_detour.add(13 + 15).as<decltype(g_sound_overload_ret_addr)>();
std::vector<byte> bytes = {0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90}; // far jump opcode + a nop opcode

View File

@ -148,51 +148,50 @@ namespace big
enum class eRemoteEvent
{
Bounty = 1459520933, // (137, "FM_TXT_BNTY0", iVar1, PLAYER::GET_PLAYER_NAME(Var2.f_1), "", 5000, Var2.f_6);
CeoBan = 1517094008, // mpply_vipgameplaydisabledtimer
CeoKick = 1421455565,
CeoMoney = 75579707, // Goon_Paid_Large
ClearWantedLevel = 1743540940,
ForceMission = -2138393348, // ), Var0.f_2, 1))
GiveCollectible = 1839167950, // DLC_SUM20_HIDDEN_COLLECTIBLES xref
GtaBanner = 2114252738, // NETWORK::NETWORK_IS_SCRIPT_ACTIVE("BUSINESS_BATTLES", -1, true, 0) second one
NetworkBail = 1017995959, // NETWORK::NETWORK_BAIL(16, 0, 0); xref func
PersonalVehicleDestroyed = -642631978, // PLYVEH_INS_DES1
RemoteOffradar = 1141648445, // NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), Var0.f_2)
SendToCutscene = 2139870214, // (bVar3, bVar4, 125f, 1)
SendToCayoPerico = -369672308, // CELL_HI_INV
SendToLocation = 330622597, // &Var222, 11);
SoundSpam = 36077543, // CELL_APTINVYACHT
Spectate = -2029707091, // SPEC_TCK1
Teleport = -702866045, // Mission_Pass_Notify
TeleportToWarehouse = -1796714618, // .f_4 == 50
TransactionError = 54323524, // NETWORK_RECEIVE_PLAYER_JOBSHARE_CASH
VehicleKick = -1603050746, // PIM_RFMOC
MCTeleport = 891653640, // NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(PLAYER::PLAYER_ID()) == (first one)
StartActivity = 1104117595, // (Var0.f_2, -1); first match
MarkPlayerAsBeast = -1721728321, // GB_BOSSBST xref == PLAYER... global (sadly doesn't actually turn people into the beast)
KickFromInterior = 786522321, // ENTITY::SET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID(), PED::GET_PED_MAX_HEALTH(PLAYER::PLAYER_PED_ID()), false)
InteriorControl = 1727896103, // eventData.f_3 != _INVALID_PLAYER_INDEX_0()
SMS = 53975141,
SendTextLabelSMS = 1075676399,
Bounty = 1517551547, // (137, "FM_TXT_BNTY0", iVar1, PLAYER::GET_PLAYER_NAME(Var2.f_1), "", 5000, Var2.f_6);
CeoBan = 1531565154, // mpply_vipgameplaydisabledtimer
CeoKick = -11681548,
CeoMoney = -337848027, // Goon_Paid_Large
ClearWantedLevel = -1704545346,
ForceMission = 259469385, // ), Var0.f_2, 1))
GiveCollectible = 968269233, // DLC_SUM20_HIDDEN_COLLECTIBLES xref
GtaBanner = -330501227, // NETWORK::NETWORK_IS_SCRIPT_ACTIVE("BUSINESS_BATTLES", -1, true, 0) second one
NetworkBail = -901348601, // NETWORK::NETWORK_BAIL(16, 0, 0); xref func
PersonalVehicleDestroyed = 1655503526, // PLYVEH_INS_DES1
RemoteOffradar = 57493695, // NETWORK::GET_TIME_DIFFERENCE(NETWORK::GET_NETWORK_TIME(), Var0.f_2)
SendToCutscene = -1951335381, // (bVar3, bVar4, 125f, 1)
SendToCayoPerico = 373376135, // CELL_HI_INV
SendToLocation = 1669592503, // &Var222, 11);
SoundSpam = 996099702, // CELL_APTINVYACHT
Spectate = 1840946429, // SPEC_TCK1
Teleport = -1321657966, // Mission_Pass_Notify
TeleportToWarehouse = -1253241415, // .f_4 == 50
TransactionError = -830063381, // NETWORK_RECEIVE_PLAYER_JOBSHARE_CASH
VehicleKick = -503325966, // PIM_RFMOC
MCTeleport = 1103127469, // NETWORK::NETWORK_HASH_FROM_PLAYER_HANDLE(PLAYER::PLAYER_ID()) == (first one)
StartActivity = 1450115979, // (Var0.f_2, -1); first match
MarkPlayerAsBeast = 1649541577, // GB_BOSSBST xref == PLAYER... global (sadly doesn't actually turn people into the beast)
KickFromInterior = -1496371358, // ENTITY::SET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID(), PED::GET_PED_MAX_HEALTH(PLAYER::PLAYER_PED_ID()), false)
InteriorControl = -1638522928, // eventData.f_3 != _INVALID_PLAYER_INDEX_0()
SendTextLabelSMS = -1773335296,
Crash = -992162568, // SET_NO_LOADING_SCREEN, xref it
Crash2 = 1131623211,
Crash3 = 1556360603,
Crash = -1604421397, // SET_NO_LOADING_SCREEN, xref it
Crash2 = -375628860,
Crash3 = 323285304,
TSECommand = -1428749433, // CnCTG_IN_BF
TSECommandRotateCam = 448051697 /*joaat("pats_horse_right") in script*/, // != 29) && f
TSECommand = 800157557, // CnCTG_IN_BF
TSECommandRotateCam = 225624744, // != 29) && f
Notification = 2041805809,
NotificationMoneyBanked = 276906331, // TICK_TC_BANK
NotificationMoneyRemoved = 853249803, // TICK_TC_REMO
NotificationMoneyStolen = 82080686, // TICK_TC_STOL
Notification = -642704387,
NotificationMoneyBanked = 94410750, // TICK_TC_BANK
NotificationMoneyRemoved = -242911964, // TICK_TC_REMO
NotificationMoneyStolen = -295926414, // TICK_TC_STOL
DestroyPersonalVehicle = -2101545224, // CnC_PV_THEFT
TriggerCEORaid = -1388385133,
DestroyPersonalVehicle = 109434679, // CnC_PV_THEFT
TriggerCEORaid = -1906536929,
StartScriptBegin = -95341040,
StartScriptProceed = 1742713914
StartScriptBegin = -366707054,
StartScriptProceed = 1757622014
};
enum class eCollectibleType

View File

@ -258,13 +258,12 @@ namespace big
NLOHMANN_DEFINE_TYPE_INTRUSIVE(script_events, bounty, ceo_money, clear_wanted_level, fake_deposit, force_mission, force_teleport, gta_banner, mc_teleport, personal_vehicle_destroyed, remote_off_radar, rotate_cam, send_to_cutscene, send_to_location, sound_spam, spectate, give_collectible, vehicle_kick, teleport_to_warehouse, start_activity, send_sms)
} script_events{};
bool desync_kick = false;
bool rid_join = false;
bool lessen_breakups = false; // disabled by default due to anticheat concerns
bool receive_pickup = false;
bool admin_check = true;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, desync_kick, receive_pickup, admin_check)
NLOHMANN_DEFINE_TYPE_INTRUSIVE(protections, script_events, rid_join, lessen_breakups, receive_pickup, admin_check)
} protections{};
struct self

View File

@ -3,71 +3,67 @@
namespace big::scr_globals
{
namespace size
{
constexpr int globalplayer_bd = 466;
constexpr int gpbd_fm_3 = 608;
constexpr int gpbd_fm_1 = 862;
}
static inline script_global gsbd(2648605);
static inline script_global gsbd(2648711);
static inline script_global gsbd_fm(1835504);
static inline script_global gsbd_kicking(1885209);
static inline script_global gsbd_fm_events(1923597);
static inline script_global gsbd_block_c(2652258);
static inline script_global gsbd_property_instances(1943595);
static inline script_global gsbd_kicking(1885447);
static inline script_global gsbd_fm_events(1924276);
static inline script_global gsbd_block_c(2652364);
static inline script_global gsbd_property_instances(1944302);
static inline script_global globalplayer_bd(2657589);
static inline script_global gpbd_fm_3(1894573);
static inline script_global gpbd_fm_1(1853910);
static inline script_global globalplayer_bd(2657704);
static inline script_global gpbd_fm_3(1895156);
static inline script_global gpbd_fm_1(1853988);
static inline script_global launcher_global(2756259);
static inline script_global launcher_global(2756336);
static inline script_global sp(113648);
static inline script_global mission_definition(91469);
static inline script_global sp(113810); // check flow_controller
static inline script_global mission_definition(91601); // standard_global_init (66, "agency_heist1", "AH1", 230, 1, 1, -1, -1, 8192)
// creator globals usually remain the same after updates
static inline script_global creator_job_metadata(4718592);
static inline script_global terminate_creator(1574607);// NETWORK::NETWORK_BAIL(1, 0, 0); fm_*_creator
static inline script_global terminate_creator(1574607); // NETWORK::NETWORK_BAIL(1, 0, 0); fm_*_creator
static inline script_global switch_struct(1574632);
static inline script_global mission_creator_radar_follows_camera(2621443);
static inline script_global mission_creator_exited(1574530);
static inline script_global in_multiplayer(78558);// g_bInMultiplayer
static inline script_global transition_state(1574993);
static inline script_global in_multiplayer(78689); // g_bInMultiplayer
static inline script_global transition_state(1574996);
static inline script_global vehicle_global = script_global(1586468);
static inline script_global mechanic_global = script_global(2793046);
static inline script_global vehicle_global = script_global(1586488);
static inline script_global mechanic_global = script_global(2794162);
static inline script_global spawn_global = script_global(2694562);
static inline script_global spawn_global = script_global(2694613);
static inline script_global offradar_time(2672524);
}
namespace big::scr_locals
{
namespace am_hunt_the_beast
{
constexpr static auto broadcast_idx = 599;
constexpr static auto player_broadcast_idx = 2583;
constexpr static auto broadcast_idx = 600;
constexpr static auto player_broadcast_idx = 2584;
}
namespace am_criminal_damage
{
constexpr static auto broadcast_idx = 110;
constexpr static auto score_idx = 105;
constexpr static auto broadcast_idx = 111;
constexpr static auto score_idx = 106;
}
namespace am_cp_collection
{
constexpr static auto broadcast_idx = 815;
constexpr static auto player_broadcast_idx = 3456;
constexpr static auto broadcast_idx = 816;
constexpr static auto player_broadcast_idx = 3457;
}
namespace am_king_of_the_castle
{
constexpr static auto broadcast_idx = 93;
constexpr static auto broadcast_idx = 94;
}
namespace fmmc_launcher
{
constexpr static auto broadcast_idx = 11153;
constexpr static auto broadcast_idx = 11629;
}
}

View File

@ -37,8 +37,6 @@ namespace big
memory::handle m_creator_warp_cheat_triggered_patch;
memory::handle m_ntqvm_caller;
memory::handle m_sound_overload_detour;
memory::handle m_disable_collision;
@ -156,7 +154,6 @@ namespace big
functions::fipackfile_unmount m_fipackfile_unmount{};
PVOID m_invalid_mods_crash_detour{};
PVOID m_constraint_attachment_crash{};
PVOID m_invalid_decal_crash{};
PVOID m_task_parachute_object_0x270{};
@ -172,10 +169,6 @@ namespace big
rage::rlGamerInfo* m_player_info_gamer_info{}; // the gamer info that is applied to CPlayerInfo
CCommunications** m_communications{};
PVOID m_serialize_ped_inventory_data_node;
PVOID m_serialize_vehicle_gadget_data_node;
functions::get_vehicle_gadget_array_size m_get_vehicle_gadget_array_size;
PVOID m_handle_join_request;
functions::write_join_response_data m_write_join_response_data;
@ -230,12 +223,8 @@ namespace big
functions::send_packet m_send_packet;
functions::connect_to_peer m_connect_to_peer;
PVOID m_fragment_physics_crash;
PVOID m_fragment_physics_crash_2;
PVOID m_infinite_train_crash;
functions::get_next_carriage m_get_next_carriage;
functions::get_entity_attached_to m_get_entity_attached_to;
PVOID m_received_array_update;

View File

@ -59,16 +59,12 @@ namespace big
detour_hook_helper::add<hooks::write_player_gamer_data_node>("WPGDN", g_pointers->m_gta.m_write_player_gamer_data_node);
detour_hook_helper::add<hooks::invalid_mods_crash_detour>("IMCD", g_pointers->m_gta.m_invalid_mods_crash_detour);
detour_hook_helper::add<hooks::constraint_attachment_crash>("CAC", g_pointers->m_gta.m_constraint_attachment_crash);
detour_hook_helper::add<hooks::invalid_decal>("IDC", g_pointers->m_gta.m_invalid_decal_crash);
detour_hook_helper::add<hooks::task_parachute_object_0x270>("TPO270", g_pointers->m_gta.m_task_parachute_object_0x270);
detour_hook_helper::add<hooks::update_presence_attribute_int>("UPAI", g_pointers->m_sc.m_update_presence_attribute_int);
detour_hook_helper::add<hooks::update_presence_attribute_string>("UPAS", g_pointers->m_sc.m_update_presence_attribute_string);
detour_hook_helper::add<hooks::serialize_ped_inventory_data_node>("SPIDN", g_pointers->m_gta.m_serialize_ped_inventory_data_node);
detour_hook_helper::add<hooks::serialize_vehicle_gadget_data_node>("SVGDN", g_pointers->m_gta.m_serialize_vehicle_gadget_data_node);
detour_hook_helper::add<hooks::handle_join_request>("HJR", g_pointers->m_gta.m_handle_join_request);
detour_hook_helper::add<hooks::sort_session_details>("SSD", g_pointers->m_gta.m_sort_session_details);
@ -95,11 +91,8 @@ namespace big
detour_hook_helper::add<hooks::queue_dependency>("QD", g_pointers->m_gta.m_queue_dependency);
detour_hook_helper::add<hooks::prepare_metric_for_sending>("PMFS", g_pointers->m_gta.m_prepare_metric_for_sending);
detour_hook_helper::add<hooks::fragment_physics_crash>("FPC", g_pointers->m_gta.m_fragment_physics_crash);
detour_hook_helper::add<hooks::fragment_physics_crash_2>("FPC2", g_pointers->m_gta.m_fragment_physics_crash_2);
detour_hook_helper::add<hooks::infinite_train_crash>("ITC", g_pointers->m_gta.m_infinite_train_crash);
detour_hook_helper::add<hooks::received_array_update>("RAU", g_pointers->m_gta.m_received_array_update);
detour_hook_helper::add<hooks::receive_pickup>("RPI", g_pointers->m_gta.m_receive_pickup);

View File

@ -13,7 +13,7 @@ namespace big
{
case rage::eEventNetworkType::CEventNetworkRemovedFromSessionDueToComplaints:
{
g_notification_service->push_success("KICKED"_T.data(), "USER_DESYNC_KICKED"_T.data());
g_notification_service->push_warning("KICKED"_T.data(), "USER_DESYNC_KICKED"_T.data());
break;
}
case rage::eEventNetworkType::CEventNetworkEntityDamage:

View File

@ -1,13 +1,56 @@
#include "hooking.hpp"
#include "pointers.hpp"
#include <Psapi.h>
namespace big
{
bool inline is_address_in_game_region(uint64_t address)
{
static uint64_t moduleBase = NULL;
static uint64_t moduleSize = NULL;
if ((!moduleBase) || (!moduleSize))
{
MODULEINFO info;
if (!GetModuleInformation(GetCurrentProcess(), GetModuleHandle(0), &info, sizeof(info)))
{
LOG(FATAL) << "GetModuleInformation failed!";
return true;
}
else
{
moduleBase = (uint64_t)GetModuleHandle(0);
moduleSize = (uint64_t)info.SizeOfImage;
}
}
return address > moduleBase && address < (moduleBase + moduleSize);
}
bool is_jump(__int64 fptr)
{
if (!is_address_in_game_region(fptr))
return false;
auto value = *(std::uint8_t*)(fptr);
return value == 0xE9;
}
bool is_unwanted_dependency(__int64 cb)
{
auto f1 = *(__int64*)(cb + 0x60);
auto f2 = *(__int64*)(cb + 0x100);
auto f3 = *(__int64*)(cb + 0x1A0);
if (!is_address_in_game_region(f1) || !is_address_in_game_region(f2) || !is_address_in_game_region(f3))
return false;
return is_jump(f1) || is_jump(f2) || is_jump(f3);
}
void hooks::queue_dependency(void* dependency)
{
if (dependency == g_pointers->m_gta.m_interval_check_func)
if (is_unwanted_dependency((__int64)dependency))
{
//LOG(INFO) << "Prevent attempt to queue a report to R*.";
return;
}

View File

@ -482,6 +482,8 @@ namespace big
inline bool is_crash_object(uint32_t model)
{
if (!model_info::get_model(model))
return false;
if (!model_info::is_model_of_type(model, eModelType::Object, eModelType::Time, eModelType::Weapon, eModelType::Destructable, eModelType::WorldObject, eModelType::Sprinkler, eModelType::Unk65, eModelType::Plant, eModelType::LOD, eModelType::Unk132, eModelType::Building))
return true;
for (auto iterator : crash_objects)
@ -714,7 +716,7 @@ namespace big
{
static bool init = ([] { cache_nodes(); }(), true);
if (tree->m_child_node_count && check_node(tree->m_next_sync_node, g.m_syncing_player, object))
if (tree->m_child_node_count && tree->m_next_sync_node && check_node(tree->m_next_sync_node, g.m_syncing_player, object))
{
return false;
}

View File

@ -1,12 +0,0 @@
#include "hooking.hpp"
namespace big
{
std::int64_t hooks::constraint_attachment_crash(std::uintptr_t a1)
{
if (!*reinterpret_cast<void**>(a1 + 0x38))
return 0;
return g_hooking->get_original<hooks::constraint_attachment_crash>()(a1);
}
}

View File

@ -2,15 +2,6 @@
namespace big
{
bool hooks::fragment_physics_crash(uintptr_t a1, uint32_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
{
if (auto ptr = *reinterpret_cast<uintptr_t*>(a5 + 0x70); ptr)
if (auto ptr2 = *reinterpret_cast<uintptr_t*>(ptr + 8 * a2); !ptr2)
return false;
return g_hooking->get_original<hooks::fragment_physics_crash>()(a1, a2, a3, a4, a5);
}
bool hooks::fragment_physics_crash_2(float* a1, float* a2)
{
if (!a1 || !a2)

View File

@ -1,21 +0,0 @@
#include "hooking.hpp"
#include "pointers.hpp"
namespace big
{
void* hooks::infinite_train_crash(void* carriage)
{
void* current_carriage = carriage;
int count = 0;
while (g_pointers->m_gta.m_get_next_carriage(current_carriage))
{
if (++count > 20)
return nullptr;
current_carriage = g_pointers->m_gta.m_get_next_carriage(current_carriage);
}
return current_carriage;
}
}

View File

@ -60,7 +60,7 @@ namespace big
auto plyr = g_player_service->get_by_id(player->m_player_id);
if (g_lua_manager->get_modules().size() > 0)
if (g_lua_manager && g_lua_manager->get_modules().size() > 0)
{
std::vector<int32_t> script_event_args;
@ -343,20 +343,6 @@ namespace big
}
break;
}
case eRemoteEvent::SMS:
if (g.protections.script_events.send_sms)
{
if (g.session.kick_chat_spammers)
{
if (auto plyr = g_player_service->get_by_id(player->m_player_id))
{
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(plyr, {});
}
}
return true;
}
break;
case eRemoteEvent::DestroyPersonalVehicle: g.reactions.destroy_personal_vehicle.process(plyr); return true;
case eRemoteEvent::KickFromInterior:
if (scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].SimpleInteriorData.Owner != plyr->id())

View File

@ -1,50 +0,0 @@
#include "gta/net_game_event.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
#include <netsync/nodes/ped/CPedInventoryDataNode.hpp>
namespace big
{
void hooks::serialize_ped_inventory_data_node(CPedInventoryDataNode* node, rage::CSyncDataBase* data)
{
if (data->IsSizeCalculator())
{
node->m_num_items = 105;
node->m_num_ammos = 65;
}
data->SerializeDwordAlt(&node->m_num_items, 7);
if (node->m_num_items > 105)
{
notify::crash_blocked(g.m_syncing_player, "out of bounds inventory item count");
return;
}
for (uint32_t i = 0; i < node->m_num_items; i++)
{
data->SerializeDwordAlt(&node->m_items[i], 9);
node->unk_1680[i] = 0;
node->unk_16E9[i] = 0;
}
data->SerializeDwordAlt(&node->m_num_ammos, 7);
data->SerializeBool(&node->m_ammo_all_infinite);
if (node->m_num_ammos > 65)
{
notify::crash_blocked(g.m_syncing_player, "out of bounds inventory ammo count");
return;
}
for (uint32_t i = 0; i < node->m_num_ammos; i++)
{
data->SerializeDwordAlt(&node->m_ammos[i], 9);
if (node->m_ammo_all_infinite && !data->IsSizeCalculator())
continue;
data->SerializeBool(&node->m_infinite_ammos[i]);
if (node->m_infinite_ammos[i] && !data->IsSizeCalculator())
continue;
data->SerializeDwordAlt(&node->m_ammo_quantities[i], 14);
}
}
}

View File

@ -1,50 +0,0 @@
#include "gta/net_game_event.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
#include <netsync/nodes/vehicle/CVehicleGadgetDataNode.hpp>
namespace big
{
void hooks::serialize_vehicle_gadget_data_node(CVehicleGadgetDataNode* node, rage::CSyncDataBase* data)
{
data->SerializeBool(&node->m_has_parent_offset);
if (node->m_has_parent_offset || data->IsSizeCalculator())
{
data->SerializeSignedFloat((float*)&node->m_parent_offset_x, 24.0f, 14);
data->SerializeSignedFloat((float*)&node->m_parent_offset_y, 24.0f, 14);
data->SerializeSignedFloat((float*)&node->m_parent_offset_z, 24.0f, 14);
}
else
{
node->m_parent_offset_x = 0;
node->m_parent_offset_y = 0;
node->m_parent_offset_z = 0;
node->m_parent_offset_w = 0;
}
data->SerializeDwordAlt(&node->m_gadget_count, 2);
if (data->IsSizeCalculator())
node->m_gadget_count = 2;
if (node->m_gadget_count > 2)
{
notify::crash_blocked(g.m_syncing_player, "out of bounds vehicle gadget count");
return;
}
for (uint32_t i = 0; i < node->m_gadget_count; i++)
{
data->SerializeDwordAlt((uint32_t*)&node->m_gadget_data[i].m_gadget_type, 3);
int size;
if (data->IsSizeCalculator())
size = 94;
else
size = g_pointers->m_gta.m_get_vehicle_gadget_array_size(node->m_gadget_data[i].m_gadget_type);
data->SerializeArray(&node->m_gadget_data[i].m_data, size);
}
}
}

View File

@ -219,10 +219,10 @@ namespace big
// Read Bitbuffer String
{
"RBS",
"E8 ? ? ? ? 48 8D 4F 3C",
"48 89 5C 24 08 48 89 6C 24 18 56 57 41 56 48 83 EC 20 48 8B F2 45",
[](memory::handle ptr)
{
g_pointers->m_gta.m_read_bitbuf_string = ptr.add(1).rip().as<decltype(gta_pointers::m_read_bitbuf_string)>();
g_pointers->m_gta.m_read_bitbuf_string = ptr.as<decltype(gta_pointers::m_read_bitbuf_string)>();
}
},
// Read Bitbuffer Boolean
@ -444,13 +444,13 @@ namespace big
// Received clone sync & Get sync tree for type & Get net object for player & Get sync type info & Get net object
{
"RCS/GSTFT/GNOFP/GNO/GSTI",
"4C 8B FA 41 0F B7 D1",
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57 48 83 EC 40 4C 8B EA",
[](memory::handle ptr)
{
g_pointers->m_gta.m_received_clone_sync = ptr.sub(0x1D).as<decltype(gta_pointers::m_received_clone_sync)>();
g_pointers->m_gta.m_get_sync_tree_for_type = ptr.add(0x14).rip().as<decltype(gta_pointers::m_get_sync_tree_for_type)>(); // 0F B7 CA 83 F9 07 .as()
g_pointers->m_gta.m_get_net_object = ptr.add(0x76).rip().as<decltype(gta_pointers::m_get_net_object)>(); // E8 ? ? ? ? 0F B7 53 7C .add(1).rip().as()
g_pointers->m_gta.m_get_sync_type_info = ptr.add(0x8C).rip().as<decltype(gta_pointers::m_get_sync_type_info)>(); // 44 0F B7 C1 4C 8D 0D .as()
g_pointers->m_gta.m_received_clone_sync = ptr.as<decltype(gta_pointers::m_received_clone_sync)>();
g_pointers->m_gta.m_get_sync_tree_for_type = ptr.add(0x2F).add(1).rip().as<decltype(gta_pointers::m_get_sync_tree_for_type)>(); // 0F B7 CA 83 F9 07 .as()
g_pointers->m_gta.m_get_net_object = ptr.add(0x109).add(1).rip().as<decltype(gta_pointers::m_get_net_object)>(); // E8 ? ? ? ? 0F B7 53 7C .add(1).rip().as()
g_pointers->m_gta.m_get_sync_type_info = ptr.add(0x11F).add(1).rip().as<decltype(gta_pointers::m_get_sync_type_info)>(); // 44 0F B7 C1 4C 8D 0D .as()
}
},
// Read Bitbuffer Into Sync Tree
@ -679,37 +679,10 @@ namespace big
g_pointers->m_gta.m_communications = ptr.add(3).rip().as<CCommunications**>();
}
},
// Serialize Ped Inventory Data Node
{
"SPIDN",
"48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 54 41 56 41 57 48 83 EC 20 48 8B 02 48 8B F1 48 8B CA 48 8B FA FF 90",
[](memory::handle ptr)
{
g_pointers->m_gta.m_serialize_ped_inventory_data_node = ptr.as<PVOID>();
}
},
// Serialize Vehicle Gadget Data Node
{
"SVGDN",
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 30 48 8B 02 48 8D",
[](memory::handle ptr)
{
g_pointers->m_gta.m_serialize_vehicle_gadget_data_node = ptr.as<PVOID>();
}
},
// Get Vehicle Gadget Array Size
{
"GVGAS",
"40 53 48 83 EC 40 33 DB E8",
[](memory::handle ptr)
{
g_pointers->m_gta.m_get_vehicle_gadget_array_size = ptr.as<functions::get_vehicle_gadget_array_size>();
}
},
// Handle Join Request
{
"HJR",
"48 8B C4 48 89 58 08 4C 89 48 20 4C 89 40 18 48 89 50 10 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 E8",
"48 8B C4 48 89 58 08 4C 89 48 20 4C 89 40 18 48 89 50 10 55 56 57 41 54 41 55 41 56 41 57 48 8D A8 C8 FE",
[](memory::handle ptr)
{
g_pointers->m_gta.m_handle_join_request = ptr.as<PVOID>();
@ -718,7 +691,7 @@ namespace big
// Write Join Response Data
{
"WJRD",
"E8 ?? ?? ?? ?? 41 8B DF 84 C0",
"E8 ? ? ? ? 41 8B DF 84 C0",
[](memory::handle ptr)
{
g_pointers->m_gta.m_write_join_response_data = ptr.add(1).rip().as<functions::write_join_response_data>();
@ -745,7 +718,7 @@ namespace big
// Add Player To Session
{
"APTS",
"E8 ?? ?? ?? ?? 48 8D 8D F0 01 00 00 8A D8",
"E8 ? ? ? ? 48 8D 8D F0 01 00 00 8A D8",
[](memory::handle ptr)
{
g_pointers->m_gta.m_add_player_to_session = ptr.add(1).rip().as<PVOID>();
@ -781,7 +754,7 @@ namespace big
// Serialize Join Request Message
{
"SJRM",
"E8 ?? ?? ?? ?? 84 C0 0F 84 9B 00 00 00 49 8D 8F 50 11 00 00",
"E8 ? ? ? ? 84 C0 0F 84 9B 00 00 00 49 8D 8F 48 11 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_serialize_join_request_message = ptr.add(1).rip().as<PVOID>();
@ -827,10 +800,10 @@ namespace big
// Handle Remove Gamer Command
{
"HRGC",
"41 FF C6 FF C7",
"48 85 D2 0F 84 0E 04",
[](memory::handle ptr)
{
g_pointers->m_gta.m_handle_remove_gamer_cmd = ptr.sub(0x6E).as<functions::handle_remove_gamer_cmd>();
g_pointers->m_gta.m_handle_remove_gamer_cmd = ptr.as<functions::handle_remove_gamer_cmd>();
}
},
// Broadcast Net Array
@ -896,15 +869,6 @@ namespace big
g_pointers->m_gta.m_create_script_handler = *(ptr.add(3).rip().as<std::uint64_t**>() + 8);
}
},
// Constraint Attachment Crash
{
"CAC",
"40 53 48 83 EC 20 48 8B D9 48 8B 49 38 48 8B 01",
[](memory::handle ptr)
{
g_pointers->m_gta.m_constraint_attachment_crash = ptr.as<PVOID>();
}
},
// Invalid Decal Crash
{
"IDC",
@ -935,7 +899,7 @@ namespace big
// Decode Session Info
{
"DSI",
"E8 ?? ?? ?? ?? 84 C0 74 16 48 8B 4B 60",
"E8 ? ? ? ? 84 C0 74 16 48 8B 4B 60",
[](memory::handle ptr)
{
g_pointers->m_gta.m_decode_session_info = ptr.add(1).rip().as<functions::decode_session_info>();
@ -1049,15 +1013,6 @@ namespace big
g_pointers->m_gta.m_connect_to_peer = ptr.as<functions::connect_to_peer>();
}
},
// Fragment Physics Crash
{
"FPC",
"E8 ? ? ? ? 44 8B 4D 1C",
[](memory::handle ptr)
{
g_pointers->m_gta.m_fragment_physics_crash = ptr.add(1).rip().as<PVOID>();
}
},
// Fragment Physics Crash 2
{
"FPC2",
@ -1076,16 +1031,6 @@ namespace big
g_pointers->m_gta.m_clear_ped_tasks_network = ptr.add(1).rip().as<functions::clear_ped_tasks_network>();
}
},
// Infinite Train Crash
{
"ITC",
"E8 ? ? ? ? F3 44 0F 10 93 90 03 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_infinite_train_crash = ptr.add(1).rip().as<PVOID>();
g_pointers->m_gta.m_get_next_carriage = ptr.add(1).rip().add(0xF).rip().as<functions::get_next_carriage>();
}
},
// Get Entity Attached To
{
"GEAT",
@ -1321,15 +1266,6 @@ namespace big
g_pointers->m_gta.m_creator_warp_cheat_triggered_patch = ptr;
}
},
// NTQVM Caller
{
"NTQVMC",
"66 0F 6F 0D ? ? ? ? 66 0F 6F 05 ? ? ? ? 66 0F 66 C4",
[](memory::handle ptr)
{
g_pointers->m_gta.m_ntqvm_caller = ptr;
}
},
// Sound Overload Detour
{
"SOD",

View File

@ -75,6 +75,4 @@ namespace big
{
return nav;
}
}

View File

@ -45,6 +45,7 @@ namespace big
SETTINGS,
LUA_SCRIPTS,
CONTEXT_MENU_SETTINGS,
ESP_SETTINGS,
GTA_CACHE_SETTINGS,
GUI_SETTINGS,

View File

@ -7,7 +7,7 @@
namespace big
{
player_service::player_service() :
m_self(),
m_self(nullptr),
m_selected_player(m_dummy)
{
g_player_service = this;

View File

@ -62,7 +62,7 @@ namespace big
{
std::uint64_t args[] = {6, 27, 1}; // TODO: check args
int id = SYSTEM::START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS(RAGE_JOAAT("tuneables_processing"), (Any*)args, sizeof(args) / 8, 1424);
int id = SYSTEM::START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS(RAGE_JOAAT("tuneables_processing"), (Any*)args, sizeof(args) / 8, 5050);
if (!id)
{
@ -82,6 +82,12 @@ namespace big
{
if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("tuneables_processing")) == 0)
{
if (m_tunables.size() == 0)
{
LOG(FATAL) << "Failed to cache tunables";
return;
}
m_script_started = false;
m_initialized = true;
LOG(INFO) << "Saving " << m_tunables.size() << " tunables to cache";

View File

@ -235,6 +235,7 @@ namespace big::entity
}
}
if (pointer)
*pointer = closest_entity_ptr;
return closest_entity;

View File

@ -4,6 +4,9 @@
#include "pointers.hpp"
#include "script_global.hpp"
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big::globals
{
inline void clear_wanted_player(Player target)
@ -11,7 +14,7 @@ namespace big::globals
constexpr size_t arg_count = 3;
int64_t args[arg_count] = {static_cast<int64_t>(eRemoteEvent::ClearWantedLevel),
self::id,
*scr_globals::gpbd_fm_3.at(target, scr_globals::size::gpbd_fm_3).at(510).as<int*>()};
(int64_t)scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[target].ScriptEventReplayProtectionCounter};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << target);
}
@ -25,13 +28,13 @@ namespace big::globals
0,
true,
false,
*scr_globals::gpbd_fm_3.at(target, scr_globals::size::gpbd_fm_3).at(510).as<int64_t*>()};
(int64_t)scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[target].ScriptEventReplayProtectionCounter};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << target);
}
inline Interior get_interior_from_player(Player player)
{
return *scr_globals::globalplayer_bd.at(player, scr_globals::size::globalplayer_bd).at(245).as<Interior*>();
return scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[player].CurrentInteriorIndex;
}
}

View File

@ -92,7 +92,7 @@ namespace big::scripts
{
if (launcher->m_net_component->is_player_a_participant(plyr->get_net_game_player()))
{
if (*script_local(launcher->m_stack, 232).at(plyr->id(), 3).at(2).as<int*>() == state)
if (*script_local(launcher->m_stack, 233).at(plyr->id(), 3).at(2).as<int*>() == state)
{
set = true;
break;
@ -160,7 +160,7 @@ namespace big::scripts
// 6) Actually get the script to start
misc::set_bit(scr_globals::launcher_global.at(1).as<int*>(), 1); // run immediately
*scr_globals::launcher_global.at(2).as<int*>() = 6; // will change to 7 shortly but that's fine as players are guaranteed not to be in the waiting stage
*script_local(launcher->m_stack, 232).at(self::id, 3).at(2).as<int*>() = 6;
*script_local(launcher->m_stack, 233).at(self::id, 3).at(2).as<int*>() = 6;
*scr_globals::launcher_global.at(3).at(1).as<int*>() = script_id;
launcher->m_context.m_state = rage::eThreadState::running;
@ -210,7 +210,7 @@ namespace big::scripts
return;
}
if (MISC::GET_NUMBER_OF_FREE_STACKS_OF_THIS_SIZE(54000) == 0)
if (MISC::GET_NUMBER_OF_FREE_STACKS_OF_THIS_SIZE(57500) == 0)
{
g_notification_service->push_warning("Creator", "No free stacks for MISSION stack size");
}
@ -226,7 +226,7 @@ namespace big::scripts
*scr_globals::mission_creator_exited.as<bool*>() = false;
*scr_globals::mission_creator_radar_follows_camera.as<bool*>() = true;
if (SYSTEM::START_NEW_SCRIPT_WITH_NAME_HASH(hash, 54000))
if (SYSTEM::START_NEW_SCRIPT_WITH_NAME_HASH(hash, 57500))
{
g.m_mission_creator_thread = gta_util::find_script_thread(hash);
}

View File

@ -20,6 +20,7 @@
#include <network/snConnectToPeerTask.hpp>
#include <rage/rlQueryPresenceAttributesContext.hpp>
#include <rage/rlScHandle.hpp>
#include <script/globals/GPBD_FM_3.hpp>
namespace big::session
{
@ -40,7 +41,7 @@ namespace big::session
if (session == eSessionType::LEAVE_ONLINE)
*script_global(1574589).at(2).as<int*>() = -1;
else
*script_global(1575017).as<int*>() = (int)session;
*script_global(1575020).as<int*>() = (int)session;
*script_global(1574589).as<int*>() = 1;
script::get_current()->yield(200ms);
@ -51,18 +52,18 @@ namespace big::session
{
int idx = index / 32;
int bit = index % 32;
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(354).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(347).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gpbd_fm_3.at(self::id, scr_globals::size::gpbd_fm_3).at(10).at(205).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(361).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(353).at(idx, 1).as<int*>(), bit);
misc::set_bit((int*)&scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.ActiveFreemodeEvents[idx], bit);
}
inline void clear_fm_event_index(int index)
{
int idx = index / 32;
int bit = index % 32;
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(354).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(347).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gpbd_fm_3.at(self::id, scr_globals::size::gpbd_fm_3).at(10).at(205).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(361).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(353).at(idx, 1).as<int*>(), bit);
misc::clear_bit((int*)&scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[self::id].BossGoon.ActiveFreemodeEvents[idx], bit);
}
inline void join_session(const rage::rlSessionInfo& info)

View File

@ -1,5 +1,6 @@
#include "core/scr_globals.hpp"
#include "script_local.hpp"
#include "services/tunables/tunables_service.hpp"
#include "util/math.hpp"
#include "util/scripts.hpp"
#include "util/teleport.hpp"
@ -7,7 +8,7 @@
namespace big
{
int get_land_mark_beast_is_closest_to(player_ptr player, script_local land_mark_list)
int get_land_mark_beast_is_closest_to(player_ptr player, script_local land_mark_list, int num_landmarks)
{
if (!player->get_ped() || !player->get_ped()->m_navigation)
return -1;
@ -18,7 +19,7 @@ namespace big
player->get_ped()->m_navigation->get_position()->z);
float distance = math::distance_between_vectors(transformed_vector, *land_mark_list.at(0, 3).as<Vector3*>());
for (int i = 1; i < *script_global(262145).at(11711).as<int*>(); i++)
for (int i = 1; i < num_landmarks; i++)
{
float new_distance = math::distance_between_vectors(transformed_vector, *land_mark_list.at(i, 3).as<Vector3*>());
if (new_distance < distance)
@ -47,21 +48,25 @@ namespace big
ImGui::Spacing();
auto beast_land_mark_list = script_local(hunt_the_beast_script_thread, 599).at(1).at(19);
auto beast_land_marks = *script_global(262145).at(11711).as<int*>();
auto beast_land_mark_list =
script_local(hunt_the_beast_script_thread, scr_locals::am_hunt_the_beast::broadcast_idx).at(1).at(19);
static int* num_landmarks = nullptr;
if (!num_landmarks)
num_landmarks = g_tunables_service->get_tunable<int*>(RAGE_JOAAT("HUNT_THE_BEAST_NUMBER_OF_ACTIVE_LANDMARKS"));
if (ImGui::ListBoxHeader("##beastlandmarks", ImVec2(400, 300)))
{
for (int i = 0; i < beast_land_marks; i++)
for (int i = 0; i < (num_landmarks ? *num_landmarks : 10); i++)
{
auto script_local_land_mark = *beast_land_mark_list.at(i, 3).as<Vector3*>();
std::string label = std::format("Tp to landmark {} at {} {} {}",
std::string label = std::format("TP To Landmark {} at {} {} {}",
i,
script_local_land_mark.x,
script_local_land_mark.y,
script_local_land_mark.z);
if (ImGui::Selectable(label.data(), i == get_land_mark_beast_is_closest_to(g_player_service->get_by_id(beast_player_index), beast_land_mark_list)))
if (ImGui::Selectable(label.data(), i == get_land_mark_beast_is_closest_to(g_player_service->get_by_id(beast_player_index), beast_land_mark_list, num_landmarks ? *num_landmarks : 10)))
g_fiber_pool->queue_job([script_local_land_mark, beast] {
teleport::teleport_player_to_coords(g.player.spectating ? beast : g_player_service->get_self(), script_local_land_mark);
});

View File

@ -3,11 +3,11 @@
#include "gta_util.hpp"
#include "script_local.hpp"
#include "util/scripts.hpp"
#include "views/view.hpp"
#include "views/network/missions/hunt_the_beast.hpp"
#include "views/network/missions/king_of_the_castle.hpp"
#include "views/network/missions/cp_collection.hpp"
#include "views/network/missions/criminal_damage.hpp"
#include "views/network/missions/hunt_the_beast.hpp"
#include "views/network/missions/king_of_the_castle.hpp"
#include "views/view.hpp"
namespace big
{
@ -72,16 +72,16 @@ namespace big
ImGui::BeginGroup();
components::button("One-On-One Deathmatch", [] {
scripts::start_launcher_script(197);
scripts::start_launcher_script(204);
});
components::button("Impromptu Race", [] {
scripts::start_launcher_script(16);
});
components::button("Flight School", [] {
scripts::start_launcher_script(196);
scripts::start_launcher_script(203);
});
components::button("Golf", [] {
scripts::start_launcher_script(193);
scripts::start_launcher_script(200);
});
components::button("Tutorial", [] {
scripts::start_launcher_script(20);
@ -94,19 +94,28 @@ namespace big
ImGui::BeginGroup();
components::button("Gunslinger", [] {
scripts::start_launcher_script(211);
scripts::start_launcher_script(218);
});
components::button("Space Monkey", [] {
scripts::start_launcher_script(216);
scripts::start_launcher_script(223);
});
components::button("Wizard", [] {
scripts::start_launcher_script(212);
scripts::start_launcher_script(219);
});
components::button("QUB3D", [] {
scripts::start_launcher_script(217);
scripts::start_launcher_script(224);
});
components::button("Camhedz", [] {
scripts::start_launcher_script(218);
scripts::start_launcher_script(225);
});
ImGui::EndGroup();
ImGui::BeginGroup();
components::button("Ghost Hunt", [] {
scripts::start_launcher_script(174);
});
components::button("Possesed Animals", [] {
scripts::start_launcher_script(179);
});
ImGui::EndGroup();
@ -121,7 +130,7 @@ namespace big
if (check_script(RAGE_JOAAT("am_king_of_the_castle")))
render_king_of_the_castle_ui();
if(check_script(RAGE_JOAAT("am_hunt_the_beast")))
if (check_script(RAGE_JOAAT("am_hunt_the_beast")))
render_hunt_the_beast_ui();
if (!mission_found)

View File

@ -13,6 +13,7 @@
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -171,14 +172,14 @@ namespace big
if (ImGui::SliderInt("WANTED_LVL"_T.data(), &global_wanted_level, 0, 5))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(212).as<Player*>() = __rdtsc() + 32;
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
components::command_button<"killall">({}, "KILL_ALL"_T);

View File

@ -12,9 +12,9 @@ namespace big
return gta_util::get_network()->m_game_session_ptr->is_host();
};
components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine();
components::command_checkbox<"breakupcheating">();
//components::player_command_button<"breakup">(g_player_service->get_selected());
//ImGui::SameLine();
//components::command_checkbox<"breakupcheating">();
components::player_command_button<"bailkick">(g_player_service->get_selected());
ImGui::SameLine();

View File

@ -109,8 +109,6 @@ namespace big
toxic::start_activity(g_player_service->get_selected(), eActivityType::Skydive);
});
ImGui::SameLine();
components::player_command_button<"cayotp">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), {81}, "TP To MOC");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {123}, "TP To Casino");

View File

@ -34,7 +34,6 @@ namespace big
ImGui::Checkbox("SPECTATE"_T.data(), &g.protections.script_events.spectate);
ImGui::Checkbox("VEHICLE_KICK"_T.data(), &g.protections.script_events.vehicle_kick);
ImGui::Checkbox("WANTED_LEVEL"_T.data(), &g.protections.script_events.clear_wanted_level);
ImGui::Checkbox("DESYNC_KICK"_T.data(), &g.protections.desync_kick);
ImGui::EndGroup();
ImGui::SameLine();