6. Detailed server packet analysis

This section goes through the individual packets that the server can send.

6.1. The ERROR_MESSAGE packet

The error message packet is sent back to the client to inform the client that an error has occurred.

Table 11. ERROR_MESSAGE contents

LengthContent (if fixed)NameDescription
2 bytes00 02MARK_ERRORA marker to indicate that this block contains an error string.
4 bytesxx xx xx xxERROR_LENThe length of the error string.
variable ERROR_STRINGThe error string.
2 bytes00 01MARK_UNKNOWNUnknown.
4 bytes00 00 00 02UNKNOWN_LENUnknown
2 bytes00 01UNKNOWNUnknown.

6.2. The LOGIN_NOTIFY packet

Login notify message to inform client that server is experiencing difficulties.

Table 12. LOGIN_NOTIFY contents

LengthContent (if fixed)NameDescription
2 bytes00 02X1Unknown marker.
4 bytesxx xx xx xxTEXT_LEN1The length of the notification string.
variable NOTICE_STRINGThe notification string

6.3. The LOGIN_BAD_RESP packet

Login failure message when Client sends a bad LOGIN_RESP packet.

Table 13. LOGIN_BAD_RESP contents

LengthContent (if fixed)NameDescription
2 bytes00 02X1Unknown.
4 bytesxx xx xx xxTEXT_LEN1The length of the error string.
variable ERROR_STRINGA string indicating the error.
2 bytes00 01X2Unknown.
4 bytes00 00 00 02X3Unknown.
2 bytes00 01X4Unknown.

6.4. The REGISTER_OK packet

Registration successful message when client sends a proper REGISTER packet.

Table 14. REGISTER_OK contents

LengthContent (if fixed)NameDescription
2 bytes00 01X1Unknown. Possibly a marker for the welcome message.
4 bytesxx xx xx xxWELCOMEMSG_LENThe length of the welcome message
variable WELCOMEMSGThe welcome message

6.5. The KEEP_ALIVE_RESP packet

The KEEP_ALIVE_RESP packet is sent from the server to the client after the server receives a KEEP_ALIVE packet. This packet contains no data. A sequence number is stored in the low command bytes. It seems to always match the sequence number from the last KEEP_ALIVE packet.

6.6. The LOGIN_CHAL packet

The login challenge packet.

Table 15. LOGIN_CHAL contents

LengthContent (if fixed)NameDescription
2 bytes00 02X1Unknown.
4 bytesxx xx xx xxTEXT_LEN1The length of an unknown string.
variable X2An unknown random string.
2 bytes00 01X1Unknown.
4 bytesxx xx xx xxTEXT_LEN2The length of the hashing string.
variable HASH_STRINGThe bytes of the hashing string.

The HASH_STRING is used in the LOGIN_RESP packet sent by the client to generate a proper hash code.

6.7. The LOGIN_OK / MOTD packet

The login OK message with optional message of the day.

Table 16. LOGIN_OK / MOTD contents

LengthContent (if fixed)NameDescription
2 bytes00 0CBLOCK_EXCHANGE_RATEUsed to mark the exchange rate block. Not in all responses.
4 bytesxx xx xx xxEXCHANGE_RATE_LENThe length of the exchange rate message
variable EXCHANGE_RATEThe exchange rate message
2 bytes00 0BX2Unknown.
4 bytesxx xx xx xxCURRENCY_LENLength of the currency field
variable CURRENCYThe currency. "USD" for US dollars.
2 bytes00 0AX3Unknown.
4 bytesxx xx xx xxUNKNOWN_IP_LENAn IPv4 address
variable IP_ADDRESSAn ip address. (e.g. "202.154.106.233")
2 bytes00 09X4Unknown.
4 bytes00 00 00 04X5Unknown.
4 bytes00 00 00 03X6Unknown.
2 bytes00 08X7Unknown.
4 bytes00 00 00 01X8Unknown.
1 byte00X9Unknown.
2 bytes00 06X10Unknown.
4 bytes00 00 00 01X11Unknown.
1 byte00X12Unknown.
2 bytes00 03X13Unknown.
4 bytesxx xx xx xxMOTD_LENLength of the MOTD string
variable MOTDThe message of the day
2 bytes00 02X14Unknown.
4 bytes00 00 00 01X15Unknown.
2 bytes00X16Unknown.
1 byte00 01X17Unknown.
4 bytesxx xx xx xxMOBILE_NUM_LENThe length of the string containing your mobile number
variable MOBILE_NUMYour mobile number including country code without () or dashes

6.8. The CLIST_GROUPS packet

The packet sent after the client requests the contact list. This packet contains the groups on the contact list. Each group is sent in a different packet.

Table 17. CLIST_GROUPS contents

LengthContent (if fixed)NameDescription
2 bytes00 02MARK_GROUPNAMEA marker that indicates this block contains the name of the group.
4 bytesxx xx xx xxGROUPNAME_LENThe length of the name of the group
variable GROUPNAMEThe name of the group. (e.g. "mig33 Contacts")
2 bytes00 01MARK_IDA marker for an unknown block.
4 bytes00 00 00 04ID_LENSeems to always be 4.
4 bytesxx xx xx xxIDAn ID number for this group.

The ID number is used when you get the buddies in the contact list. In block 4 of the contact packet, the ID code will tell you which group a buddy belongs to.

6.9. The CLIST_BUDDIES packet

The packet sent after the client requests the contact list. This packet contains the buddies on the contact list. Each buddy is sent in a different packet.

Table 18. CLIST_BUDDIES contents

LengthContent (if fixed)NameDescription
2 bytes00 19MARK_UNKNOWNA marker for an unknown block.
4 bytes00 00 00 01UNKNOWN_LENThe length for some unknown data. Possibly a flag.
1 byte00UNKNOWNAn unknown piece of data. Seems to always be 0?
2 bytes00 03MARK_USERNAMEA marker for the username
4 bytesxx xx xx xxUSERNAME_LENThe length of the username
variable USERNAMEThe username.
2 bytes00 0DMARK_STATUSA marker used to indicate a buddy's status.
4 bytes00 00 00 01STATUS_LENThe length of the status byte.
1 bytexxSTATUSStatus. 0x63 = "Offline", 0x01 = "Online".
2 bytes00 02MARK_GROUP_IDA marker used to indicate which group a buddy is in.
4 bytes00 00 00 04GROUP_ID_LENThe length of the GROUP_ID.
4 bytesxx xx xx xxGROUP_IDThe group ID that this buddy belongs to.
2 bytes00 0CMARK_BUDDY_NAMEA marker used ot indicate the buddies name again.
4 bytesxx xx xx xxBUDDY_NAME_LENThe length of the buddies name.
variable BUDDY_NAMEThe buddy's name.
2 bytes00 01MARK_BUDDY_IDA marker for the buddy ID.
4 bytes00 00 00 04BUDDY_ID_LENThe length of the buddy ID.
4 bytesxx xx xx xxBUDDY_IDThe Buddy ID.

6.10. The CLIST_TERMINATOR packet

The contact list terminator. It has no parameters.

6.11. The CLIST_STATUS_CHANGE packet

The packet sent to notify a client that a buddy's status has changed.

Table 19. CLIST_STATUS_CHANGE contents

LengthContent (if fixed)NameDescription
2 bytes00 02MARK_STATUSA marker that indicates this block contains the status number.
4 bytes00 00 00 01STATUS_LENThe length of the status byte.
1 bytexxSTATUSThe users status. 0x63 = Offline, 0x01 = Online.
2 bytes00 01MARK_BUDDY_IDA marker to indicate the buddy id.
4 bytes00 00 00 04BUDDY_ID_LENThe length of the buddy ID.
4 bytesxx xx xx xxBUDDY_IDThe buddy id who's status has changed.

6.12. The RECV_MSG packet

The packet sent to notify a client that another user sent a message to a chat room or mig33 contact.

Table 20. RECV_MSG contents

LengthContent (if fixed)NameDescription
2 bytes00 08MARK_MSGA marker that indicates this block is the chat message.
4 bytesxx xx xx xxMSG_LENLength of the chat message.
variable MSGThe bytes that make up the chat message.
2 bytes00 06MARK_X1A marker for an unknown block.
4 bytes00 00 00 02X2_LENAn unknown length
2 bytes00 01X3An unknown piece of data.
2 bytes00 04MARK_DESTINATIONA marker for the destination string.
4 bytesxx xx xx xxDESTINATION_LENLength of the string containing the destination.
variable DESTINATIONThe name of the destination. Can be either a chatroom or a user's name.
2 bytes00 03MARK_X4A marker for an unknown block.
4 bytes00 00 00 01X5_LENAn unknown length
1 bytexxX6Unknown. Can be 03 or 01. This may be an indication of whether the message is to a chat room or to a user.
2 bytes00 02MARK_USERA marker for the user who sent the message.
4 bytesxx xx xx xxUSER_LENThe lenght of the username
variable USERThe username that sent the message.
2 bytes00 01MARK_X7An unknown marker.
4 bytes00 00 00 01X8_LENAn unknown length
1 byte01X9Unknown.

6.13. The RECV_SYS_MSG packet

This packet is sent to the client when the server needs to inform the client about some event.

Table 21. RECV_SYS_MSG contents

LengthContent (if fixed)NameDescription
2 bytes00 05MARK_DATAA marker that indicates this block contains the data of the system message.
4 bytesxx xx xx xxDATA_LENLength of the data message.
variable DATAThe bytes that make up the data. Could be a URL.
2 bytes00 04MARK_DESCA marker that indicates this block contains a description of the data in the system mesage.
4 bytesxx xx xx xxDESC_LENLength of the description.
variable DESCThe bytes that make up the decription.
2 bytes00 02MARK_INVOKERA marker that indicates this block contains the invoker of the system message.
4 bytesxx xx xx xxINVOKER_LENLength of the invoker's nick.
variable INVOKERThe bytes that make up the invoker's name
2 bytes00 01MARK_UNKNOWNAn unknown block of data.
4 bytes00 00 00 01UNKNOWN_LENAn unknown length. Seems to always be 1 byte.
1 byte01UnknownSeems to always be 01.