From 6b9c1561e3163b8063e7793e3a9c90dbacb8cffd Mon Sep 17 00:00:00 2001 From: holysnipz <9103583+holysnipz@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:57:28 +0700 Subject: [PATCH] ChaosMod: "Snow" pattern update for build 3095+ (#3700) Tested on builds 2944, 3095 and 3411 --- ChaosMod/Memory/Snow.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ChaosMod/Memory/Snow.h b/ChaosMod/Memory/Snow.h index 5f8ff629d..b559b7c6a 100644 --- a/ChaosMod/Memory/Snow.h +++ b/ChaosMod/Memory/Snow.h @@ -15,7 +15,10 @@ namespace Memory static bool init = false; - static auto handle = FindPattern("80 3D ?? ?? ?? ?? 00 74 25 B9 40 00 00 00"); + static bool isPre3095 = getGameVersion() < eGameVersion::VER_1_0_3095_0; + auto snowPattern1 = isPre3095 ? "80 3D ?? ?? ?? ?? 00 74 25 B9 40 00 00 00" + : "44 38 ?? ?? ?? ?? 01 74 12 B9 40 00 00 00"; + static auto handle = FindPattern(snowPattern1); if (!handle.IsValid()) return; @@ -44,7 +47,7 @@ namespace Memory BYTE *from = reinterpret_cast(addr1); from[0] = 0x48; // mov rax, func from[1] = 0xB8; - *reinterpret_cast(&from[2]) = reinterpret_cast(addr1 + 0x1B); + *reinterpret_cast(&from[2]) = reinterpret_cast(addr1 + (isPre3095 ? 0x1B : 0x20)); from[10] = 0x50; // push rax from[11] = 0xC3; // ret }