From c5c37131376899c28e3d9ce8fbf13549d6f16278 Mon Sep 17 00:00:00 2001 From: yubie <24496817+yubie-re@users.noreply.github.com> Date: Sat, 2 Dec 2023 11:31:09 -0500 Subject: [PATCH] fix(anticheat): Fix AC bypass not working when injecting too early (#2473) --- src/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7787f039..408c7083 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,8 +39,9 @@ namespace big { - void disable_anticheat_skeleton() + bool disable_anticheat_skeleton() { + bool patched = false; for (rage::game_skeleton_update_mode* mode = g_pointers->m_gta.m_game_skeleton->m_update_modes; mode; mode = mode->m_next) { for (rage::game_skeleton_update_base* update_node = mode->m_head; update_node; update_node = update_node->m_next) @@ -54,6 +55,7 @@ namespace big // TamperActions is a leftover from the old AC, but still useful to block anyway if (group_child_node->m_hash != 0xA0F39FB6 && group_child_node->m_hash != RAGE_JOAAT("TamperActions")) continue; + patched = true; //LOG(INFO) << "Patching problematic skeleton update"; reinterpret_cast(group_child_node)->m_function = g_pointers->m_gta.m_nullsub; @@ -66,10 +68,10 @@ namespace big { if (i.m_hash != 0xA0F39FB6 && i.m_hash != RAGE_JOAAT("TamperActions")) continue; - //LOG(INFO) << "Patching problematic skeleton init/shutdown"; i.m_init_func = reinterpret_cast(g_pointers->m_gta.m_nullsub); i.m_shutdown_func = reinterpret_cast(g_pointers->m_gta.m_nullsub); } + return patched; } } @@ -111,7 +113,11 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) auto pointers_instance = std::make_unique(); LOG(INFO) << "Pointers initialized."; - disable_anticheat_skeleton(); + while(!disable_anticheat_skeleton()) + { + LOG(WARNING) << "Failed patching anticheat gameskeleton (injected too early?). Waiting 100ms and trying again"; + std::this_thread::sleep_for(100ms); + } LOG(INFO) << "Disabled anticheat gameskeleton."; auto byte_patch_manager_instance = std::make_unique();