This commit is contained in:
Alexander
2024-12-31 13:19:46 +00:00
parent ce811e8287
commit 047d5ea26a

View File

@@ -27,12 +27,11 @@ void SetSubGameHook(void* thisref, uint8_t SubGame)
PWSTR rawLocalAppData;
SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &rawLocalAppData);
std::wstring localAppData(rawLocalAppData);
std::wstring dllPath(rawLocalAppData);
dllPath += L"\\Mercury\\Mercury-1.8.dll";
CoTaskMemFree(rawLocalAppData);
std::wstring dllPath(localAppData + L"\\Mercury\\Mercury-1.8.dll");
// reference https://github.com/ZeroMemoryEx/Dll-Injector/blob/master/DLL-Injector/Dll-Injector.cpp#L43
HANDLE fnHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, GetCurrentProcessId());
void* location = VirtualAllocEx(fnHandle, 0, MAX_PATH, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);