In the code below, I would like to read the result of LoadLibrayA created using CreateRemoteThread.
I will be grateful for the help, because it seems impossible,
Perhaps the result is free on time to read, any proposal will be happy to receive
procedure InjectDLL(hProcess : Cardinal; ADllPath : String); var lSize : Cardinal; hThread : Cardinal; szLibPath : array [0..MAX_PATH] of char; pLibRemote : Pointer; hLibModule : DWORD ; hKernel32 : HMODULE; begin hKernel32 := GetModuleHandle('Kernel32.dll'); FillMemory(@szLibPath, sizeOf(szLibPath), 0); CopyMemory(@szLibPath, Pointer(ADllPath), length(ADllPath)); pLibRemote := VirtualAllocEx( hProcess, nil, sizeOf(szLibPath), MEM_COMMIT, PAGE_READWRITE ); try WriteProcessMemory( hProcess, pLibRemote, @szLibPath, sizeOf(szLibPath), lSize ); hThread := CreateRemoteThread( hProcess, nil, 0, GetProcAddress(hKernel32, 'LoadLibraryA'), pLibRemote, 0, lSize ); try WaitForSingleObject(hThread, INFINITE);
source share