Page 1 of 2

Yu-Gi-Oh power of chaos all 3 versions *.dat files

Posted: Sun Sep 24, 2006 9:58 am
by astro
please create script :|
___________________
i have information about this but i dont know how to make plug-in
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) (edited) NUMBER OF FILES
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

NUMBER OF FILES,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
i have unpacker.exe but it cant uncompress or add files

other extractor:download-------source------- documentation

Posted: Sun Sep 24, 2006 1:57 pm
by Savage
i that case i recommend the "injection" techique, you can do with naeder or filestripper ;)

Posted: Sun Sep 24, 2006 5:40 pm
by astro
how to uncompress theese

Posted: Sun Sep 24, 2006 5:47 pm
by astro
image

Posted: Mon Sep 25, 2006 8:30 am
by Silver
Looks like rle, maybe LZ77 or something. Only looked briefly

Posted: Mon Sep 25, 2006 1:13 pm
by astro
i found this rle decompression script but i don't know what to do with this
while InputPos < InputSize do
begin
RunLength := Input[InputPos++]
if RunLength = 0 then
begin
Count := Input[InputPos++]
for i := 1 to Count do
Output[OutPos++] := Input[InPos++]
end
else
begin
Symbol := Input[InputPos++]
for i := 1 to RunLength do
Output[OutPos++] := Symbol
end
end
----------------------------------------------

lob065-.bmp: compressed size 139144
uncompressed size 174056
i took it from data.dat with unpacker.exe

lob065.bmp: it's lob065-.bmp uncompressed
i took it from older game version

Posted: Tue Sep 26, 2006 3:51 am
by TightIsRight
Found this on sourceforge.net

Code: Select all

http://sourceforge.net/projects/yugiohextractor
An application that can extract, replace and view the files as cards, sound effects and music from the Yu Gi Oh! Power of Chaos PC games. It is written in C# .NET. Aplicaci�n que puede extraer y manipular los archivos de YuGiOh Power of Chaos, cartas,etc.

Translations : English, Spanish

Posted: Tue Sep 26, 2006 1:24 pm
by astro
TightIsRight wrote:Found this on sourceforge.net

Code: Select all

http://sourceforge.net/projects/yugiohextractor
An application that can extract, replace and view the files as cards, sound effects and music from the Yu Gi Oh! Power of Chaos PC games. It is written in C# .NET. Aplicaci�n que puede extraer y manipular los archivos de YuGiOh Power of Chaos, cartas,etc.

Translations : English, Spanish
it can't uncompress either :evil:
---------------
Tell me if you need more information

Posted: Tue Sep 26, 2006 10:09 pm
by TightIsRight
Oh... I forgot that this forum is all about uncompressing things, not editing them. :P

Posted: Mon Dec 04, 2006 11:50 pm
by smernesto
Hi.

I am the creator of yu gi oh extractor, I was reading the forum.

If you have more information about how works the files in the game please write me at [email protected].

I never knew how read the text files in the game.

Bye

Ernesto Gutierrez Arrazola

Posted: Thu Jan 11, 2007 11:17 pm
by aluigi
The compression algorithm is the same used by the games Chaser, KOTT2 and Conan for their files.
I don't know its name for the moment anyway the following is the C code of the unpacking function I have reversed from Chaser:

int unpack(u_char *out, int outsz, u_char *in, int insz) {
u_short i,
c,
zg,
num,
e14 = 0,
zp = 0xfee;
u_char *p,
*inx,
*outx;
static u_char zmem[0x1000];

p = out;
inx = in + insz;
outx = out + outsz;
memset(zmem, 0x20, sizeof(zmem));

#define CGET if(in == inx) break; \
c = *in++;
#define CPUT if(p == outx) break; \
*p++ = c;
#define ZGET c = zmem[(zg + i) & 0xfff];
#define ZPUT zmem[zp] = c; \
zp = (zp + 1) & 0xfff;

for(;;) {
for(;;) {
e14 >>= 1;
if(!((e14 >> 8) & 1)) {
CGET
e14 = c | 0xff00;
}
if(!(e14 & 1)) break;
CGET
CPUT
ZPUT
}
CGET
zg = c;
CGET
zg |= (c & 0xf0) << 4;
num = (c & 0x0f) + 2;
for(i = 0; i <= num; i++) {
ZGET
CPUT
ZPUT
}
}

#undef CGET
#undef CPUT
#undef ZGET
#undef ZPUT

return(p - out);
}

Posted: Thu Apr 05, 2007 5:21 pm
by astro
BMS

ImpType Standard;
IDString 0 KCEJYUGI;
Get RN Long 0;
For T = 1 To RN;
SavePos N 0;
Math N += 256;
GoTo N 0;
SavePos FOO 0;
Get FO Long 0;
SavePos FSO 0;
Get FS Long 0;
SavePos UFSO 0;
Get UFS Long 0;
Log T FO UFS FOO UFSO;
Next T;

But still it cant show filenames
The file name is illegible since they invert the first 4 bits with the last 4 bits of each character, or it can be described as a rotation of 4 bits toward the left or the same thing a rotation of 1 bit, 4 times toward the left. To make it llegible the inverse process should be made and rotate the bits 4 times toward the right. For example if we have the byte 0x4A (01001010) when rotating it 4 times to the right it would be 0xA4(10100100).

Step for step would be this way: (0x4A)01001010 -> 00100101 -> 10010010 -> 01001001 -> 10100100(0xA4)

Immediately after having finished all the file descriptions, they follow the data of each one of the files.
filename
--------
swap the hexadecimal values of each byte and chop off the trailing zeros

Re: Yu-Gi-Oh power of chaos all 3 versions *.dat files

Posted: Sat Jan 31, 2009 6:06 pm
by Xtrmntr
Hello, I am new here! I wanted to add god cards to Joey the passion, but I find out I must have "Yu-gi-oh! power of chaos file extractor", so I downloaded it! I have some problems with it :evil: , so if someone can help me, here goes: I turn on My Yu-gi-oh! File Extractor.exe and I get following:Yu-gi-oh! File Extractor.exe - Aplication error
The application failed to initialize properly (0x0000135). Click on OK to terminate the application.
If anyone knows what is the problem, PLEASE HELP!! :[

Re:

Posted: Sun Feb 01, 2009 11:42 am
by Mr.Mouse
smernesto wrote:Hi.

I am the creator of yu gi oh extractor, I was reading the forum.

If you have more information about how works the files in the game please write me at [email protected].

I never knew how read the text files in the game.

Bye

Ernesto Gutierrez Arrazola
Better is that the information is posted here for all to read and work with. :)

Re: Yu-Gi-Oh power of chaos all 3 versions *.dat files

Posted: Mon Jun 22, 2015 4:08 am
by Rancher
I need help with decompiling the files inside .dat file of this game. 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!