diff --git a/GUI/host/host.cpp b/GUI/host/host.cpp index cdcf0f2..83e25a8 100644 --- a/GUI/host/host.cpp +++ b/GUI/host/host.cpp @@ -1,5 +1,6 @@ #include "host.h" #include "defs.h" +#include "module.h" #include "hookcode.h" #include "../texthook/texthook.h" @@ -206,7 +207,7 @@ namespace Host IsWow64Process(process, &invalidProcess); if (invalidProcess) return AddConsoleOutput(NEED_32_BIT); #endif - static std::wstring location = std::filesystem::current_path().wstring() + L"\\" + ITH_DLL; + static std::wstring location = std::filesystem::path(GetModuleFilename().value()).replace_filename(ITH_DLL); if (LPVOID remoteData = VirtualAllocEx(process, nullptr, (location.size() + 1) * sizeof(wchar_t), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)) { WriteProcessMemory(process, remoteData, location.c_str(), (location.size() + 1) * sizeof(wchar_t), nullptr);