MSN Messenger Protocol
What are pings?
Pings are commands sent by either the server or the client, presumably to ensure the connection. These are analogous to the PINGs and PONGs of IRC. Pings from the client are sent with the
Pings from the client are generally used to either make sure the connection is still working or to prevent some NATs from automatically closing idle sockets. One can also use these pings to test the latency between the client and the server.
Client pings are the simplest of all commands. The client sends
Pings from the server are sent with the
Challenges are sent by the NS from time to time, the first one shortly after the initial status has been set with
When you receive a challenge, you must send a
If you sent an invalid email address or incorrect digest, the server will send error 540 and close the connection. If you get the payload wrong, the results will be hard to predict and not good. Otherwise, the server will send a
Client identification information
Different Microsoft clients use different ID codes and ID strings. Here is a list of the strings and their corresponding strings:
It doesn't matter which ID string you use, but you must use the corresponding ID code - for example, you can't use
A common theory for why challenge strings exist is to keep third party client developers away from the protocol. How these client ID codes were originally discovered has been lost in the mists of time, but they were presumably either reverse-engineered or leaked from Microsoft, so we're not sure what their legal state is. There is a thread in the forum discussing the legality of challenges.
MD5 is a message digest algorithm. Taking the MD5 digest of a string gives you a 32 byte "fingerprint" of it. If possible, you should try to find a library or an external program that creates MD5 fingerprints, but it's is officially described in RFC 1321, so you can try to implement it yourself if you're feeling brave. Make sure that your library can produce lower-case hexadecimal digests (there should be an option for this)
When the server gives you a challenge string, add your client code onto the end of it. For example, if the server gives you
Example server ping
Here is an example server ping and reply. You should check that your MD5 implementation against this example to make sure that you're encoding correctly. The most common mistake is to add a newline to the end of the challenge string before or after encoding it.
In this case, you would take the hexadecimal digest of