QuestionHelpCalling functions externally

Posts 1–4 of 4 · Page 1 of 1
Calling functions externally
I understand what I'm asking is much easier done with DLL injection, however I wanted to try something new.

Okay, so I'm trying to call functions externally (hence the thread title). If I understand correctly, I can accomplish this with CreateRemoteThread. However I don't know how to exactly do this.

Here's what i'm thinking:

  • In our host process, we create a function that we will inject into the target process
  • Inside that function will contain our instructions that declare and assign to where the function we want to call now that we are inside the target address space.


Does anyone have an example code that does something similar to this?
1. find the function you want to call (address)
2. createremotethread with that address
3. ???
4. profit!
Quote Originally Posted by Alainx277 View Post
1. find the function you want to call (address)
2. createremotethread with that address
3. ???
4. profit!
You can't add multiple parameters using CreateRemoteThread thread.
You can define a structure, allocate with VirtualAllocEx and then write the parameters with WriteProcessMemory, then at CreateRemoteThread you pass the address of the structure. This means you have to do code injection, which is just a bit more complicated than DLL injection. Better, DLL injection it's a quicker solution of Code Injection.
just coppied from a relevant thread on rohitab
Quote Originally Posted by Nimboso View Post
You can't add multiple parameters using CreateRemoteThread thread.

just coppied from a relevant thread on rohitab
Yeah, sorry. I forgot that you can only pass one argument. And your solution is also correct, I would recommend a DLL injection over code injection. If you want to know how to do a code injection I recommend this video:
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us