News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: GBA ROM unpacking  (Read 5430 times)

DixieKongJD

  • Newbie
  • *
  • Posts: 4
    • View Profile
GBA ROM unpacking
« on: December 27, 2015, 07:00:40 am »
yes, this is being a noob, but that's what I am :D
---------------------------------------------------------------------------
So I want to look in the game data of MKSC mostly for documenting unused content if I find any, but also, in case I want to do anything with the game itself, what tools are there which allow to unpack the ROM?
(Running on a 64-bit OS, and I don't mind if it involves using a command line either)

I'm aware of ndstool for DS roms so there must be something similar for GBA roms as well, then?
Thanks ~dixie

FAST6191

  • Hero Member
  • *****
  • Posts: 3020
    • View Profile
Re: GBA ROM unpacking
« Reply #1 on: December 27, 2015, 07:46:29 am »
No. GBA ROMs are compiled into one big lump a la NES and SNES and such, though with the added bonus of being a relatively modern compiler used so things can be jumbled up everywhere where you have some things you might at least want to try on older systems ("X bank is usually graphics" sort of thing). Some GBA homebrew uses one of a few filesystem options available ( https://pineight.com/gba/#gbfs being the more popular) and there are formats used in commercial games that you can scan for* but for the most part there is no unpacking.

*three main things here
1) The GBA binary (as in code that the processor runs) is readily found. The very first byte of the ROM is usually to the end of the header and there you will find various pieces of IO (setting stack pointers, initialising things...). Shortly after that will be a jump to somewhere in the 08?????? region and that is your binary. I have a picture version in http://www.romhacking.net/forum/index.php?topic=14708.0

2) The sappy sound format. If you are familiar with DS games you probably ran into the SDAT sound format, the half precursor and GBA equivalent tends to be known in hacking circles as sappy. Various tools can detect this.
A few game specific tools go further still, for me the ultimate expression of that would be Atrius' work in the Golden Sun series which uses all sorts of fingerprinting and pointer analysis.

3) Compression detection. There are a few tools that chain compression detection with a tile editor and they can do things. Technically this would be a basic technique in line with relative search and pointer detection (the GBA ROM is all mapped between 08000000 and 09FFFFFF, though in practice most ROMs are less than 16 megabytes so it is between 08000000 and 08FFFFFF, and as such if you see a bunch of 08 values typically with some 6 bytes between them then you probably have some pointers and you want to look at that).

http://www.romhacking.net/documents/361/ is worth a read and these days the no$gba debugging emulator ( http://problemkaputt.de/gba.htm#debug ) is free and well worth playing with as well.

I am guessing MKSC is Mario Kart Super Circuit. Most other Mario Kart games on other platforms are as well hacked as the systems there are on, however I have not paid any attention to what people might have done for the GBA edition (mainly as the amount of drama that the Mario Kart hacking set seem to get involved in is second only to the pokemon crowd). If you want to poke around http://wiki.tockdom.com/wiki/Main_Page and http://www.dshack.wiki/ and use author names, tool names, links and such for a jumping off point then you might find something.