Jump to content

TCPSend() in connecting to the instant messanger server


Recommended Posts

Hi :) Im doing an implementation of GG protocol in my instant messanger. And i have problem witch TCPSend(). I have C++ code of all the protocol (all functions) from http://ekg.chmurka.net/docs/protocol.html#ch1.1. And im starting with HTTP GET, it return me the IP and opened port of GG server.When i make TCPConnect() to this IP and Port server is sending me

Recv=0x0100000004000000349AF1C7
0x0100 - means "Welcome/Greetings" and the rest "000004000000349AF1C7" is seed for hashing function.Next i have to send:

#define GG_LOGIN70 0x0019

struct gg_login70 {
    int uin;              /* mój numerek */ - My number of GG
    char hash_type;    /* rodzaj funkcji skrótu hasła */ -type of password hashing
        char hash[64];      /* skrót hasła */ -hash of my pass.
        int status;        /* status na dzień dobry */ -My GG status
        int version;          /* moja wersja klienta */ -Client version
        char unknown1;      /* 0x00 */ -dunno
        int local_ip;        /* mój adres ip */ -My IP
    short local_port;    /* port, na którym słucham */-My opened Port
        int external_ip;      /* zewnętrzny adres ip */- My external IP
        short external_port;  /* zewnętrzny port */ - My external opened Port
    char image_size;      /* maksymalny rozmiar grafiki w KB */ -Max size of received image files
        char unknown2;      /* 0xbe */ -Dunno
p.s char description[];   /* opis, nie musi wystąpić */-Not nessesery
    int time;            /* czas, nie musi wystąpić */-Not nessesery
};

and my question is, how to send it ? Like

TCPSend($mainsocket,0x0019& 0x16&1535586& "1234567898765432123456789876543"& 0x0002& 0x0b& 0& 0)

(the values isnt correct!!) the server returns me nothing, and it should return somme error if im sending incorrect values, or succes if they are correct. i have even tried to send

TCPSend($mainsocket,0x0019)
TCPSend($mainsocket,0x16)
TCPSend($mainsocket,1535586)
next.....
next....
next....

And again server return me nothing, my TCPRecv loop is looping without any recv ? Any ideas what to do ?? :) Please help ;(

p.s-oh and one more thing !! Wgy at the start server return to me 0x0100000004000000349AF1C7 and greeting bytres are 0x0100 but they shoul be 0x0001 !! Whay??

Edited by Uriziel01
Link to comment
Share on other sites

I dont realy understand what hes writing in the link :)

but it seems you have to send information with the HTTP Get, dont you?

GET /appsvc/appmsg4.asp?fmnumber=NUMER&version=WERSJA&fmt=FORMAT&lastmsg=WIADOMOŚĆ

Try connecting with the "normal" method or program and logg the traffic (with HTTP Analyzer or something simmilar)

Link to comment
Share on other sites

GET /appsvc/appmsg4.asp?fmnumber=NUMER&version=WERSJA&fmt=FORMAT&lastmsg=WIADOMOŚĆ i have sended that already ! And after this GET, site appears with IP and Port of the GG server. Please help p.s-if needed i may translate a part of those link :)

Link to comment
Share on other sites

Please download HTTP analyer;

Run it an then run you Messenger Tool (one that works)

put the get request in the Request Builder and post a screenshot (delete Cookie/PW aso. first)

Then do the same thing with your tool and post a screenshot

Examplescreen attached

post-31703-1202586775_thumb.jpg

Link to comment
Share on other sites

When im running my script HttpAnalyzer log only the first GET request (server answer is the same as in orginal, and its OK) but it dont see any of the next packets, im using TCPSend and HttpAnalyzer dont see them ??!! Situation is the same when im running the orginal program, HttpAnalyzer log the first GET request and next it get nothing. Some other ideas?

Edited by Uriziel01
Link to comment
Share on other sites

from the orginal script:

HTTP/1.0 200 OK

0 0 217.17.45.146:8074 217.17.45.146

From my GET request:

HTTP/1.0 200 OK

7797 0 91.197.13.18:8074 91.197.13.1

WooW! This 7797 meas that after header i will receive system message but:

Recv=0x0100000004000000E4FD952B ?? What is that system message?

Edited by Uriziel01
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...