Update for b3407 and b3411 (#55)

This commit is contained in:
Mr-X-GTA 2024-12-13 23:52:31 +01:00 committed by GitHub
parent 6edc483502
commit d7419711b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
29 changed files with 139 additions and 279 deletions

View File

@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare(
gtav_classes
GIT_REPOSITORY https://github.com/Mr-X-GTA/GTAV-Classes-1.git
GIT_TAG 6e53c26ac9904e00e3f851826fb61367829eca26
GIT_TAG dee76e935485c13e8a660d3640aca9345a18a6f1
GIT_PROGRESS TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""

View File

@ -1,6 +1,6 @@
{
"game": {
"online": "1.69",
"build": "3274"
"online": "1.70",
"build": "3411"
}
}

View File

@ -21,7 +21,7 @@ namespace big
{
void bypass_battleye()
{
constexpr std::array<std::uint32_t, 16> valid_hashes = {1410389794, 967, 1523678325, 472, 0, 0, 1323039495, 0, 0, 1731098795, 2256610353, 17956, 414639110, 307143837, 3443181821, 0};
constexpr std::array<std::uint32_t, 16> valid_hashes = {4022154788, 988, 3512952254, 472, 0, 0, 3308328917, 0, 0, 1731098795, 2256610353, 18616, 1540917665, 307143837, 1629784955, 2012170620};
if (auto hashes = *g_pointers->m_gta.m_game_data_hash)
{

View File

@ -10,7 +10,7 @@
namespace big
{
class battleye_update_kick : player_command
class battleye_kick : player_command
{
using player_command::player_command;
@ -21,15 +21,17 @@ namespace big
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
{
unsigned char data[] = {0x00, 0x50, 0x31, 0x4A, 0xC0, 0x1A, 0x13, 0xFF, 0xFF, 0xFF};
player->tampered_with_be = true;
for (int i = 0; i < 20; i++)
{
data[0] = i;
g_battleye_service.send_message_to_client(player->get_net_game_player()->get_host_token(), &data, sizeof(data));
}
packet msg{};
msg.write_message(rage::eNetMessage::MsgKickPlayer);
msg.write<KickReason>(KickReason::BATTLEYE_KICK, 5);
msg.write<int>(0, 32);
msg.write<bool>(false, 1);
auto msg_id = player->get_session_player()->m_msg_id;
msg.send(msg_id);
}
};
battleye_update_kick g_battleye_update_kick("battleupdate", "BATTLEYE_UPDATE_KICK", "BATTLEYE_UPDATE_KICK_DESC", 0);
battleye_kick g_battleye_kick("battlekick", "BATTLEYE_KICK", "BATTLEYE_KICK_DESC", 0);
}

View File

@ -20,9 +20,16 @@ namespace big
else
{
if (player->is_host())
player_command::get("battleupdate"_J)->call(player, {});
{
constexpr size_t arg_count = 16;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, 1 << player->id(), (int64_t)(int)-1};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
}
else
{
player_command::get("desync"_J)->call(player, {});
}
}
}
};

View File

@ -32,11 +32,11 @@ namespace big
}
else if (scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index != eSimpleInteriorIndex::SIMPLE_INTERIOR_INVALID)
{
*scr_globals::interiors.at(3347).as<Player*>() =
*scr_globals::interiors.at(3762).as<Player*>() =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Owner;
*scr_globals::interiors.at(3684).as<eSimpleInteriorIndex*>() =
*scr_globals::interiors.at(4111).as<eSimpleInteriorIndex*>() =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.Index;
*scr_globals::interiors.at(3683).as<bool*>() = true;
*scr_globals::interiors.at(4110).as<bool*>() = true;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].SimpleInteriorData.InteriorSubtype =
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[id].SimpleInteriorData.InteriorSubtype;
}

View File

@ -1,29 +0,0 @@
#include "backend/bool_command.hpp"
#include "memory/byte_patch.hpp"
#include "pointers.hpp"
namespace big
{
class window_hook : bool_command
{
using bool_command::bool_command;
virtual void refresh() override
{
static auto& window_hook_patch = memory::byte_patch::make(g_pointers->m_gta.m_window_hook.as<void*>(), std::to_array({0xC3, 0x90, 0x90, 0x90}));
if (m_toggle)
{
window_hook_patch->apply();
UnhookWindowsHookEx(*g_pointers->m_gta.m_window_hook.add(45).rip().as<HHOOK*>());
}
else
{
SetWindowsHookExA(13, g_pointers->m_gta.m_window_hook.add(18).rip().as<HOOKPROC>(), GetModuleHandleA("GTA5.exe"), 0);
window_hook_patch->restore();
}
}
};
window_hook g_window_hook("windowhook", "BACKEND_GTA_WINDOW_HOOK", "BACKEND_GTA_WINDOW_HOOK_DESC", g.debug.window_hook);
}

View File

@ -14,14 +14,14 @@ namespace big
*scr_globals::disable_wasted_sound.as<bool*>() = true;
// triggers respawn instantly upon death, has no effect if not respawning so no need to check if the player's dead
misc::set_bit(&(*scr_globals::freemode_properties.at(1728).at(756).as<int*>()), 1); // Update: freemode -> KILL_STRIP_H -> Above that = "!IS_BIT_SET(global, 2)"
misc::set_bit(&(*scr_globals::freemode_properties.at(1761).at(756).as<int*>()), 1); // Update: freemode -> KILL_STRIP_H -> Above that = "!IS_BIT_SET(global, 2)"
}
virtual void on_disable() override
{
*scr_globals::disable_wasted_sound.as<bool*>() = false;
misc::clear_bit(&(*scr_globals::freemode_properties.at(1728).at(756).as<int*>()), 1);
misc::clear_bit(&(*scr_globals::freemode_properties.at(1761).at(756).as<int*>()), 1);
}
};

View File

@ -14,7 +14,7 @@ namespace big
virtual void on_tick() override
{
if (g.self.ghost_org)
MISC::SET_BIT(scr_globals::freemode_global.at(4682).as<int*>(), 2);
MISC::SET_BIT(scr_globals::freemode_global.at(4698).as<int*>(), 2);
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = true;
*scr_globals::freemode_properties.at(58).as<int*>() = NETWORK::GET_NETWORK_TIME() + 1;
}
@ -22,7 +22,7 @@ namespace big
virtual void on_disable() override
{
if (!g.self.ghost_org)
MISC::CLEAR_BIT(scr_globals::freemode_global.at(4682).as<int*>(), 2);
MISC::CLEAR_BIT(scr_globals::freemode_global.at(4698).as<int*>(), 2);
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].OffRadarActive = false;
}
};

View File

@ -27,7 +27,7 @@ namespace big
&& gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained && g_player_service->get_self()->is_valid()
&& !g_player_service->get_self()->is_host())
{
g_pointers->m_gta.m_reset_network_complaints(&gta_util::get_network()->m_game_complaint_mgr);
g_pointers->m_gta.m_reset_network_complaints(&gta_util::get_network()->m_game_complaint_mgr, false);
}
}
}

View File

@ -4,16 +4,16 @@
namespace big::scr_globals
{
static inline const script_global gsbd(2648938);
static inline const script_global gsbd_kicking(1877252);
static inline const script_global gsbd_fm_events(1916617);
static inline const script_global gsbd(2648914);
static inline const script_global gsbd_kicking(1877384);
static inline const script_global gsbd_fm_events(1916957);
static inline const script_global globalplayer_bd(2657971);
static inline const script_global gpbd_fm_3(1887305);
static inline const script_global gpbd_fm_1(1845281);
static inline const script_global interiors(1943520);
static inline const script_global globalplayer_bd(2657991);
static inline const script_global gpbd_fm_3(1887549);
static inline const script_global gpbd_fm_1(1845221);
static inline const script_global interiors(1943917);
static inline const script_global launcher_global(2699172);
static inline const script_global launcher_global(2699419);
// creator globals usually remain the same after updates
static inline const script_global terminate_creator(1574607); // NETWORK::NETWORK_BAIL(1, 0, 0); fm_*_creator
@ -21,84 +21,84 @@ namespace big::scr_globals
static inline const script_global mission_creator_radar_follows_camera(2621443);
static inline const script_global mission_creator_exited(1574530);
static inline const script_global transition_state(1575011);
static inline const script_global sctv_spectator(2697732); // pausemenu_multiplayer function 0xE49C42EC
static inline const script_global transition_state(1575012);
static inline const script_global sctv_spectator(2697978); // pausemenu_multiplayer function 0xE49C42EC
static inline const script_global vehicle_global(1586521);
static inline const script_global vehicle_global(1586535);
static inline const script_global freemode_properties(2672855);
static inline const script_global freemode_global(2738935);
static inline const script_global freemode_properties(2672939);
static inline const script_global freemode_global(2739811);
static inline const script_global spawn_global(2696212);
static inline const script_global spawn_global(2696456);
static inline const script_global transaction_overlimit(4537455);
static inline const script_global transaction_overlimit(4538089);
static inline const script_global stats(2359296);
static inline const script_global session(1574589);
static inline const script_global session2(1575035);
static inline const script_global session3(32949);
static inline const script_global session2(1575036);
static inline const script_global session3(33088);
static inline const script_global session4(1574942);
static inline const script_global session5(1575010);
static inline const script_global session6(2696130); // freemode -> if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
static inline const script_global session5(1575011);
static inline const script_global session6(2696374); // freemode -> if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !NETWORK::NETWORK_IS_ACTIVITY_SESSION())
static inline const script_global interaction_menu_access(2710430); // am_pi_menu -> if (NETWORK::NETWORK_IS_SIGNED_ONLINE()) first global after that
static inline const script_global interaction_menu_access(2711020); // am_pi_menu -> if (NETWORK::NETWORK_IS_SIGNED_ONLINE()) first global after that
static inline const script_global disable_wasted_sound(2707680); // freemode -> AUDIO::PLAY_SOUND_FRONTEND(-1, "Wasted", "POWER_PLAY_General_Soundset", true);
static inline const script_global disable_wasted_sound(2708030); // freemode -> AUDIO::PLAY_SOUND_FRONTEND(-1, "Wasted", "POWER_PLAY_General_Soundset", true);
static inline const script_global passive(1574582); // if (((!PED::IS_PED_IN_ANY_VEHICLE(PLAYER::GET_PLAYER_PED(bVar1), false) || Global_
static inline const script_global property_garage(1937684);
static inline const script_global property_names(1312298);
static inline const script_global property_garage(1938043);
static inline const script_global property_names(1312333);
static inline const script_global reset_clothing(104077); // freemode 75, &iLocal_.*, 2\);
static inline const script_global reset_clothing(104243); // freemode 75, &iLocal_.*, 2\);
static inline const script_global gun_van(1949748); // return -29.532f, 6435.136f, 31.162f;
static inline const script_global gun_van(1950373); // return -29.532f, 6435.136f, 31.162f;
static inline const script_global disable_phone(20913);
static inline const script_global disable_phone(21049);
static inline const script_global should_reset_fm_weapons(1578026);
static inline const script_global should_reset_fm_weapons(1578039);
}
namespace big::scr_locals
{
namespace am_hunt_the_beast
{
constexpr static auto broadcast_idx = 604; // (bParam0) != 0;
constexpr static auto player_broadcast_idx = 2588; // if (NETWORK::PARTICIPANT_ID_TO_INT() != -1)
constexpr static auto broadcast_idx = 622; // (bParam0) != 0;
constexpr static auto player_broadcast_idx = 2606; // if (NETWORK::PARTICIPANT_ID_TO_INT() != -1)
}
namespace am_criminal_damage
{
constexpr static auto broadcast_idx = 115; // /* Tunable: CRIMINAL_DAMAGE_DISABLE_SHARE_CASH */)
constexpr static auto score_idx = 110; // AUDIO::PLAY_SOUND_FRONTEND(-1, "Criminal_Damage_High_Value", "GTAO_FM_Events_Soundset", false);
constexpr static auto broadcast_idx = 117; // /* Tunable: CRIMINAL_DAMAGE_DISABLE_SHARE_CASH */)
constexpr static auto score_idx = 112; // AUDIO::PLAY_SOUND_FRONTEND(-1, "Criminal_Damage_High_Value", "GTAO_FM_Events_Soundset", false);
}
namespace am_cp_collection
{
constexpr static auto broadcast_idx = 820; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0));
constexpr static auto player_broadcast_idx = 3461; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0));
constexpr static auto broadcast_idx = 822; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0));
constexpr static auto player_broadcast_idx = 3463; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0));
}
namespace am_king_of_the_castle
{
constexpr static auto broadcast_idx = 98; // KING_OF_THE_CASTLE_EVENT_TIME_LIMIT
constexpr static auto broadcast_idx = 100; // KING_OF_THE_CASTLE_EVENT_TIME_LIMIT
}
namespace fmmc_launcher
{
constexpr static auto broadcast_idx = 12564; // if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(PLAYER::INT_TO_PLAYERINDEX(Global_
constexpr static auto broadcast_idx = 12721; // if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(PLAYER::INT_TO_PLAYERINDEX(Global_
}
namespace fm_mission_controller
{
constexpr static auto mission_controller_wanted_state_flags = 60096; // if (PLAYER::GET_PLAYER_WANTED_LEVEL(bLocal_
constexpr static auto mission_controller_wanted_state_flags = 60851; // if (PLAYER::GET_PLAYER_WANTED_LEVEL(bLocal_
}
namespace freemode
{
// first uLocal_ in this function call
// func_\d+\((&.Local_\d+(, )?){9}\);
inline static script_local mobile(19139);
inline static script_local mobile(19253);
}
}

View File

@ -111,7 +111,7 @@ namespace big::functions
using read_bitbuffer_into_sync_tree = void (*)(rage::netSyncTree* tree, uint64_t flag, uint32_t flag2, rage::datBitBuffer* buffer, uint64_t netLogStub);
//Sync signatures END
using reset_network_complaints = void (*)(CNetComplaintMgr* mgr);
using reset_network_complaints = void (*)(CNetComplaintMgr* mgr, bool force);
using fidevice_get_device = rage::fiDevice* (*)(const char* path, bool allow_root);
using fipackfile_ctor = rage::fiPackfile* (*)(rage::fiPackfile* this_);

View File

@ -64,8 +64,6 @@ namespace big
memory::handle m_crash_trigger;
memory::handle m_window_hook;
memory::handle m_script_vm_patch_1;
memory::handle m_script_vm_patch_2;
memory::handle m_script_vm_patch_3;
@ -396,8 +394,6 @@ namespace big
std::uint32_t* m_object_ids_offset;
PVOID m_error_packet_memmove;
PVOID m_create_pool_item;
PVOID m_scope_sway_function;

View File

@ -48,7 +48,7 @@ namespace big
fix_hook_address();
if (auto status = MH_CreateHook(m_target, m_detour, &m_original); status != MH_OK)
throw std::runtime_error(std::format("Failed to create hook '{}' at 0x{:X} (error: {})", m_name, uintptr_t(m_target), MH_StatusToString(status)));
LOGF(FATAL, "Failed to create hook '{}' at 0x{:X} (error: {})", m_name, uintptr_t(m_target), MH_StatusToString(status));
}
detour_hook::~detour_hook() noexcept
@ -66,7 +66,7 @@ namespace big
return;
if (auto status = MH_QueueEnableHook(m_target); status != MH_OK)
throw std::runtime_error(std::format("Failed to enable hook 0x{:X} ({})", uintptr_t(m_target), MH_StatusToString(status)));
LOGF(FATAL, "Failed to enable hook 0x{:X} ({})", uintptr_t(m_target), MH_StatusToString(status));
}
void detour_hook::disable()

View File

@ -6,8 +6,7 @@ namespace big
{
hooking::hooking() :
m_swapchain_hook(*g_pointers->m_gta.m_swapchain, hooks::swapchain_num_funcs),
m_sync_data_reader_hook(g_pointers->m_gta.m_sync_data_reader_vtable, 27),
m_error_packet_memmove_hook(g_pointers->m_gta.m_error_packet_memmove, hooks::error_packet_memmove)
m_sync_data_reader_hook(g_pointers->m_gta.m_sync_data_reader_vtable, 27)
{
m_swapchain_hook.hook(hooks::swapchain_present_index, &hooks::swapchain_present);
m_swapchain_hook.hook(hooks::swapchain_resizebuffers_index, &hooks::swapchain_resizebuffers);
@ -177,7 +176,6 @@ namespace big
{
m_swapchain_hook.enable();
m_sync_data_reader_hook.enable();
m_error_packet_memmove_hook.enable();
m_og_wndproc = WNDPROC(SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, LONG_PTR(&hooks::wndproc)));
for (auto& detour_hook_helper : m_detour_hook_helpers)
@ -200,7 +198,6 @@ namespace big
}
SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(m_og_wndproc));
m_error_packet_memmove_hook.disable();
m_sync_data_reader_hook.disable();
m_swapchain_hook.disable();

View File

@ -210,8 +210,6 @@ namespace big
static std::uint32_t get_dlc_hash(void* mgr, std::uint32_t seed);
static bool add_gamer_to_session(rage::netConnectionManager* mgr, std::uint32_t msg_id, int* req_id, RemoteGamerInfoMsg* info, int flags, void* a6);
static void error_packet_memmove(void* dst, void* src, int size);
static void* create_pool_item(GenericPool* pool);
static uint32_t network_can_access_multiplayer(uint32_t a1, uint64_t* a2);
@ -305,8 +303,6 @@ namespace big
vmt_hook m_swapchain_hook;
vtable_hook m_sync_data_reader_hook;
call_hook m_error_packet_memmove_hook;
WNDPROC m_og_wndproc = nullptr;
static inline std::vector<detour_hook_helper> m_detour_hook_helpers;

View File

@ -1539,6 +1539,11 @@ namespace big
case sync_node_id("CPedGameStateDataNode"):
{
const auto game_state_node = (CPedGameStateDataNode*)(node);
if (game_state_node->m_weapon_hash == "WEAPON_STRICKLER"_J)
{
notify::crash_blocked(sender, "invalid weapon");
return true;
}
if (game_state_node->m_on_mount)
{
notify::crash_blocked(sender, "mount flag");

View File

@ -1,19 +0,0 @@
#include "hooking/hooking.hpp"
namespace big
{
void hooks::error_packet_memmove(void* dst, void* src, int size)
{
if (!src || !dst) [[unlikely]]
return;
// remote crash
if (size > 0x80) [[unlikely]]
{
LOG(INFO) << "remote crash blocked";
return;
}
return g_hooking->m_error_packet_memmove_hook.get_original<decltype(&hooks::error_packet_memmove)>()(dst, src, size);
}
}

View File

@ -375,7 +375,7 @@ namespace big
case eRemoteEvent::InteriorControl:
{
int interior = (int)args[3];
if (interior < 0 || interior > 171) // the upper bound will change after an update
if (interior < 0 || interior > 173) // the upper bound will change after an update
{
if (auto plyr = g_player_service->get_by_id(player->m_player_id))
session::add_infraction(plyr, Infraction::TRIED_KICK_PLAYER);

View File

@ -3,7 +3,7 @@
#include "gta_pointers_layout_info.hpp"
#include "sc_pointers_layout_info.hpp"
#define GTA_VERSION_TARGET "1.69-3351"
#define GTA_VERSION_TARGET "1.70-3411"
namespace big
{
@ -500,7 +500,7 @@ namespace big
// Reset Network Complaints
{
"RENC",
"E8 ? ? ? ? 8B 8B ? ? ? ? 03 CF",
"E8 ? ? ? ? 83 BB 70 10 00 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_reset_network_complaints = ptr.add(1).rip().as<functions::reset_network_complaints>();
@ -582,17 +582,15 @@ namespace big
g_pointers->m_gta.m_start_get_session_by_gamer_handle = ptr.add(1).rip().as<functions::start_get_session_by_gamer_handle>();
}
},
#if 0
// Start Matchmaking Find Sessions
{
"SMFS",
"83 ? ? ? ? E8 ? ? ? ? 84 C0 0F 84 ? ? ? ? C7",
"4C 8D 83 AC 10 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_start_matchmaking_find_sessions = ptr.add(6).rip().as<functions::start_matchmaking_find_sessions>();
g_pointers->m_gta.m_start_matchmaking_find_sessions = ptr.add(8).rip().add(1).rip().as<functions::start_matchmaking_find_sessions>();
}
},
#endif
// Join Session By Info
{
"JSBI",
@ -695,7 +693,7 @@ namespace big
// 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 ? ? ? ? 48 81 EC ? ? ? ? 45 33 F6",
"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 A8",
[](memory::handle ptr)
{
g_pointers->m_gta.m_handle_join_request = ptr.as<PVOID>();
@ -704,7 +702,7 @@ namespace big
// Write Join Response Data
{
"WJRD",
"E8 ? ? ? ? 84 C0 74 07 40 84 FF 41 0F 95 C6",
"E8 ? ? ? ? 41 8B DF 84 C0 74 06",
[](memory::handle ptr)
{
g_pointers->m_gta.m_write_join_response_data = ptr.add(1).rip().as<functions::write_join_response_data>();
@ -740,7 +738,7 @@ namespace big
// Serialize Join Request Message
{
"SJRM",
"E8 ? ? ? ? 84 C0 0F 84 9B 00 00 00 49 8D 8F 48 11 00 00",
"E8 ? ? ? ? 84 C0 0F 84 9B 00 00 00 49 8D 8F 50 11 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_serialize_join_request_message = ptr.add(1).rip().as<PVOID>();
@ -776,7 +774,7 @@ namespace big
// Request Control
{
"RC",
"E8 ? ? ? ? EB 3E 48 8B D3",
"E8 ? ? ? ? EB 50 48 8B D3",
[](memory::handle ptr)
{
g_pointers->m_gta.m_request_control = ptr.add(1).rip().as<functions::request_control>();
@ -803,7 +801,7 @@ namespace big
// Handle Remove Gamer Command
{
"HRGC",
"74 74 33 FF",
"74 74 33 FF 45 33 F6",
[](memory::handle ptr)
{
g_pointers->m_gta.m_handle_remove_gamer_cmd = ptr.sub(0x3B).as<functions::handle_remove_gamer_cmd>();
@ -857,7 +855,7 @@ namespace big
// Invalid Decal Crash
{
"IDC",
"E8 ? ? ? ? 8B 9C 24 B8 00 00 00 4C 8B AC 24 A8 00 00 00",
"E8 ? ? ? ? 8B AC 24 D0 00 00 00 48 8B 4C 24 38",
[](memory::handle ptr)
{
g_pointers->m_gta.m_invalid_decal_crash = ptr.add(1).rip().as<PVOID>();
@ -983,7 +981,7 @@ namespace big
// Prepare Metric For Sending
{
"PMFS",
"48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 83 EC 30 49 8B E8 4C 8D 40 EC 49 8B F1 48 8B D9 40 32 FF E8",
"48 8B C4 48 89 58 08 48 89 68 10 48 89 70 18 48 89 78 20 41 56 48 83 EC 30 49 8B F0 4C",
[](memory::handle ptr)
{
g_pointers->m_gta.m_prepare_metric_for_sending = ptr.as<PVOID>();
@ -1201,7 +1199,7 @@ namespace big
// NetFilter Handle Message
{
"NHM",
"EB 2E 49 8D 82 ? ? ? ? 4C",
"EB 34 48 8D 81 ? ? ? ? 4C",
[](memory::handle ptr)
{
g_pointers->m_gta.m_netfilter_handle_message = ptr.sub(4).rip().as<PVOID>();
@ -1229,7 +1227,7 @@ namespace big
// Get Host Array Handler By Index
{
"GHAHBI",
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 8A 81 8F",
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 20 8A 81 97",
[](memory::handle ptr)
{
g_pointers->m_gta.m_get_host_array_handler_by_index = ptr.as<functions::get_host_array_handler_by_index>();
@ -1442,7 +1440,7 @@ namespace big
// Blame Explode
{
"BE",
"0F 85 ? ? ? ? 48 8B 05 ? ? ? ? 48 8B 48 08 E8",
"0F 85 EE 00 00 00 84 C0",
[](memory::handle ptr)
{
g_pointers->m_gta.m_blame_explode = ptr;
@ -1569,15 +1567,6 @@ namespace big
g_pointers->m_gta.m_get_title_caption_error_message_box = ptr.add(1).rip().as<functions::get_title_caption_error_message_box>();
}
},
// Disable Window Hook
{
"DT",
"48 83 EC 28 33 C9 FF 15 ? ? ? ? 45 33 C9",
[](memory::handle ptr)
{
g_pointers->m_gta.m_window_hook = ptr;
}
},
// Vehicle Metadata Manager.
{
"VEHMMGR",
@ -1819,10 +1808,10 @@ namespace big
// Session Request Patch
{
"SRP",
"48 8B 9D 70 01 00 00 E9 FF 00 00 00",
"45 38 BE 48 B7 00 00 0F 85 F6 00 00 00",
[](memory::handle ptr)
{
g_pointers->m_gta.m_session_request_patch = ptr.add(0x13).as<PVOID>();
g_pointers->m_gta.m_session_request_patch = ptr.add(0x14).as<PVOID>();
}
},
// Get Peer By Security Id
@ -1846,7 +1835,7 @@ namespace big
// Get DLC Hash
{
"GDLCH",
"74 0B 41 BC 10",
"74 0B 41 BF 10",
[](memory::handle ptr)
{
g_pointers->m_gta.m_dlc_manager = ptr.sub(0x11).rip().as<void**>();
@ -1880,15 +1869,6 @@ namespace big
g_pointers->m_gta.m_object_ids_offset = ptr.add(0xF).as<std::uint32_t*>();
}
},
// Error Packet Memmove
{
"EPM",
"49 8D 4C 24 60 44 8B C0 E8",
[](memory::handle ptr)
{
g_pointers->m_gta.m_error_packet_memmove = ptr.add(0x8).as<PVOID>();
}
},
// Create Pool Item
{
"CPI",
@ -1983,7 +1963,7 @@ namespace big
// Network Can Access Multiplayer
{
"NCAM",
"E9 26 01 00 00 33 D2 8B CB",
"E9 36 01 00 00 33 D2 8B CB",
[](memory::handle ptr)
{
g_pointers->m_gta.m_network_can_access_multiplayer = ptr.add(10).rip().as<PVOID>();
@ -2108,9 +2088,6 @@ namespace big
const auto mem_region = memory::module("GTA5.exe");
// TODO: this is far from ideal, but it is impossible to find a signature for this anymore
g_pointers->m_gta.m_start_matchmaking_find_sessions = mem_region.begin().add(0x148626C).as<functions::start_matchmaking_find_sessions>();
constexpr auto gta_batch_and_hash = pointers::get_gta_batch();
constexpr cstxpr_str gta_batch_name{"GTA5"};
write_to_cache_or_read_from_cache<gta_batch_name,

View File

@ -310,14 +310,6 @@ namespace big
{
send_message_to_server(token, message, size);
if (g.session.kick_host_when_forcing_host && msg[1] == 5)
{
if (auto player = g_player_service->get_by_host_token(token); player && !player->is_modder)
{
player_command::get("battleupdate"_J)->call(player, {});
}
}
break;
}
case REQUEST:

View File

@ -5,7 +5,7 @@
#include "script.hpp"
#include "util/mobile.hpp"
#define MAX_GARAGE_NUM 32
#define MAX_GARAGE_NUM 33
namespace big
{
@ -44,6 +44,7 @@ namespace big
case 28: return 350;
case 29: return 363;
case 31: return 515;
case 32: return 537;
case MAX_GARAGE_NUM+0: return 156; //Mobile Operations Center
case MAX_GARAGE_NUM+1: return 224; //Nightclub B1
case MAX_GARAGE_NUM+2: return 223; //Terrorbyte
@ -72,6 +73,7 @@ namespace big
case 20:
case 21:
case 22:
case 32:
case 25: return 10;
case 13: return 11;
case 0:
@ -130,6 +132,7 @@ namespace big
case 28: stat = self::char_index ? "MP1_MULTI_PROPERTY_9"_J : "MP0_MULTI_PROPERTY_9"_J; break;
case 29: stat = self::char_index ? "MP1_MULTSTOREY_GAR_OWNED"_J : "MP0_MULTSTOREY_GAR_OWNED"_J; break;
case 31: stat = self::char_index ? "MP1_PROP_BAIL_OFFICE"_J : "MP0_PROP_BAIL_OFFICE"_J; break;
case 32: stat = self::char_index ? "MP1_PROP_HACKER_DEN"_J : "MP0_PROP_HACKER_DEN"_J; break;
case MAX_GARAGE_NUM+0:
case MAX_GARAGE_NUM+1:
case MAX_GARAGE_NUM+2:
@ -154,7 +157,7 @@ namespace big
{
case 12: //Hangar
{
auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 883).at(268).at(297).as<PINT>();
auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 889).at(268).at(299).as<PINT>();
switch (hangar_id)
{
case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_HANGAR_1"); //LSIA Hangar 1
@ -167,7 +170,7 @@ namespace big
}
case 13: //Facility
{
auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 883).at(268).at(304).as<PINT>();
auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 889).at(268).at(306).as<PINT>();
switch (facility_id)
{
case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_DBASE_1"); //Grand Senora Desert Facility
@ -206,6 +209,7 @@ namespace big
}
}
case 31: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("BO_GARNAME"); //Bail Office
case 32: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("HD_GARNAME"); //Garment Factory
case MAX_GARAGE_NUM+0: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("GRTRUCK"); //Mobile Operations Center
case MAX_GARAGE_NUM+1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_BHUB_GAR0"); //Nightclub B1
case MAX_GARAGE_NUM+2: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_BHUB_CLUBT"); //Terrorbyte
@ -352,7 +356,7 @@ namespace big
if (i % 100 == 0)
script::get_current()->yield();
auto veh_idx_global = scr_globals::vehicle_global.at(i, 142);
auto veh_idx_global = scr_globals::vehicle_global.at(i, 143);
const auto hash = *veh_idx_global.at(66).as<Hash*>();
const auto& it = m_pv_lookup.find(i);

View File

@ -18,12 +18,12 @@ namespace big::mobile
int get_current_personal_vehicle(); // forward declare
inline void despawn_current_personal_vehicle()
{
misc::clear_bits(scr_globals::vehicle_global.at(get_current_personal_vehicle(), 142).at(103).as<int*>(), eVehicleFlags::TRIGGER_SPAWN_TOGGLE);
misc::clear_bits(scr_globals::vehicle_global.at(get_current_personal_vehicle(), 143).at(104).as<int*>(), eVehicleFlags::TRIGGER_SPAWN_TOGGLE);
}
inline int get_current_personal_vehicle()
{
return *scr_globals::stats.at(0, 5568).at(681).at(2).as<int*>();
return *scr_globals::stats.at(0, 5571).at(681).at(2).as<int*>();
}
}
@ -31,27 +31,27 @@ namespace big::mobile
{
inline void request_ammo_drop()
{
*scr_globals::freemode_global.at(906).as<int*>() = 1;
*scr_globals::freemode_global.at(917).as<int*>() = 1;
}
inline void request_boat_pickup()
{
*scr_globals::freemode_global.at(907).as<int*>() = 1;
*scr_globals::freemode_global.at(918).as<int*>() = 1;
}
inline void request_helicopter_pickup()
{
*scr_globals::freemode_global.at(908).as<int*>() = 1;
*scr_globals::freemode_global.at(919).as<int*>() = 1;
}
inline void request_backup_helicopter()
{
*scr_globals::freemode_global.at(4506).as<int*>() = 1;
*scr_globals::freemode_global.at(4522).as<int*>() = 1;
}
inline void request_airstrike()
{
*scr_globals::freemode_global.at(4507).as<int*>() = 1;
*scr_globals::freemode_global.at(4523).as<int*>() = 1;
}
}
@ -59,15 +59,15 @@ namespace big::mobile
{
inline bool fix_index(int veh_idx, bool spawn_veh = false)
{
bool can_be_fixed = misc::has_bits_set(scr_globals::vehicle_global.at(veh_idx, 142).at(103).as<int*>(), eVehicleFlags::DESTROYED | eVehicleFlags::HAS_INSURANCE);
bool can_be_fixed = misc::has_bits_set(scr_globals::vehicle_global.at(veh_idx, 143).at(104).as<int*>(), eVehicleFlags::DESTROYED | eVehicleFlags::HAS_INSURANCE);
if (can_be_fixed)
{
misc::clear_bits(scr_globals::vehicle_global.at(veh_idx, 142).at(103).as<int*>(), eVehicleFlags::DESTROYED | eVehicleFlags::IMPOUNDED | eVehicleFlags::UNK2);
misc::clear_bits(scr_globals::vehicle_global.at(veh_idx, 143).at(104).as<int*>(), eVehicleFlags::DESTROYED | eVehicleFlags::IMPOUNDED | eVehicleFlags::UNK2);
if (spawn_veh)
{
misc::set_bits(scr_globals::vehicle_global.at(veh_idx, 142).at(103).as<int*>(), eVehicleFlags::TRIGGER_SPAWN_TOGGLE | eVehicleFlags::SPAWN_AT_MORS_MUTUAL);
misc::set_bits(scr_globals::vehicle_global.at(veh_idx, 143).at(104).as<int*>(), eVehicleFlags::TRIGGER_SPAWN_TOGGLE | eVehicleFlags::SPAWN_AT_MORS_MUTUAL);
}
}
return can_be_fixed;
@ -90,12 +90,12 @@ namespace big::mobile
{
inline void request_bullshark_testosterone()
{
*scr_globals::freemode_properties.at(3733).as<int*>() = 1;
*scr_globals::freemode_properties.at(925).as<int*>() = 1;
}
inline void request_ballistic_armor() //i think this is a ceo ability atleast?
{
*scr_globals::freemode_global.at(906).as<int*>() = 1;
*scr_globals::freemode_global.at(927).as<int*>() = 1;
}
}
@ -103,32 +103,32 @@ namespace big::mobile
{
inline void request_avenger()
{
*scr_globals::freemode_global.at(953).as<int*>() = 1;
*scr_globals::freemode_global.at(964).as<int*>() = 1;
}
inline void request_kosatka()
{
*scr_globals::freemode_global.at(975).as<int*>() = 1;
*scr_globals::freemode_global.at(991).as<int*>() = 1;
}
inline void request_mobile_operations_center()
{
*scr_globals::freemode_global.at(945).as<int*>() = 1;
*scr_globals::freemode_global.at(956).as<int*>() = 1;
}
inline void request_terrorbyte()
{
*scr_globals::freemode_global.at(958).as<int*>() = 1;
*scr_globals::freemode_global.at(969).as<int*>() = 1;
}
inline void request_acidlab()
{
*scr_globals::freemode_global.at(959).as<int*>() = 1;
*scr_globals::freemode_global.at(970).as<int*>() = 1;
}
inline void request_acidlab_bike()
{
*scr_globals::freemode_global.at(1009).as<int*>() = 1;
*scr_globals::freemode_global.at(1025).as<int*>() = 1;
}
}
@ -152,7 +152,7 @@ namespace big::mobile
inline void summon_vehicle_by_index(int veh_idx)
{
if (*scr_globals::freemode_global.at(1000).as<int*>() != -1)
if (*scr_globals::freemode_global.at(1016).as<int*>() != -1)
return g_notification_service.push_warning("VEHICLE"_T.data(), "VEHICLE_MECHANIC_BUSY"_T.data());
if (g.clone_pv.spawn_inside && self::veh)
@ -167,11 +167,11 @@ namespace big::mobile
// only do this when spawn inside is enabled otherwise the vehicle will spawn relatively far away from players
if (g.clone_pv.spawn_inside)
{
*scr_globals::freemode_global.at(957).as<int*>() = 1; // disable vehicle node distance check
*scr_globals::freemode_global.at(968).as<int*>() = 1; // disable vehicle node distance check
}
*scr_globals::freemode_global.at(943).as<int*>() = 1; // tell freemode to spawn our vehicle
*scr_globals::freemode_global.at(1003).as<int*>() = 0; // required
*scr_globals::freemode_global.at(1000).as<int*>() = veh_idx;
*scr_globals::freemode_global.at(954).as<int*>() = 1; // tell freemode to spawn our vehicle
*scr_globals::freemode_global.at(1019).as<int*>() = 0; // required
*scr_globals::freemode_global.at(1016).as<int*>() = veh_idx;
script::get_current()->yield(100ms);
@ -186,7 +186,7 @@ namespace big::mobile
}
// blocking call till vehicle is delivered
notify::busy_spinner("Delivering vehicle...", scr_globals::freemode_global.at(1000).as<int*>(), -1);
notify::busy_spinner("Delivering vehicle...", scr_globals::freemode_global.at(1016).as<int*>(), -1);
if (g.clone_pv.spawn_inside)
{
@ -199,7 +199,7 @@ namespace big::mobile
{
inline void request_taxi()
{
*scr_globals::freemode_global.at(868).as<int*>() = 1;
*scr_globals::freemode_global.at(879).as<int*>() = 1;
}
inline void request_gun_van()

View File

@ -57,26 +57,26 @@ namespace big::outfit
// usually each update increases 1//
inline char* get_slot_name_address(int slot)
{
return scr_globals::stats.at(0, 5568).at(681).at(2462).at(slot, 8).as<char*>();
return scr_globals::stats.at(0, 5571).at(681).at(2463).at(slot, 8).as<char*>();
}
inline int* get_component_drawable_id_address(int slot, int id)
{
return scr_globals::stats.at(0, 5568).at(681).at(1338).at(slot, 13).at(id, 1).as<int*>();
return scr_globals::stats.at(0, 5571).at(681).at(1339).at(slot, 13).at(id, 1).as<int*>();
}
inline int* get_component_texture_id_address(int slot, int id)
{
return scr_globals::stats.at(0, 5568).at(681).at(1612).at(slot, 13).at(id, 1).as<int*>();
return scr_globals::stats.at(0, 5571).at(681).at(1613).at(slot, 13).at(id, 1).as<int*>();
}
inline int* get_prop_drawable_id_address(int slot, int id)
{
return scr_globals::stats.at(0, 5568).at(681).at(1886).at(slot, 10).at(id, 1).as<int*>();
return scr_globals::stats.at(0, 5571).at(681).at(1887).at(slot, 10).at(id, 1).as<int*>();
}
inline int* get_prop_texture_id_address(int slot, int id)
{
return scr_globals::stats.at(0, 5568).at(681).at(2097).at(slot, 10).at(id, 1).as<int*>();
return scr_globals::stats.at(0, 5571).at(681).at(2098).at(slot, 10).at(id, 1).as<int*>();
}
}

View File

@ -66,8 +66,8 @@ namespace big::session
{
int idx = index / 32;
int bit = index % 32;
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(389).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(379).at(idx, 1).as<int*>(), bit);
misc::set_bit(scr_globals::gsbd_fm_events.at(11).at(370).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);
}
@ -75,8 +75,8 @@ namespace big::session
{
int idx = index / 32;
int bit = index % 32;
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(389).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(379).at(idx, 1).as<int*>(), bit);
misc::clear_bit(scr_globals::gsbd_fm_events.at(11).at(370).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);
}

View File

@ -182,69 +182,6 @@ namespace big::vehicle
return 0;
}
Vehicle clone_from_vehicle_data(std::map<int, int32_t>& data, Vector3 location, float heading)
{
Vector3 tmpLocation = {location.x, location.y, 1200.0f};
if (location.z > 1000.0f && location.z < 1400.0)
{
tmpLocation.z = 800.0f;
}
// vehicle data
for (const auto& [idx, val] : data)
{
if (idx >= 0 && idx < 142)
{
*scr_globals::spawn_global.at(27).at(idx).as<int32_t*>() = val;
}
}
// permission fix
*scr_globals::spawn_global.at(27).at(1).as<int32_t*>() = 0;
// personal car flag
*scr_globals::spawn_global.at(27).at(94).as<int32_t*>() = 14;
*scr_globals::spawn_global.at(27).at(95).as<int32_t*>() = 2;
// mmi
*scr_globals::spawn_global.at(27).at(103).as<int32_t*>() = 0;
// spawn location
*scr_globals::spawn_global.at(7).at(0).as<float*>() = tmpLocation.x;
*scr_globals::spawn_global.at(7).at(1).as<float*>() = tmpLocation.y;
*scr_globals::spawn_global.at(7).at(2).as<float*>() = tmpLocation.z;
// spawn non pegasus
*scr_globals::spawn_global.at(3).as<int*>() = 0;
// spawn signal
int* spawn_signal = scr_globals::spawn_global.at(2).as<int32_t*>();
*scr_globals::spawn_global.at(5).as<int32_t*>() = 1;
*spawn_signal = 1;
// wait until the vehicle is spawned
for (size_t retry = 0; *spawn_signal != 0 && retry < 200; retry++)
{
script::get_current()->yield(10ms);
}
if (*spawn_signal == 1)
{
return 0;
}
auto veh = get_closest_to_location(tmpLocation, 200);
if (veh == 0)
{
return 0;
}
ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, 0);
ENTITY::SET_ENTITY_HEADING(veh, heading);
return veh;
}
std::map<int, int32_t> get_owned_mods_from_vehicle_idx(script_global vehicle_idx)
{
std::map<int, int32_t> owned_mods;
@ -257,7 +194,7 @@ namespace big::vehicle
int32_t val_32 = *vehicle_idx.at(32).as<int32_t*>();
int32_t val_77 = *vehicle_idx.at(77).as<int32_t*>();
int32_t val_102 = *vehicle_idx.at(102).as<int32_t*>();
int32_t val_103 = *vehicle_idx.at(103).as<int32_t*>();
int32_t val_103 = *vehicle_idx.at(104).as<int32_t*>();
owned_mods[MOD_MODEL_HASH] = *vehicle_idx.at(66).as<int32_t*>();

View File

@ -28,7 +28,6 @@ namespace big::vehicle
void repair_engine_from_water(Vehicle veh);
bool repair(Vehicle veh);
Vehicle spawn(Hash hash, Vector3 location, float heading, bool is_networked = true, bool script_veh = false);
Vehicle clone_from_vehicle_data(std::map<int, int32_t>& data, Vector3 location, float heading);
std::map<int, int32_t> get_owned_mods_from_vehicle_idx(script_global vehicle_idx);
Vehicle clone_from_owned_mods(std::map<int, int32_t> owned_mods, Vector3 location, float heading, bool is_networked = true, bool is_script_vehicle = false);
std::map<int, int32_t> get_owned_mods_from_vehicle(Vehicle vehicle);

View File

@ -174,10 +174,6 @@ namespace big
ImGui::EndDisabled();
ImGui::Checkbox("Auto Kick Host", &g.session.kick_host_when_forcing_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Kicks the host every few minutes until you become host to avoid being kicked");
ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_SCRIPT_HOST_DESC"_T.data());

View File

@ -13,6 +13,8 @@ namespace big
components::player_command_button<"hostkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battlekick">(g_player_service->get_selected());
ImGui::EndDisabled();
components::player_command_button<"smartkick">(g_player_service->get_selected());
@ -24,7 +26,5 @@ namespace big
components::player_command_button<"endkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"desync">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battleupdate">(g_player_service->get_selected());
}
}