PDA

View Full Version : Research: Hacking Nintendo DS .sbnk files


Spiky-Eared Pichu
October 8th, 2010, 9:12 AM
The other day I found a webpage describing how NDS .sbnk files work, but only a bit of information of them. So I will write it here and if someone knows more we can make a fully-fledged hacking tutorial.

What we know currently:



.SBNK files are like SoundFonts, but they only have pointers to other files that contain the instrument waveforms.
.SBNK files define how an instrument is played (ex: pitch, notes, pan, etc)
Each instrument is composed of 20 bytes:



8 bytes of "Region". I don't know what does this do, but we know that some soundbanks have it while others no.
4 bytes of unknnown information. Its value is 0100 by default.
4 bytes that define which .swav to use. The bytes are the position of the file in numerical/alphabetical order.
4 bytes that define which .swar to use. The first 2 bytes are which .swar files are used and the other 2 are the position of the file in numerical/alphabetical order.
6 bytes that define the instrument's settings. The 6 bytes are: Note number, Attack rate, Decay rate, Sustain rate, Release rate and Pan.

This is the known information for now. I still need to figure WHERE is this data found inside the .SBNK and discover what the unknown bytes are.

Information source: jul.rustedlogic.net

If you find new information, please post it here and help!

Team Fail
October 21st, 2010, 5:57 PM
Well, I know that VGMTrans can export them as .dls files. This (http://www.pokecommunity.com/showthread.php?t=230599) tutorial can explain how to extract them, and this (http://emusician.com/mag/emusic_downloadable_sounds/) webpage explains what they are. If we can extract them as downloadable sounds, edit them and convert them back to .sbnk files and insert them, we could hack them. Just a thought.

Spiky-Eared Pichu
October 23rd, 2010, 7:22 AM
Well, I know that VGMTrans can export them as .dls files. This (http://www.pokecommunity.com/showthread.php?t=230599) tutorial can explain how to extract them, and this (http://emusician.com/mag/emusic_downloadable_sounds/) webpage explains what they are. If we can extract them as downloadable sounds, edit them and convert them back to .sbnk files and insert them, we could hack them. Just a thought.

Yes, I used the .dls files to remix Pokémon music. I tried to recompile it with hex, but I have the real trouble with the offsets. If we could have them, would be able to edit the instrument data.

Team Fail
October 23rd, 2010, 7:54 AM
Yes, I used the .dls files to remix Pokémon music. I tried to recompile it with hex, but I have the real trouble with the offsets. If we could have them, would be able to edit the instrument data.

Ha. I see someone thinks like I do. FL Studio, no? Anyways, what offsets are you after? And what are they supposed to be for? Everything you may be looking for could be in the .sdat file.

Spiky-Eared Pichu
October 23rd, 2010, 12:24 PM
The data in a SBNK is organized in two parts:

1. A list of every instrument with the offset to its data.
2. The data of the instruments. This is where it's determined which wave to use, the volume, etc.

What we don't know is WHERE is the 1st part.

Team Fail
October 30th, 2010, 9:35 PM
Well... I looked in my hard drive and found an old download.

*Nintendo Nitro SDK*

It MAY HELP, but I need to figure out how to use it.

Spiky-Eared Pichu
November 2nd, 2010, 8:17 AM
Thank you, now we know more things. I'm trying to edit a .sbnk from Pokémon Diamond, but I'm facing two problems:

1. NDS Editor doesn't work for me. When I open a file it says "Could not open file". To get the file dumps, I had to ask help to a friend (Sphark) who dumped and sent me the .sbnk dumps.

2. I am trying to replace a .sbnk with a bigger one, and you know what happens. I and Sphark have researched for the way an .sdat is read and we have made some progress: VGMTrans, Crystal Tile 2, etc read the new data, but the game does not.

Team Fail
November 28th, 2010, 10:07 PM
Well, why don't we look at VGMTrans' sourcecode? If it has the code to convert SBNK -> DLS, why don't we make it reverse the operation and make it into a separate running program?

Spiky-Eared Pichu
November 29th, 2010, 4:32 AM
...

I didn't know that VGMTrans was open-source. Yes, we can try to "mod" it so it does the reverse operation, but I'm not a computer programmer. I can try to do it, but I don't know what will happen...