Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Yu-Gi-Oh! Power of Chaos (*.bin, *.txt and *.yga)

Featured Replies

  • Author
  • Localization

Rancher, posted Fri May 22, 2015 9:25 am (5355)


Taken from the GameFAQs concerning .dat files which contain above mentioned files; it would be a good idea to create a QuickBMS script for this game format, too:

Quote:
------------------------
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!
  • Author
  • Localization

Rancher, posted Wed Jun 24, 2015 6:21 am (5892)


Anyone?
  • Author
  • Localization

aluigi, posted Wed Jun 24, 2015 10:09 pm (5903)


In my opinion the algorithm is lzss with the init char set to 0x00 (comtype lzss0).
The only problem I see with card_desceng.bin is that the output file from about offset 0x1e8cc is no longer good, so I guess it's a variant but my scanner didn't give other results. My other idea is that it's just lzss 0x00 but the file is divided in chunks.

For example title.txt should contain a bitmap file after the text I guess, but it's output is ok till one point and then starts to be garbage.
  • Author
  • Localization

Rancher, posted Thu Jul 02, 2015 9:00 am (6072)


So there is no solution for now? Did you see the decompiled files I added as a reference?
  • Author
  • Localization

aluigi, posted Thu Jul 02, 2015 11:02 am (6076)


They are not the same.
card_desceng.dec.bin is NOT the decompressed data of card_desceng.bin.

Try this to understand what I mean:
Code:
comtype lzss0
get ZSIZE asize
xmath SIZE "ZSIZE * 10"
clog "dump.dat" 0 ZSIZE SIZE

With card_desceng.bin you can see that the output is perfect till offset 0x1e8cc and then it starts to be wrong probably because that's data of another compressed file and not part of the current data.
  • Author
  • Localization

Rancher, posted Sun Jan 17, 2016 12:00 am (10834)


A guy on Xentax managed to decompress card_desceng.bin, but recompression is the problem. I'll quote:

admirzuza wrote:
how to compress files back after decompressing?

decompression works fine, but compression doesnt work (several bytes are missing)

in attached zip file u will find original compressed file (card_desceng_compressed), file after being decompressed (card_desceng_decompressed), and file being compressed back again but with different size thn original (card_desceng_compress2)..

NOTE: nothing has been changed inside files during compression/decompression

thanks :wink:

Luigi, can you try again based on the attached files? If those help at all, considering he didn't share what he did to decompress them. Anyone else? What about recompression? Thank you.
  • Author
  • Localization

aluigi, posted Mon Jan 18, 2016 9:04 pm (10842)


I have tried the reimport mode and it worked correctly:
quickbms script.bms card_desceng_compressed.bin
quickbms -r -w script.bms card_desceng_compressed.bin

The re-extracted file is correct and the new and old archive are the same if the file has not been modified.
  • Author
  • Localization

Rancher, posted Mon Jan 18, 2016 10:03 pm (10849)


Great news! Can you share the script? Thanks.
  • Author
  • Localization

aluigi, posted Mon Jan 18, 2016 10:07 pm (10851)


I used just the one above I posted the 02 Jul 2015.
Considering that in that post I wrote that the script decompresses the data incorrectly, I don't know if it may be considered a success.
Probably it's a success with small files that should not be affected by the error.
  • Author
  • Localization

Rancher, posted Mon Jan 18, 2016 10:55 pm (10853)


I just tried the script to decompress the file, but as you said, it works until one point and then it starts to malfunction. :( I'll try to get in touch with the guy who managed to decompress it, maybe it would help you write a reimport script based on his script.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.