Resolving a TCP Connection

I have a small project that I worked on in C ++, and due to the nature of what it does, I need to insert packets into the TCP direct stream. (The goal is innocent, http://ee.forumify.com/viewtopic.php?id=3299 if you SHOULD know) I am creating a level editor for the game, and due to the nature of the handshakes I cannot just establish a new connection to the high library level like WinSock. So far, he used the Winsock Packet Editor to do the dirty work, but if I let the application handle all of this, it would make everyone happy.

So my question is this: is there an API somewhere that will allow me to control the real-time TCP stream and, preferably, one that keeps it in action after its completion? And I would prefer not to enter any DLL files. Also, Detours is a no-no, as I use GCC / Mingw.

I played with WinPCap and I have some kind of working code (I can compile the package and create the proper package from it for sending), but since it works at such a low level, I can’t foresee the full potential of the protocols that the final one can use user. Yes, it is likely that they will use IPv4 over Ethernet, but what about those people who are still using PPP or some other obscure protocol? In addition, the connection is dropped by the client application after mine is completed with it, since the last ID values ​​in the packages have changed, and the client assumes that it is disconnected.

So, if someone can provide a high-level TCP stream manipulator, I would be very pleased. If not, I will just continue to mess around with WinPCap and tell all dial-up users in order to better set up the Internet.

Target platform: Microsoft Windows XP through Windows 7

+5
source share
3 answers

Create a separate process to bind to the local port. When the initial tcp stream is created, the proxy is through this process, which can then redirect it to the network. When you need to "inject" into a stream, you can force this proxy process to do this. Just a thought.

+2
source

you should look at the source code of ettercap http://ettercap.sourceforge.net/ or hunt, tcp hijacker http://packetstormsecurity.org/files/view/21967/hunt-1.5.tgz

These 2 soft programs do what you need.

+1
source

, API, TCP. .

- ? , , , , .

, , TCP .

0

All Articles