If you want to create your own tool for building or extracting files from UMOD installers, you'll need knowledge about their internal structure.
A UMOD installer file consists of three parts:
- First comes the (uncompressed) content of all files that are contained in the UMOD installer.
- After that, a list of files including their offset and length (and some more information which is detailed below) follows.
- At the very end of the UMOD file (with a fixed offset from the file end), the UMOD file "header" is stored.
The UMOD installer must contain a file Manifest.ini that describes the target locations of the files, the installed mod's requirements and other details, and Manifest.int that contains the textual captions and descriptions used in the installer. See /Creating on how to set up those files.
Described in reverse order of their appearance in the file, since this is the order they'll be parsed when reading the UMOD file.
The UMOD file header is 20 bytes long. The header is stored in the last 20 bytes of the file (hence the quotes around the term "header").
|0||4||unsigned int||Magic number. Used to verify this file as a UMOD installer. Always 0x9FE3C5A3.|
|4||4||unsigned int||Byte offset of file directory in the UMOD file. (See below.)|
|8||4||unsigned int||Total byte size of the UMOD file.|
|12||4||unsigned int||UMOD file version.|
|16||4||unsigned int||CRC32 checksum over the file content.|
Mychaeel: That CRC32 checksum needs further investigation... It's just a guess that the checksum goes over the file content (first part of UMOD file) only. Besides, I've been running into problems trying to verify UnrealScript source code TextBuffer checksums using a standard CRC32 algorithm with a standard seed – or I didn't feed it the right data. Any help?
The file directory describes the files stored in the first part of the UMOD file. Its byte offset in the UMOD file is given in the file "header" (see above).
The directory consists of an index-type file count (the index data type is described below), followed by variable-size records, each describing one file in the UMOD installer.
|0||variable||index||Length of file name (including trailing null byte).|
|variable||char||File name, with trailing null byte.|
|4||unsigned int||Byte offset of file in UMOD file.|
|4||unsigned int||Byte length of file.|
|4||unsigned int||Bit field describing file flags. (See below.)|
Mychaeel: Feel free to investigate and contribute information about the file flags. (I know that they have to be set to 0x03 for Manifest.ini and Manifest.int to prevent those files from being copied to the user's System directory, and set to 0x00 for all other files.)
The files are stored without compression starting from byte 0 of the file, one after another, with no padding or separators between them. Their respective byte offsets in the file are specified by the file directory (see above).
Specifications of the integer and index values can be found: Package File Format/Data Details