tags:

views:

90

answers:

1

I'm trying to calculate the stream name for the named property part of an MSG file, specifically string named properties. The MSG file format specification says that the ID is generated as follows:

Stream ID = 0x100m ((ID XOR (GUID index << 1 | 1)) MOD 0x1f

Where the ID value is the CRC-32 for the "Unicode name identifier". I'm also confident that 0x100m is actually 0x1000.

This somehow maps 'x-mailer' to 0x100f when the GUID index is 3. The value for ID is 0x894e50ff (since it is stored in another location), but how does 'x-mailer' get converted to that value?

(These are the properties stored under "__nameid_version1.0", partly inside the "__substg1.0_00040102" stream).

+1  A: 

Here is the answer from a Microsoft Engineer:

Hi Luke,

Sorry it took so long to get back to you on this. I verified the CRC-32 calculation and it indeed results in a value of 0xff504e89 for the string 'x-mailer'. Two things that you need to consider:

  1. make sure you are calculating CRC for 'x-mailer' as a UNICODE string. ASCII will give you a different result.
  2. make sure you are using the algorithm specified by MS-OXRTFCP sections 3.1.3.2 and 3.1.4 including using the precalculated lookup table and the corresponding algorithm pseudocode.

If you follow these, you will get the proper result.

Let me know if you are able to get this working.

Regards, Tom Jebo Senior Support Escalation Engineer Microsoft DS Protocol Team

Luke Quinane