P2P Protocol


P2Pv1 Headers


The flags define the type of P2P message that is being sent.

  • 0x0 Normal Message
  • 0x1 Nak
  • 0x2 Ack
  • 0x4 Waiting for a pending invite
  • 0x8 Notify a binary error
  • 0x10 File
  • 0x20 Msn Object: Display Picture or Custom Emoticon Data
  • 0x40 Close session
  • 0x80 Error at transport layer protocol
  • 0x100 Direct Handshake
  • 0x1000000 Define data for File transfer

The footer is 4 bytes long (DWORD) in big endian. It represents the Application Identifier (AppID)

  • 0x0 Negotiating session
  • 0x1 MsnObject: Display Picture or Custom Emoticon
  • 0x2 File transfer
  • 0xB CustomEmoticon (0d11)
  • 0xC Display Image (0d12)


Msnobj based transfers

MSNObject Description

The MSNObject is the way of MSNP to identify contents: Display Pictures, Custom Emoticons, Backgrounds, Voice Clips, etc.


The MSNObject has always the following format

<msnobj Creator="buddy@hotmail.com" Size="24539" Type="3" Location="TFR2C.tmp" Friendly="AAA=" SHA1D="trC8SlFx2sWQxZMIBAWSEnXc8oQ=" SHA1C="U32o6bosZzluJq82eAtMpx5dIEI="/>

This field specify the person who made the object, in other words, the sender. Typically is the address of the buddy.


The total size of the data the object represents, in bytes.


Indicates which kind of transaction this object describes.

The known types are documented in the Reference page.


Contains the filename under which the filename will be, or has been stored.


Contains the name of the picture in Unicode (UTF-16 Little Endian) format. The string is encoded with Base64. For most types of descpritors this field is a null character or 'AAA=' when encoded.


The SHA1D field contains the SHA1 hash of the images data encoded in Base64. It's also known as the Data Hash or the SHA1 Data Field.


Contains all previous fields hashed with SHA1, and then encoded in Base64. This field is better known as the Checksum or SHA1 Checksum Field. The string format must be hashed to get the resulting SHA1C value looks similar to:


It is suspected, but not verified, that the order in which the fields are hashed must be the same as the order of the fields in the XML format.