< Back to the tutorial index

So let's talk dtab. If you're using the old DTB editor for anything other than minor string changes, you're doing it wrong and you'll aggravate yourself. dtab instead converts the DTB file structure to DTA, which is a plain text representation of the stuff you're working with in the DTB editor. This makes massive, sweeping changes for strings, song settings, and cheat codes much easier since you can do it all in a text editor. It's command line, so if you've never used that, please be able to before you try using this. Make sure you know what a path is and what arguments and switches are. At the very least, pay attention to what I'm doing. I'll be showing you how to decrypt a DTB, convert DTB to DTA, converting back, and re-encrypting.

You can get the latest version of dtab at http://github.com/mtolly/dtab/releases, or you can grab a (probably older) version as part of my toolkit. (I'd get my toolkit either way, I have ArkTool in there and it'll make your life much easier and I'll explain why.)

Open up your Command Prompt; there's a bunch of ways to do this, but the way I like is to hit Win+X on your keyboard and selecting it from the menu in the corner of your screen. (If it says PowerShell, it's the same deal and you'll be doing the same things in it. Just a different command line.) You'll see a text-only window pop up that says something like this:

Microsoft Windows [Version 10.0.18362.959]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\mariteaux>

Let's talk about actually running something from the command line. That C:\Users\mariteaux bit? That's a path, and that's your working directory. That means that's where Windows will try to run the command or program from. If you're not in the right folder, the command won't work.

So how to switch folders? You use the cd command. If you don't know where dtab is located, find it on your hard drive and click in the little breadcrumb box above the files in the folder. That will give you the path of dtab pre-highlighted. Copy it. Back at the command line, type cd, hit Space (to separate the cd and the path), and then paste the path. (And then hit Enter.)

Windows showing the path of the current folder in Explorer
Windows showing the path of the current folder in Explorer
C:\Users\mariteaux>cd C:\Users\mariteaux\Dropbox\Programs\ghmodding\dtab

Your working directory should now be the dtab directory. (Let you in on a little trade secret here: drag the dtab executable into the Command Prompt window next time. It will give you the full path and executable name for dtab automatically, no matter your working directory. This means you can run the program from anywhere, because you've given Windows where to find the thing you're trying to run. You can do this for any file, including the files you'll be working with.)

Let's actually build a command now. Run dtab on its own (without anything else after the program name) and you'll see this:

C:\Users\mariteaux>C:\Users\mariteaux\Dropbox\Programs\ghmodding\dtab\dtab.exe
dtab v1.1.1.1, by onyxite. Built on earlier work by xorloser, deimos, and maxton.
Usage: dtab mode file-in file-out [encrypt-key]

RB3 and earlier text/binary conversion:
       -a converts DTB (binary) to DTA (text)
       -b converts DTA (text) to DTB (binary)
Post-RB3 text/binary conversion:
       -A converts new format DTB (binary) to DTA (text)
GH2 360 and later encryption:
       -d decrypts new-style DTB
       -e encrypts new-style DTB, with optional key
Pre-360 encryption:
       -D decrypts old-style DTB
       -E encrypts old-style DTB, with optional key

Use a hyphen (-) for stdin (file-in) or stdout (file-out).

Learn to read and love that reference. Every other command line program you'll ever use will have some kinda reference built in. That "usage" bit is what you'll use to craft your command. And you will need to provide the full command every time you run this.

So in pieces.

Command Explanation
dtab
Program name, naturally. This tells Windows what you're trying to run.
mode
This is the mode to run dtab in. All modes start with a hyphen (-), and now you know what those things under the usage bit are.
file-in
This is your input file, the one you're trying to either perform crypts on or convert to another format. If you're trying to convert DTB to DTA, this is your DTB.
file-out
This is what file dtab will write what you want out to. If you're trying to convert DTB to DTA, this is your DTA.

You'll need to first decrypt any DTB you're trying to convert to DTA. I urge you not to bother with this and instead extract files from your ARK using ArkTool. By default, ArkTool will decrypt any DTBs you extract from an ARK and encrypt any DTBs you add to an ARK. This will save you two entire steps here. This is why I told you to grab my pack at the start of this. Of course, because it's not the only tool in town (Scott swears by ARK Expander, and while I hate you if you use GHex, it's still there I guess), I'll still tell you how to decrypt anyway.

So got your DTB? Cool. PS2 GH2 uses "old-style" encryption, so you'll first need to run the command using the -D switch. If you're modding 360 GH2, use -d. Yes, they're different, get used to it.

dtab -D modes.dtb dec-modes.dtb

Obviously, don't just run this exactly, use the DTB you're trying to decrypt in your command. The dec- prefix is necessary because dtab can't write to the same file it's reading from, so you'll need to convert out to a different file.

If you get an error, you did one of three things wrong:

  1. You're not in the right working directory. dtab isn't in the folder you're working in. cd over to that folder.
  2. Your DTB isn't in your working directory. dtab doesn't have any idea what you're trying to decrypt. Either copy your DTB into the same folder as dtab, or like I explained earlier, drag the DTB into the Command Prompt window. This will expand out to a full path and will work.
  3. You got the command syntax wrong. I just gave you a full, working command, so I don't know how you managed that.

You'll now have a decrypted DTB. Now you need to expand out that DTB to DTA. Same command as before, but you're using a different mode this time, in this case -a.

dtab -a dec-modes.dtb modes.dta

Congrats, you now have a DTA. Open this guy up in a text editor and make the necessary changes.

Once you're done with that, it's time to repeat the process in reverse. You'll be using the -b mode to get the DTA back into DTB form. You don't have to worry if the original DTB is still there, dtab will overwrite it, but it might be a good idea to keep backups of your original DTB in case you make the game crash or something with your changes. Probably also a good idea to keep the output DTA to make new DTBs from in case you make new changes.

dtab -b modes.dta dec-modes.dtb

I should note that if you get an error at this stage, a different one to any before, you've made an error in DTA syntax. You'll need to have this looked at by someone in MiloHax most likely. The error can be something as simple as forgetting a bracket. Nothing I can go over in a tutorial, but DTAs are extremely precise in their syntax, so don't miss.

Finally, to encrypt the DTB, you'll either use -E for PS2 or -e for 360.

dtab -E dec-modes.dtb modes.dtb

Your DTB is now ready to slot back into your ARK and you've successfully used dtab.

< Back to the tutorial index

Advertisement