Siemens .smi/.smi/SMS.dat file format
=====================================

Author: Hendrik Sattler <post@hendrik-sattler.de>

.smi/.smo files:
================

Location of .smi/.smo files:
.smi/.smo files can be found in the "/SMS" directory of
the FlexMem (accessible by obexftp protocl) or MMC.
Only phones manufactured by Siemens that have an address book may
have such a file (with exception to phones with SymbianOS).

The .smi/.smo files have different sizes but the most interesting part
has a static size and is well-defined by ETSI SMS specs.
The examples is an .smi file from a S55 with a size of 193 bytes.

Format: <magic> <version> <header> <entry>*
  magic: 2x 8bit
    These are at the beginning of the file: 0x0b 0x0b for .smi and .smo.

  version: 1x 8bit
    The format version of the header, not really important for us:
      0x00 for SL42
      0x02 for S55

  header: <length> <fields>*
    length: 1x 16bit
      The length of the header in bytes (may be 0, e.g. for SL42)
    fields:
      may be more than one, for S55 those are:
        1x  8bit: count of concatenated short message parts (total)
        1x  8bit: counts of parts in this file
        1x 16bit: unknown meaning
        7x  8bit: SCTS field copied from PDU
        1x  8bit: unknown meaning    

  entry: <status> <pdu>
    Since file format version 02, there can be more than one entry.
    status: 1x 8bit
      The status (implies direction) of this short message:
      values for .smi: 01 (read), 03 (unread)
      values for .smo: 05 (sent), 07 (unsent)
    pdu: exactly 175 octets
      PDU with SMSC-field as specified by ETSI, padded with 0xff


SMS.dat file:
=============

Location of the SMS.dat files
The SMS.dat file can be found in the "/PersistentData/SMS" directory of
the FlexMem (accessible by obexftp protocl) or MMC.
Only phones manufactured by Siemens may have such a file (with exception
to phones with SymbianOS).

The .smi/.smo files have different sizes but the most interesting part
has a static size and is well-defined by ETSI SMS specs.
The examples is an .smi file from a S55 with a size of 17802 bytes.

Format: <magic> <entry>*
  magic: 2x 8bit
    These are at the beginning of the file: 0xff 0xff

  entry: <prefix> <status> <pdu>
    prefix: 2x 8bit
      unknown meaning but always 0x11 0x11
      if this is 0xff 0xff, the "never used" part of the file is reached.
    status: 1x 8bit
      The status (implies direction) of this short message:
      01 (read), 03 (unread), 05 (sent), 07 (unsent) and 00 (empty)
    pdu: exactly 175 octets
      PDU with SMSC-field as specified by ETSI, padded with 0xff
