C++ winsock hooking
C++ winsock hooking
could you use madcodehook to hook/inject another process and use that processes winsock send method/s
Not at all the time.madshi wrote:That is possible, but it sounds "bad" to me. Please use madCodeHook only for legal projects!
If you have a socket openned in another process, and if you want to send a Buffer by this Openned Socket, you can not do in our own process, we need to inject a DLL and send messages to the DLL recognize this.
If it is what you want, so you dont need to inject a DLL. Just use the API DuplicateHandle and passing the SocketID as the source parameter, then you could call SEND or RECV (whatever) in your own process.
If the other process is your own, then I take that "bad" word back...
Okay, could you tell us a bit more about why one of your processes wants to use the socket functions of another of your processes? Why can't you implement the socket functions in both processes?
Anyway, there are several possibilities:
(1) Either the non-socket process can ask the socket process to send data for it. You can use SendMessage to send the request or madCodeHook's SendIpcMessage.
(2) Or the non-socket process can copy the socket's process socket (that's nildo's suggestion). Not sure how/whether this works, since I'm not socket expert at all!
(3) Or the non-socket process could execute a function in the context of the socket process (e.g. by using madRemote's RemoteExecute).
(4) Or the non-socket process could inject a dll into the socket process which could then do the sending.
Okay, could you tell us a bit more about why one of your processes wants to use the socket functions of another of your processes? Why can't you implement the socket functions in both processes?
Anyway, there are several possibilities:
(1) Either the non-socket process can ask the socket process to send data for it. You can use SendMessage to send the request or madCodeHook's SendIpcMessage.
(2) Or the non-socket process can copy the socket's process socket (that's nildo's suggestion). Not sure how/whether this works, since I'm not socket expert at all!
(3) Or the non-socket process could execute a function in the context of the socket process (e.g. by using madRemote's RemoteExecute).
(4) Or the non-socket process could inject a dll into the socket process which could then do the sending.