From 08c17788032e258660fee0b4f347ae0a36fdfa56 Mon Sep 17 00:00:00 2001 From: zappatic Date: Tue, 23 Mar 2021 14:00:41 +0100 Subject: [PATCH] use pattern searching instead of plain RVA for reveng'ed functions -> works in 1.20.3.c and 1.20.4a --- injected/src/SeedFinder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/injected/src/SeedFinder.cpp b/injected/src/SeedFinder.cpp index f2eec9b..5d2851c 100644 --- a/injected/src/SeedFinder.cpp +++ b/injected/src/SeedFinder.cpp @@ -671,7 +671,8 @@ namespace SeedFinder // RevEng: Set hw write bp on state->feedcode, enter a seed in game and start the level typedef void sgs_func(uint32_t dummy, uint32_t seed); - static sgs_func* sgs = (sgs_func*)(memory.at_exe(0x221301C0)); + auto address = function_start(memory.at_exe(find_inst(memory.exe(), "\xC7\x41\x14\x01\x00\x00\x00\xC3\x48\x8b\x15"s, memory.after_bundle))); + static sgs_func* sgs = (sgs_func*)(address); // Set the "screen_last" state to 0x0E, so the game thinks we came from the // "Enter New Seed" menu item in-game. This way, the character selection @@ -689,7 +690,8 @@ namespace SeedFinder auto memory = Memory::get(); typedef void w_func(struct StateMemory*, int); - static w_func* w = (w_func*)(memory.at_exe(0x221A7080)); + auto address = function_start(memory.at_exe(find_inst(memory.exe(), "\x48\x89\x6c\x24\x58\x48\x98\x48\x89\x7c\x24\x60"s, memory.after_bundle))); + static w_func* w = (w_func*)(address); g_state->world = world; g_state->world_next = world;