Hacking GBA injection

  • Thread starter Thread starter ajd4096
  • Start date Start date
  • Views Views 28,374
  • Replies Replies 79
  • Likes Likes 17

Will I answer dumb questions?

  • No!

    Votes: 18 32.7%
  • Hell, no!

    Votes: 37 67.3%

  • Total voters
    55

ajd4096

Well-Known Member
Member
Joined
Feb 17, 2009
Messages
179
Reaction score
193
Trophies
1
XP
569
Country
If you have to ask for a guide, you probably shouldn't be doing it.

Script is here:
https://github.com/ajd4096/inject_gba

Of 2810 roms, 2810 can be injected.

On an N54L, that took about 2.5 hours and used about 118G
(find|xargs is your friend)
-----
To install (needs python3)
python setup.py install
-----
inject_gba -h

inject_gba --inpsb=/path/to/alldata.psb.m --inrom=/path/to/new.gba --outpsb=/path/to/new/alldata.psb.m

Options:
--allow-overwrite
--create-backup
Do what it says on the tin.

--prefix=PREFIX
Prefix the new ROM with goomba or pocketnes.
(I don't include these, get them from dwedit's site.)

--pad00 --padFF
Pad to original length with 00s or FFs.
I haven't found any games which need this, YMMV.

The gui automatically assumes --create-backup and --allow-overwrite.
There is a wizard sequence for setting the prefix/padding options.
-----
Batch processing:
inject_gba_batch -h

inject_gba_batch --base=BASEDIR *.gba

This will create a sub-dir for each ROM file, copy BASEDIR into it, and inject the ROM into the copy.
(BASEDIR defaults to 'base' in the current directory)

This also supports @optionfile, so you can set --prefix=goomba.gba etc.

For the drag-n-droolers, you can create a desktop shortcut as a drop target.
-----
GUI
inject_gba_gui -h
-----
When in doubt, RTFS.
 
Last edited by ajd4096,
well i will wait for an idiot proof tutorial by someone lol.

As long as your game compresses down to 8 megabytes or less (you can test by zipping your ROM to get a general idea, but obviously, don't feed this script the zip file, give it the raw gba file), here's how I did it:
  • Open command prompt/terminal window
  • Code:
    python inject_gba.py -z alldata.bin your-rom-file.gba

  • Put your-rom-file.adb that you get from the Python script onto your SD card where appropriate (/wiiu/games/your-gba-game/content) and rename it to alldata.bin
  • Run game through Loadiine
If you've used Python, before it's no different than running any other scripts, really. Just use -z if you have The Minish Cap as your base game, or -m if you have Mario.

Edit: As a side-note, FireRed works great, but you can't save. C'mon Nintendo, support more save formats! :P
 
Last edited by daxtsu,
Maybe we should try to use a game with native supported savestate and use the emu (rpx) inside it to inject. Any candidate title ?
 
Maybe we should try to use a game with native supported savestate and use the emu (rpx) inside it to inject. Any candidate title ?

You mean for FireRed/LeafGreen? I doubt any of the current GBA VC emulators support the save type it uses.
 
  • Like
Reactions: asper
As long as your game compresses down to 8 megabytes or less (you can test by zipping your ROM to get a general idea, but obviously, don't feed this script the zip file, give it the raw gba file), here's how I did it:
  • Open command prompt/terminal window
  • Code:
    python inject_gba.py -z alldata.bin your-rom-file.gba

  • Put your-rom-file.adb that you get from the Python script onto your SD card where appropriate (/wiiu/games/your-gba-game/content) and rename it to alldata.bin
  • Run game through Loadiine
If you've used Python, before it's no different than running any other scripts, really. Just use -z if you have The Minish Cap as your base game, or -m if you have Mario.

Edit: As a side-note, FireRed works great, but you can't save. C'mon Nintendo, support more save formats! :P
fire red saves work if you used the patched save versions like

Pokemon - Fire Red Version (U) (V1.0) [f1].gba xD
 
fire red saves work if you used the patched save versions like

Pokemon - Fire Red Version (U) (V1.0) [f1].gba xD
Cool, thanks for the info pedro.

@ajd4096 Quick question about the keys. Does it apply to the entire bin file, or just the rom mdf section (cause of know string in original file)? I was looking through the RPX for configuration settings of any kind, such as sound bitrate, screen width, patches, etc, but it looks like just the functions in there, not the actual config file. Unless I missed it or it is hardcoded.

Anyone else with info?
 
Cool, thanks for the info pedro.

@ajd4096 Quick question about the keys. Does it apply to the entire bin file, or just the rom mdf section (cause of know string in original file)? I was looking through the RPX for configuration settings of any kind, such as sound bitrate, screen width, patches, etc, but it looks like just the functions in there, not the actual config file. Unless I missed it or it is hardcoded.

Anyone else with info?

These keys match just the rom section.

@FIX94 I believe you made some progress on the alldata.psb.m? Can you shoot me your notes?
I've tried poking at the seed/hash/mt19937 approach (from exm2lib) but haven't had much luck yet.
 
Note that injecting homebrew roms this way does not work at all.
This includes goomba, pocketnes, anything I compile myself, and any other homebrew games in my collection.

For now, to use homebrew roms you need to use RAM injection or vWii + mGBA or similar.
 
  • Like
Reactions: eco95

Site & Scene News

Popular threads in this forum