The module pack init.ocm1 carries 31 modules of native code. One of them sits in the file
unencrypted and holds the key ring; the other 30 are literals of the
encrypted program. Offsets on this page count from the start of the module header. All numbers are little-endian.
The ring of the pack
The pack has no ring block. The module in its second OCTET STRING, named intrins, is stored without
encryption: a header and a zlib stream. In the inflated image the 8192-byte ring stands directly in front of the
T1 table of the cipher, at offset 0xd230. It is byte for byte the ring
that all the type-01 files carry. A reader therefore needs nothing but the file itself to open it: inflate the
record, find T1, take the 8192 bytes before it, and decrypt the body with the seed of the pack.
Module header
| Offset | Size | Field | Meaning |
|---|---|---|---|
0x00 | 20 | zero | Zero bytes. |
0x14 | 40 | unknown | Differs from module to module. |
0x3c | 2 | reserved | Zero. |
0x3e | 8 | name | ASCII, padded with zeros. |
0x46 | 1 | reserved | Zero. |
0x47 | 1 | compression | 1: a zlib stream follows the header. 0: the image is stored as it is. |
0x48 | 4 | image size | Size in memory, header included; the same as header plus image, or up to 15 more. |
0x4c | 4 | entry | Offset of the entry point. |
0x50 | 4 | unknown | Equal to the image size except in at3ex, at3hq and at3plus, where it is smaller. |
0x54 | 4 | unknown | Zero except in the same three: 0xd0000, 0x40000 and 0x2b0000. |
0x58 | 4 | relocation offset | Where the relocation table starts. |
0x5c | 4 | relocation bytes | Size of the table, a multiple of 8. |
0x60 | … | image | One zlib stream, or the stored bytes. |
Offsets in the header refer to the module as loaded: the 0x60-byte header, followed by the inflated bytes. The
reference reader inflates a module only when the compression byte is 1 and its name is neither wm nor _wm.
Relocation table
Each entry is 8 bytes. The first word holds the type in its low byte and the target offset in the upper 24 bits; the second word is the value. The reader copies the module into memory and writes one 32-bit word at each target.
| Type | Word written at the target |
|---|---|
0x02 | module base + value |
0x09 | the value as it is |
0x80 | an address in the data of the reader + value |
0x81, 0x82, 0x84, 0x85, 0x86 | a relative 32-bit reference to one of five functions of the reader (target address of the function − address of the word − 4) |
The reader treats any other type as an error. The compressed modules of the pack hold 17,730 entries.
The modules of the pack
In file order, the encrypted program holds extrins, compat, at3ex, at3hq, at3plus,
atwrap, attrans, aawrap, mp3, wmamod, wm (the one stored without compression), ocmmod,
mgrmod, trkinf, maclist, localek, pcmacli, misc, lekbdnk, sinfpar,
gpdbind, asndec, error, salenc, crypto, mgraes, xmlpars, rsam,
ezaes and kmf. Short runs of operation bytes separate them, and the program ends with the literal
intrinz. The explorer lists every module with its header fields, every relocation and the whole inflated image.
Sources
- Analysis of
init.ocm1of a SonicStage 4.3 installer's OpenMG package and of the loading routine of the reference reader in the same package (2026-12-03). No Sony document describes the format.