Difference between revisions of "MOGG File Format"

From Milo Modding Wiki
Jump to navigation Jump to search
(Created page with "MOGG files are often used in Harmonix games for all platforms except for PS2 and DS. They are an extension of the [https://xiph.org/vorbis/ OGG Vorbis] container with an extra header prepending it, and almost all official MOGGs shipped on-disk and as DLC are encrypted. The version value in the MOGG header is used to indicate which encryption key and format should be used for decryption. ==Structure== ===MOGG Header=== {| class="wikitable" !Name !Type !Size !Function...")
 
m (Add basic information about encryption)
Line 1: Line 1:
MOGG files are often used in Harmonix games for all platforms except for PS2 and DS. They are an extension of the [https://xiph.org/vorbis/ OGG Vorbis] container with an extra header prepending it, and almost all official MOGGs shipped on-disk and as DLC are encrypted.
MOGG files are often used in Harmonix games for all platforms except for PS2 and DS. They are an extension of the [https://xiph.org/vorbis/ OGG Vorbis] container with an extra header prepending it, and almost all official MOGGs starting with [[Rock Band (game)|Rock Band]] shipped on-disk and as DLC are encrypted.


The version value in the MOGG header is used to indicate which encryption key and format should be used for decryption.
The version value in the MOGG header is used to indicate which encryption key and format should be used for decryption.
Line 46: Line 46:
|Byte Array
|Byte Array
|16 bytes
|16 bytes
|An obfuscated key used to encrypt the file. Only present if MOGG version is >= 11 / 0xB.
|An AES key used to encrypt the file. ''Only present if MOGG version is >= 11 / 0xB.''
|}
|}


Line 68: Line 68:
|4 bytes
|4 bytes
|The sample in the OGG stream that corresponds to the byte offset.
|The sample in the OGG stream that corresponds to the byte offset.
|}
===OGG File===
Past this point is a regular OGG Vorbis format file containing multiple tracks. The tracks corresponding to instruments are defined in the [[songs.dta]] file.
==Encryption==
{| class="wikitable"
!Generation
!Info
!Games
|-
|10 / 0xA
|Unencrypted. Lacks key in MOGG header.
|Used in [[Guitar Hero 2]]
|-
|11 / 0xB
|128-bit AES EBC encryption with a static key. Uses key in MOGG header as IV.
|Used in [[Rock Band (game)|Rock Band]] on-disc songs
|}
|}


Line 78: Line 98:
* [[ArkTool]]
* [[ArkTool]]
* [[C3 CON Tools]]
* [[C3 CON Tools]]
* [https://www.audacityteam.org/ Audacity] (supports reading smaller unencrypted MOGG files directly)


==References==
==References==

Revision as of 05:25, 6 June 2022

MOGG files are often used in Harmonix games for all platforms except for PS2 and DS. They are an extension of the OGG Vorbis container with an extra header prepending it, and almost all official MOGGs starting with Rock Band shipped on-disk and as DLC are encrypted.

The version value in the MOGG header is used to indicate which encryption key and format should be used for decryption.

Structure

MOGG Header

Name Type Size Function
Version Integer (LE) 4 bytes Version of the MOGG file. Related to encryption (10 / 0xA = unencrypted)
Header Size Integer (LE) 4 bytes Length of the MOGG header / offset in the file where the OGG begins.
Map Version Integer (LE) 4 bytes Version of the MOGG map. (usually 16 / 0x10)
Buffer Size Integer (LE) 4 bytes Usually 20000 / 0x4E20. (TODO: what purpose?)
Entry Count Integer (LE) 4 bytes The number of entries in the MOGG header.
Entries #MOGG Entry Array sizeof(MOGG Entry) * Entry Count Presumably a table to help the game stream the OGG file from disk.
AES Key Byte Array 16 bytes An AES key used to encrypt the file. Only present if MOGG version is >= 11 / 0xB.

MOGG Entry

TODO: is this correct?

Entry Type Size Function
Byte Offset Integer (LE) 4 bytes Offset into the file that the entry starts.
Sample Integer (LE) 4 bytes The sample in the OGG stream that corresponds to the byte offset.

OGG File

Past this point is a regular OGG Vorbis format file containing multiple tracks. The tracks corresponding to instruments are defined in the songs.dta file.

Encryption

Generation Info Games
10 / 0xA Unencrypted. Lacks key in MOGG header. Used in Guitar Hero 2
11 / 0xB 128-bit AES EBC encryption with a static key. Uses key in MOGG header as IV. Used in Rock Band on-disc songs

Tools

Several tools are available for working with MOGG files (creation/extraction, encryption, etc)

References