-
Notifications
You must be signed in to change notification settings - Fork 5
Universal Disk Image Format
Please refer to the documentation for any ambiguities.
Universal Disk Images (.2mg or .2img) consist of a 64-byte header followed by disk image data. An optional comment chunk and creator-specific chunk (in that order) may be present after the image data.
All values are stored in little endian format.
Name | Offset | Size |
---|---|---|
magic_code | $00 | 4 bytes |
creator_code | $04 | 4 bytes |
header_length | $08 | 2 bytes |
version | $0a | 2 bytes |
format | $0c | 4 bytes |
flags | $10 | 4 bytes |
blocks | $14 | 4 bytes |
data_offset | $18 | 4 bytes |
data_length | $1c | 4 bytes |
comment_offset | $20 | 4 bytes |
comment_length | $24 | 4 bytes |
creator_offset | $28 | 4 bytes |
creator_length | $2c | 4 bytes |
reserved | $30 | 16 bytes |
This is the string '2IMG'.
This is a four-character tag which identifies the file creator. Currently know values are:
Application | Code |
---|---|
Bernie ][ the Rescue | B2TR |
Catakig | CTKG |
Sheppy's ImageMaker | ShIm |
Sweet 16 | WOOF |
ProFUSE | PRFS |
This is the length of the header. Although the documentation specifies 52 (which excludes reserved bytes), some files are known to use 64.
The version number of the image file. This should be 1.
The image data format. Valid values are:
Format | Value |
---|---|
DOS 3.3 Order | 0 |
ProDOS Order | 1 |
Nibblized data | 2 |
Bit flags pertaining to the disk image. Undefined bits should be set to 0.
Bit | Description |
---|---|
31 | If this bit is set, the disk is locked. |
8 | If this bit is set, bits 0--7 are valid. If this bit is not set, a volume number of 254 should be assumed |
0--7 | The DOS 3.3 volume number (0--254). Only valid if bit 8 is set |
The number of 512-byte blocks in the disk image. For Non-ProDOS Order disk images, this field should be 0.
Offset to the first byte of the image data. The image data must come before the comment data and the creator data (if present).
Length of the image data in bytes. For ProDOS Order disk image, this should be blocks *
512.
Offset to the first byte of the comment data. May be 0 if there is no comment.
Length of the comment data. May be 0 if there is no comment.
Offset to the first byte of the creator-specific data. May be 0 if there is no creator-specific data.
Length of the creator-specific data. May be 0 if there is no creator-specific data.