Hi,
I am new here, someone I know referred me to this site to discuss various hacks with the DS.
I have a website called PathHero. The site displays a good portion of the songs in the Guitar Hero and Rock Band series of games. Here you can visually see what notes will be coming up throughout any given song, think of it like a map, only we call it a notechart or chart. In addition, users of my site will submit what they think is the best way to achieve the optimal score (by means of showing where you should activate starpower/multiplier) in any given song/difficulty/instrument combo. Anywho, I'll stop advertising
I have been able to extract chart information from GHn Tour as the source files are in plaintext, QGM files. As you can see on the site, you can see those charts. But ever since GHn Tour Decades, the files have been encrypted and I cannot make out any data. No progress really had been made on this until about a week ago. I had the bright idea of loading the ROM into an emulator, DemSuME to be exact (it seemed to have good dev tools and also had the Guitar Grip built-in). When I ran it, I selected Dirty Little Secret, the first song, and paused right before the notes started coming out. I did a memory dump and searched for "00 00 00 00 10 01", a common sequence of bytes inside QGM files (but isn't guaranteed, its been awhile but I think 00 00 10 01 means a plain green note). There were multiple instances, but I eliminated those where that sequence above ends on an even 4-byte word. Although its not guaranteed to eliminate it to 1 instance like I did, you should be able to see a repeating structure in increments of 8 bytes somewhere in the few instances.
So I traced backward until I found the start, not hard since I recognize QGM files when I see them, each note in a song takes up 8 bytes, like so:
...and voila, I found the decompressed version!
Then I discovered that in DS memory, there are parts that repeat in this format:
So, before the start of the data, it shows the length of the data. I also found that the length of the decompressed file matches what it says in the header of the compressed version, the header is as follows:
It does seem strange that the header seems to be only 11 bytes, but its possible the length of decompressed file is 3 bytes, but its in little endian so I cannot make that determination.
So I tried this again for a different song. And it worked, I was able to find it, but its in a completely different memory location, which shouldn't surprise me, but it makes it difficult. So I've come to the conclusion that using this method to extract the charts cannot be done systematically and will take a long time (8 times per song, 2 instruments * 4 difficulties).
My original intention was to debug and step through the process of it decompressing it to figure out what algorithm it is doing, but I think I don't have the tools to exactly do that. This is where you all come into play, I was hoping if someone could help me out with more DS-specific general experience, like with developing emulators.
I would be willing to provide sample compressed & decompressed files, although if you have the ROMS for GHOT and GHOTD, you can see the source files for yourself. GHOT has a GOB file, which you have to ungob, I have a perl script for that if you need it, idk if GOBs are typical...and GHOTD doesn't use that, the files are just listed at the root. The only thing you won't have right out of the box is the decompressed files I extracted, but I provided the tutorial above to help.
EDIT: Tutorial to extract contents of GHOT GOB file
I am new here, someone I know referred me to this site to discuss various hacks with the DS.
I have a website called PathHero. The site displays a good portion of the songs in the Guitar Hero and Rock Band series of games. Here you can visually see what notes will be coming up throughout any given song, think of it like a map, only we call it a notechart or chart. In addition, users of my site will submit what they think is the best way to achieve the optimal score (by means of showing where you should activate starpower/multiplier) in any given song/difficulty/instrument combo. Anywho, I'll stop advertising
I have been able to extract chart information from GHn Tour as the source files are in plaintext, QGM files. As you can see on the site, you can see those charts. But ever since GHn Tour Decades, the files have been encrypted and I cannot make out any data. No progress really had been made on this until about a week ago. I had the bright idea of loading the ROM into an emulator, DemSuME to be exact (it seemed to have good dev tools and also had the Guitar Grip built-in). When I ran it, I selected Dirty Little Secret, the first song, and paused right before the notes started coming out. I did a memory dump and searched for "00 00 00 00 10 01", a common sequence of bytes inside QGM files (but isn't guaranteed, its been awhile but I think 00 00 10 01 means a plain green note). There were multiple instances, but I eliminated those where that sequence above ends on an even 4-byte word. Although its not guaranteed to eliminate it to 1 instance like I did, you should be able to see a repeating structure in increments of 8 bytes somewhere in the few instances.
So I traced backward until I found the start, not hard since I recognize QGM files when I see them, each note in a song takes up 8 bytes, like so:
Code:
Plaintext QGM File Structure
- - - - - - - - - - - - - - - - - -
4-bytes - Start of note in milliseconds
2-bytes - Duration of note
2-bytes - Information about note (color/star/etc)
Then I discovered that in DS memory, there are parts that repeat in this format:
Code:
4-bytes - Length of data (x bytes)
x-bytes - Data
So, before the start of the data, it shows the length of the data. I also found that the length of the decompressed file matches what it says in the header of the compressed version, the header is as follows:
Code:
Compressed QGM File Header
- - - - - - - - - - - - - - - - - - - - -
5-bytes - Magic Number "4C 08 00 00 45"
2 bytes - Length of compressed file
2 bytes - Always "00 10", possibly indicating the size in chunks in which it is compressed
2 bytes - Length of decompressed file
So I tried this again for a different song. And it worked, I was able to find it, but its in a completely different memory location, which shouldn't surprise me, but it makes it difficult. So I've come to the conclusion that using this method to extract the charts cannot be done systematically and will take a long time (8 times per song, 2 instruments * 4 difficulties).
My original intention was to debug and step through the process of it decompressing it to figure out what algorithm it is doing, but I think I don't have the tools to exactly do that. This is where you all come into play, I was hoping if someone could help me out with more DS-specific general experience, like with developing emulators.
I would be willing to provide sample compressed & decompressed files, although if you have the ROMS for GHOT and GHOTD, you can see the source files for yourself. GHOT has a GOB file, which you have to ungob, I have a perl script for that if you need it, idk if GOBs are typical...and GHOTD doesn't use that, the files are just listed at the root. The only thing you won't have right out of the box is the decompressed files I extracted, but I provided the tutorial above to help.
EDIT: Tutorial to extract contents of GHOT GOB file