This commit is contained in:
Mr-X-GTA 2025-01-10 09:33:59 +01:00
parent bb6286595f
commit 87c6fcc786
11 changed files with 109 additions and 7 deletions

View File

@ -21,6 +21,9 @@ namespace big
{ {
void bypass_battleye() void bypass_battleye()
{ {
if (g.spoofing.spoof_game_data_hash)
return;
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}; 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) if (auto hashes = *g_pointers->m_gta.m_game_data_hash)

View File

@ -27,11 +27,55 @@ namespace big
msg.write<KickReason>(KickReason::BATTLEYE_KICK, 5); msg.write<KickReason>(KickReason::BATTLEYE_KICK, 5);
msg.write<int>(0, 32); msg.write<int>(0, 32);
msg.write<bool>(false, 1); msg.write<bool>(false, 1);
auto msg_id = player->get_session_player()->m_msg_id; auto msg_id = player->get_session_player()->m_msg_id;
msg.send(msg_id); msg.send(msg_id);
} }
}; };
battleye_kick g_battleye_kick("battlekick", "BATTLEYE_KICK", "BATTLEYE_KICK_DESC", 0); class battleye_ban : player_command
{
using player_command::player_command;
virtual CommandAccessLevel get_access_level() override
{
return CommandAccessLevel::TOXIC;
}
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
{
packet msg{};
msg.write_message(rage::eNetMessage::MsgKickPlayer);
msg.write<KickReason>(KickReason::BATTLEYE_BAN, 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);
}
};
class battleye_update_kick : player_command
{
using player_command::player_command;
virtual CommandAccessLevel get_access_level() override
{
return CommandAccessLevel::TOXIC;
}
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));
}
}
};
battleye_kick g_battleye_kick("battlekick", "BATTLEYE_KICK", "BATTLEYE_KICK_DESC", 0);
battleye_ban g_battleye_ban("battleban", "BATTLEYE_FAKE_BAN", "BATTLEYE_FAKE_BAN_DESC", 0);
battleye_update_kick g_battleye_update_kick("battleupdate", "BATTLEYE_UPDATE_KICK", "BATTLEYE_UPDATE_KICK_DESC", 0);
} }

View File

@ -408,6 +408,9 @@ namespace big
PVOID m_network_can_access_multiplayer; PVOID m_network_can_access_multiplayer;
PVOID m_be_network_bail_patch; PVOID m_be_network_bail_patch;
PVOID m_add_skeleton_extension;
int* m_skeleton_extension_count;
}; };
#pragma pack(pop) #pragma pack(pop)
static_assert(sizeof(gta_pointers) % 8 == 0, "Pointers are not properly aligned"); static_assert(sizeof(gta_pointers) % 8 == 0, "Pointers are not properly aligned");

View File

@ -157,6 +157,8 @@ namespace big
detour_hook_helper::add<hooks::network_can_access_multiplayer>("NCAM", g_pointers->m_gta.m_network_can_access_multiplayer); detour_hook_helper::add<hooks::network_can_access_multiplayer>("NCAM", g_pointers->m_gta.m_network_can_access_multiplayer);
detour_hook_helper::add<hooks::add_skeleton_extension>("ASE", g_pointers->m_gta.m_add_skeleton_extension);
g_hooking = this; g_hooking = this;
} }

View File

@ -212,6 +212,8 @@ namespace big
static void* create_pool_item(GenericPool* pool); static void* create_pool_item(GenericPool* pool);
static uint32_t network_can_access_multiplayer(uint32_t a1, uint64_t* a2); static uint32_t network_can_access_multiplayer(uint32_t a1, uint64_t* a2);
static void* add_skeleton_extension(rage::fwEntity* entity);
}; };
class minhook_keepalive class minhook_keepalive

View File

@ -0,0 +1,15 @@
#include "hooking/hooking.hpp"
#include "pointers.hpp"
namespace big
{
void* hooks::add_skeleton_extension(rage::fwEntity* entity)
{
if (*g_pointers->m_gta.m_skeleton_extension_count >= 32) [[unlikely]]
{
return nullptr;
}
return g_hooking->get_original<hooks::add_skeleton_extension>()(entity);
}
}

View File

@ -267,7 +267,7 @@ namespace big
return false; return false;
} }
void scan_explosion_event(CNetGamePlayer* player, rage::datBitBuffer* buffer) bool scan_explosion_event(CNetGamePlayer* player, rage::datBitBuffer* buffer)
{ {
uint16_t f186; uint16_t f186;
uint16_t targetEntity; uint16_t targetEntity;
@ -302,6 +302,8 @@ namespace big
uint32_t f164; uint32_t f164;
uint32_t interiorIndex;
float posX224; float posX224;
float posY224; float posY224;
float posZ224; float posZ224;
@ -345,6 +347,8 @@ namespace big
f191 = buffer->Read<uint8_t>(1); f191 = buffer->Read<uint8_t>(1);
f164 = buffer->Read<uint32_t>(32); f164 = buffer->Read<uint32_t>(32);
interiorIndex = buffer->Read<uint32_t>(32);
if (f242) if (f242)
{ {
posX224 = buffer->ReadSignedFloat(31, 27648.0f); posX224 = buffer->ReadSignedFloat(31, 27648.0f);
@ -358,10 +362,14 @@ namespace big
posZ224 = 0; posZ224 = 0;
} }
auto f168 = buffer->Read<uint32_t>(32);// >= 1868: f_168
f240 = buffer->Read<uint8_t>(1); f240 = buffer->Read<uint8_t>(1);
if (addOwnedExplosion)
{
buffer->Read<uint32_t>(32);
buffer->Read<uint32_t>(32);
}
if (f240) if (f240)
{ {
f218 = buffer->Read<uint16_t>(16); f218 = buffer->Read<uint16_t>(16);
@ -374,6 +382,12 @@ namespace big
buffer->Seek(0); buffer->Seek(0);
if (*(int16_t*)&interiorIndex < -1)
{
notify::crash_blocked(player, "invalid interior");
return true;
}
auto object = g_pointers->m_gta.m_get_net_object(*g_pointers->m_gta.m_network_object_mgr, ownerNetId, true); auto object = g_pointers->m_gta.m_get_net_object(*g_pointers->m_gta.m_network_object_mgr, ownerNetId, true);
auto entity = object ? object->GetGameObject() : nullptr; auto entity = object ? object->GetGameObject() : nullptr;
@ -391,7 +405,7 @@ namespace big
reinterpret_cast<CPed*>(entity)->m_player_info->m_net_player_data.m_name))); reinterpret_cast<CPed*>(entity)->m_player_info->m_net_player_data.m_name)));
session::add_infraction(g_player_service->get_by_id(player->m_player_id), Infraction::BLAME_EXPLOSION_DETECTED); session::add_infraction(g_player_service->get_by_id(player->m_player_id), Infraction::BLAME_EXPLOSION_DETECTED);
LOGF(stream::net_events, WARNING, "{} sent an EXPLOSION_EVENT with addOwnedExplosion enabled and with the wrong owner", player->get_name()); LOGF(stream::net_events, WARNING, "{} sent an EXPLOSION_EVENT with addOwnedExplosion enabled and with the wrong owner", player->get_name());
return; return true;
} }
if (g.session.explosion_karma && g_local_player if (g.session.explosion_karma && g_local_player
@ -403,6 +417,7 @@ namespace big
}); });
} }
return false;
// clang-format on // clang-format on
} }

View File

@ -440,7 +440,7 @@ namespace big
} }
case eRemoteEvent::StartScriptBegin: case eRemoteEvent::StartScriptBegin:
{ {
auto script_id = args[3]; int script_id = args[3];
if (!protection::should_allow_script_launch(script_id)) if (!protection::should_allow_script_launch(script_id))
{ {

View File

@ -1914,6 +1914,17 @@ namespace big
{ {
g_pointers->m_gta.m_be_network_bail_patch = ptr.add(17).rip().add(1).rip().as<PVOID>(); g_pointers->m_gta.m_be_network_bail_patch = ptr.add(17).rip().add(1).rip().as<PVOID>();
} }
},
// Add Skeleton Extension
{
"ASE",
"E8 ? ? ? ? 48 89 44 24 ? 48 85 C0 0F 84 ? ? ? ? 0F 28 05",
[](memory::handle ptr)
{
ptr = ptr.rip();
g_pointers->m_gta.m_add_skeleton_extension = ptr.as<PVOID>();
g_pointers->m_gta.m_skeleton_extension_count = ptr.add(0x2C).rip().as<int*>();
}
} }
>(); // don't leave a trailing comma at the end >(); // don't leave a trailing comma at the end

View File

@ -429,6 +429,9 @@ namespace big
const auto name = item.child("Name").text().as_string(); const auto name = item.child("Name").text().as_string();
const auto hash = rage::joaat(name); const auto hash = rage::joaat(name);
if (hash == "WEAPON_STRICKLER"_J) // Gen9 exclusive
continue;
if (hash == "WEAPON_BIRD_CRAP"_J) if (hash == "WEAPON_BIRD_CRAP"_J)
continue; continue;

View File

@ -15,6 +15,10 @@ namespace big
components::player_command_button<"breakup">(g_player_service->get_selected()); components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine(); ImGui::SameLine();
components::player_command_button<"battlekick">(g_player_service->get_selected()); components::player_command_button<"battlekick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battleban">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battleupdate">(g_player_service->get_selected());
ImGui::EndDisabled(); ImGui::EndDisabled();
components::player_command_button<"smartkick">(g_player_service->get_selected()); components::player_command_button<"smartkick">(g_player_service->get_selected());