Important information: this site is currently scheduled to go offline indefinitely by December 1st 2023.
If you wish to donate to attempt the preservation of tools and software somewhere else before it goes down, check the GoFundMe

Mercenaries 2 .WAD file.

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
caws
veteran
Posts: 120
Joined: Sat Mar 01, 2008 7:57 pm
Been thanked: 4 times

Mercenaries 2 .WAD file.

Post by caws »

Hey, can anyone here make a unpacker\packer for this kind of file???

i´ve attached the file, thx for the attention!! :D :D
You do not have the required permissions to view the files attached to this post.
grimdoomer
advanced
Posts: 70
Joined: Fri Mar 21, 2008 8:11 pm
Location: New York
Been thanked: 1 time

Re: Mercenaries 2 .WAD file.

Post by grimdoomer »

Ok, pretty simple format. Although it does in fact have a checksum if not 2.

The header is organized in blocks, each block has a header 4 characters, and is 12 bytes long. The data is compressed, but I don't know how. The first checksum seems is simple, XOR operation, or maybe crc not sure. The second is the big blob of data after the header blocks. I'm not sure what it is exactly, but it's not long enough to be RSA, so it could be SHA1s.

Unknown
Index
Data
Checksum
Assets
Paths

Here is a layout:

Code: Select all

0 - UnknownBlockHeader - Chars(4)
4 - Unknown - Int32
8 - Unknown - Int32

12 - IndexBlockHeader - Chars(4)
16 - IndexOffset - Int32
20 - IndexEntryCount - Int32

24 - DataBlockHeader - Chars(4)
28 - DataStartOffset - Int32
32 - Unknown - Int32 // Something todo with Compression?

36 - ChecksumBlockHeader - Chars(4)
40 - Unknown - Int32
44 - ChecksumCount - Int32

48 - AssetsBlockHeader - Chars(4)
52 - AssetsIndexOffset - Int32
56 - AssetsEntryCount - Int32

60 - PathsBlockHeader - Chars(4)
64 - PathsStartOffset - Int32 // Null terminating strings
68 - PathsEntryCount - Int32

// The block of data under this at offset 72 seems to be some sort of hash.
// It looks like 3 hashes of 48 bytes each, if that has anything todo with the Checksum block.

// Index
public struct IndexEntry
{
    // None of these match the length of any entry's in the Paths Table
    public int Unknown;
    public int Unknown2;
    public int Unknown3;
}

// Assets
public struct AssetEntry
{
     //No offsets or sizes
     public int Unknown;
     public byte[] Null; // 6 bytes
     public short Unknown; // Maybe Enum?
     public int Unknown;
}

// Data
// Data seems to be compressed, and has an identifier in the header of each file "sges" a google search turns up 
// nothing about compression or formats related to it.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 667 times
Contact:

Re: Mercenaries 2 .WAD file.

Post by aluigi »

old thread but I downloaded the demo of this game casually only today and after having done the work I noticed this thread opened so...
http://aluigi.org/papers/bms/mercs2.bms

a small note: the archived files are not "normal" files but are contained in a certain UCFX container that looks easy to handle, for example in some of them there are also the full filenames (with the full original path!) and are usually headerless dds while others have a "data" field with zlib compressed data.
Post Reply