Kuribo64
Views: 10,321,038 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
01-20-20 01:59 AM
Guest:

0 users reading Donkey Kong Country Returns Hacking | 1 bot

Main - Misc. ROM hacking - Donkey Kong Country Returns Hacking New reply


Jesse
Posted on 10-22-14 06:09 PM (rev. 7 of 02-09-15 10:14 AM) Link | #50025
The last few weeks I am trying to hack donkey kong country returns. It is widly known that the files are stored inside PAK files, but no one (other then metroid hackers with other versions) tried to unpack these packs. So I have decoded (or how you call it) this PAK file and managed to extract some files manually.

I need people who are interested to help me with looking at 3d files. since I do not have any experience with it.

I will post the findings I did about DKCR files here.


File Header
------------------------------------------------------------------------------------------------------
The file begins with a header which has a length of 0x80.

Offset Size Description
0x00 8 Unknown (Allways 0x0000000200000040)
0x08 16 Unknown
0x18 40 Null bytes
0x40 4 03 command
0x44 4 Magic "STRG" (STRG section)
0x48 4 Length of STRG section
0x4c 4 Magic "RSHD" (RSHD section)
0x50 4 Length of RSHD section
0x54 4 Magic "DATA" (DATA section)
0x58 4 Length of DATA section
0x5c 24 Null bytes
0x80 # End of header


Sections
------------------------------------------------------------------------------------------------------
The PAK file was make of three sections, which start from 0x80.

Section Description
STRG This section is used to store string data. such as file-names.
RSHD This section is the "Navigation" of the DATA section. This is important because it gives the files a ID
DATA This section contains all the files of the PAK. Compression on these files is a option.


STRG section

The string section starts with 4 bytes [00 00 00 01]. The last byte depends on how the PAK is used. Level PAKs use 01.

Each string contains the following information,
- The filename
- The extention of 0x05 bytes (a dot with 4 bytes of the extention name)
- The ID of the file it is assigned to. Length of 0x08 bytes

Example:
[53 41 56 57 5F 6C 30 32 5F 6A 75 6E 67 6C 65 5F 63 6C 69 6E 67] - File-name (reads SAVW_l02_jungle_cling)
[00 53 41 56 57] - Extention (reads .SAVW)
[5D C4 49 31 ED AC 51 B7] - File ID in hex

The section ends with a series of 00.


RSHD section

The RSHD section is made of little blocks of information for the DATA section. A block of information is 18 bytes long and gives a file the ID, extention and gives the whole length of the file in the DATA section.

A file block is made as follows:

Offset Size Description
0x00 4 Compressed or not (0x01 is compressed)
0x04 4 Magic (extension)
0x08 8 File ID
0x10 4 Length of File data (In the DATA section)
0x14 4 Pointer to File (Starts at the beginning of the DATA section)


DATA section

This is where all the file data is located.


Unknown stuff
------------------------------------------------------------------------------------------------------
All unknown or things I don't know about the PAK file are listed:

- Unknown compression of the files.
- Unknown 4 bytes at the end of the RSHD section.



This file contains meta-data, like what the main level model is and such. sadly this file is pretty useless and wasted my time on doing research on it. its possible to remove the file from the PAK and the game will still work. (only tested in dolphin)

Offset Size Description
0x00 4 Compression or uncompressed
0x04 4 Unknown (Always 0x0000001b)
0x08 8 ID of a .STRG
0x10 4 Level Number (string)
0x25 8 ID of a .SAWV
0x89 8 ID of a .MREA
0x9d N Filename of the PAK (N = Length of name in bytes)
0x9d+N 1 Null bytes
0x9e+N 4 01 command
0xa2+N 4 ?? (0x00000005)
0xa6+N 8 Always [0xFFFFFFFFFFFFFFFD]

and later in the mlvl you will find "string" data

Tools:

CR Pak Viewer
This tool allows you to view the content of a Donkey Kong Country Returns Pak File. Its also my selfmade "Second" Program.

CR Pak Tool v1
CR PakTool v3 - Added import button and the save as... button works
Newer and better tool which lets you view the pak in a GUI. Its also able to export and decompress the files.

[image]

CyberTanuki
Posted on 02-06-15 12:36 PM Link | #55936
Quite a handy tool you got there, Jesse.
For a "second program" that you made yourself, it's very nice.
I'd love to help with the 3D files, but alas I have no experience with that sort of thing either.
I wish you the best of luck with this tool.

Jesse
Posted on 02-16-15 05:07 PM Link | #56318
[image]
Tadaa, STRG editor! will be added in the next release

Arisotura
Posted on 02-16-15 05:29 PM Link | #56319
Can't help but wonder why French and Italian are shouting when all the others are calm.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

Hiccup
Posted on 02-17-15 08:46 AM Link | #56328
It's like with NSMBW's European versions. The game always refers to itself as NEW SUPER MARIO BROS. WII in those versions.

Jesse
Posted on 06-05-15 02:41 PM (rev. 2 of 06-05-15 02:41 PM) Link | #60691
BUMPERDEBUMP

its on github now, so if you like to take a look at it, its here


Main - Misc. ROM hacking - Donkey Kong Country Returns Hacking New reply

Page rendered in 0.034 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 213/213, time: 0.026 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.