From 48e79faffa6c39dee7d7627c973c9e4b3e3d9536 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 6 Jan 2025 00:37:00 +0100 Subject: [PATCH] RTech: search for pattern again The extra runtime overhead this creates is negligible as all patterns will be searched once, and have their results being cached off. Due to a planned future change, we can't extern it anymore. --- src/rtech/async/asyncio.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rtech/async/asyncio.h b/src/rtech/async/asyncio.h index b1c5f2e7..31a9fd32 100644 --- a/src/rtech/async/asyncio.h +++ b/src/rtech/async/asyncio.h @@ -87,8 +87,7 @@ class V_AsyncIO : public IDetour } virtual void GetVar(void) const { - extern void(*v_StreamDB_Init)(const char* const pszLevelName); - const CMemory streamDbBase(v_StreamDB_Init); + const CMemory streamDbBase = g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 54 41 56 41 57 48 83 EC 40 48 8B E9"); g_pAsyncFileSlots = streamDbBase.Offset(0x70).FindPatternSelf("4C 8D", CMemory::Direction::DOWN, 512, 1).ResolveRelativeAddress(0x3, 0x7).RCast(); g_pAsyncFileSlotMgr = streamDbBase.Offset(0x70).FindPatternSelf("48 8D 0D", CMemory::Direction::DOWN, 512, 2).ResolveRelativeAddress(0x3, 0x7).RCast();