Thread: WinSock // Existing Games

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    15

    WinSock // Existing Games

    Hi - i'm a relative begginer to C/C++ but have a firm foundation of classes, functions and the sort. My question is, is it possible to use the WinSock class & functions to connect to an existing server and send already defined game packets to the server with WinSock? - I am looking at a couple of WinSock tutorials and I am very interested in network//server programming. I was wondering if I would be able to do this with a previous existing game - send packets to the server (I.E. move to position x,y game defined packet) - and have this work out. All help is very much appreciated.

  2. #2
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    My answer has to be Yes and No.
    Depends on thesecurity of the server.
    If the server uses some form of encryption, so that only its client program can send data, then without know how that encryption works i would say no.
    Now if it uses ansi characters to send information, then you could send information to it, if you know what socket it uses and the protocols it uses.
    your best bet, grab a packet sniffer,
    www.majorgeeks.com has some in download section
    oh and winsocks is very complex, so you'll need to find some good info on it

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    15
    Thank you very much Lamien - but now this sparks some interest how does a packet sniffer work? - Just saves and prints what the listening socket finds?

  4. #4
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    Basicly it detects incoming and outcomign data. and reprots it to you.

    An example:

    I have Network Activ Sniffer 1.5 running <avaible Here > i connect to a server, to connect i first send the message "hello" to the server, which it will recieve and respond with apropriate things < maybe asking for a username and password, etc etc> the packet sniffer sees an outgoing packet of data reads its contents, then makes a log of it, without interfeering in the sending of the packet.
    Now that is a example, server/client won't alwasy use hello .

    Same thing for an incoming packet.

    this would allow you too see what kind of system is being used to transfer information.
    Now a note. say they are using a binary informatio ntransfer. All your going to be getting is hex, and that probaly wont help you too much.

    i hope this helped a bit.


    As a note. i would not suggest trying to make something that will allow you to hack a game or the like if you plan on beating other players using it. as an educational thing, not that bad just do it on your own private server. in a game where you Pay to play IE Everquest, this WILL get you banned if you are detected and they will detect. if its UT or CS or something, try makign your own server and doing it like that
    Oh an it is iamien

  5. #5
    Registered User
    Join Date
    May 2003
    Posts
    15
    Thank you for the explanation but no I am just looking to see how some people have come to manipulate in game movements while playing on a server, I.E. - moving your character to point A and use skill B to kill monster C. I don't really want to create anything. I also have another question refering to this - how would I go about mimicing mouse clicks and movements? - Is there a special header file and functions I would have to familarize my self with? - This all concerns game programming.

    EDIT:: - Diablo 2 (Not pay to play)
    Last edited by CPP-Null; 05-24-2003 at 12:00 PM.

  6. #6
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    In windows you have to call to API. to be honest, i'm just learning C++. my skills lie in Delphi. You call the windows API you can position the mouse based on X,Y coords and then you can simulates a Click, double click left/right clicks etc.

    Lets say i'm playing Everquest <i just kicked the habit after 4 years > Anyway i attack a rat with my short sword. clinet program send the data to server, consisting of what my weapon is, what my attack moddifiers are, what my skill is and the like, that returns if i hit or miss the rat.

    So if i where to be sending a false packet to server i'd need to know everything that should be sent. how it is represented and then i create that data and send it.

  7. #7
    Registered User
    Join Date
    May 2003
    Posts
    15
    Alright than I suppose working with the WinAPI would be the best route so this wayI don't have to decipher what each game packet is and what information is to send it. - The packet thing was just a curiosity question because in D2 for instance (yes trying to kick the habit =D) a term "botting" has become an issue -which really is just centered around the constant sending of packets. - As for networking I am highly interested in it as well and possibly using WinSock i'll make an instant messaging program =D as a first shot (dont know how well that will go.) Thanks a bunch! iamien!

  8. #8
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    I made a nice server/client program in delphi for an IM app. was gona make it have file transfer and stuff but never got around to it.
    I'm not sure how botting in D2 works but my guess would be that it would detect the packets. read em, find out where every monster and the like is and attack/cast spell what ever it sees best.

    As for winAPI, well you still need to learn what goes where in the packet if you want to recreate it. Else you can APi the click and location of click so that the client program handels everything

  9. #9
    Registered User
    Join Date
    May 2003
    Posts
    15
    Thats the idea =D

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Winsock issues
    By tjpanda in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2008, 08:32 AM
  2. Violent video games?
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 58
    Last Post: 04-26-2006, 01:43 PM
  3. Where do I initialize Winsock and catch messages for it?
    By Lithorien in forum Windows Programming
    Replies: 10
    Last Post: 12-30-2004, 12:11 PM
  4. Video Games Industry. 5 years left.
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 12-10-2002, 10:52 PM