diff --git a/src/hooking.cpp b/src/hooking.cpp index fa1ee2bf..c4c918c7 100644 --- a/src/hooking.cpp +++ b/src/hooking.cpp @@ -65,7 +65,6 @@ namespace big detour_hook_helper::add("IMCD", g_pointers->m_invalid_mods_crash_detour); detour_hook_helper::add("CAC", g_pointers->m_constraint_attachment_crash); - detour_hook_helper::add("CBDSM", g_pointers->m_crash_bdsm); detour_hook_helper::add("UPAI", g_pointers->m_update_presence_attribute_int); detour_hook_helper::add("UPAS", g_pointers->m_update_presence_attribute_string); diff --git a/src/hooking.hpp b/src/hooking.hpp index 6651dda4..47c1e63d 100644 --- a/src/hooking.hpp +++ b/src/hooking.hpp @@ -99,7 +99,6 @@ namespace big 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 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_string(void* presence_data, int profile_index, char* attr, char* value); diff --git a/src/hooks/protections/crash_bdsm.cpp b/src/hooks/protections/crash_bdsm.cpp deleted file mode 100644 index 2a6697e3..00000000 --- a/src/hooks/protections/crash_bdsm.cpp +++ /dev/null @@ -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()(a1, a2, a3, a4, a5); - } -} \ No newline at end of file diff --git a/src/hooks/protections/received_event.cpp b/src/hooks/protections/received_event.cpp index 38d3afa6..4567d3f9 100644 --- a/src/hooks/protections/received_event.cpp +++ b/src/hooks/protections/received_event.cpp @@ -519,8 +519,10 @@ namespace big buffer->Read(19); // rot z buffer->Read(16); // length int type = buffer->Read(4); + float initial_length = buffer->Read(16); + float min_length = buffer->Read(16); - if (type != 7) + if (type == 0 || initial_length < min_length) // https://docs.fivem.net/natives/?_0xE832D760399EB220 { // most definitely a crash LOG(INFO) << std::hex << std::uppercase << "0x" << id.m_hash; diff --git a/src/pointers.cpp b/src/pointers.cpp index 99a200de..c5c68eeb 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -670,11 +670,6 @@ namespace big m_constraint_attachment_crash = ptr.as(); }); - 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(); - }); - auto mem_region = memory::module("GTA5.exe"); main_batch.run(mem_region); diff --git a/src/pointers.hpp b/src/pointers.hpp index 8a5e5edd..37190b0e 100644 --- a/src/pointers.hpp +++ b/src/pointers.hpp @@ -149,7 +149,6 @@ namespace big PVOID m_invalid_mods_crash_detour{}; PVOID m_constraint_attachment_crash{}; - PVOID m_crash_bdsm{}; int64_t** m_send_chat_ptr{}; functions::send_chat_message m_send_chat_message{};