------------------------
10. Data Files Structure
------------------------
The structure of the data files are the same in all three of the Power of Chaos
games. There two files in which all of the information is stored:
data.dat - everything except sound data (text files [*.txt], bitmaps [*.bmp],
opponent decks [*.ydc], etc.)
Voice.dat - sound data (sound effects, music, and voice-overs [*.wav])
Both of them operate the same way:
Offset: Purpose:
0-7 (8 bytes) a tag acknowledging that the file is from Power of
Chaos
8-11 (4 bytes) unknown
12-279 (268 bytes each) individual file information
280-547
...
etc.
the rest file contents
Individual file information segments consist of four parts: filename (bytes
0-255), file starting offset (256-259 bytes), uncompressed size(?) (bytes 260-
263), and compressed (in-file) size (264-267 bytes). The procedure for
extracting this information goes as follows:
filename
--------
swap the hexadecimal values of each byte and chop off the trailing zeros
file offset, uncompressed size(?), and compressed size
------------------------------------------------------
byte0 + 256^1 * byte1 + 256^2 * byte2 + 256^3 * byte3
Using the file starting offset and compressed size, you can easily pull out the
file information. How the files are compressed is unknown (toss me an e-mail if
you figure it out), but most of the files are stored uncompressed, so this
isn't too much of a problem.
By the way, I've slapped together a small program that does all of this:
http://crispymarshmallow.home.comcast.net/unpacker.exe (needs Microsoft .NET
Framework 2.0)
Some stuff you might want to look at:
data.dat:
\card\*.bmp - card images
\?\file\*.ydc - the opponent's decks (? = y, k, or j)
voice.dat:
everything - all game audio is at your disposal
An extractor already exists; here's the source code of it and the documentation.
Anyway, I attached two .bin files with card descriptions: a binary and a decompiled one I found on Google (I don't know if the content is the same; this game has a lot of mods floating around the net), binary .txt files (I found a decompiled version of "list_card.txt" here) and .yga one. Please help me decompile and recompile them back. Thank you in advance!