Page 1 of 1

DLL Injection

PostPosted: Sun Aug 29, 2010 7:22 am
by PsychoTron
I want to implement the LoadLibrary hook, but I can't quite figure it out, I've read a few tutorials, but all of them had a bunch of unnecessary stuff, and I couldn't quite sort what I needed to use. (I saw at least 3-4 tuts, and all of them had vastly different setups, I did pick up on a few common themes, but not enough to confidently build this..)

So can I get a barebones example of the LoadLibrary\CreateRemoteThread hook, in plain C++?

For instance, don't you need to replace a file for this to auto-load? ie, spoofing another dll the .exe loads already, then loading the real one, and passing back control to it?

As you can see, I at least need some clarification on a few things.

-------

Edit: Found a set of tools, called Comrade's PE Tools. It included a tool called Patch.exe, it basically patches the .exe to load your .dll for you.

(Not sure how safe this toolset is, but I do know it worked, though I got a virus warning, but considering the tools nature, it's not surprising, it comes with FASM files though, so you can compile it yourself if you want to try them out, and don't trust compiled code from random sites..)

http://comrade.ownz.com/projects/petools.html