Update modulehelper.c
This commit is contained in:
@@ -25,6 +25,7 @@ bool mod_inject_and_begin_thread(
|
|||||||
LPVOID pBaseAddress = NULL;
|
LPVOID pBaseAddress = NULL;
|
||||||
SIZE_T cb;
|
SIZE_T cb;
|
||||||
HMODULE hRemoteModule = NULL;
|
HMODULE hRemoteModule = NULL;
|
||||||
|
uintptr_t offset;
|
||||||
HANDLE hThread;
|
HANDLE hThread;
|
||||||
|
|
||||||
Status = NtSuspendProcess(hProcess);
|
Status = NtSuspendProcess(hProcess);
|
||||||
@@ -43,10 +44,11 @@ bool mod_inject_and_begin_thread(
|
|||||||
goto virt_free;
|
goto virt_free;
|
||||||
}
|
}
|
||||||
if ( mod_inject_by_hmodule(hProcess, hModule, &hRemoteModule) ) {
|
if ( mod_inject_by_hmodule(hProcess, hModule, &hRemoteModule) ) {
|
||||||
|
offset = (uintptr_t)pStartAddress - (uintptr_t)hModule;
|
||||||
hThread = CreateRemoteThread(hProcess,
|
hThread = CreateRemoteThread(hProcess,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
(LPTHREAD_START_ROUTINE)((uint8_t *)hRemoteModule + ((uint8_t *)pStartAddress - (uint8_t *)hModule)),
|
(LPTHREAD_START_ROUTINE)RtlOffsetToPointer(hRemoteModule, offset),
|
||||||
pBaseAddress,
|
pBaseAddress,
|
||||||
0,
|
0,
|
||||||
NULL);
|
NULL);
|
||||||
|
Reference in New Issue
Block a user