Results 1 to 17 of 17

Thread: [2005] How would I

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Question [2005] How would I

    How would I get a list of IP address of people in a game I am hosting? Example: Warcraft III. You can host custom games. How would you get the IP addresses of the people in your game? Would you have to memory read or would it be more network related?

    Thanks

    -The-Guardians

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] How would I

    What is the connection technology? Are the connections TCP, or UDP packets? Either one should have the senders IP address contained in the packets. I haven't tried it, but for a UDP datagram system, you should be able to pass in an empty IPEndPoint to the Receive method of the UDPClient class, and have the IPAddress filled with the IP address of the sender. A similar thing should work for TCP.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Ya. It's TCP.

    If it's in the network packets, ill search the game myself and find out. I'll repost with results.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] How would I

    You are probably getting a socket when you accept the connection (possibly with the AcceptSocket method). The socket which is returned from that has a RemoteEndpoint, which contains an IPAddress member.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Yeah. I searched in-game with Wireshark and it will grab the player's IP address. Now I just have to figure out how to do that in Visual Basic 2005... Thanks!

  6. #6
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [2005] How would I

    Does this have to be done in vb? Because there's a built-in program that lists them.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] How would I

    So you don't have access to the source for the actual program that does the hosting?

    You and Lord Orwell both mention some means to show them. If either of those runs real-time, and you don't have access to the source, then you can use API calls to read the information out of a window of a different program. That might be the best way to go about it, as every other technique I am aware of would require access to the source code.

    If that sounds like an option you'd be interested in, I can set you on the right path. It is somewhat weird to get the right window handle for a control in a program, but it isn't really all that difficult.
    My usual boring signature: Nothing

  8. #8

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Quote Originally Posted by Lord Orwell
    Does this have to be done in vb? Because there's a built-in program that lists them.
    Any language is fine, but I don't want to use an already compiled program.

    Quote Originally Posted by Shaggy Hiker
    So you don't have access to the source for the actual program that does the hosting?

    You and Lord Orwell both mention some means to show them. If either of those runs real-time, and you don't have access to the source, then you can use API calls to read the information out of a window of a different program. That might be the best way to go about it, as every other technique I am aware of would require access to the source code.

    If that sounds like an option you'd be interested in, I can set you on the right path. It is somewhat weird to get the right window handle for a control in a program, but it isn't really all that difficult.
    No, I do not have access to the game's source code (Warcraft III). I don't think you can read the IP address of the players because it only shows their name in the window, unless there are API calls for this as well. Hey, I'm up for anything you give/tell me. Also, I have the window handle and everything, I made a process memory reader/writer for Warcraft III (spoofs your name in custom games). So that shouldn't be too big of a deal.

  9. #9
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [2005] How would I

    If you are running a server, you will have a socket connection for each player. If you are running a client, you won't have any way of discovering the IP, because the information won't be transmitted to your computer.

    If the former is the case, This Link will get you started.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  10. #10

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Thanks. I'm going to look at that and give it a try, but you can also get a player's ip address when your not hosting. I used Wireshark and it gave me the players ip address. Ill re-post with results from the Netstat example.

    EDIT: Ya, I don't think this source will help me, but really, I don't know. I ran the application and it didn't give me any information I needed. Maybe I just don't know what to look for?


    Here's what you get when you follow the TCP stream for Warcraft III (I followed his ip address).

    Code:
    ..)................AcE.......................s...d......d........d........d........d........d........d........d........d........d........d.....
    ..d........dA. ........H..M..........5......Gg-Beaner....................................=J.....Maps\Download\Sheep Tag Alternative 1.1 Optimized.w3m.k
    ..%...."O...y.s...d......d........d........d........d........d........d........d........d........d........d.....
    ..d........d.. ....B
    ......k
    ....y.s..........d........d........d........d........d........d.d......d........d........d........d.....
    ..d........dr. .....y.s..........d.d......d........d........d........d........d.d......d........d........d........d.....
    ..d........d.. .....y.s..........d.d......d........d........d........d........d........d.d......d........d........d.....
    ..d........d.. .....y.s..........d.d......d........d........d........d........d........d........d.d......d........d.....
    ..d........d.. .....y.s..........d.d......d........d........d........d........d........d........d........d.d......d.....
    ..d........d.. ....
    ..........ill end game...
    .....asap...........#..............'.....H].......'...o..........'.....NH.......'..............'.
    .bI...I........&....YcbI...I.............S..
    .bI...I........'...J`......
    ..'..............'...5d.........'[email protected]=(.......'...../].......'....t_........'...d..@....... ....same somethign..(..... ....when ever..'....q|........'...#..s.......'...\N.........'......f.......'....K:.............. ....real quick..'..............'....H............... ....ok..'...0.H=.......&......bL...L.........(... ..
    .bL...L........
    .bL...L........'....K........O..
    .bI...I........&...f.qbI...I........'..RS-h|.......<.
    .bI...I........'....c......... ....gg..'......<.............'..............'....!*!.......'...?.Z[..............
    AcE would be his name, Gg-Beaner would be mine, then it shows what map he downloads/plays off of me, and then it shows the convo we have.




    EDIT: Also, a program called TCPView made by SysInternals will allow you to view who is in your game or the game you are playing in. Like this:

    System:-1 TCP me-pc:6112 71.237.177.45:1075 TIME_WAIT

    me-pc:6112 means it's on port 6112 (warcraft iii game port).

    So, how would I go about putting this into code?
    Last edited by The-Guardians; Jul 3rd, 2007 at 11:41 AM.

  11. #11
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [2005] How would I

    If he's playing off your map, then he has to connect to your computer. That's why you have access to his ip. You are in fact serving the map. If that code isn't what you are looking for, google NETSTAT vb.net and there are dozens more examples. I frankly am not sure which protocol you need to query, but it seems to me like tcp is the right one.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: [2005] How would I

    If we're talking about WOW, I don't think that, even if you're "hosting" a game, you're acting as a server. The game is still being played on the WOW server you're connected to, so you probably won't see any IP addresses. I could be wrong, though - I don't play, I just try to figure out the details of the software when my wife does (which is 25/8/367).
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  13. #13

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Quote Originally Posted by Lord Orwell
    If he's playing off your map, then he has to connect to your computer. That's why you have access to his ip. You are in fact serving the map. If that code isn't what you are looking for, google NETSTAT vb.net and there are dozens more examples. I frankly am not sure which protocol you need to query, but it seems to me like tcp is the right one.
    Netstat might work. I think I'm going to have to use packet sniffing on TCP port 6112 to figure this out. I'll give it a try in a little bit. Ill edit post with my results.

    Quote Originally Posted by Al42
    If we're talking about WOW, I don't think that, even if you're "hosting" a game, you're acting as a server. The game is still being played on the WOW server you're connected to, so you probably won't see any IP addresses. I could be wrong, though - I don't play, I just try to figure out the details of the software when my wife does (which is 25/8/367).
    Warcraft III. It's the previous game of warcraft before WoW.

  14. #14
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] How would I

    What I was suggesting with the APIs is that if you have a program that displays the IPs in a window, you can get the handle for that control and read the information off that window or control. Packet sniffing would be the more low level technique, as those IP addresses should be in the packets.
    My usual boring signature: Nothing

  15. #15

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    I have a program that gives you the account name and ip address of that user. So your technique would be to get the API's that the program uses to get the account and ip address, then put that into my application? Sorry if I'm not following right, I'm really confused.

    If you want, you can contact me on aim or xfire:
    xfire: uglynerd
    aim: li hyper il
    Last edited by The-Guardians; Jul 3rd, 2007 at 04:10 PM.

  16. #16
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] How would I

    No, my suggestion deals with running that program (it can even be minimized), and using API calls to grab the text right out of the window that the program is using to display the info. It doesn't interact with the other program to any great extent, but it is also getting the info "second hand". This is not the best solution, but I've never looked at packets directly.
    My usual boring signature: Nothing

  17. #17

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    35

    Re: [2005] How would I

    Yeah, I want to make my own program, so I don't have to use another. Thanks for the help. I'll figure it out, and when I do I'll be sure to post the program/source code here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width