Winsock

c++ / delphi package - dll injection and api hooking
Post Reply
cogumel0
Posts: 8
Joined: Wed Nov 10, 2004 2:32 am

Winsock

Post by cogumel0 »

This is the first time I am using madshi's tools and never have I done anything quite alike what I am trying to do here. So, I really don't even know where to start.

I am trying to send my own packets to a server using Winsock as if it was the client itself sending it.

In theory, I suppose I have to hook the Winsock and use it to send packets with both the send and recv funcs. But how do I know where to send them to? And even if I had an ip and a port, if I had 2 clients working at the very same time I send a packet, how would the server know which one sent it and now screw up a the information?

Kinda confused here and would appreciate some help. Thank you.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I think this is a similar question to this one:

viewtopic.php?t=235
cogumel0
Posts: 8
Joined: Wed Nov 10, 2004 2:32 am

Post by cogumel0 »

I have been in that thread already and it helps, but there's some things not very clear there. Nildo talks about both hooking the application and the dll (winsock).

He also says I gotta use the handle of the socket used by the program in the socket parameter of the winsock send function, and after that he talks about using the IPC technique to pass from the dll to the exe. That part is a bit confusing :?

Also, how to I get the handle of the socket itself? I got the handle of the program, but not the socket the program uses.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

If you're already in that thread, why are you opening a new one? You have Nildo in that other thread, and he's the guy who's done the most work with WinSock. If he can't help you, I probably can't, either. I'm simply no expert in WinSock programming.
cogumel0
Posts: 8
Joined: Wed Nov 10, 2004 2:32 am

Post by cogumel0 »

I hadn't seen is before, sorry :sorry:

Well, I guess there's no use in posting the same in both now that this one is created.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

I thought you've been in the other thread before you posted this new one. If you only saw it afterwards, it's no problem. So don't worry... :D

But anyway, I can't really help you here.
cogumel0
Posts: 8
Joined: Wed Nov 10, 2004 2:32 am

Post by cogumel0 »

Guess all I have left to do is wait :wink:

Thx for the help and quick responses though.
Post Reply