• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Hacking Nintendo DS .sbnk files

Spiky-Eared Pichu

NDS Hacker/Researcher
  • 257
    Posts
    15
    Years
    • Seen Oct 2, 2019
    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:

    1. 8 bytes of "Region". I don't know what does this do, but we know that some soundbanks have it while others no.
    2. 4 bytes of unknnown information. Its value is 0100 by default.
    3. 4 bytes that define which .swav to use. The bytes are the position of the file in numerical/alphabetical order.
    4. 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.
    5. 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!
     
    Well, I know that VGMTrans can export them as .dls files. This tutorial can explain how to extract them, and this 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.
     
    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.
     
    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.
     
    ...

    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...
     
    Back
    Top