 Copyright (C) 2007-2011  pancake <pancake@youterm.com>
 Copyright (C) 2011-2012  Pali Rohár <pali.rohar@gmail.com>

SPECS FOR THE FIASCO FIRMWARE FILE FORMAT ffff!
-----------------------------------------------

  This is final working version of FIASCO format. FIASCO image which
  is generated by this spec is acceptable by Nokia flasher-3.5 and
  unpack data same as FIASCO image generated by Nokia fiasco-gen. This
  format is implemented in 0xFFFF and every image which I tested
  (generated by 0xFFFF and fiasco-gen) was properly unpacked under
  0xFFFF and flasher-3.5 with same result. Small difference is that
  fiasco-gen add some unknown subsection block to image header
  (type '4' or '/') which contains some messy characters... But if
  these sections missing, flasher-3.5 working fine too. And old FIASCO
  images (for N8x0) does not have these subsection...


FILE HEADER

   1 byte = 0xb4    --  signature
   4 bytes          --  FW header length (big endian)


FW HEADER

   4 bytes          --  number of FW header blocks (big endian)
             block {
   1 byte           --  type of block
                          0xE8 - Fiasco name
                          0x31 - FW name
   1 byte           --  length of block data
   N bytes          --  block data
             }


IMAGE

   1 byte = 0x54    --  signature
   1 byte           --  number of subsection blocks
                        (start of data block)
   1 byte           --  type of subsection block (data - always 0x2e)
   1 byte           --  length of subsection block (data - always 25)
   3 bytes          --  unknown (always 0x01 0x01 0x00)
   2 bytes          --  checksum for the image contents (xorpair) (big endian)
  12 bytes          --  image name type (first byte is FF if is the last image)
   4 bytes          --  length of image data (big endian)
   4 bytes          --  unknown (always 0x00 0x00 0x00 0x00)
                        (end of data block)
             block {
   1 byte           --  type of subsection block
                          '1' - version
                          '2' - device & hw revisions (size of device is 16, hw revision 8)
                          '3' - layout
                          '4' - unknown
                          '/' - unknown
   1 byte           --  length of subsection block
   N bytes          --  subsection block data
             }
   1 byte           --  unknown (0x00 is accepted, maybe end of subsections?)
   N bytes          --  image data
