diff --git a/TalesOfBerseria/dllmain.cpp b/TalesOfBerseria/dllmain.cpp index ea00bbd..222a0bc 100644 --- a/TalesOfBerseria/dllmain.cpp +++ b/TalesOfBerseria/dllmain.cpp @@ -31,6 +31,7 @@ static uint8_t* FOVaddress = nullptr; static uint8_t* UltraWideaddress = nullptr; static uint8_t* Resolutionaddress = nullptr; static uint8_t* pluginDLLModule = nullptr; +static uint8_t* GameAssemblyDLLModule = nullptr; // Hooking static SafetyHookMid FOVHook{}; static SafetyHookMid UWHook{}; @@ -88,6 +89,18 @@ extern "C" __declspec(dllexport) void InitializeCore() { logger->info("Core ready."); } }).detach(); + std::thread([]() { + HMODULE hModule = nullptr; + for (int i = 0; i < 100; ++i) { // gives 10 seconds to find Unity GameAssembly.dll + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + hModule = GetModuleHandleA("GameAssembly.dll"); + if (hModule) break; + } + if (hModule) { + GameAssemblyDLLModule = reinterpret_cast(hModule); + logger->debug("GameAssembly loaded @ {}", (void*)GameAssemblyDLLModule); + } + }).detach(); } // Setters for Reshade addon call