From 81d5b745aa9ab83183a5ae7d1f3869a607a29c2d Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 17 Jan 2020 21:51:11 -0700 Subject: [PATCH] dont use legacy api --- GUI/host/host.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GUI/host/host.cpp b/GUI/host/host.cpp index 53b749b..55ac92b 100644 --- a/GUI/host/host.cpp +++ b/GUI/host/host.cpp @@ -2,6 +2,7 @@ #include "defs.h" #include "util.h" #include "../texthook/texthook.h" +#include extern const wchar_t* ALREADY_INJECTED; extern const wchar_t* NEED_32_BIT; @@ -204,7 +205,7 @@ namespace Host IsWow64Process(process, &invalidProcess); if (invalidProcess) return AddConsoleOutput(NEED_32_BIT); #endif - static std::wstring location = Util::GetModuleFilename(LoadLibraryExW(ITH_DLL, nullptr, DONT_RESOLVE_DLL_REFERENCES)).value(); + static std::wstring location = std::filesystem::current_path().wstring() + L"\\" + 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);