Skip to content

Commit

Permalink
ChaosMod: "Snow" pattern update for build 3095+ (#3700)
Browse files Browse the repository at this point in the history
Tested on builds 2944, 3095 and 3411
  • Loading branch information
holysnipz authored Jan 23, 2025
1 parent 51b4994 commit 6b9c156
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ChaosMod/Memory/Snow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -44,7 +47,7 @@ namespace Memory
BYTE *from = reinterpret_cast<BYTE *>(addr1);
from[0] = 0x48; // mov rax, func
from[1] = 0xB8;
*reinterpret_cast<BYTE **>(&from[2]) = reinterpret_cast<BYTE *>(addr1 + 0x1B);
*reinterpret_cast<BYTE **>(&from[2]) = reinterpret_cast<BYTE *>(addr1 + (isPre3095 ? 0x1B : 0x20));
from[10] = 0x50; // push rax
from[11] = 0xC3; // ret
}
Expand Down

0 comments on commit 6b9c156

Please sign in to comment.