ScoreHero Wiki : GuitarHeroDTBFileFormat

ScoreHero :: Forums :: HomePage :: Categories :: UserIndex :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Redirected from RandomPage

Guitar Hero DTB File Format

by User_Nacyoz Nachyoz

June 17, 2007


1. Summary


The majority of the game text, strings and variables are stored in an encrypted .DTB file, the same file decrypted is known as a .DTA file. This file structure was developed and used by Harmonix for their games and this article pertains more specifically to Guitar Hero, Guitar Hero II and Guitar Hero Encore: Rocks the 80s.

2. DTB Format


The file is encrypted using a 32 bit key. The key is the first 4 bytes of the file. I wont explain how its encoded but if you want to know, here is the source to the decrypter/encrypter. Its in C but could easily be ported (I ported it from java). The more important information is the decrypted file format. Also known as a DTA file.

3. DTA Format

First, general information. The file is stored LSB and all strings are ANSI. This means that all data is store least significant bits first (01 00 00 00 instead of 00 00 00 01 for a 32 bit integer equal to 1). And all strings are arrays of bytes using the ANSI character set. Not all characters are supported (judging by the fonts) though but most are.

The first 7 bytes of the file are some sort of header.
1: Not sure (usually 01)
2: Number of parent nodes
3: --
4: Not sure (usually 01)
5: Not sure (usually 00)
6: Not sure (usually 00)
7: Not sure (usually 00)

The file data is a list of chunks, as I call them. The chunks are varying lengths but all start with 4 bytes. The 4 bytes specify the type of the chunk or ID. Depending on the chunk type there maybe more bytes or none (haven't seen any with 0 but no reason its not possible). There are 16 chunks that I have seen. But the type is a 32 bit field (aka 2^32 possible IDs) and the highest I've seen is 35. So there could be more.

3. Possible Chunks


This is a list of chunks including what I think they are and the size of each. There are 3 categories of chunks that I have seen. Fixed size (4), fixed size (6), and variable size. Each on of the types listed fits into one of those categories. The chunk types are in Hex.

00 00 00 00: 32 bit Integer 4 bytes
01 00 00 00: 32 bit Float 4 bytes
02 00 00 00: Function name 4 bytes specifying the size of the string that follows
05 00 00 00: Keyword 4 bytes specifying the size of the string that follows
06 00 00 00: Not sure 4 bytes
07 00 00 00: Not sure 4 bytes specifing the size of data that follows
08 00 00 00: Not sure 4 bytes
09 00 00 00: Not sure 4 bytes
10 00 00 00: Tree Node 6 bytes first 2 bytes contain the number of direct children last 4 bytes are the Node's ID
11 00 00 00: Tree Node 6 bytes first 2 bytes contain the number of direct children last 4 bytes are the Node's ID
12 00 00 00: Data String 4 bytes specifying the size of the string that follows
13 00 00 00: Tree Node 6 bytes first 2 bytes contain the number of direct children last 4 bytes are the Node's ID
20 00 00 00: String 4 bytes specifying the size of the string that follows
21 00 00 00: File Reference 4 bytes specifying the size of the filename that follows
22 00 00 00: File Reference 4 bytes specifying the size of the filename that follows
23 00 00 00: String 4 bytes specifying the size of the string that follows

Here is an example of the 3 categories:
Fixed size (4 bytes): 00 00 00 00 23 01 00 00 -> An integer with a value of 291 (0x123).
Fixed size (6 bytes): 10 00 00 00 0B 00 3A 00 00 00 -> A node with 11(0x0B) children and an id of 58(0x3A).
Variable size (4+ bytes): 05 00 00 00 04 00 00 00 69 6E 69 74 -> A keyword thats 4 bytes long "init" (69 6E 69 74).

4. Tree format


It is also important to note that the file has a tree structure to it. As seen by the chunk type node. All the node chunks list how many DIRECT children they have so a node may say it has 1 child but that child could be a node with 20 children. This being said the chunks after a node are its children. So if you have a node with 6 children (ID 5) and after it is a string chunk and then node with 2 children (ID 7) and then 6 consecutive integer chunks the structure would be

Node 5-->Str "something"
	  |->Node 7--> Int 1
	  |        \-> Int 2
	  |->Int 3
	  |->Int 4
	  \->Int 5
Int 6


If this is confusing, decode a file with the decrypter and look at the hex and then compare it to the tree view in the DTB Editor to get a good grasp on it.

5. Other notes


I've opened I think pretty much every DTB file in the game in the DTB Editor and it hasn't found any chunks it doesn't understand so either we've found them all or there are some not being used.

Happy software writing/DTB editing.




Source


Information originally compiled and published by:
User_Nachyoz Nachyoz for ScoreHero on June 17th, 2007
Source - www.scorehero.com


Category: CategoryTechnical

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 6.9253 seconds