[Help] Decompressing Iron Storm's .4x3 files

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AKMDM
Posts: 1
Joined: Fri Jun 23, 2017 4:29 pm

[Help] Decompressing Iron Storm's .4x3 files

Post by AKMDM »

I've posted this topic over at the Xentax forums already, but I figured that posting here too would be a good idea.

I need help with decompressing the .4x3 files from Iron Storm by 4X Studios. They are the 3D models from the game and they also contain the textures, materials and meshes used by the model.

After looking through the files in a hex editor, as well as searching through the game's executable, I think that the 3D models are using zip deflate compression. Additionally, the .4x3 files are full of "zip!" keywords, so I'm wondering if they could be .zip files too.

The .4x3 files are composed of several or more entries stored one after another. Every entry starts with the "zip!" keyword, followed by 4 bytes indicating the size of the entry in the file. The next 4 bytes indicates the type of file it is. From my understanding,

    TEXU = Textures
    MATL = Materials
    MESH = Meshes

There's more types than what I listed, but these are bigger ones and are the most common.

Finally, the next 4 bytes could represent the uncompressed size of the file. The compressed data follows, usually ending with "00 00 FF FF" followed by a null byte in case the aforementioned entry size is an odd number.

I tried using Offzip to decompress the deflated data from these files. Actually, the first entries (always textures) in every .4x3 file decompressed perfectly and I could view the image after editing its header afterwards. However, all subsequent entries just won't decompress at all. The only message I keep getting is:

Code: Select all

zlib Z_DATA_ERROR, the data in this file is not in zip format or uses a different windowsBit value (-z). Try using -z 15


I've tried writing a script for QuickBMS that would inflate the compressed data streams and save them into a new file, but it yielded the same results.

I'm really unsure as to why the first entry would always decompress without issues but the rest fail. I want to be able to use these 3D models for editing and other uses, so I'm asking now if anyone has any idea how to solve this. Also, would it be a good idea to try and reverse engineer some .zip file using the decompressed data? There doesn't seem to be any CR-32 checksum values anywhere, which may be problematic.

I've uploaded a couple of .4x3 files taken directly from Iron Storm's Models.ibf archive. You can find them at this link. If anyone has any idea on what to do, please respond.

Thank you.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: [Help] Decompressing Iron Storm's .4x3 files

Post by aluigi »

Homer7133
Posts: 1
Joined: Wed Sep 12, 2018 1:34 pm

Re: [Help] Decompressing Iron Storm's .4x3 files

Post by Homer7133 »

Thank you for your reply aluigi.
But could you help us open the extracted .DEF file now with your script?
I leave you a link containing .DEF files.

https://drive.google.com/open?id=1N1PWl ... qx1SDDr-zg
jespertjee
Posts: 1
Joined: Wed Dec 12, 2018 11:30 pm

Re: [Help] Decompressing Iron Storm's .4x3 files

Post by jespertjee »

Sorry for hijacking this thread a bit, but I also tried decompressing the game files. I read however that you managed to "view the image after editing its header afterwards". Would you be able to show this, since this is kind of exactly what I need.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: [Help] Decompressing Iron Storm's .4x3 files

Post by Acewell »

here is Noesis python script to open your def textures. :D
tex_IronStorm_def.zip

supports dxt1 and dxt5, top level mip only
only works with def files from the TEXU folders.
and the files will export with proper names. :)