* General comments are indicated by a // at the start of the line If you have any information that you can add to this file, including new archives andĬorrections, please contact WATTO at - your help is greatly appreciated!
#MECHCOMMANDER 2 OMNITECH STRATEGY CODE#
Here, be sure to download the source code for Game Extractor ()Īs it contains fully commented Java code for reading and writing many game archives, Information has been verified by the associated companies or game developers.įor better clarification of format structures, and for additional formats not listed There is absolutely NO GUARENTEE that the information within this document is correct!Īll information has been obtained through experimentation and investigation only, no
** NOTE: Some specifications are not complete. The information contained in a particular file. Specifications to help you create your own programs, or to give you an insight into
#MECHCOMMANDER 2 OMNITECH STRATEGY ARCHIVE#
This file describes many different archive formats used by games. this method although didn't work for MechCommander - and i found out why on : The next step i took was searching for information about PAK files in general and found one solution that possibly could have work: Just compressing the voice files as *.zip / *.rar file, rename it to *.PAK. My exe modding skills are hex-editing only. Nice to have the source code for this exe file or function - but using it for creating my own BAT is - at the moment - out of my limits. Sizewritten = fwrite(CompressedBuffer,1,sizecompressed,tfile) Compressed files have the uncompressed file size stored in the first DWORD of the file data. Sizecompressed = LZCompress(CompressedBuffer, CopyBuffer, fsize) Printf("Error - Couldn't allocate buffer to compress %s.\n",filename) data growing instead of shrinking, but it is technically possible.ĬompressedBuffer = (unsigned char *)malloc(fsize) Since pretty much everything is a text file, we shouldn't have to worry about the Printf("Error writing %s to tempfile.\n",filename) Sizewritten = fwrite(CopyBuffer,1,fsize,tfile)
Printf("Error reading file %s\n",filename) Sizeread = fread(CopyBuffer,1,fsize,copyfile) Printf("Error - Couldn't allocate buffer to copy %s.\n",filename) Printf("Error - can't open file %s\n", filename) ĬopyBuffer = (unsigned char *)malloc(fsize) If((copyfile = fopen(filename,"rb")) = NULL) Printf("Error allocating memory for TOC list\n") NewNode = (PAK_Entry *)malloc(sizeof(PAK_Entry)) Adjust the table of contents offsets, flag them as compressed or empty as needed.įscanf(infile, "%c %s\n", &cmd, filename) Ĭase 'e': // add an empty entry to the TOCĭefault: // Unknown command, print error but keep going. Calc where the real data will start in the output file Printf("Error reading temporary data file into memory\n") Sizeread = fread(CopyBuffer, 1,tmpsize, tfile) Printf("Error - Couldn't allocate buffer to copy the temp data\n")
Printf("Error - Can't re-open temporary data file for reading\n") Ĭhecksum = 0xfeedface // Don't have a checksum anymore, just an identifier of value "0xfeedface".ĬopyBuffer = (unsigned char *)malloc(tmpsize) Close and re-open the temporary file for reading Printf("Can't open temporary data file.\n") Printf("Can't open output file '%s'\n",argv) If((outfile = fopen(argv, "wb+")) = NULL) Printf("Can't open input file list '%s'\n",argv) Printf("- makepak - creates a PAK file from a file list -\n\n") Seem a bit odd at times, or the code a little redundant, you know why.įILE *infile, *outfile, *tfile, *copyfile Įxtern long LZCompress(unsigned char *CompDataBuff, unsigned char *UncompDataBuff, unsigned long UncompDataSize) The following is actually just a quick modification of makesol.c, so if the comments Number of entries in table = ("DataStartOffset" - 8) / 4 If the offset has 0圎0 in its high byte, this entry is effectively The true offset is (Offset & ~0x40000000) and the first DWORD If an offset has a 0x40 in its high byte, it is compressed, and PAK file format (Nearly identical to the SOL/PKK/MPK/SAV file formats)Ġ00000 DWORD PAK File Identifier (value is always 0xFEEDFACE)Ġ00004 DWORD Offset where file data actually startsĠ00008 DWORD*n Table of offsets to the data in the file. It can export any content of any pak file but the function to create NEW PAK files doesn't work. But in fact, the version i own doesn't pack new files. This tool should allow unpacking & repacking of PAK file source for MechCommander.