From 5747e8d20196e7de49df13d9d28586a6ec0957d2 Mon Sep 17 00:00:00 2001 From: PixieCore <41352111+PixieCore@users.noreply.github.com> Date: Thu, 24 Mar 2022 00:04:33 +0100 Subject: [PATCH] Patch entitlement check from S2C_CONNECT routine. --- r5dev/common/opcodes.cpp | 3 +++ r5dev/common/opcodes.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/r5dev/common/opcodes.cpp b/r5dev/common/opcodes.cpp index f6b022ef..e777e4fb 100644 --- a/r5dev/common/opcodes.cpp +++ b/r5dev/common/opcodes.cpp @@ -302,6 +302,9 @@ void RuntimePtc_Init() /* .TEXT */ p_CAI_NetworkManager__ShouldRebuild.Offset(0xA0).FindPatternSelf("FF ?? ?? ?? 00 00", ADDRESS::Direction::DOWN, 200).Patch({ 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }); // CAL --> NOP | Virtual call to restart when building AIN (which clears the AIN memory). Remove this once writing to file works. Detour_LevelInit.Offset(0x100).FindPatternSelf("74", ADDRESS::Direction::DOWN, 600).Patch({ 0xEB }); // JE --> JMP | Do while loop setting fields to -1 in navmesh is writing out of bounds (!TODO). #endif +#ifndef GAMECLIENTONLY + Server_S2C_CONNECT_1.Offset(0x7).Patch({ 0xEB }); // JZ --> JMP | Prevent entitlement check to kick player from server on S2C_CONNECT Packet if it does not match the servers one. +#endif // !GAMECLIENTONLY } void RuntimePtc_Toggle() /* .TEXT */ diff --git a/r5dev/common/opcodes.h b/r5dev/common/opcodes.h index 2cdf94cc..0a58f478 100644 --- a/r5dev/common/opcodes.h +++ b/r5dev/common/opcodes.h @@ -97,6 +97,13 @@ namespace ADDRESS Detour_LevelInit = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x48\x89\x7C\x24\x00\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x45\x33\xE4", "xxxx?xxxx?xxxx?xxxxxxxxxxxxx????xxx????xxx"); // 0x140EF9100 // 48 89 5C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 55 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 45 33 E4 // + //------------------------------------------------------------------------- + // RUNTIME: S2C_CHALLENGE + //------------------------------------------------------------------------- +#ifndef GAMECLIENTONLY + ADDRESS Server_S2C_CONNECT_1 = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x3B\x05\x00\x00\x00\x00\x74\x0C", "xxx????xx"); +#endif // !GAMECLIENTONLY + //------------------------------------------------------------------------- // .RDATA //-------------------------------------------------------------------------