Algorithm for viewing the Yahoo Messenger archive
There's this article I found when I started working on this program.
However, there are a few errors in it (or maybe it reffers to an older version of Yahoo Messenger?).
- The size is not stored in the 13th byte, it's actually in the 13th and 14th byte. (The order is little endian).
- 4 bytes (always set to 0) follow each message.
So, the algorithm is as follows:
- While (!eof())
- read 16 bytes (the header). The first 5 bytes are the timestamp. The 9th byte is 0 if the message was sent by the local user, and 1 if it was received from his/her buddy. Bytes 13 and 14 are used to calculate the SIZE of the message to follow.
- read an array of bytes, of the size calculated from the header. This array will be xor-ed with the local user's name.
- skip 4 bytes.