This commit is contained in:
Mr-X-GTA 2024-10-20 18:32:24 +02:00
parent 0815f78f9e
commit 6473416b14
10 changed files with 17 additions and 53 deletions

View File

@ -166,10 +166,8 @@ namespace big
functions::get_gamer_online_state m_get_gamer_online_state;
functions::start_get_session_by_gamer_handle m_start_get_session_by_gamer_handle;
#if 0
functions::start_matchmaking_find_sessions m_start_matchmaking_find_sessions;
functions::join_session_by_info m_join_session_by_info;
#endif
functions::invite_player_by_gamer_handle m_invite_player_by_gamer_handle;
functions::add_friend_by_gamer_handle m_add_friend_by_gamer_handle;
@ -423,10 +421,6 @@ namespace big
PVOID m_network_can_access_multiplayer;
uint32_t* m_minority_report;
#if 0
PVOID m_send_clone_create;
#endif
};
#pragma pack(pop)
static_assert(sizeof(gta_pointers) % 8 == 0, "Pointers are not properly aligned");

View File

@ -158,12 +158,8 @@ namespace big
detour_hook_helper::add<hooks::create_pool_item>("CPI", g_pointers->m_gta.m_create_pool_item);
#if 0
detour_hook_helper::add<hooks::network_can_access_multiplayer>("NCAM", g_pointers->m_gta.m_network_can_access_multiplayer);
detour_hook_helper::add<hooks::send_clone_create>("SCC", g_pointers->m_gta.m_send_clone_create);
#endif
g_hooking = this;
}

View File

@ -214,9 +214,7 @@ namespace big
static void* create_pool_item(GenericPool* pool);
static bool network_can_access_multiplayer(void* a1, int* error);
static void send_clone_create(CNetworkObjectMgr* _this, rage::netObject* object, CNetGamePlayer* player, rage::datBitBuffer* buffer);
static uint32_t network_can_access_multiplayer(uint32_t a1, uint64_t* a2);
};
class minhook_keepalive

View File

@ -126,7 +126,6 @@ namespace big
LOG(INFO) << "METRIC: " << metric_name << "; DATA: " << yim_serializer.get_string();
}
return true; //
if (g.debug.block_all_metrics) [[unlikely]]
return true;
else

View File

@ -2,11 +2,11 @@
namespace big
{
bool hooks::network_can_access_multiplayer(void* a1, int* error)
uint32_t hooks::network_can_access_multiplayer(uint32_t a1, uint64_t* a2)
{
if (error)
*error = 0;
if (a2)
*a2 = 0;
return true;
return 0;
}
}

View File

@ -1,17 +0,0 @@
#include "hooking/hooking.hpp"
#include "services/players/player_service.hpp"
#include <network/CNetGamePlayer.hpp>
namespace big
{
void hooks::send_clone_create(CNetworkObjectMgr* _this, rage::netObject* object, CNetGamePlayer* player, rage::datBitBuffer* buffer)
{
if (auto plyr = g_player_service->get_by_id(player->m_player_id); plyr && plyr->bad_host && (eNetObjType)object->m_object_type == eNetObjType::NET_OBJ_TYPE_PLAYER)
{
return;
}
g_hooking->get_original<hooks::send_clone_create>()(_this, object, player, buffer);
}
}

View File

@ -11,9 +11,7 @@ namespace big
{
if (g.session.join_queued)
{
#if 0
g_pointers->m_gta.m_join_session_by_info(*g_pointers->m_gta.m_network, &g.session.info, g.session.join_in_sctv_slots ? 1 : 0, 1 | 2, nullptr, 0);
#endif
g.session.join_queued = false;
src->set_return_value<BOOL>(TRUE);
}

View File

@ -592,16 +592,16 @@ namespace big
g_pointers->m_gta.m_start_matchmaking_find_sessions = ptr.add(6).rip().as<functions::start_matchmaking_find_sessions>();
}
},
#endif
// Join Session By Info
{
"JSBI",
"E8 ? ? ? ? 0F B6 CB 84 C0 41 0F 44 CD",
"89 6C 24 28 4C 89 74 24 20 E8 ? ? ? ? EB 02 32 C0 48 8B 5C 24 40",
[](memory::handle ptr)
{
g_pointers->m_gta.m_join_session_by_info = ptr.add(1).rip().as<functions::join_session_by_info>();
g_pointers->m_gta.m_join_session_by_info = ptr.add(10).rip().as<functions::join_session_by_info>();
}
},
#endif
// Invite Player By Gamer Handle
{
"IPBGH",
@ -1983,10 +1983,10 @@ namespace big
// Network Can Access Multiplayer
{
"NCAM",
"E8 ? ? ? ? 8B 54 24 30 89 13",
"E9 26 01 00 00 33 D2 8B CB",
[](memory::handle ptr)
{
g_pointers->m_gta.m_network_can_access_multiplayer = ptr.add(1).rip().as<PVOID>();
g_pointers->m_gta.m_network_can_access_multiplayer = ptr.add(10).rip().as<PVOID>();
}
},
// Minority Report
@ -1998,17 +1998,6 @@ namespace big
g_pointers->m_gta.m_minority_report = ptr.add(7).rip().as<uint32_t*>();
}
}
#if 0
// Send Clone Create
{
"SCC",
"48 8B 02 4D 8B F8",
[](memory::handle ptr)
{
g_pointers->m_gta.m_send_clone_create = ptr.sub(0x1C).as<PVOID>();
}
}
#endif
>(); // don't leave a trailing comma at the end
// clang-format on
@ -2119,6 +2108,9 @@ 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

@ -69,7 +69,9 @@ namespace big
}
};
#if 0
battleye_server g_battleye_server("battleyeserver", "BATTLEYE_SERVER", "BATTLEYE_SERVER_DESC", g.debug.battleye_server);
#endif
bool battleye_service::is_running()
{

View File

@ -44,6 +44,8 @@ namespace big
bool matchmaking_service::matchmake(std::optional<int> constraint, std::optional<bool> enforce_player_limit)
{
return false; // TODO
for (auto& session : m_found_sessions)
{
session.is_valid = true;