inject correctly in CLI
This commit is contained in:
parent
bb0df71da2
commit
19f35f743c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user