diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd62afce..3f5ee688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ concurrency: jobs: ci: - runs-on: windows-latest + runs-on: windows-2022 name: CI steps: - uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: arch: amd64 - name: Generate CMake project - run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -S. -Bbuild -G Ninja + run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -D CMAKE_POLICY_VERSION_MINIMUM=3.5 -S. -Bbuild -G Ninja - name: Build 64bit release DLL run: cmake --build ./build --config RelWithDebInfo --target YimMenu -- diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c52b5887..c26f01dc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,7 +29,7 @@ jobs: fi build_nightly: - runs-on: windows-latest + runs-on: windows-2022 name: Build Nightly needs: check_recent_commit if: needs.check_recent_commit.outputs.should_run == 'true' @@ -50,7 +50,7 @@ jobs: arch: amd64 - name: Generate CMake project - run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -S. -Bbuild -G Ninja + run: cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D OPTIMIZE=YES -D CMAKE_POLICY_VERSION_MINIMUM=3.5 -S. -Bbuild -G Ninja - name: Build 64bit release DLL run: cmake --build ./build --config RelWithDebInfo --target YimMenu -- diff --git a/cmake/gtav-classes.cmake b/cmake/gtav-classes.cmake index f1d40d09..f7528cc5 100644 --- a/cmake/gtav-classes.cmake +++ b/cmake/gtav-classes.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( gtav_classes GIT_REPOSITORY https://github.com/Mr-X-GTA/GTAV-Classes-1.git - GIT_TAG 9fa80bd650d37afd70056ec0f0c987cbc62e8a74 + GIT_TAG a8c08f1990347904bd76489efe33e139db94647b GIT_PROGRESS TRUE CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/cmake/json.cmake b/cmake/json.cmake index 014f3e74..50ce24c8 100644 --- a/cmake/json.cmake +++ b/cmake/json.cmake @@ -1,12 +1,9 @@ include(FetchContent) -set(JSON_MultipleHeaders OFF) - FetchContent_Declare( json - GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git - GIT_TAG 67e6070f9d9a44b4dec79ebe6b591f39d2285593 - GIT_PROGRESS TRUE + URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz + DOWNLOAD_EXTRACT_TIMESTAMP TRUE ) -message("json") +option(JSON_MultipleHeaders "Disable nlohmann JSON multi header default." OFF) FetchContent_MakeAvailable(json) diff --git a/cmake/minhook.cmake b/cmake/minhook.cmake index 9ec3790c..234d454b 100644 --- a/cmake/minhook.cmake +++ b/cmake/minhook.cmake @@ -2,8 +2,8 @@ include(FetchContent) FetchContent_Declare( minhook - GIT_REPOSITORY https://github.com/YimMenu/minhook.git - GIT_TAG 902ab63e0a771547961e132ccc0700d62e2a1423 + GIT_REPOSITORY https://github.com/TsudaKageyu/minhook.git + GIT_TAG 2b003bb063d66f016cc1aef7d63951350ce60f35 GIT_PROGRESS TRUE ) message("MinHook") diff --git a/cmake/pugixml.cmake b/cmake/pugixml.cmake index 362a9e1a..154bfe48 100644 --- a/cmake/pugixml.cmake +++ b/cmake/pugixml.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( pugixml GIT_REPOSITORY https://github.com/zeux/pugixml.git - GIT_TAG a0e064336317c9347a91224112af9933598714e9 + GIT_TAG 27b68329de32cf9c601ca8eb6c588fd639960c40 GIT_PROGRESS TRUE ) message("pugixml") diff --git a/src/backend/commands/player/misc/enter_interior.cpp b/src/backend/commands/player/misc/enter_interior.cpp index 4df7f04a..d2bcc75b 100644 --- a/src/backend/commands/player/misc/enter_interior.cpp +++ b/src/backend/commands/player/misc/enter_interior.cpp @@ -32,11 +32,11 @@ namespace big } else if (scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Index != eSimpleInteriorIndex::SIMPLE_INTERIOR_INVALID) { - *scr_globals::interiors.at(3891).as() = + *scr_globals::interiors.at(3892).as() = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Owner; - *scr_globals::interiors.at(4248).as() = + *scr_globals::interiors.at(4249).as() = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.Index; - *scr_globals::interiors.at(4247).as() = true; + *scr_globals::interiors.at(4248).as() = true; scr_globals::globalplayer_bd.as()->Entries[self::id].SimpleInteriorData.InteriorSubtype = scr_globals::globalplayer_bd.as()->Entries[id].SimpleInteriorData.InteriorSubtype; } diff --git a/src/core/data/all_script_names.hpp b/src/core/data/all_script_names.hpp index 773c09ff..5506c705 100644 --- a/src/core/data/all_script_names.hpp +++ b/src/core/data/all_script_names.hpp @@ -226,6 +226,11 @@ namespace big "fm_content_survival_grouping"_J, "fm_content_valentine_cheater"_J, "fm_content_survival"_J, + "fm_content_kortz_scoping"_J, + "fm_content_kortz_entry"_J, + "fm_content_kortz_equipment"_J, + "fm_content_kortz_disruption"_J, + "fm_content_kortz_task"_J, "AM_BOAT_TAXI"_J, "AM_HELI_TAXI"_J, "fm_hold_up_tut"_J, @@ -401,6 +406,7 @@ namespace big "am_mp_island", "am_mp_juggalo_hideout", "am_mp_mansion", + "am_mp_mansion_art_workshop", "am_mp_mansion_driveway", "am_mp_mansion_garage", "am_mp_multistorey_garage", @@ -712,6 +718,7 @@ namespace big "flow_help", "flyunderbridges", "fmmc_contentquicklauncher", + "fmmc_lasers", "fmmc_launcher", "fmmc_playlist_controller", "fm_bj_race_controler", @@ -768,6 +775,11 @@ namespace big "fm_content_hsw_time_trial", "fm_content_island_dj", "fm_content_island_heist", + "fm_content_kortz_disruption", + "fm_content_kortz_entry", + "fm_content_kortz_equipment", + "fm_content_kortz_scoping", + "fm_content_kortz_task", "fm_content_metal_detector", "fm_content_movie_props", "fm_content_mp_intro", @@ -827,6 +839,7 @@ namespace big "fm_main_menu", "fm_mission_controller", "fm_mission_controller_2020", + "fm_mission_controller_v3", "fm_mission_creator", "fm_race_controler", "fm_race_creator", @@ -991,6 +1004,7 @@ namespace big "josh4", "juggalo_hideout_carmod", "juggalo_hideout_seating", + "kortz_planning", "lamar1", "landing_pre_startup", "laptop_trigger", @@ -1040,6 +1054,7 @@ namespace big "maintransition", "main_install", "main_persistent", + "mansion_art_workshop_seating", "mansion_basement_seating", "mansion_carmod", "mansion_club_bar", @@ -1093,6 +1108,7 @@ namespace big "mp_registration", "mp_save_game_global_block", "mp_skycam_stuck_wiggler", + "mp_strand_f9", "mp_unlocks", "mp_weapons", "mrsphilips1", diff --git a/src/core/data/stack_sizes.hpp b/src/core/data/stack_sizes.hpp index 11ce5e63..b2b3d39c 100644 --- a/src/core/data/stack_sizes.hpp +++ b/src/core/data/stack_sizes.hpp @@ -29,7 +29,7 @@ namespace big {"INGAMEHUD", 4600}, {"TRANSITION", 8032}, {"FMMC_LAUNCHER", 28000}, - {"MULTIPLAYER_FREEMODE", 89500}, + {"MULTIPLAYER_FREEMODE", 92500}, {"MISSION", 64500}, {"MP_LAUNCH_SCRIPT", 35250}, }; diff --git a/src/core/scr_globals.hpp b/src/core/scr_globals.hpp index 85c69750..688fa26d 100644 --- a/src/core/scr_globals.hpp +++ b/src/core/scr_globals.hpp @@ -4,101 +4,101 @@ namespace big::scr_globals { - static inline const script_global gsbd(2649159); - static inline const script_global gsbd_kicking(1877125); - static inline const script_global gsbd_fm_events(1922477); + static inline const script_global gsbd(2649161); + static inline const script_global gsbd_kicking(1877205); + static inline const script_global gsbd_fm_events(1922845); - static inline const script_global globalplayer_bd(2658291); - static inline const script_global gpbd_fm_3(1892653); - static inline const script_global gpbd_fm_1(1845250); - static inline const script_global interiors(1950198); + static inline const script_global globalplayer_bd(2658293); + static inline const script_global gpbd_fm_3(1892925); + static inline const script_global gpbd_fm_1(1845298); + static inline const script_global interiors(1950702); - static inline const script_global launcher_global(2699984); + static inline const script_global launcher_global(2700095); // creator globals usually remain the same after updates static inline const script_global terminate_creator(1574607); // NETWORK::NETWORK_BAIL(1, 0, 0); fm_*_creator - static inline const script_global switch_struct(1574634); + static inline const script_global switch_struct(1574635); 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(1575018); - static inline const script_global sctv_spectator(2698539); // pausemenu_multiplayer function 0xE49C42EC + static inline const script_global transition_state(1575022); + static inline const script_global sctv_spectator(2698647); // pausemenu_multiplayer function 0xE49C42EC - static inline const script_global vehicle_global(1583765); + static inline const script_global vehicle_global(1583771); - static inline const script_global freemode_properties(2673271); - static inline const script_global freemode_global(2733002); + static inline const script_global freemode_properties(2673273); + static inline const script_global freemode_global(2733190); - static inline const script_global spawn_global(2697006); + static inline const script_global spawn_global(2697114); - static inline const script_global transaction_overlimit(4516902); + static inline const script_global transaction_overlimit(4516981); static inline const script_global stats(2359296); static inline const script_global session(1574589); - static inline const script_global session2(1575042); - static inline const script_global session3(33776); - static inline const script_global session4(1574943); - static inline const script_global session5(1575017); - static inline const script_global session6(2696922); // freemode -> if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !NETWORK::NETWORK_IS_ACTIVITY_SESSION()) + static inline const script_global session2(1575046); + static inline const script_global session3(33816); + static inline const script_global session4(1574944); + static inline const script_global session5(1575021); + static inline const script_global session6(2697030); // freemode -> if (NETWORK::NETWORK_IS_GAME_IN_PROGRESS() && !NETWORK::NETWORK_IS_ACTIVITY_SESSION()) - static inline const script_global interaction_menu_access(2712075); // am_pi_menu -> if (NETWORK::NETWORK_IS_SIGNED_ONLINE()) first global after that + static inline const script_global interaction_menu_access(2712187); // am_pi_menu -> if (NETWORK::NETWORK_IS_SIGNED_ONLINE()) first global after that - static inline const script_global disable_wasted_sound(2708893); // freemode -> AUDIO::PLAY_SOUND_FRONTEND(-1, "Wasted", "POWER_PLAY_General_Soundset", true); + static inline const script_global disable_wasted_sound(2709004); // 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(1944263); + static inline const script_global property_garage(1944657); static inline const script_global property_names(1312440); - static inline const script_global reset_clothing(105008); // freemode 75, &iLocal_.*, 2\); + static inline const script_global reset_clothing(105065); // freemode 75, &iLocal_.*, 2\); - static inline const script_global gun_van(1956819); // return -29.532f, 6435.136f, 31.162f; + static inline const script_global gun_van(1957326); // return -29.532f, 6435.136f, 31.162f; - static inline const script_global disable_phone(21593); + static inline const script_global disable_phone(21632); - static inline const script_global should_reset_fm_weapons(1576473); + static inline const script_global should_reset_fm_weapons(1576478); } namespace big::scr_locals { namespace am_hunt_the_beast { - constexpr static auto broadcast_idx = 626; // (bParam0) != 0; - constexpr static auto player_broadcast_idx = 2610; // if (NETWORK::PARTICIPANT_ID_TO_INT() != -1) + constexpr static auto broadcast_idx = 633; // (bParam0) != 0; + constexpr static auto player_broadcast_idx = 2617; // if (NETWORK::PARTICIPANT_ID_TO_INT() != -1) } namespace am_criminal_damage { - constexpr static auto broadcast_idx = 121; // /* Tunable: CRIMINAL_DAMAGE_DISABLE_SHARE_CASH */) - constexpr static auto score_idx = 116; // AUDIO::PLAY_SOUND_FRONTEND(-1, "Criminal_Damage_High_Value", "GTAO_FM_Events_Soundset", false); + constexpr static auto broadcast_idx = 144; // /* Tunable: CRIMINAL_DAMAGE_DISABLE_SHARE_CASH */) + constexpr static auto score_idx = 139; // AUDIO::PLAY_SOUND_FRONTEND(-1, "Criminal_Damage_High_Value", "GTAO_FM_Events_Soundset", false); } namespace am_cp_collection { - constexpr static auto broadcast_idx = 826; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0)); - constexpr static auto player_broadcast_idx = 3467; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0)); + constexpr static auto broadcast_idx = 849; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0)); + constexpr static auto player_broadcast_idx = 3490; // bVar1 = NETWORK::NETWORK_GET_PLAYER_INDEX(PLAYER::INT_TO_PARTICIPANTINDEX(iVar0)); } namespace am_king_of_the_castle { - constexpr static auto broadcast_idx = 104; // KING_OF_THE_CASTLE_EVENT_TIME_LIMIT + constexpr static auto broadcast_idx = 127; // KING_OF_THE_CASTLE_EVENT_TIME_LIMIT } namespace fmmc_launcher { - constexpr static auto broadcast_idx = 12888; // if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(PLAYER::INT_TO_PLAYERINDEX(Global_ + constexpr static auto broadcast_idx = 12988; // if (NETWORK::NETWORK_IS_PLAYER_ACTIVE(PLAYER::INT_TO_PLAYERINDEX(Global_ } namespace fm_mission_controller { - constexpr static auto mission_controller_wanted_state_flags = 60898; // if (PLAYER::GET_PLAYER_WANTED_LEVEL(bLocal_ + constexpr static auto mission_controller_wanted_state_flags = 61913; // 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(19547); + inline static script_local mobile(19586); } } diff --git a/src/hooking/call_hook.cpp b/src/hooking/call_hook.cpp index e1a9805d..698a2373 100644 --- a/src/hooking/call_hook.cpp +++ b/src/hooking/call_hook.cpp @@ -9,10 +9,26 @@ namespace namespace big { - call_hook_memory::call_hook_memory() - { - m_memory = VirtualAlloc((void*)((uintptr_t)GetModuleHandle(0) + 0x40000000), 1024, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); - m_offset = 0; + call_hook_memory::call_hook_memory() : + m_memory(nullptr), + m_offset(0) + { + uint8_t* base = static_cast(static_cast(GetModuleHandle(0))); + uint8_t* limit = base + INT32_MAX - 1024; + + for (uint8_t* addr = base; addr < limit; addr += 0x10000) + { + if (m_memory = VirtualAlloc(addr, 1024, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE)) + { + LOGF(VERBOSE, "Allocated call hook memory at {}. Base: {}.", m_memory.as(), static_cast(base)); + break; + } + } + + if (!m_memory) + { + LOG(FATAL) << "Failed to allocate call hook memory!"; + } } call_hook_memory::~call_hook_memory() diff --git a/src/hooking/hooking.hpp b/src/hooking/hooking.hpp index 8bbaeefc..4b4615cc 100644 --- a/src/hooking/hooking.hpp +++ b/src/hooking/hooking.hpp @@ -138,7 +138,7 @@ namespace big static int nt_query_virtual_memory(void* _this, HANDLE handle, PVOID base_addr, int info_class, MEMORY_BASIC_INFORMATION* info, int size, size_t* return_len); static int queue_dependency(void* a1, int a2, int64_t dependency); - static bool prepare_metric_for_sending(rage::json_serializer* bit_buffer, int unk, int time, rage::rlMetric* metric); + static bool prepare_metric_for_sending(rage::json_serializer* bit_buffer, bool* failed, char* unk, uint64_t time, rage::rlMetric* metric); static bool http_start_request(void* request, const char* uri); static bool received_array_update(rage::netArrayHandlerBase* array, CNetGamePlayer* sender, rage::datBitBuffer* buffer, int size, int16_t cycle); diff --git a/src/hooks/info/prepare_metric_for_sending.cpp b/src/hooks/info/prepare_metric_for_sending.cpp index 82f560e3..e97660c7 100644 --- a/src/hooks/info/prepare_metric_for_sending.cpp +++ b/src/hooks/info/prepare_metric_for_sending.cpp @@ -86,7 +86,7 @@ namespace big return result; } - bool hooks::prepare_metric_for_sending(rage::json_serializer* serializer, int unk, int time, rage::rlMetric* metric) + bool hooks::prepare_metric_for_sending(rage::json_serializer* serializer, bool* failed, char* unk, uint64_t time, rage::rlMetric* metric) { char metric_json_buffer [256] {}; rage::json_serializer yim_serializer(metric_json_buffer, sizeof(metric_json_buffer)); @@ -117,7 +117,7 @@ namespace big if (result.size() != data.size()) LOG(INFO) << "Removed YimMenu DLL from MM metric"; strncpy(reinterpret_cast(metric) + 0x18, result.c_str(), 0x900); - return g_hooking->get_original()(serializer, unk, time, metric); + return g_hooking->get_original()(serializer, failed, unk, time, metric); } return true; } @@ -131,6 +131,6 @@ namespace big if (g.debug.block_all_metrics) [[unlikely]] return true; else - return g_hooking->get_original()(serializer, unk, time, metric); + return g_hooking->get_original()(serializer, failed, unk, time, metric); } } diff --git a/src/invoker/invoker.hpp b/src/invoker/invoker.hpp index 128aeb43..ee708f9f 100644 --- a/src/invoker/invoker.hpp +++ b/src/invoker/invoker.hpp @@ -36,7 +36,6 @@ namespace big constexpr void end_call() { // TODO: try to get rid of this - [[assume((cache_handlers(), m_are_handlers_cached == true))]] if (!m_are_handlers_cached) [[unlikely]] cache_handlers(); @@ -64,7 +63,6 @@ namespace big static rage::scrNativeHandler* get_handlers() { - [[assume((cache_handlers(), m_are_handlers_cached == true))]] if (!m_are_handlers_cached) [[unlikely]] cache_handlers(); diff --git a/src/main.cpp b/src/main.cpp index 7cab9eae..469daa79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,8 @@ #include "util/is_proton.hpp" #include "version.hpp" +#include + namespace big { std::string ReadRegistryKeySZ(HKEY hKeyParent, std::string subkey, std::string valueName) @@ -90,6 +92,29 @@ namespace big GlobalFree(UTF16); return UTF8; } + + HMODULE CheckForFSL() + { + HMODULE modules[1024]; + DWORD needed; + + if (!EnumProcessModules(GetCurrentProcess(), modules, sizeof(modules), &needed)) + { + return nullptr; + } + + size_t count = needed / sizeof(HMODULE); + + for (size_t i = 0; i < count; ++i) + { + if (GetProcAddress(modules[i], "LawnchairGetVersion")) + { + return modules[i]; + } + } + + return nullptr; + } } BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) @@ -146,12 +171,19 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) if (!*g_pointers->m_gta.m_anticheat_initialized_hash) { *g_pointers->m_gta.m_anticheat_initialized_hash = new rage::Obf32; // this doesn't get freed so we don't have to use the game allocator - (*g_pointers->m_gta.m_anticheat_initialized_hash)->setData(0x124EA49D); - } - else - { - (*g_pointers->m_gta.m_anticheat_initialized_hash)->setData(0x124EA49D); } + (*g_pointers->m_gta.m_anticheat_initialized_hash)->setData(0x124EA49D); + + if (HMODULE FSL = CheckForFSL()) + { + LOGF(INFO, "FSL Version: {}", reinterpret_cast(GetProcAddress(FSL, "LawnchairGetVersion"))()); + LOGF(INFO, "FSL Local Saves: {}", reinterpret_cast(GetProcAddress(FSL, "LawnchairIsProvidingLocalSaves"))() ? "Enabled" : "Disabled"); + LOGF(INFO, "FSL BE Bypass: {}", reinterpret_cast(GetProcAddress(FSL, "LawnchairIsProvidingBattlEyeBypass"))() ? "Enabled" : "Disabled"); + } + else + { + LOGF(FATAL, "YimMenu requires FSL to be loaded. Please get it from UnknownCheats.me"); + } auto byte_patch_manager_instance = std::make_unique(); LOG(INFO) << "Byte Patch Manager initialized."; diff --git a/src/pointers.cpp b/src/pointers.cpp index 3fdd7974..02ce98e1 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -3,7 +3,7 @@ #include "gta_pointers_layout_info.hpp" #include "sc_pointers_layout_info.hpp" -#define GTA_VERSION_TARGET "1.72-3788.0" +#define GTA_VERSION_TARGET "1.73-3889.0" namespace big { @@ -639,7 +639,7 @@ namespace big // Handle Join Request { "HJR", - "48 81 EC E8 03 00 00 4C 8B F1", + "48 81 EC 88 03 00 00 4C 8B F1", [](memory::handle ptr) { g_pointers->m_gta.m_handle_join_request = ptr.sub(0x26).as(); @@ -648,10 +648,10 @@ namespace big // Write Join Response Data { "WJRD", - "E8 ? ? ? ? 84 C0 75 0A 44 89 23", + "48 83 C2 34 4C 8B CB", [](memory::handle ptr) { - g_pointers->m_gta.m_write_join_response_data = ptr.add(1).rip().as(); + g_pointers->m_gta.m_write_join_response_data = ptr.add(8).rip().as(); } }, // Queue Packet @@ -693,10 +693,10 @@ namespace big // Serialize Join Request Message 2 { "SJRM2", - "E8 ? ? ? ? 48 8D 8D E0 01 00 00 8A D8", + "48 8D 8D ? ? ? ? 8A D8 E8 ? ? ? ? 48 8D 4D", [](memory::handle ptr) { - g_pointers->m_gta.m_serialize_join_request_message_2 = ptr.add(1).rip().as(); + g_pointers->m_gta.m_serialize_join_request_message_2 = ptr.sub(4).rip().as(); } }, // Send Network Damage @@ -927,7 +927,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 F0 4C", + "48 89 5C 24 08 48 89 6C 24 18 56 57 41 56 48 83 EC 20 4D 8B F1 49 8B D8", [](memory::handle ptr) { g_pointers->m_gta.m_prepare_metric_for_sending = ptr.as(); @@ -1762,10 +1762,10 @@ namespace big // Session Request Patch { "SRP", - "41 38 9E 98 B7 00 00 0F 85 6A FE FF FF", + "83 F8 01 0F 97 44 24", [](memory::handle ptr) { - g_pointers->m_gta.m_session_request_patch = ptr.add(0x14).as(); + g_pointers->m_gta.m_session_request_patch = ptr.add(8).as(); } }, // Get Peer By Security Id @@ -1956,10 +1956,10 @@ namespace big // Anticheat Context { "AC", - "69 C9 FD 43 03 00 8B D0", + "89 42 48 89 4A 4C 48 8B 1D", [](memory::handle ptr) { - g_pointers->m_gta.m_anticheat_context = ptr.sub(4).rip().as(); + g_pointers->m_gta.m_anticheat_context = ptr.add(9).rip().as(); } }, // Game Skeleton Update diff --git a/src/services/matchmaking/matchmaking_service.cpp b/src/services/matchmaking/matchmaking_service.cpp index 67f846e9..31aeba1f 100644 --- a/src/services/matchmaking/matchmaking_service.cpp +++ b/src/services/matchmaking/matchmaking_service.cpp @@ -122,23 +122,22 @@ namespace big if (g.session_browser.sort_method != 0) { - std::qsort(m_found_sessions, m_num_sessions_found, sizeof(session), [](const void* a1, const void* a2) -> int { - std::strong_ordering result; + std::sort(m_found_sessions, m_found_sessions + m_num_sessions_found, [](const session& a1, const session& a2) { + std::strong_ordering result = std::strong_ordering::equal; if (g.session_browser.sort_method == 1) { - result = (((session*)(a1))->attributes.player_count <=> ((session*)(a2))->attributes.player_count); + result = a1.attributes.player_count <=> a2.attributes.player_count; } if (result == 0) - return 0; + return false; if (result > 0) - return g.session_browser.sort_direction ? -1 : 1; + return g.session_browser.sort_direction ? true : false; if (result < 0) - return g.session_browser.sort_direction ? 1 : -1; - + return g.session_browser.sort_direction ? false : true; std::unreachable(); }); diff --git a/src/services/mobile/mobile_service.cpp b/src/services/mobile/mobile_service.cpp index 72328717..d05b926c 100644 --- a/src/services/mobile/mobile_service.cpp +++ b/src/services/mobile/mobile_service.cpp @@ -167,7 +167,7 @@ namespace big { case 12: //Hangar { - auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 880).at(260).at(304).as(); + auto hangar_id = *scr_globals::gpbd_fm_1.at(self::id, 881).at(260).at(304).as(); switch (hangar_id) { case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_HANGAR_1"); //LSIA Hangar 1 @@ -180,7 +180,7 @@ namespace big } case 13: //Facility { - auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 880).at(260).at(311).as(); + auto facility_id = *scr_globals::gpbd_fm_1.at(self::id, 881).at(260).at(311).as(); switch (facility_id) { case 1: return HUD::GET_FILENAME_FOR_AUDIO_CONVERSATION("MP_DBASE_1"); //Grand Senora Desert Facility