Help gurus! I am very very close to complete the decode of a simple...

Help gurus! I am very very close to complete the decode of a simple... SearchSearch
Author Message
Anonymous
 
Posted on Wednesday, March 17, 2004 - 04:01 am:   

I am trying to decode a simple MMS thats only have a text ("This is a multimedia test").. this is the MMS...


0x8C (Message Type) == 0x80 (m-send-req)
0x98 (Transaction ID) == 0x31 0x38 0x34 0x35 0x31 0x35 0x39 0x35 0x39 0x39 0x0
0x8D (MMS Version) == 0x90 (8 bits)... converted to 7bits -> 0010000 = 001 0000 = (1.0)
0x89 (From) == 0x1 0x81 (Insert Address Token)
0x97 (To) == 0x30 0x39 0x36 0x31 0x37 0x31 0x34 0x39 0x36 0x33 0x2F 0x54 0x59 0x50 0x45 0x3D 0x50 0x4C 0x4D 0x4E 0x0
0x8A (Message Class) == 0x80 (Personal)
0x88 (Expiry) == 0x5 0x81 0x3 0x1 0x51 0x80
0x8F (Priority) == 0x81 (Normal)
0x86 (Delivery Report) == 0x81 (No)
0x90 (Read Reply) == 0x81 (No)

0x84 (Content Type) Format= [header len][data len][content type][headers][data]
-> 0x1F == Header Length: Length Quote (uintvar)
-> 0x21 == Header Length in bytes (32 bytes)
-> 0xB3 == Content Type (application/vnd.wap.multipart.related)
-> 0x8A (Start) == 0x3C 0x31 0x36 0x33 0x38 0x35 0x39 0x39 0x34 0x33 0x38 0x3E 0x0 (<1638599438>)
-> 0x89 0x61 0x70 0x70 0x6C 0x69 0x63 0x61 0x74 0x69 0x6F 0x6E 0x2F 0x73 0x6D 0x69 0x6C 0x0 (application/smil)

//After that, you're done with the headers, and into the "application/vnd.wap.multipart.related" content.


-> 0x2 == Entries Number (text and smil ???)
-> 0x20 == Header Length
-> 0x34 == Data Length
-> 0x12 0x83 0x81 0x2 0x3 0xE8 0x85 == ????
-> 0x54 0x68 0x69 0x73 0x5F 0x69 0x73 0x2E 0x74 0x78 0x74 0x0 == This_is.txt
-> 0x8E (Content Location) == 0x54 0x68 0x69 0x73 0x5F 0x69 0x73 0x2E 0x74 0x78 0x74 0x0 == This_is.txt
-> 0xFF 0xFE == ?????
// The content of the file this_is.txt...
-> 0x54 0x0 0x68 0x0 0x69 0x0 0x73 0x0 0x20 0x0 0x69 0x0 0x73 0x0 0x20 0x0 0x61 0x0 0x20 0x0 0x6D 0x0 0x75 0x0 0x6C 0x0 0x74 0x0 0x69 0x0 0x6D 0x0 0x65 0x0 0x64 0x0 0x69 0x0 0x61 0x0 0x20 0x0 0x74 0x0 0x65 0x0 0x73 0x0 0x74 0x0 0x2E 0x82 0x7B 0x1E 0x61 0x70 0x70 0x6C 0x69 0x63 0x61 0x74 0x69 0x6F 0x6E 0x2F 0x73 0x6D 0x69 0x6C 0x0 0x81 0xEA 0x85 0x70 0x72 0x65 0x73 0x2E 0x73 0x6D 0x69 0x6C 0x0

-> 0xC0 (Content Id)
-> 0x22 == ????
-> 0x3C 0x31 0x36 0x33 0x38 0x35 0x39 0x39 0x34 0x33 0x38 0x3E 0x0 == (<1638599438>)

// Begin smil XML document
0x3C 0x73 0x6D 0x69 0x6C 0x20 0x78 0x6D 0x6C 0x6E 0x73 0x3D 0x22 0x68 0x74 0x74 0x70 0x3A 0x2F 0x2F 0x77 0x77 0x77 0x2E 0x77 0x33 0x2E 0x6F 0x72 0x67 0x2F 0x32 0x30 0x30 0x30 0x2F 0x53 0x4D 0x49 0x4C 0x32 0x30 0x2F 0x43 0x52 0x2F 0x4C 0x61 0x6E 0x67 0x75 0x61 0x67 0x65 0x22 0x3E 0xD 0xA 0x20 0x20 0x20 0x3C 0x68 0x65 0x61 0x64 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x6C 0x61 0x79 0x6F 0x75 0x74 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x72 0x6F 0x6F 0x74 0x2D 0x6C 0x61 0x79 0x6F 0x75 0x74 0x20 0x68 0x65 0x69 0x67 0x68 0x74 0x3D 0x22 0x32 0x30 0x38 0x22 0x20 0x77 0x69 0x64 0x74 0x68 0x3D 0x22 0x31 0x37 0x36 0x22 0x20 0x2F 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x72 0x65 0x67 0x69 0x6F 0x6E 0x20 0x69 0x64 0x3D 0x22 0x54 0x65 0x78 0x74 0x22 0x20 0x68 0x65 0x69 0x67 0x68 0x74 0x3D 0x22 0x31 0x30 0x30 0x25 0x22 0x20 0x77 0x69 0x64 0x74 0x68 0x3D 0x22 0x31 0x30 0x30 0x25 0x22 0x20 0x6C 0x65 0x66 0x74 0x3D 0x22 0x30 0x25 0x22 0x20 0x74 0x6F 0x70 0x3D 0x22 0x30 0x25 0x22 0x20 0x66 0x69 0x74 0x3D 0x22 0x73 0x63 0x72 0x6F 0x6C 0x6C 0x22 0x20 0x2F 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x2F 0x6C 0x61 0x79 0x6F 0x75 0x74 0x3E 0xD 0xA 0x20 0x20 0x20 0x3C 0x2F 0x68 0x65 0x61 0x64 0x3E 0xD 0xA 0x20 0x20 0x20 0x3C 0x62 0x6F 0x64 0x79 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x70 0x61 0x72 0x20 0x64 0x75 0x72 0x3D 0x22 0x32 0x30 0x30 0x30 0x30 0x6D 0x73 0x22 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x74 0x65 0x78 0x74 0x20 0x73 0x72 0x63 0x3D 0x22 0x54 0x68 0x69 0x73 0x5F 0x69 0x73 0x2E 0x74 0x78 0x74 0x22 0x20 0x72 0x65 0x67 0x69 0x6F 0x6E 0x3D 0x22 0x54 0x65 0x78 0x74 0x22 0x20 0x2F 0x3E 0xD 0xA 0x20 0x20 0x20 0x20 0x20 0x20 0x3C 0x2F 0x70 0x61 0x72 0x3E 0xD 0xA 0x20 0x20 0x20 0x3C 0x2F 0x62 0x6F 0x64 0x79 0x3E 0xD 0xA 0x3C 0x2F 0x73 0x6D 0x69 0x6C 0x3E 0xD 0xA
// End smil XML document


Apparently, the text "This is a multimedia text" is encoded in UCS-2 (Unicode) How Can I detect that?
Vitaliy N. Kravchenko
New member
Username: Kvn

Post Number: 13
Registered: 10-2003
Posted on Wednesday, March 17, 2004 - 10:44 am:   

0xFF 0xFE == charset utf-be (imho).
...
-> 0xC0 (Content Id)
-> 0x22 == " (quote)
-> 0x3C 0x31 0x36 0x33 0x38 0x35 0x39 0x39 0x34 0x33 0x38 0x3E 0x0 == (<1638599438>)
Anonymous
 
Posted on Wednesday, March 17, 2004 - 04:07 pm:   

1) From where do you get that 0xFF 0xFE = charset utf-be (imho). Do you know some url or documentation thats explain this?

2) When the Quote indicator is present what that means? I don't see any where a quote in the Content Id just a <> Thanks a lot Vitaliy!
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2144
Registered: 10-2002
Posted on Thursday, March 18, 2004 - 12:55 am:   

0x12 0x83 0x81 0x2 0x3 0xE8 0x85 == ????
-> 0x54 0x68 0x69 0x73 0x5F 0x69 0x73 0x2E 0x74 0x78 0x74 0x0

This is the content type, which is always the first field in the header. 0x12 specifies the length of the header.

Content-type: text/plain; charset=iso-10646-ucs-2; name="This_is.txt"

By convention (not sure what standard, but this is not specific to MMS), the first two bytes of a Unicode format text file are: 0xFF 0xFE

The 0xFF 0xFE is beyond the length of the headers, so it is definitely part of the data.

WSP defines the Content-ID field as using the Quoted-string format. Quoted-string format is defined in WSP Section 8.4.2.1, it always starts with a quote character (0x22).
Anonymous
 
Posted on Thursday, March 18, 2004 - 03:17 pm:   

Thanks Bryce, But... in the WSP documentation, the the order is:

Headers length:
Data length:
Content Type
Headers
Data

But you said that 0x12 is the length of the header and after that come the 0x83 that is the content type, so where the data length is? between the content type and headers len is supposes.

Bryce, do you have some url that explain in visually how the content is encoded?
I am confused with the structure and I read too many posts here but I can't find how the content structure can behave. I read too the WSP section: 8.5 Multipart Data but sometimes the structure don't match with the structure that I have in my MMS package

Thank you very much

AA
Vitaliy N. Kravchenko
New member
Username: Kvn

Post Number: 14
Registered: 10-2003
Posted on Thursday, March 18, 2004 - 03:57 pm:   

0x12 0x83 0x81 0x2 0x3 0xE8 0x85
0. 0x12 = 18 (headers_len)
1. 0x83 = Content-type: text/plain;
2. 0x81 = charset
3. 0x02 0x3 0xE8 = (value_len) (value) = iso-10646-ucs-2 = MIBEnum = 1000 = 0x3 0xE8 (see: http://www.iana.org/assignments/character-sets)
6. 0x85 = header object_name
7. This_is.txt+0x00 - object_name null-terminated string.

total: 18 bytes = 0x12

IMHO.

Anonymous
 
Posted on Thursday, March 18, 2004 - 06:41 pm:   

Thanks Vitaliy, but I am still with the doubt... Why there is not a "Data Len" field after "Headers Length" field? thats is making me crazy because there is not a pattern Please help me! :-)
Anonymous
 
Posted on Thursday, March 18, 2004 - 06:53 pm:   

I focus too much in that because in the WSP documentation (Table 26. Multipart Entry Fields) a multipart entry is defined with the structure...:

Headers Len (Uintvar)
Data Len (Uintvar)
ContentType (Multi octets)
Headers (HeadersLen – length of ContentType)
Data (DataLen octects)

There is a "Data len" field before the "content type" field, but in you said that after the "Headers len" field come the "content type".

Well, I am shaking my mind :-)