Advertisement

how to use an socket in an ohter process.

Started by February 19, 2005 09:50 PM
3 comments, last by X5-Programmer 20 years ago
Hi, I have a question about using an socket from an ohter app process, let say we have a game that is connected to a server.. and I wanna try to make a app that can send packets to the server between the, game clients socket so if I send a move packet from my app it will be sent to, the server like it was sent from the orginal game client if you know what I mean.. if someone know how to do this- let me know. //thx.
-[ thx ]-
I cannot figure out why you want to do this.
If you use udp and you are on the same machine you can open a socket on the same port and act like the copied application. If you use tcp you can duplicate the socket (in windows env DuplicateHandle) and do the same thing. You can also open a socket in raw mode and act like a "man in the middle" filtering all the packet sent by your target application. You can do in a lot of different way.
[ILTUOMONDOFUTURO]
Advertisement
Now now Anonymous, not everybody cheats. I did it just to see if I could, and I ended up with something that basically recorded internet radio streams (not a good idea, but what better way to test it?). What you need to do, X5-Programmer, is make an application with 2 threads. Create a socket in each thread, connect your other app to the first one, then use the 2nd thread's socket to connect to the remote server. Once you've done that, set the threads to loop. The first one needs to receive all of the data from your app, then send it to the remote server, the second receives all of the data from the remote server, and sends it to your app.

Here's a dodgy ascii-drawing of how it should work:

A = your appB = your data interceptorC = remote server1 = thread 12 = thread 2</> = direction of data .-> A >-. |       | 2|||B|||1 |       | `-< C <-'
Thanks all.
-[ thx ]-

This topic is closed to new replies.

Advertisement