The Ultimate Nintendo DS ROM Hacking Guide!

logo.png

This pack contains all the programs I'll discuss here in this guide.​
It contains various useful ROM hacking tools like extractors and​
translation tools. I recommend you to download it before you​
continue! Note: To download it, click the image above.



introduction.png

Hello everyone, this is my entry to the GBATemp 2011 Tutorial Competition. In this guide, I will explain you about almost everything you need to know about Nintendo DS ROM hacking. So far, Nintendo DS ROM hacking is quite popular, but there are still people who don't know anything about ROM hacking. I hope that, with this guide, people will understand ROM hacking, and thus in this way the hacking area will grow.

If you've found anything incorrect in this guide, please let my know by sending me a PM, or by commenting here.
If you still have any questions, after reading this guide, feel free to ask me or the 'Tempers around.

Before I'll really start with this guide, I would like to point out a mistake that is commonly used by many people: the difference between hacking and cracking.
In simple words; hacking is a completely legal way to modify a game, while cracking is illegal, and is only used to harm things.
A few examples of hacks we are sharing here at this community are; translations, hardcore hacks, graphical hacks etc.
We 'hackers' are modifying a game, and are using our knowledge and creativity for well-intentioned acts, and for fun.

It is completely legal to upload a hack, as long as you don't distribute the whole game on the internet, only the files you modified.
There is one simple solution to do this; making patches. These files do only contain the modified parts of a game, so they don't contain anything of the game itself; only the bytes you changed, and thus the parts you created your own.

There are several patching programs like xDelta or Lunar IPS. The most common program that is used for Nintendo DS hacks is xDelta.
To create a patch, you will need both the original, unmodified, untrimmed game, and the game you have modified. If someone has downloaded your hack, he/she has to use the same program you used. The user needs to open your patch alongside an original backup game, and the patcher will insert the modified parts into the backup.

So in this way, you can upload a file with a small file size, so you will save bandwidth... And it is completely legal!
It is absolutely not allowed to post Nintendo DS ROMs anywhere, it is not allowed to post them or ask for them here!

This information is very important, be aware of what you are going to do!



Hacking%20Graphics.png

In this section we are going to replace the graphics of a Nintendo DS game. A few examples of graphics are Logos, buttons, overworld sprites, character sprites, et cetera. I will only explain you how to hack the most common graphic data files. You can find these in almost every game, there are only a few games that are using another file type.



This video basically summarizes what's been done at ROM Hacking Example 1. However, if you'd like a detailed explanation of everything read it below.​

Example 1: Replacing a compressed graphic file
[GEX1]
In this example, I will replace the "Nintendo" logo that appears at the startup of Mario Kart DS. You can all download the needed tools for ROM Hacking later, as one .rar file. The tools I will use in this example are CrystalTile and BatchLZ77. Find them on Filetrip for now.

exp1s1.png

First of all we are going to open Mario Kart DS in CrystalTile.
Click the folder button at the top bar.

exp1s2.png
Select your Mario Kart DS ROM file, and click "Open".​

exp1s3.png
Now, a list should appear containing all the files within the ROM.​
If this didn't happen, click Tools -> NDS File System or press Ctrl + N at the same time.​

exp1s4.png
Scroll down, until you see the data/Scene/Logo.carc file... Do you notice the LZ icon in front of that file?​
It means the file is compressed. It is very useful to know that, because it needs to be decompressed first, before you can edit it.​
Sometimes, you will encounter a file without a file extension, if it has a "LZ" logo in front of it, it means it is compressed.​
Every .carc file (Compressed Nintendo Archive) has a LZ77 compression, you'll need to decompress such files using a special tool.​
You can do that with CrystalTile, but I won't be using that, because sometimes CrystalTile fails to (de)compress files. I'll just use BatchLZ77 here.​
But now, we are going to take out the file of the ROM file. We are going to export it... right click the file, and click "Export".​
Choose where you want to save the file, and click "Save".​

exp1s5.png

Now we are going to BatchLZ77... Just what I said earlier, the file is compressed, we need to decompress it.

Click "File -> Decompress Files...", go to the folder where you just saved you .carc file, and select it.
When it's done, a window will appear saying you're file has been decompressed succesfully, that should be really quick.

exp1s6.png
So now, you have two files... "Logo.carc" and "Logo.carc.decompressed".​
You could say that "Logo.carc" has been decompressed to a narc file now.​

exp1s1.png
Now we're going back to CrystalTile.​
Hit the folder button, and open up your decompressed .carc file (so "Logo.carc.decompressed").​

exp1s7.png
A new list should appear. If not, press the F2 button, or go to "Tools -> Sub-file Sort...".​

exp1s8.png
You'll see nine files in total, but actually, these are just three graphics.​
You have three extensions here, .NSCR, .NCGR, and .NCLR.​
All these .NSCR files are 'Map files', they will put the image on the right place in game.​
Sometimes, you have a puzzle instead of a complete picture (if you open it with CrystalTile).​
But once you open the graphic alongside the .NSCR file, you will see that the pieces will form a complete picture.​
However, you cannot edit a graphic alongside an .NSCR file.​
If you do, it will be messed up in-game, or the game will crash. Be careful about that.​
The .NCGR files are 'Graphic files', they contain the 'picture' of a graphic.​
Once you open it alone in CrystalTile, you will notice that the colors are messed up...​
That's why we also have .NCLR files, these are the pallete files. It will assign a picture its right colors.​
When you opened a graphic file, alongside a pallete file, you can just edit it normaly.​
It won't crash if you would modify it in this way.​

exp1s9.png
Click the button marked above, the tiled mountain, and change the 'scale' value under the​
'Tile property' tab from 400 to 100 (400% picture size to 100% picture size).​
Now, you have to select the logo_R_Nintendo_m.NCGR graphic file (don't double click it), and then press the space bar​
(or right click the file and select "Retrieve Tile adress"), (if you double click the file, the image is messed up).​
You have to do the same with the palette file (logo_R_Nintendo_m.NCLR), click it once, and press the space bar.​
Now you will see the 'Nintendo' logo correctly.​

exp1s11.png
Right click the logo that just appeared, and click copy. Now you can paste it in programs like Paint or Photoshop.​
You can make your own, custom logo now.​
Make sure that you only edit the 'black' part and not the 'blue' part, and only use white characters.​
Copy your modified logo in Paint, Photoshop or any other tool, and go to the next step.​

exp1s12.png
Right click the logo in CrystalTile, and click 'Paste' (the same way as you copied the file).​
Now you can move it around, which we're not gonna do here, just double click the logo, so it will be pasted.​

exp1s14.png

Go to "File -> Save" or use the Ctrl + S shortcut to save the file. Or go to "File -> Save As" if you also want to keep the original.
You can close the logo window in CrystalTile after you saved it.

exp1s13.png
Now we're gonna recompress the file using BatchLZ77. Choose "File -> Compress Files...".​
exp1s16.png
Select the modified file you just saved.​
The program will create a new file, and its extension will be '.compressed'.​
This is your modified file in .carc-form, as you probably already figured out.​
exp1s15.2.png
In CrystalTile, we're going back to our Mario Kart DS ROM window.​
Right click the data/Scene/Logo.carc file again, and press "Import".​

exp1s17.png

Select your "Logo.carc.decompressed" file, and CrystalTile will replace the original file with your modified file.
The extension doesn't matter, as long as it remains a graphic file.

exp1s18.png
Finally, we're going to save the modified Nintendo DS ROM.​

exp1sRes.png
If you followed all the steps correctly, the Nintendo logo has been replaced with your​
own, like the one above! The font I used here is called 'Pretendo'.​

Example 2: Changing Palette Files
[GEX2]
In this example, we're not only going to change the graphic file, but also the palette file. The tools I will use for this example are CrystalTile, BatchLZ77, Paint.NET and ConsoleTool. It is important that you don't use Microsoft Paint for this, just use Paint.NET (free), Photoshop (shareware, but very useful), or another program. Before you're going to read this example, make sure you read the first one to make things more clearly.

This time we're going to change the Title Screen of Mario Kart DS (the Top Screen only).

Open your Mario Kart DS ROM file with CrystalTile.

Scroll down, and export the data/Scene/Title_us.carc.

Decompress the exported file with BatchLZ77.

Open the decompressed file with CrystalTile.

Right click/Retrieve Tile file for the Title_m_b.NCGR and Right click/Load Palette for the Title_m_b.NCLR file.

Right click the Title_m_b.NCLR palette file, click 'Export', and save it to some folder.

Copy the graphic that just showed up correctly, and paste it in you graphic editor.

After you edited the graphic, you have to make sure your image is in 8 bit pixel mode:

Using Adobe Photoshop
Go to 'Image/Mode/Indexed color...', and use the following settings:
Palette: Local (Perceptual)
Colors: 256
Forced: None
Transparency: Unchecked
Dither: Diffusion
Amount: 75%
Preserve Exact Colors: Unchecked
Click 'OK'.

Using Paint.NET
Click 'Save as', and select BMP and 8 Bit, save it, and open the .BMP file.

Now we have to save the palette to a file:

Using Photoshop
Go to 'Image/Color Table...', and select the 'Save...' button (use the .act extension).

Using Paint.NET
This isn't possible with Paint.NET, you will have to find a tool which creates a .act palette file.
You can use the palette editor here, for example. Open the .bmp file using 'Load Palette', and export the .act file using 'Save Palette'.
Now you'll have to open the created .act file in ConsoleTool, after you opened it, also open the .NCLR file you extracted with CrystalTile.

Compare the two files; make sure that your .act files has the same amount of colors. Delete the last color if it has more colors that the .NCLR file. Make sure the first color is the same as the one in the .NCLR file, this color will set the transparency.

Save the .act file as a .NCLR in ConsoleTool using 'File/Export'.

Replace the old .NCLR file in your ROM(Title_m_b.NCLR) with CrystalTile with the newly created .NCLR file by ConsoleTool.

Load the palette using CrystalTile, right click the Title_m_b.NCLR file and select Palette Load.

Now the colors will be messed up, this is okay, because now you have to copy the edited graphic file from you graphic editor, and paste it.

Click 'Save', and close the two windows of the .carc file (not the two of your .nds file).

Compress the 'Title_us.narc.decompressed' file with BatchLZ77, so the file 'Title_us.narc.decompressed.compressed' will be created.

Replace the old Title_us.carc in your ROM with the 'Title_us.narc.decompressed.compressed' file using CrystalTile (remember: Right Click/Import').

Save your ROM file, and test it!

proof.png




hacking%20sounds%20and%20music.png


In this section I am going to explain you how to replace the music and sounds of a Nintendo DS game. The tools required for this aren't perfect, so there is going to be some hex editing. If you are in search of a good, free hex editor, I'd recommend you HxD. Another good hex editing program is Hex Workshop, but this one is shareware.

Example 1: Inserting Your Own Custom Music
[MEX1]
In this example I will use FL Studio (you can use the demo version), a hex editor (I'll use HxD here), midi2sseq, VGMTrans, CrystalTile and a midi file. Here, I will explain you how to replace the Olympus Coliseum battle music from Kingdom Hearts Re: Coded with your own battle theme.

First, we are going to extract the sound_data.sdat file out of Kingdom Hearts Re: Coded using CrystalTile. So open CrystalTile, and scroll down 'till you see "sd/sound_data.sdat".

Right click the file and select "Export", and save the file to any location.

Open VGMTrans, and drag and drop the sound_data.sdat file you just extracted to the program window.
VGMTrans will read the file, just be patient until the list containing the music shows up.

We need to extract the Olympus Coliseum battle theme, which is the file named "Herc_B". Select the file so three
files will appear at the left side.

You see those three files? The first file is the SSEQ file, the sound sequence.
These files are like .midi files, but especially made for the Nintendo DS. The second file is the SBNK file, the Sound Bank.
You can compare these with soundfonts, they assign the instruments of an SSEQ file a realistic, not midi-ish sound. Like you hear them in-game.
The third file is the SWAR file, the Sound Wave Archive. It contains a collection of SWAV files (Sound samples/Sound Waves), which are like .wav files.

We only have to extract the SBNK, as a .DLS, so right click the second file, and select "Convert to DLS".

Now you'll have to open your .midi file using FL Studio.

There should be a small window in FL Studio, named Fruity LSD. Click the grey folder button on the left top, and select the .DLS file you just extracted.

Now you'll have to replace each MIDI channel. Right click every MIDI channel, hover replace, and click 'MIDI out'. Now you will be able to change the instruments, so that they will be heard correctly in-game. You can only have 14 channels for every song you want to put into a Nintendo DS game. The file size can also not exceed the original, if this happens, you'll have to reduce the MIDI channels, delete some notes, or reduce the song length.

Export the file as a MIDI using "File/Export/MIDI File" when you're done with editing. Do not close FL Studio yet!

Open your hex editor, and open the MIDI file you just saved.

We are going to change the tempo by changing one byte. This step is really necessary. Press ctrl + F, enter "60", and set the "Data type" option to "Hex". It should find a byte very early in the file.

Change that byte to C0, so change "60" to "C0", press ctrl + S to save your file.

Now you'll have to open the MIDI file again, the one you did just change, using FL Studio.

You'll notice the tempo is twice as fast, this is just what we want. So export it as a MIDI, again.

Open the file, you just saved using the hex editor.

Press ctrl + F again, and search for that "60" byte again… Make sure the "Data Type" option is set to "Hex".

Overwrite the byte with "30", so "60" becomes "30".

Save the file. The song should sound normal now, its tempo should be recovered.

Open the folder where your latest created .midi file is located, and make sure midi2sseq is in the same folder.

Drag and drop the .midi file to the midi2sseq executable.

It will create a new .sseq, it should have the same file name as the .midi.

Unfortunately, midi2sseq isn't perfect. So we have to edit the newly generated .sseq with a hex editor.

Press ctrl + F, enter "FF C0". Again, make sure you're searching for hex data types.

Change the C0 value to C7, and ADD (not replace) a 00 byte.

My midi file has 12 channels, that means there are twelve "FF C0"s in my SSEQ.
If you got 6 channels for examples you'll have 6 "FF C0"s. You'll have to edit them, so just repeat the previous two steps, until you have edited them all.

Save your file, and open CrystalTile.

Open the sound_data.sdat you created at the beginning of this example.

Locate the "Sequences13-Herc_B.SSEQ" file in the window that just appeared.

Right click it and import the .SSEQ you made using midi2sseq. Again, you cannot exceed the file size, otherwise an error will appear.

Click the save button at the top bar.

Extract you Nintendo DS ROM using a ROM Extractor.

Go to the "sd" folder, and replace the sound_data.sdat file with the new one.

Rebuild your ROM, and test it.

Optionally, you can make your music loop. To do this, look at this tutorial. Unfortunately, I haven't really figured out to make it work, so
you'll need to do this on your own. VGMTrans can sort out all the bytes for you, I recommend it if you want to use that tutorial.



hacking%20levels.png


Due to a shortage of time, I couldn't finish this section. I can only give you the needed tools for editing levels for now.



hacking%20text.png


Due to a shortage of time, I couldn't finish this section. If you really want to edit text, you can download The Ultimate Nintendo DS ROM Hacking Pack. You can find the link above. Alternatively, you can use this link to figure out how to do text hacking yourself.



hacking%20tools.png


General ROM Hacking Tools
BatchLZ77 by DarthNemesis
This program is used for compressing and decompressing files which can be read by the Nintendo DS. To let this tool do its work, you'll just have to select the "File" option at the top bar, and select whether you want to compress or decompress a file, and select the file you want the program to (de)compress. This procedure will (usually) take a very short time, if it doesn't the program will 'freeze', but that does only mean it's busy, so just be patient. If the program failed, a text file will be opened telling you which files weren't (de)compressed successfully. If it succeeded, you will be able to use the program again.

CrystalTile by angel-team
Probably the most useful ROM Hacking tool for the Nintendo DS. It offers a wide range of features like viewing and editing graphics in an easy way, (de)compressing files (however, this feature doesn't work always), extracting single files, a Multimedia Editor, listening to music inside the ROM file (although, I haven't figured out how to make it work correctly, to be honest), a hex editor and more. Sometimes, the program could be a little unstable. Make sure you'll save your work regularly!

Mario Kart DS Course Modifier by Gericom | Discussion thread
Don't let its name misguide you; this tool does way more than modify courses. Make sure to check it out, though it is still a work in progress. This editor has support for a number of file formats:

- 3D MODELS (NSBMD); ...or rather a sort of archive containing the 3D model (the three-dimensional shape of an object), textures...
- TEXTURES (NSBTX); These files contain information that puts the texture of a 3D model on the right place, should be inside an NSBMD file.
- MODEL ANIMATIONS (NSBTP); Sometimes, a texture contains multiple 'parts'. This file decides when the texture parts should switch between each other. A few examples are blinking eyes, moving lips... Should be inside an NSBMD file.
- BMD FILES; 3D models, also seen in Gamecube games.
- DIALOG TEXT (BMG); There are many games that are using BMG files, even Wii games are using BMG's...though not every BMG file is the same, they could slightly differ from each other.
- NINTENDO PALETTES (NCLR); Palettes especially made for DS games.
- NINTENDO GRAPHICS (NCGR); Graphics like logo's, menu buttons, especially made for DS games.
- NINTENDO SCREEN RESOURCES (NSCR); Sometimes a graphic file is messed up when you open it, to see the full picture you can use these.
- KCL FILES; Collision files, if they weren't there, you would fall through the floor. Example: In The Legend of Zelda: Ocarina of Time you can walk through several walls (the walls that disappear using the Eye of Truth), that's because they have no collision.
- NKM FILES; Decides the position of an object, or where an object should be located. Some Mario Kart examples: Starting position, current position on the map, respawn position et cetera.

The editor has also support for NARC's (Nintendo Archives), CARC's (Compressed Nintendo Archives, NARC's with LZSS compression, could be decompressed using an in-build feature), and .nds files (so you won't have to extract your game first).

Project Pokémon's ROM Editor
This tool is specially designed for Pokémon games. In order to use this tool, you will first have to select your ROM using the "Choose ROM" button. After that, you must select the "Set ROM" button, so the program will extract the ROM using NDSTool. Now you can make use of several features: editing Pokémon (evolutions, attacks, data, TMs etc.), maps (wild Pokémon, events, Trainers…), moves (changing their description, type…), TMs and HMs (changing the attacks of any TM/HM), items, abilities, scripts (text) and trainers (Pokémon levels, and such). If you're done with using one feature, and you want to switch to another feature, make sure to click the "Save" button before you continue (if any)! If you're done with modifying your game, you can rebuild your ROM using the "Write ROM" button… It even has a patch maker build-in, so make use of that one, and share your hack with us!


Viewers
Console Tool by lowlines
Another very useful tool which allows you to view and convert the Nintendo DS' pallet files, viewing 3D models and viewing, ripping textures, extracting single files of a Nintendo DS ROM, editing files with the built-in hex editor, viewing the files within .narc as well as .carc files (without having to decompress them), extracting and viewing 2D graphics and 2D animations! You can open files directly (files that are already extracted from the ROM), and you can open a Nintendo DS ROM file, so a list containing the files within the ROM will appear. In order to make a graphic appear in a correct way, you need to open the Nintendo DS ROM file, containing the uncompressed graphic (NCGR) and palette file (NCLR) (and, if they're there, the animation (NANR), screen (NSCR) and (NCER) cell) files. You have to click every one of them ONCE, so an icon will appear behind them, after that you'll have to double click the NCGR file.

NSBMD by kiwi.ds
This tool allows you to view and dump 3D models and textures of a Nintendo DS ROM. This tool uses the Command Line. I would recommend you to use ConsoleTool, because it is more user friendly. You can't open the program directly, you have to open it using the CMD.


Graphical ROM Hacking Tools
PokeTex
With this tool, you can open up and view graphics (overworld sprites) from Pokémon games, pretty much outdated IMHO. In order to view the graphics, you'll need a .txt file containing some codes (actually locations), so the program can detect the graphics. With this tool, it is possible to edit graphics, but it's a real pain. Instead of pixels, you'll need to change numbers, each referring to a single color. It's not a bad tool either, if you consider this is one of the early Nintendo DS ROM Hacking tools.

TiledGGD by barubary
This tool supports .NCGR and .NCLR files, meaning you can view graphics with it, with its right colors. Unfortunately, .NSCR files aren't supported, so some graphics will end up as puzzles. I would only recommend you this tool, if you're looking for some information for the palettes or graphics you're using. You can also use this tool to make a .bmp file out of the .NCGR and .NCLR files.

Tile Molester by SnowBro
I used this tool in the days I didn't knew CrystalTile had a graphic editor. With this tool, you can open graphics files from the Nintendo DS, and many other handhelds/consoles. You might encounter the following problems though; you'll have to make the picture show up correctly yourself, by changing some values and settings. You can't open the .NCLR palette files directly, you'll have to edit them with a hex editor, or you'll have to convert them to a supported file (using ConsoleTool, for example). I think it's best to use an alternative, because you'll probably will have many questions when using this program. I don't think it is necessary to write about this tool, just use Google in order to find the answers of your questions about this program.


Translation tools
FINAL FANTASY III Dialog editor by KengHot
With this translation tool, you can translate FINAL FANTASY III for the Nintendo DS.
First you will have to extract the FINAL FANTASY III ROM file, and locate all the .msd files.
These are the files containing the script. Take a look at the file names you'll see that each file has a letter in front of its file name.
"d" stands for dungeon, "t" stands for town "world_talk" are the dialogs of the events occurring on the world map, "eureka" are special dialogs (like battles, menu's etc.). I don't know what "f" stands for, maybe this text is unused, because it mainly contains Japanese text stings. There is only one "s", containing the dialog when you wake up.

Back to the dialog editor, first open the text .msd you'd like to modify.
Now the editor shows you the original text on the left side, and the modified text on the right side.
Once you selected a text string, you can edit it below.
Again: the original text on the left side, and a text field where you can input your translated text.
Change the "Max Chars" or "Max Lines" values if it tells you that the text won't fit.

When you're done with editing a string, click "Update" before you'll continue, after that you can select another text string.
If you're done with editing one file, click the "Save File" button.
The modified files will be saved in a folder named "output", it should be in the same folder as the executable.
Just overwrite the .msd files containing in your extracted ROM folder with the one in the "output" folder.
After that, rebuild your ROM, and test it! Unfortunately I noticed one little problem with this program…
When your sentence starts with a blank space, the program will remove it.
For example, if character one tells something to character two, first the name will be displayed with a blank space in front of it.
That space will be lost, once you edited it with the dialog editor. There may be a way to fix this, but I haven't figured it out yet, or at least tried to. Maybe you should take a look at the "xml" folder, in the same folder as the executable.
You can also open FINAL FANTASY IV text files with it, but you can't edit the dialog, because these files are a little different than the ones for FINAL FANTASY III. I know the creator (Kenghot) also made a tool for FFIV, but he hasn't released it, so you got to ask him if you want that tool.

FINAL FANTASY III Font Editor by KengHot
Editing fonts for FINAL FANTASY III has been made easy with this tool.

FINAL FANTASY Tactics A2 Script Editor by Deufeufeu
This tool can be used for translating FINAL FANTASY Tactics A2: Grimoire of the Rift.

Kingdom Hearts ReCoded by Tricky Upgrade
This tool can be used for either Kingdom Hearts Re: Coded as Kingdom Hearts 358/2 Days. It can open up decompressed .s text files. See the decompressed in there? You first have to locate the .s file, and then you'll have to decompress it with BatchLZ77, for example. You can't open every .s file, because some files do not contain any text. Open the decompressed .s file with the dialog editor using "File/Open". Now the original non-changeable text will be displayed on the left side, and the editable text on the right side. {Line Break} refers to a new text line in-game. If you're done with editing the text file, you can save it using "File/Save". Now you'll have to recompress the file again (with BatchLZ77), and replace the original .s file with the newly created file. Rebuild your ROM, and test the game!

Phoenix Wright Script Editor by Deufeufeu
Using this program, you can translate Phoenix Wright: Justice for All (the USA version, ROM number 0820). If you're running the executable for the first time, you will be asked to select the PW:JfA ROM file. Don't move the file to anywhere! Otherwise, the program will refer to the wrong location, and you won't be able to make use of it anymore. If you accidently did this, modify the config.py file using Notepad, which should be in the same folder as the executable.

TheNewPokéText by loadingNOW
With this tool, you can translate most Pokémon games. Including: Pokémon Diamond, Pearl, Platinum, HeartGold and SoulSilver.


Music ROM Hacking Tools
Midi2SSEQ by kiwi.ds
If you want to convert your midi file to an SSEQ file, you need to use this tool. Simply drag a midi file to the .exe file. However, this tool isn't perfect, the created SSEQ file needs to be edited with a hex editor, and sometimes, the tool even crashes when converting it. If you're looking for more information, take a look at the Music Hacking section above.

NDS Sound Extractor by Nintendon
A program which is using the Command Line which can extract sound sequences and is able to convert them to .midi's (for .sseq's) and .wav's (for .swar's). Enter "LocationOfExecutable\ndssndext.exe –-help" in the command line, to view the command options for this tool.

SSEQ2Midi by kiwi.ds
This tool is basically the same as Midi2SSEQ, but it converts a SSEQ to a midi. To use this program, simply drag and drop the SSEQ file to the executable, like Midi2SSEQ. Fortunately, this program has less problems than Midi2SSEQ and does almost always guarantee a conversion without any issues.

SWAV2SWAR by Borra
A tool that is able to convert .swav files of a .swar file and vica versa. You can compare this with extracting .wav files a .RAR file (SWAR to SWAV, RAR to WAV -> SWAV to SWAR, WAV to RAR).

VGMToolbox
This tool can locate and extract SDAT files. These features can be found under "VGMToolbox/Misc. Tools/Extraction Tools/Nintendo DS". Drag and drop the .sdat or .nds file to the window, once you have selected one of the Nintendo DS features, and let it extract the sound files.

VGMTrans
If you are going to hack some music, this program is really useful. To use it, you'll first have to extract your ROM file, and find the .sdat file (the file containing the music of the game, often called sound_data.sdat, these are often located in folders named music, sound etc.). The folder/open button doesn't work for some reason, so you have to drag and drop the file to the VGMTrans window. Be patient, and a list containing the music will appear. You can listen to them, and extract them as a midi. However, once you converted an SSEQ to a midi, it will lose its instruments. Because the instruments are contained in a different file (the SBNK file). You can convert this one to a DLS file. Open them both with FL Studio, so you can hear the music correctly. Unfortunately, this program is very unstable, and often crashes. For more detailed information, look at the Music Hacking section above. The program also features a build-in hex viewer, this one is very useful because it can spot the tempo, volume etc. of a music file.


Level Editing Programs
New Super Mario Bros. Editor by Dirbaio and Pirahnaplant | Official Forums
Ever wanted to create your own Super Mario level? You can edit New Super Mario Bros. levels for the Nintendo DS using this tool!

Super Mario 64 DS Editor by Mega-Mario | Discussion thread
To edit Super Mario 64 DS levels, you can use this tool. Even though SMB64DS' levels are fully 3D!


Nintendo DS ROM Extractors
DSBuff by WB3000
A Nintendo DS ROM extractor with several other features like trimming, patching...

DSLazy by ratx
A wonderful ROM extractor with several other features. This is one of the most popular extraction tools. It has simple GUI, so it is easy to use.

NDS Editor by kiwi.ds
A tool that is able to extract and rebuild Nintendo Archives, LZ, Nintendo DS ROM, and Sound Data files. To extract files from a Nintendo DS ROM, simply open it, so it will be listed in the program. Double click it, and you'll see the list containing the files inside the ROM. Check the files you want to extract, and press the yellow-ish button at the left top. The NDSTool This is the first Nintendo DS ROM extraction tool ever made, but it works perfectly well for almost every game. How does this tool work? Simple.

Let's say the NDSTool executable and the ROM file is located at C:/NDS/…
For extracting a Nintendo DS ROM file, open the Command Line, type: "cd C:/NDS/" (without quotes), and press enter.
After this, type: "C:/NDS/ndstool.exe -x NameOfNdsRomFile.nds -9 arm9.bin -7 arm7.bin -y9 y9.bin -y7 y7.bin -d data -y overlay -t banner.bin -h header.bin" (again without quotes) and press enter.

Wait a moment, so all the files will be extracted. Modify the extracted files, and rebuild your Nintendo DS ROM using the following method:

Go back to the Command Line, make sure you are still located at C:/NDS/.
Type the following (without quotes): "ndstool -c NameOfNewNdsRomFile.nds -9 arm9.bin -7 arm7.bin -y9 y9.bin -y7 y7.bin -d data -y overlay -t banner.bin -h header.bin" and press enter. You can also use TheNewPokeText alongside NDSTool, for easier use.

Tahaxan by Arcnor
A useful tool which can view the files within Nintendo DS ROM files. It has a nice graphic viewer, text viewer and file extractor build-in (right mouse button/extract). The graphic viewer is able to convert the Nintendo DS' graphics files to a bitmap file, and you can set your own image size, which could be useful for some graphics. Nothing much to tell you more, it is very user-friendly, so you should be able to make use of this program yourself.


Changelog:
05/03/12: Initial Release.​
11/11/12: The layout has been fixed and is now compatible with the new forum software!​
11/17/12: Got rid of the spoiler tags, the layout is still being worked on.​
 

HandsomeHans

New Member
Newbie
Joined
Jun 20, 2020
Messages
2
Trophies
0
Age
29
XP
53
Country
Germany
Is this guide stil up to date? Also the download images don't display properly anymore, I think. besides that my google chrome blocks the download. Any way to fix that? I want to make a advance wars days of ruin hack.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Is this guide stil up to date? Also the download images don't display properly anymore, I think. besides that my google chrome blocks the download. Any way to fix that? I want to make a advance wars days of ruin hack.
It is not like ROMS change with time.

Still if you never played with internet archive there is no time like the present (also many links you might encounter when you learn to hack will often be broken so there is that)
https://web.archive.org/web/2014041...ltimate-nintendo-ds-rom-hacking-guide.291274/
It seems the original poster was around yesterday as well so maybe they will be able to restore things, or I might give it a go later.

Also if you never visited http://forums.warsworldnews.com/viewforum.php?f=11 you might want to.
Not so many editors but usually a lot of info.
 
  • Like
Reactions: HandsomeHans

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
With a DS ROM opened in CT2 then click the little DS icon on the right hand side of the main menu. It will then pop up the menu in the bottom middle of the screen.
If it detects a file format it knows (that one being the carc format, which is just NARC but compressed) then if you right click you will get a bunch of options depending upon the format. In the case of archive stuff you will then get a further window with the contents of the archive.
You might also be able to load the carc file RAW into the CT2 and do some stuff but that gets trickier.
 

EpicGamer256893

Active Member
Newcomer
Joined
Jul 24, 2020
Messages
29
Trophies
0
Location
my house
XP
159
Country
Australia
I dont really understand sorry. here's my screen. I dont know what ds icon you mean. and when I right click on most files it says .(filetype) Unknown PakFile at the bottom
upload_2020-7-25_0-39-45.png
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
You might try in the tools menu as well. It might have something to handle NARC files. Might also want to decompress it first (if it detects the compression it will have a decompress option as well as extract/unpack).
Alternatively things can be detected better by CT2 when decompressed.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Probably want to find a better download where someone repacked it.

Still if it is the standard one from the site itself
Code:
www.angeleden.net
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
It says that the site cant be reached
Yeah it died years ago. It is however the password for the zip file and most other files -- around the time it was released people still used a lost of direct links and had not figured out the "wait 5 seconds, point at the traffic lights and then click problems downloading anyway" routine. To that end a decent way to ensure you either spread your site was to use the site name or something as a password.
 

Aaroaoi

Member
Newcomer
Joined
Jul 24, 2020
Messages
5
Trophies
0
XP
49
Country
Estonia
Yeah it died years ago. It is however the password for the zip file and most other files -- around the time it was released people still used a lost of direct links and had not figured out the "wait 5 seconds, point at the traffic lights and then click problems downloading anyway" routine. To that end a decent way to ensure you either spread your site was to use the site name or something as a password.
okay i typed it and it said it was not valid
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Is there any way to edit the code?
Code for what?

Many times in threads like this then code = the ROM itself and... yeah this is what this thread and the ROM hacking section here cover and have for years.

If the average programmer asks me that then I will think they mean either the stuff running on the CPU or a scripting language if it is one of those games (we saw a few on the DS using various shades of Lua as well as their own custom stuff that may or may not have been Turing complete).

In that case yeah pretty much since proper custom ROMs could be run.

In DS ROMs the code is found in technically four locations, maybe 5 but we will cover that in a minute, plus scripting if that is a thing.

Said locations are

ARM9.bin

ARM7.bin

Overlay files, both ARM9 and ARM7 flavours can exist in theory but in practice there will tend to only be ARM9 files.

The fifth oddity then being download play (usually seen as something .srl or ultility.bin, especially if located in a directory called DWC). This is basically another DS ROM (as in literally use the same tools you used to pull apart the ROM to get there to play with this. It is signed so you either need to use the signing trick discovered not so very long ago or use a DS with flashme installed (don't know what goes for DSi and 3ds). Most things will be various flavours of compressed. Editing this is usually done for purposes of editing the download play aspect (sometimes they are nice little games you can't get otherwise) or if the download play is a simplified version of the main game and you can use that as being simpler to find a rough equivalent (don't know I have really seen this done for assembly, quite often though for fonts, graphics and the general layout of a ROM and thus it follows assembly might yield something).


Anyway general breakdown for most commercial ROMs (homebrew can and does play things differently on occasion).

ARM9. This is the workhorse of the DS. It is the faster of the two processors and more capable, and sort of tied into hardware more (though for most practical purposes you don't care). If the game does something as far as game mechanics it is probably done with this.

ARM7. This is a coprocessor but basically relegated to glorified library. The ARM7.bin files can actually be swapped around with other ROMs of similar vintage with no ill effect, indeed it was a sort of fix at one point.
The only reason any ROM hacker usually cares about the ARM7 is because it can be a nice place to inject some of your own code.

Overlays...
In modern computer world we use DLL files and other such things to have code grabbed and used that would not be used the whole time and thus does not need to be in memory, however the functionality would be nice to be able to use once every so often/few thousand runs (see the classic everybody only uses 10% of the functionality, however it is a different 10% thing). The DS however is in terms of architecture closer to an early 1990s computer (albeit with better 3d, still 4 megs of RAM though). It then uses an older method called overlays. Here a section of memory is set aside (can be one overlay at a time, sometimes has multiple sub sections) and then swapped out at will. We have seen games use thousands of overlays and have everything from actual instructions for the CPU to run to just graphical assets but this is rare.


You edit these much as you would with anything else

A disassembler takes the binary and outputs it as a assembly code
http://problemkaputt.de/gbatek.htm#armcpureference
http://imrannazar.com/ARM-Opcode-Map

If you are not familiar with assembly I don't have a great intro to it by way of jumping right into ARM.
I usually suggest
https://www.plantation-productions.com/Webster/
http://stuff.pypt.lt/ggt80x86a/asm1.htm

Disassemblers are many and somewhat varied
ndsdis2 is an old one but nice for a lot of things.
crystaltile2 (you see pictures of it above) has such things
many emulators will have such features, with the added bonus of being available at runtime so you can follow what is going on. Also dodges compression issues.

Desmume has such things but no$gba is probably what we suggest
http://problemkaputt.de/gba.htm
There are several other emulators with some amount of debugging functionality, however they are mostly old. MelonDS does however look to be doing something.

Compression issues.
All the DS binaries and overlays can optionally be compressed by the devs that made the game, or on super rare occasion the one dumping or hacking the game (this is generally discouraged and viewed as pointless but it is a thing that can be out there).
The compression however is not the standard compression seen in most other files on the DS (and GBA) and is instead a kind of backwards approach. Just need the relevant tool to handle it
In this case the BLZ tool in https://www.romhacking.net/utilities/826/ is good.
Crystlatile2 has such options but often lies about detecting compression.

If you do any amount of assembly work as a big boy hacker you will probably meet IDA, though it is paid for software. There are some modules for it but have not kept up to date there. Not sure if ghidra and radare2 have anything specifically for ARM right now but they are two of the tools that usually form the open source world's answer to IDA.
Desmume above speaks to GDB if you want it to. GDB is a debugger for popular open source programming tools.


Debuggers if you use one have a few key features. Breakpoints and memory viewers are what most will spend most time with here.

Once you are done looking at assembly code you then want to edit it.
Nobody disassembles something, changes one thing and reassembles it. Indeed disassemblers tend to struggle to output a file that can be reassembled. The only times this happens is when someone spends many days/months/years getting it back to a point this works for. It has happened before in ROM hacking world (all those nice Mario, Sonic and pokemon diassemblies tending to be this when completed, plus all nice comments, variable names and the like) but yeah tends to be reserved for old and popular games, likely not whatever you are looking at.

Anyway you can hand encode instructions (the earlier links for DS/ARM assembly covering how you would do that) but that is a monstrous pain in the arse for more than about 3 instructions that are replacing existing ones. Start changing things up, adding functionality and making more code than you started with and not fun at all.
To this end we have assemblers. Your debugger or disassembler if it is one of the fancy GUI ones might have such functionality. More than likely you get to write a code fragment and then either inject it yourself, or maybe with some of them you can even specify an injection point and it will do it for you.

Generally there are two tools people use here, however many more exist out in the world

1) Some hacked up GCC (GCC being the GNU compiler collection, also commonly associated with GDB mentioned earlier, and also basis for many homebrew development kits) script.
Not sure what I have for a download right now and don't know I would suggest installing full devkitpro/devkitarm just for this but eh.

You might see variations in things like
https://gbatemp.net/threads/crackers-ds-trainer-maker-tutorial.44410/
https://web.archive.org/web/20140518192134/http://crackerscrap.com/index.php

2) A more dedicated hacking tool like ARMIPS. This is probably what I would suggest get working for you.
http://www.romhacking.net/utilities/635/
https://github.com/Kingcom/armips
https://buildbot.orphis.net/armips/

There are plenty of other things (see something like the new super mario brothers wave audio injection script as it did some fun things) but those are the main two most around here and other places will use.

Places to inject your code then.
Always a fun one when playing assembly hacker.
Unlike many older systems also using cartridges the DS copies (possibly decompresses) the binary into RAM. This means you don't necessarily have as much space as you might like (the GBA on the other hand -- more or less the rest of the full 32 megabytes to do what you like in) or that might be available in other aspects of DS ROM hacking.
Being in RAM does mean you can make a cheat to edit the binary in RAM (various tools will tell you, indeed one of the bonuses of emulators, but NDSTS is my usual choice here http://www.no-intro.org/tools.htm )
Anyway if you can do it all in place (say you want to change a subtract to an add, or maybe a NOP just to have it do nothing* rather than taking a path you don't like so it always takes the one you want) then do that.
If not then you get to find a space.
You can optimise code. Don't do this if you can help it -- generally only optimise when you need the speed boost or battery consumption lowered.
This then leaves finding redundant code to instead overwrite with your stuff and have the game jump from where it normally would be to there, do what it needed to do (including any instructions you overwrote with the jumps) and jump back. In the case of the DS the compiler had a nasty habit of including each and every random wifi error code for things that nobody in the world likely ever experienced but could still have happened, in maybe 5 languages if it was a European ROM. If then you have a wifi enabled game you can find these (they are usually in plain ASCII) and overwrite them with your stuff.
There might also be random junk the devs left in for whatever reason and you can overwrite that.
Free space memory on the DS is kind of a thing sometimes. Tools to help find it include older versions of DSATM (4.3.4 I think was the last) which has a DEADBEEF padding option (it will hopefully flood the memory with DEADBEEF as opposed to the normal 0000 or random noise, you then play through to the point you care about in the game, plus whatever options/oddities you can think of, and if the memory still has DEADBEEF in there it likely is not going to use it and you are free to use it yourself, there is also the desmume free space finder fork https://gbatemp.net/threads/unofficial-desmume-build-unused-memory-finder-tool.349332/
Theoretically you could do your own extra overlay too but I don't think anybody has ever done this. Might have used the overlay space for a sneaky spare bit of memory though.
After the overlay section is often a small dump of the firmware details (your birthday, favour colour, nickname and whatever else it gets you to enter). Any use this sees in games is usually for the language settings (you can change this to force different languages even, sometimes including languages the game never officially featured, though most just use it with bad flash carts and emulators on mobile phones) and maybe the nickname so you can consider this one.
I mentioned ARM7 earlier. Many cheat tools do use this, fewer hackers though.


*NOP is short for no operation which is to say it still runs but no end result happens. Not all processors will have a dedicated one, not all assemblers will give you one as a shortcut (some assemblers give people little shortcut meta instructions**) but you can usually make one where nothing really happens. mov r1, r1 being a fairly obvious example wherein the contents of r1 are copied to r1 and thus nothing happens but some wasted time.

**seems my tangents have asides which have tangents now. Classic one is the ARM processor can't include a full 32 bit number in the instruction itself (no room for the instruction if they do that), this differs to PC. Many assemblers however will create something like this for you and handle it all itself. This spares the user then having to do something like put the 16 or however many bits in they can, then shifting the result and then adding the final bit (kind of like if you can't write 110 you can still do add 10, multiply by 10 and add 10 and yes that is possibly a bit longer winded that just multiplying by 11 but shifting is a thing on ARM processors), or maybe messing around with movn (mov negate, basically put the number in and invert the results movn 0000 becomes FFFF in memory sort of thing).

Anyway most DS assembly hackers are only concerned with changing the maths within parameters it understands (2x growth is still growth using all the same maths), marginally improving things (say adding a variable width font), stopping it from doing something (in the classic IF ELSE programming loop you might NOP one of the various IFs, in this case likely some form of compare and branch if equal or maybe not equal, so the more positive ELSE always happens, or maybe telling it to always take the good path -- classic example being anti piracy checks in that you don't have to disable the check if you can instead just tell it to always take the "all is good here" path) or something equally compact.


I should also note that in the various "gigaleaks" earlier this year various pieces of DS source code were leaked, including for some pokemon games, and the attendant development tools (before it was mostly some old stuff). You are on your own for that one, however it is possible and some people of relatively limited coding skills managed to get the compilers working. Also means you can edit C code rather than assembly, and also not have to worry so much about injection (you are still limited by the hardware but eh).
 

Miserablemasquerade

Member
Newcomer
Joined
Apr 25, 2017
Messages
7
Trophies
0
Age
36
XP
154
Country
Canada
Hello, I'm wondering if anyone can help me with Pokemon Mystery Dungeon Blue Rescue Team? I want to replace some animations but I don't know how to edit them. I've unpacked my rom and have these files.
 

Attachments

  • 2021-11-07 14_14_22-pkm.png
    2021-11-07 14_14_22-pkm.png
    19.2 KB · Views: 90

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: yawn