0

I am using CreateRemoteThread to load my DLL in another applications, but my question is how I can pass for exemple a string to my dll and retrive it from lpReserved ? I heard something like that is possible.

Axcas
  • 1
  • 3
  • See right at the end of this article, use VirtualAllocEx and WriteProcessMemory, then CreateRemoteThread and wait for the result: https://www.codeproject.com/Articles/34237/A-C-Style-of-Intercepting-Functions – armagedescu Mar 24 '20 at 10:44

1 Answers1

1

The remote process has a different virtual address space than the calling process, so indeed pointer values will be different. You would need to allocate memory specifically in the remote process, typically using VirtualAllocEx, which can allocate memory in a different process and return a pointer that's valid for that remote process only. You can pass this value via lpParameter.

I assume you mean lpParameter, and not lpReserved.

See also: DLL Injection with CreateRemoteThread

tenfour
  • 36,141
  • 15
  • 83
  • 142