GME Media file table - entropia/tip-toi-reveng GitHub Wiki

The media file table consists of pairs of offsets and length (both 32bit). There seems to be no explicit definition of the number of records in this list, so we simply look until either

  • the first media content referenced in the list begins,
  • or the additional media file table appears, which is then followed by the first media content.

The media files themselves are encrypted using a simple scheme, using a magic XOR value (x):

  • The values 0x00, 0xFF, x and x XOR 0xFF are left alone
  • Everything else is XORed bytewise by x.

The magic XOR value can be found by finding the number which makes the first 4 bytes of the first media file read OggS or RIFF.

In the header at position 0x001c there is raw XOR value that is used by the firmware to deduct the real XOR value. It might use some algorithm or a lookup table for that. For all seen TipToi gme files same raw XOR value here leads to same real XOR value. As of now ~55 different combinations have been identified by looking at existing gme files.

The purpose of the additional media file table is unknown. For many files it is identical to the main audio table, for some only single files differ.

Maybe the media flag table is applied only for one of those two.