feat(session): disable sent chat messages being filtered (#525)

This commit is contained in:
FireFox101889 2022-10-26 15:38:01 -04:00 committed by GitHub
parent 1549f157a6
commit dd6e9450fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 0 deletions

View File

@ -175,6 +175,7 @@ namespace big
} custom_time;
bool join_queued = false;
rage::rlSessionInfo info;
bool disable_chat_filter = false;
};
struct settings {

View File

@ -14,6 +14,8 @@ namespace big::functions
using ptr_to_handle = Entity(*)(void* entity);
using get_script_handle_t = uint64_t(*)(int64_t);
using multiplayer_chat_filter = int(__int64 chat_type, const char* input, const char** output);
using get_gameplay_cam_coords = Vector3(*)();

View File

@ -25,6 +25,9 @@ namespace big
// Get Label Text
m_get_label_text("GLT", g_pointers->m_get_label_text, &hooks::get_label_text),
// Multiplayer chat filter
m_multiplayer_chat_filter("MCF", g_pointers->m_multiplayer_chat_filter, &hooks::multiplayer_chat_filter),
// GTA Thead Start
m_gta_thread_start_hook("GTS", g_pointers->m_gta_thread_start, &hooks::gta_thread_start),
@ -79,6 +82,7 @@ namespace big
m_run_script_threads_hook.enable();
m_get_label_text.enable();
m_multiplayer_chat_filter.enable();
m_gta_thread_start_hook.enable();
m_gta_thread_kill_hook.enable();
m_network_group_override.enable();
@ -115,6 +119,7 @@ namespace big
m_network_group_override.disable();
m_gta_thread_kill_hook.disable();
m_gta_thread_start_hook.disable();
m_multiplayer_chat_filter.disable();
m_get_label_text.disable();
m_run_script_threads_hook.disable();

View File

@ -26,6 +26,7 @@ namespace big
static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
static const char* get_label_text(void* unk, const char* label);
static int multiplayer_chat_filter(__int64 chat_type, const char* input, const char** output);
static GtaThread* gta_thread_start(unsigned int** a1, unsigned int a2);
static rage::eThreadState gta_thread_kill(GtaThread* thread);
@ -98,6 +99,7 @@ namespace big
detour_hook m_run_script_threads_hook;
detour_hook m_get_label_text;
detour_hook m_multiplayer_chat_filter;
detour_hook m_gta_thread_start_hook;
detour_hook m_gta_thread_kill_hook;

View File

@ -0,0 +1,13 @@
#include "hooking.hpp"
namespace big
{
int hooks::multiplayer_chat_filter(__int64 chat_type, const char* input, const char** output)
{
if (g->session.disable_chat_filter)
{
return -1;
}
return g_hooking->m_multiplayer_chat_filter.get_original<decltype(&hooks::multiplayer_chat_filter)>()(chat_type, input, output);
}
}

View File

@ -328,6 +328,12 @@ namespace big
{
m_get_label_text = ptr.sub(19).as<PVOID>();
});
// Multiplayer chat filter
main_batch.add("MCF", "E8 ? ? ? ? 83 F8 FF 75 B9", [this](memory::handle ptr)
{
m_multiplayer_chat_filter = ptr.add(1).rip().as<decltype(m_multiplayer_chat_filter)>();
});
// Network
main_batch.add("N", "48 8B 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 84 C0 75 17 48 8B 0D ? ? ? ? 48 8B D7", [this](memory::handle ptr)

View File

@ -50,6 +50,7 @@ namespace big
PVOID m_native_return;
PVOID m_network_group_override;
PVOID m_get_label_text;
functions::multiplayer_chat_filter* m_multiplayer_chat_filter{};
FriendRegistry* m_friend_registry{};

View File

@ -25,5 +25,11 @@ namespace big
}
ImGui::EndListBox();
}
if (ImGui::TreeNode("Chat"))
{
ImGui::Checkbox("Disable Filter", &g->session.disable_chat_filter);
ImGui::TreePop();
}
}
}