Skip to content

Commit

Permalink
use pattern searching instead of plain RVA for reveng'ed functions ->…
Browse files Browse the repository at this point in the history
… works in 1.20.3.c and 1.20.4a
  • Loading branch information
zappatic committed Mar 23, 2021
1 parent ef37282 commit 08c1778
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions injected/src/SeedFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 08c1778

Please sign in to comment.