"movinand.bin" file format

In this page it's described the header format and the "compression schema".

hexdump of header and more

The starting point of the analysis:

00000000  46 41 54 48 45 41 44 00  00 00 00 00 00 00 00 00  |FATHEAD.........|
00000010  00 90 d3 00 00 00 00 00  00 00 00 00 00 30 f6 0a  |.............0..|
00000020  00 00 00 00 00 00 00 00  00 f0 03 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000003b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 62  |...............b|
000003c0  f5 b7 83 62 f5 b7 10 00  00 00 00 00 10 00 00 62  |...b...........b|
000003d0  f5 b7 83 62 f5 b7 10 00  10 00 00 e0 0c 00 00 62  |...b...........b|
000003e0  f5 b7 83 62 f5 b7 10 e0  1c 00 00 20 03 00 00 00  |...b....... ....|
000003f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002200  eb 3c 90 6c 69 62 46 41  54 20 20 00 02 20 08 00  |.<.libFAT  .. ..|
...

movinand.bin header

/trac/movitool/chrome/site/images/movinand_header.jpg

#define MN_FAT_MAGIC "FATHEAD"
#define MN_RFS_MAGIC "RFSHEAD"
#define MN_MAGIC_LEN 0x7

#define MN_PT_OFFSET 0x00000200 // 512 byte

/*
 * FATHEAD (or RFSHEAD) string null terminated
 * 8 byte null
 * Size of fist FAT (32bit)
 * 8 byte null
 * Size of second FAT (32bit)
 * 8 byte null
 * Size of third FAT (32bit)
*/

typedef struct moviheadfsentry
{
    u_int8_t unk[8]; //always null
    u_int32_t fs_size;
} mn_fsentry;

typedef struct movihead
{
    u_int8_t magic[7]; //maybe "FATHEAD" or "RFSHEAD"
    mn_fsentry fsentry[4];
    u_int8_t unk_5[453]; //always null
} mn_header;

partition table

Standard MBR (512 byte) at offset 0x00000200 (defined as MN_PT_OFFSET).

compression schema

Simply all filesystem are pruned from the trailing 0x00, concatenated in movinand.bin file and size stored in movinand.bin header. This way size in header could be used as offset for the subsequent filesystem in movinand.bin file.