// derived from easymyp and uodev boards
// http://code.google.com/p/easymyp/source/browse/trunk/EasyMYP/MYPInfo.txt
// http://www.uodev.de/viewtopic.php?t=4908

MYP-File
{
  MYP-Header
  (NULL[]|MYP-File-Table|MYP-File[])[]
}

MYP-Header
{
  uint32_t: Magic DWORD                          (0x0050594D; "MYP\0")
  uint32_t: Version                              (0x00000005)
  uint32_t: Byte order mark                      (0xFD23EC43)
  uint64_t: File offset of first MYP-File-Table
  uint32_t: Unknown                              (seems to be always 1000)
  uint32_t: Number of files in the whole archive
  uint32_t: Modification counter                 (gets incremented when any changes are made on myp and is reset on repack/defrag)
  uint32_t: Modification counter                 (gets incremented when any changes are made on myp and is reset on repack/defrag)
} //easymyp doc says there might be a header checksum but it doesn't seem so

MYP-File-Table
{
  uint32_t: This Filetable's capacity
  uint64_t: File offset of next file table (or zero if no other ft)
  MYP-File-Entry[]
  (NULL[])                                 (not filled entries are filled with NULLs)
}

MYP-File-Entry
{
  uint64_t: File offset of MYP-File
  uint32_t: ml: Metadata size
  uint32_t: cl: Compressed data size
  uint32_t: ul: Uncompressed data size
  uint32_t: ph: Path checksum (1/2)
  uint32_t: sh: Path checksum (2/2)
  uint32_t: mc: Metadata CRC32 checksum (uodev: Adler32LE till version 4)
  uint16_t: ct: Compression method (0 - no compression, 1 - zlib)
}

MYP-File
{
  MYP-Metadata
  DATA[cl]
}

MYP-Metadata(Version: 5)
{
  uint16_t: Unknown (seems to be always 4)
  uint16_t: size of following meta data
  uint16_t: sig_id
  uint16_t: sig_len (size of following signature)
  DATA[sig_len] // RSA signature? (encoded checksum)
}

// unused as never existed in warhammer:
MYP-Metadata(Version: 4)
{
  uint16_t: Data type
  uint16_t: Offset to data
  uint64_t: FILETIME Windows API structure
}