feat(Protections): Improve rope crash protection (#682)
This commit is contained in:
parent
86f1ce747f
commit
ae6704beea
@ -65,7 +65,6 @@ namespace big
|
|||||||
|
|
||||||
detour_hook_helper::add<hooks::invalid_mods_crash_detour>("IMCD", g_pointers->m_invalid_mods_crash_detour);
|
detour_hook_helper::add<hooks::invalid_mods_crash_detour>("IMCD", g_pointers->m_invalid_mods_crash_detour);
|
||||||
detour_hook_helper::add<hooks::constraint_attachment_crash>("CAC", g_pointers->m_constraint_attachment_crash);
|
detour_hook_helper::add<hooks::constraint_attachment_crash>("CAC", g_pointers->m_constraint_attachment_crash);
|
||||||
detour_hook_helper::add<hooks::crash_bdsm>("CBDSM", g_pointers->m_crash_bdsm);
|
|
||||||
|
|
||||||
detour_hook_helper::add<hooks::update_presence_attribute_int>("UPAI", g_pointers->m_update_presence_attribute_int);
|
detour_hook_helper::add<hooks::update_presence_attribute_int>("UPAI", g_pointers->m_update_presence_attribute_int);
|
||||||
detour_hook_helper::add<hooks::update_presence_attribute_string>("UPAS", g_pointers->m_update_presence_attribute_string);
|
detour_hook_helper::add<hooks::update_presence_attribute_string>("UPAS", g_pointers->m_update_presence_attribute_string);
|
||||||
|
@ -99,7 +99,6 @@ namespace big
|
|||||||
|
|
||||||
static void invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4);
|
static void invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4);
|
||||||
static std::int64_t constraint_attachment_crash(std::uintptr_t a1);
|
static std::int64_t constraint_attachment_crash(std::uintptr_t a1);
|
||||||
static std::int64_t crash_bdsm(std::int64_t a1, std::int64_t a2, unsigned int a3, int a4, std::int64_t a5);
|
|
||||||
|
|
||||||
static bool update_presence_attribute_int(void* presence_data, int profile_index, char* attr, std::uint64_t value);
|
static bool update_presence_attribute_int(void* presence_data, int profile_index, char* attr, std::uint64_t value);
|
||||||
static bool update_presence_attribute_string(void* presence_data, int profile_index, char* attr, char* value);
|
static bool update_presence_attribute_string(void* presence_data, int profile_index, char* attr, char* value);
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#include "hooking.hpp"
|
|
||||||
|
|
||||||
namespace big
|
|
||||||
{
|
|
||||||
std::int64_t hooks::crash_bdsm(std::int64_t a1, std::int64_t a2, unsigned int a3, int a4, std::int64_t a5)
|
|
||||||
{
|
|
||||||
if (a3 <= 0)
|
|
||||||
a3 = 1;
|
|
||||||
return g_hooking->get_original<hooks::crash_bdsm>()(a1, a2, a3, a4, a5);
|
|
||||||
}
|
|
||||||
}
|
|
@ -519,8 +519,10 @@ namespace big
|
|||||||
buffer->Read<float>(19); // rot z
|
buffer->Read<float>(19); // rot z
|
||||||
buffer->Read<float>(16); // length
|
buffer->Read<float>(16); // length
|
||||||
int type = buffer->Read<int>(4);
|
int type = buffer->Read<int>(4);
|
||||||
|
float initial_length = buffer->Read<float>(16);
|
||||||
|
float min_length = buffer->Read<float>(16);
|
||||||
|
|
||||||
if (type != 7)
|
if (type == 0 || initial_length < min_length) // https://docs.fivem.net/natives/?_0xE832D760399EB220
|
||||||
{
|
{
|
||||||
// most definitely a crash
|
// most definitely a crash
|
||||||
LOG(INFO) << std::hex << std::uppercase << "0x" << id.m_hash;
|
LOG(INFO) << std::hex << std::uppercase << "0x" << id.m_hash;
|
||||||
|
@ -670,11 +670,6 @@ namespace big
|
|||||||
m_constraint_attachment_crash = ptr.as<PVOID>();
|
m_constraint_attachment_crash = ptr.as<PVOID>();
|
||||||
});
|
});
|
||||||
|
|
||||||
main_batch.add("CBDSM", "E8 ? ? ? ? 48 8B 47 10 4C 8B 8C 24", [this](memory::handle ptr)
|
|
||||||
{
|
|
||||||
m_crash_bdsm = ptr.add(1).rip().as<PVOID>();
|
|
||||||
});
|
|
||||||
|
|
||||||
auto mem_region = memory::module("GTA5.exe");
|
auto mem_region = memory::module("GTA5.exe");
|
||||||
main_batch.run(mem_region);
|
main_batch.run(mem_region);
|
||||||
|
|
||||||
|
@ -149,7 +149,6 @@ namespace big
|
|||||||
|
|
||||||
PVOID m_invalid_mods_crash_detour{};
|
PVOID m_invalid_mods_crash_detour{};
|
||||||
PVOID m_constraint_attachment_crash{};
|
PVOID m_constraint_attachment_crash{};
|
||||||
PVOID m_crash_bdsm{};
|
|
||||||
|
|
||||||
int64_t** m_send_chat_ptr{};
|
int64_t** m_send_chat_ptr{};
|
||||||
functions::send_chat_message m_send_chat_message{};
|
functions::send_chat_message m_send_chat_message{};
|
||||||
|
Reference in New Issue
Block a user