| .gitignore | ||
| duckypon.c | ||
| README.md | ||
duckypon
This tool extracts files stored in .PAC archives found in the Wii game Dokapon Kingdom. It has only been tested with the PAL version, but it should work with any version of the game.
It does so by reading the file headers and file names contained within the accompanied .PAH file and copying the file data accordingly.
Usage
duckypon <PAH file>
Data research
The rest of this file will contain notes relating to my research on the file formats employed by the game.
File headers
The .PAH file starts with two long values describing first the number of file entries and second the starting offset of the table containing the file headers. Between these two values and the offset are a number of (yet) unknown pointers.
A file header consists of exactly 4 long ints, in the following order:
- File offset in
.PACfile - File size
- Unknown (always seems to be 0)
- Pointer to file name in
.PAHfile
Inside the .PAC archive, files are stored without compression according to their respective headers. Zero padding exists between the file data.
Resulting files
Within the archive, the following file types can be found:
| File type | Count | Total size |
|---|---|---|
| .IGB | 1864 | 327.0 MB |
| .PIM | 587 | 9,3 MB |
| .PIL | 90 | 77.7 MB |
| .TGA | 52 | 607.2 kB |
| .DAT | 47 | 781.5 kB |
| .PNG | 12 | 1.3 MB |
| .GF | 1 | 2.0 MB |
| .EXI | 1 | 921.4 kB |
| .BIN | 1 | 250.0 kB |
IGB
These seem to be objects of some kind. They contain references to various types of data like igNamedObject, igNodeList, VertexData and many more.
The presence of referenced filenames that do not occur within the .PAC archive and the variety of data found within contained suggest that these files might be archives themselves, containing even more files. Most of these filenames reference Targa images. Interestingly, while the filenames contained in the .PAC archive are all capitalized, the filename references are not.
Some contain even full paths, like C:/aki/aki_doka/doka_cha/c04/Textures/c04_f0.tga.
PIM
Headers always start with 80 00 80 00, then some more values, then data. These are probably images, icons or textures.
PIL
These might be files related to scene data. There are several for each chapter (CHAP?S, CHAP?E, CHAP?EW) as well as other scenes like WIISYS, SETTING, SYSTEM, TITLE4 and several STRAP_XXX for each language supported by the game (where XXX is a lang code).
TGA
Targa images. Most of these are small icons or images used in short animations (like the sealing status effect or instant death skills).
DAT
Seem to contain various data. There are 22 CHAIN_NNN files which are rather small, and 22 STGNNN files. The STG files contain references to the CHAIN files. These might contain map and shop data.
Then there is STAGEBASE.DAT which contains, among other things, all of the game's text. There are filename references, suggesting the presence of more packed data. Most interestingly, towards the end of the file there are various plaintext formulas, like (((DA + DM + DS) * 2) + (AA - AD)) * CM * WP and others. It is unlikely that the game parses these strings for its calculations; rather, these seem like developer notes.
PNG
These twelve images seem to piece together the title screen of the game.
GF20I22.GF
Unknown.
DK.EXI
Unknown.
FONT_22U.BIN
Probably contains font data.