Valhalla Legends Archive

Programming => Advanced Programming => Topic started by: PunK on January 20, 2009, 12:29 PM

Title: Hooking Again =x
Post by: PunK on January 20, 2009, 12:29 PM
I would post this in CupHeads original post but I doubt anyone would look at that.

Anyways, I've already injected the dll but I want to redirect the socket data back to my application via the injected dll. I'm not quite sure about how to go about this and I am doing this in VB6 to get a good understanding then eventually I will port it into C++. I don't quite have a great grasp on C++ which is why I'm doing this in VB6 first.

Does anyone have any good documentation (being any language at this point, I don't care) that I could refer to?

Second question.
Let's say I write a DLL and name it winsock32.dll. The application I inject the DLL into is already using a library named winsock32.dll.. Will it write over the existing dll that the application is already using?


Thanks.
Title: Re: Hooking Again =x
Post by: brew on January 20, 2009, 02:12 PM
1). No, but it's really really easy to do on your own. I recommend checking out DbgHelp's ImageDirectoryEntryToData (http://msdn.microsoft.com/en-us/library/ms680148(VS.85).aspx).
2). LoadLibrary will return the base address of the previously loaded module with the same name if present.
Title: Re: Hooking Again =x
Post by: PunK on January 21, 2009, 06:19 PM
Kind of was hoping for something that explained the dynamics of hooking.

I'm using http://www.edgeofnowhere.cc/viewtopic.php?p=2483118 as a reference.
Title: Re: Hooking Again =x
Post by: Hdx on March 26, 2009, 11:40 PM
Walk the imports table replacing all calls to functions you want to hook with your functions. Not hard.