mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
inject correctly in CLI
This commit is contained in:
parent
bb0df71da2
commit
19f35f743c
@ -1,5 +1,6 @@
|
|||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
#include "module.h"
|
||||||
#include "hookcode.h"
|
#include "hookcode.h"
|
||||||
#include "../texthook/texthook.h"
|
#include "../texthook/texthook.h"
|
||||||
|
|
||||||
@ -206,7 +207,7 @@ namespace Host
|
|||||||
IsWow64Process(process, &invalidProcess);
|
IsWow64Process(process, &invalidProcess);
|
||||||
if (invalidProcess) return AddConsoleOutput(NEED_32_BIT);
|
if (invalidProcess) return AddConsoleOutput(NEED_32_BIT);
|
||||||
#endif
|
#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))
|
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);
|
WriteProcessMemory(process, remoteData, location.c_str(), (location.size() + 1) * sizeof(wchar_t), nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user