######################################################################## UMOD file format 0.2.1 by Luigi Auriemma e-mail: aluigi@autistici.org web: aluigi.org ######################################################################## The UMOD file format is used by the UnrealTournament games (Unreal, UT99, UT2k3, UT2k4 and so on) to install mods and other files enough easily. It is just a simple container (a package) and in fact contains all the files that will be copied in the game's folder. The UMOD file format is composed by 3 sections: FILES: where are located all the files INDEX: where are written the filenames, their sizes and offsets END: it is part of the INDEX section and contains some informations as the size of the INDEX section and the 32bit checksum used by the UMOD installer to know if a package is corrupted. The only method to read the package (and also the same used by setup.exe) is from the end of the package (20 bytes) just reading where the INDEX section starts. I have written a nice extractor (for Win and *nix) available here: http://aluigi.org/papers/umodext.zip ######################################################################## ============================== File format, the INDEX section ============================== bytes description ------------------ INDEX it is the first number pointed by the offset used in the value "END->beginning of INDEX". It contains the total number of files in the package For each file: bytes description ------------------ INDEX filename size (n) n filename (NULL terminated) 4 starting file offset (where the file starts in the package file) 4 file size 4 flag. A flag equal to 3 is "generally" used for a setup file (like manifest.ini) so must not be extracted END: bytes description ------------------ 4 umod sign 0x9fe3c5a3 4 beginning of INDEX section 4 ending of INDEX section 4 usually 1 (I don't really know what it means) 4 package checksum (read behind) INDEX = with "INDEX" I mean the index number format of EpicGames. This format is enough simple and is used to use less bytes for numbers. On my website there is an old program containing the functions needed to read and write this type of numbers: http://aluigi.org/papers/unrindex.zip However a more comprehensible explanation (moreover for who doesn't know the C language) is available on the Antonio Cordero website http://www.acordero.org ######################################################################## ==================== Checksum calculation ==================== Calculating the checksum is very simple, in fact must be used a CRC algorithm called appmemcrc() and must applied to all the file except for the last 20 bytes. The function is available on my website: http://aluigi.org/papers/umodcrc.h The following is the CRC algorithm in C language (gcrctable is the CRC table used by the algorithm but I have not included it below for space reasons): u_long appmemcrc(u_char *buff, u_long size, u_long oldcrc) { u_char *ptr; oldcrc = ~oldcrc; for(ptr = buff; size > 0; size--, ptr++) { oldcrc = (oldcrc << 8) ^ gcrctable[*ptr ^ (oldcrc >> 24)]; } return(~oldcrc); } ########################################################################