Introduction
An .ocm or .ocm1 file is a module of the OpenMG secure layer that
Sony shipped with its SonicStage and OpenMG Jukebox software. The player loads these
modules to play and import protected music: decoders for ATRAC3, MP3 and WMA, import and
export helpers, and an init module that sets the layer up. The files are not
executable code of the host processor. Each one carries a program for a small stack-based
virtual machine inside the player, and that program is encrypted.
The explorer on this site decrypts the parts of a module that carry their own key, shows every item of the program at every depth, and lists the bytes of each item.
Structure
Three forms of file exist. A type-01 file starts 03 01 and holds
its own key: an 8192-byte ring and a 16-bit seed, followed by the encrypted stream. A
mode-2 file starts 03 02, then an eight-byte group id and an encrypted body.
The init.ocm1 file wraps a type-01 header in one OCTET STRING and leaves the
ring out. A two-byte file ff ff also occurs, as a stand-in for a module that a package
does not carry. See file layout.
The stream cipher mixes the 16-bit seed through two constant tables and reads one byte of
the ring per plain byte. Decrypted, the stream is a sequence of one-byte operations and
66 literals. A literal that starts 02 hh ll 73 is encrypted again, with the same ring and
the seed hhll, and holds more operations and literals. See cipher and
program.
0Header03 01 00 00 05 00 10 2c 00 00 01 01 04 0814 bytes14Tag, eight bytes, then7e9 bytes23Ring04 82 20 00and 8192 bytes8196 bytes8219Seed block74 02 hh ll 735 bytes8224Stream, encrypted, to the end of the filevaries
Not described
Known, not yet covered
- Mode-2 files: the key of a mode-2 file is not in the file. Files with the same group id share a keystream, and the key is presumably supplied from outside the file, so the explorer shows the header, group id and body as bytes.
- Init module: the
init.ocm1file holds no ring. The explorer shows its wrapper, header, tag and seed and the body as bytes. - Operations: the meaning of the one-byte operations of the virtual machine is not documented, so the program is listed by its literals and runs of operation bytes.
Sources
- Analysis of the 25 type-01, 27 mode-2 and 10 placeholder module files and
init.ocm1of a SonicStage 4.3 installer's OpenMG package, with the cipher constants read from the running reference reader (owner ruling QC088, 2026-12-03). No Sony document describes the format.