Table of Contents

Format of native code blocks in OCM

All pointers are offsets from the beginning of the main header. The file consists of a header (always uncompressed), followed by content (might be compressed). You need to decompress the data first (if compressed) and place it back directly behind the header to access the data pointed to.

Main Header

60h (96) Bytes header:

Format of export table

Each export entry is 8 bytes in size

Format of relocation table

Each relocation entry is 8 bytes in size.

Relocation type 02 and 91: local offset

The type specific info is interpreted as a pointer, the module base added and patched at the relocation position

Relocation type 09: absolute value

The type specific info (the whole DWORD) is simply copied to the relocation position

Relocation type 34: ignored

Relocations of this type are simply skipped during relocation process

Relocation type 80: OpenMG API function

The type-specific info is an offset into the API function pointer table, the offset is written to the relocation position

Relocation type 81-88/CB-D1: call to MS support library functions

Patches the offset of a call instruction (relocation position is the address of the offset) to point to the compiler support library function specific to the type.