Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: mfc and win32 Pin
Diddy2-Mar-04 11:14
Diddy2-Mar-04 11:14 
GeneralRe: mfc and win32 Pin
Diddy3-Mar-04 12:39
Diddy3-Mar-04 12:39 
GeneralCComPtr and CDHtmlDialog Pin
George L. Jackson1-Mar-04 11:44
George L. Jackson1-Mar-04 11:44 
GeneralRe: CComPtr and CDHtmlDialog Pin
Diddy2-Mar-04 11:19
Diddy2-Mar-04 11:19 
GeneralColor of DialogBox (Looking for macro) Pin
eigen1-Mar-04 11:40
eigen1-Mar-04 11:40 
GeneralRe: Color of DialogBox (Looking for macro) Pin
Ravi Bhavnani1-Mar-04 11:50
professionalRavi Bhavnani1-Mar-04 11:50 
GeneralCreateDispatch and globalalloc Pin
vancouver7771-Mar-04 10:14
vancouver7771-Mar-04 10:14 
GeneralYahoo client.. Pin
RobJones1-Mar-04 10:03
RobJones1-Mar-04 10:03 
Hello,
I am trying to write a Yahoo chat client.. I have found quite a bit of resources on the net but I am having problems trying to figure some of this stuff out..

After constructing a string and sending it to the yahoo server I should receive a "challenge" string back from the server.. I have a feeling my string being sent isn't configured correctly.. My resource is from the following website;
http://www.venkydude.com/articles/yahoo.htm

...... Directly cut from the website ......

0x0000   00 20 18 8F C8 16 00 50-BA 89 95 6B 08 00 45 00   . .È..Pº‰•k..E.
0x0010   00 4A F7 6A 40 00 80 06-BA 99 C0 A8 01 C1 D8 88   .J÷j@.€.º™À¨.Á؈
0x0020   AD B7 07 0D 13 BA 7F DC-96 ED DA E7 49 68 50 18   ­·...ºÜ–íÚçIhP.
0x0030   44 5C F8 02 00 00 59 4D-53 47 00 0B 00 00 00 0E   D\ø...YMSG......
0x0040   00 57 00 00 00 00 6D 61-93 13 31 C0 80 73 75 6E   .W....ma".1À€sun
0x0050   64 61 6D 61 6D 61 C0 80-                          damama
 
Let us look at what exactly is being sent
 
YMSG- is the yahoo standard header for all messenger command/messages
This is followed by 2 bytes of data - 00 0B. -this indicates the version number of the protocol
This is followed by 2 bytes of data -  00 00
Next 2 bytes specify is the length of the  message information-i.e total lengthof the string -length of the header(20 bytes)
The next bytes  of data is 00
This is followed by the charecter "W" this signifies that the command being sent is a challenge command
Next is a 4 byte are  -00 00 00 00
The next 4 bytes is what i call the initial 4 bytes bluff identifier. 
These 4 bytes identify a particular user and it  changes every time you log in.
Initially you  could send any four bytes including 00 00 00 00 and you would
still be able to log in .
This is followed by one byte of data signifying that the data being sent is for logging into the server.
This byte has an ASCII equivalent of  "0" This is followed by 1 byte of data - 31 whose ascii equivalent is "1"
This is followed by 2 bytes of data which is the standard argument separator.- C0 80
Finally this is followed by the yahoo user id and the standard argument separator. 


Here is what I have written.. I'm sure I am messing up somewhere.. Can anyone give me any pointers??

CString strMsg;
strMsg.Format("YMSG%X%X%X%X%X%X%XW%X%X%X%X%X%X%X%X01%X%Xjones_2529%X%X",
    // 'YMSG'
    0x00, 0x0B, // First 2 bytes are the protocol ver.
    0x00, 0x00,
    0x00, 0x15, // string length (41) - 20 (20 is the header length) hard coded for testing..
    0x00,
    // 'W' means challenge
    0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, // ID this 4 bytes should work.
    // '01' meaning login
    0xC0,0x80, // Standard seperator
    // Yahoo user ID
    0xC0, 0x80 // Standard seperator
    );

...... send strMsg to the yahoo server, should receive a challenge string.


Thanks!

Whoever said nothing's impossible never tried slamming a revolving door!
General#include <iostream.h> Pin
Anonymous1-Mar-04 8:59
Anonymous1-Mar-04 8:59 
GeneralRe: #include <iostream.h> Pin
User 66581-Mar-04 9:42
User 66581-Mar-04 9:42 
GeneralRe: #include &lt;iostream.h&gt; Pin
John M. Drescher1-Mar-04 9:50
John M. Drescher1-Mar-04 9:50 
GeneralRe: #include &lt;iostream.h&gt; Pin
Prakash Nadar1-Mar-04 15:18
Prakash Nadar1-Mar-04 15:18 
Generalcasting problem Pin
Mazdak1-Mar-04 8:34
Mazdak1-Mar-04 8:34 
GeneralRe: casting problem Pin
John M. Drescher1-Mar-04 8:52
John M. Drescher1-Mar-04 8:52 
GeneralRe: casting problem Pin
Mazdak1-Mar-04 9:14
Mazdak1-Mar-04 9:14 
GeneralRe: casting problem Pin
John M. Drescher1-Mar-04 9:49
John M. Drescher1-Mar-04 9:49 
GeneralRe: casting problem Pin
Mazdak1-Mar-04 10:11
Mazdak1-Mar-04 10:11 
Generala menu Pin
Anonymous1-Mar-04 8:10
Anonymous1-Mar-04 8:10 
GeneralRe: a menu Pin
Wes Aday1-Mar-04 8:17
professionalWes Aday1-Mar-04 8:17 
Generalvisual c++ Pin
vglmco1-Mar-04 7:28
vglmco1-Mar-04 7:28 
GeneralRe: visual c++ Pin
John M. Drescher1-Mar-04 7:37
John M. Drescher1-Mar-04 7:37 
GeneralRe: visual c++ Pin
vglmco1-Mar-04 7:42
vglmco1-Mar-04 7:42 
GeneralRe: visual c++ Pin
Wes Aday1-Mar-04 7:39
professionalWes Aday1-Mar-04 7:39 
GeneralRe: visual c++ Pin
vglmco1-Mar-04 7:48
vglmco1-Mar-04 7:48 
GeneralRe: visual c++ Pin
Wes Aday1-Mar-04 7:59
professionalWes Aday1-Mar-04 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.