Hacking GBA injection

Will I answer dumb questions?

  • No!

    Votes: 18 32.7%
  • Hell, no!

    Votes: 37 67.3%

  • Total voters
    55

ajd4096

Well-Known Member
OP
Member
Joined
Feb 17, 2009
Messages
179
Trophies
1
XP
562
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,

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
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,

asper

Well-Known Member
Member
Joined
May 14, 2010
Messages
942
Trophies
1
XP
2,030
Country
United States
Maybe we should try to use a game with native supported savestate and use the emu (rpx) inside it to inject. Any candidate title ?
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
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

EclipseSin

Ignorant Wizard
Member
Joined
Apr 1, 2015
Messages
2,063
Trophies
1
Age
35
Location
221b Baker Street
XP
1,737
Country
United Kingdom

pedro702

Well-Known Member
Member
Joined
Mar 3, 2014
Messages
12,722
Trophies
2
Age
33
XP
8,710
Country
Portugal
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
 

EclipseSin

Ignorant Wizard
Member
Joined
Apr 1, 2015
Messages
2,063
Trophies
1
Age
35
Location
221b Baker Street
XP
1,737
Country
United Kingdom
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?
 

ajd4096

Well-Known Member
OP
Member
Joined
Feb 17, 2009
Messages
179
Trophies
1
XP
562
Country
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.
 

ajd4096

Well-Known Member
OP
Member
Joined
Feb 17, 2009
Messages
179
Trophies
1
XP
562
Country
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

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    Ironic this was posted today lol
  • BigOnYa @ BigOnYa:
    I think the tv series has boasted play of, I did see they said playing of it Is up, way more than norm
    +1
  • BigOnYa @ BigOnYa:
    I've been playing the next gen version on Series X all day, I love it. :wub:
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Downloading some random stuff, damn almost 400GBs in like 4 hours lol
  • Psionic Roshambo @ Psionic Roshambo:
    Gonna be over 1TB this month.... damn lol
  • Xdqwerty @ Xdqwerty:
    good night
    +1
  • BigOnYa @ BigOnYa:
    At least you have some fast speeds. What a drag that used to be, I remb downloading 1 pic back in the day, and seeing line by line show
    +1
  • BigOnYa @ BigOnYa:
    Nighty night.
  • BigOnYa @ BigOnYa:
    Or worse, you downloading something, and someone calls your phone and interupts the download, good ole AOL. Of course that's before most you guys even were born yet.
  • Psionic Roshambo @ Psionic Roshambo:
    Lol I think my first modem was 48K but it had some sort of firmware or software update that let me get 56K
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I had EarthLink lol
  • Psionic Roshambo @ Psionic Roshambo:
    A bunch of NetZero accounts that I used for things... Lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    So glad I'm not in prison lol
  • BigOnYa @ BigOnYa:
    Yea marriage is a bitch sometimes...
  • Psionic Roshambo @ Psionic Roshambo:
    I legit think they passed the cyber terrorism laws from some of my hmm pranks lol
  • Psionic Roshambo @ Psionic Roshambo:
    I knocked the east coast backbone of EarthLink offline for like 6 hours one time, was on the news and everything well I mean I wasn't on the news.... Just they where having "technical difficulties" lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Was just one single custom packet. I miss when Internet security was an afterthought lol almost all modems and network hardware operated in promiscuous mode.
  • Psionic Roshambo @ Psionic Roshambo:
    Now these days they do sanity checks.... The source IP can't also be the destination IP lol
  • Psionic Roshambo @ Psionic Roshambo:
    They did end up using some of my stuff in the first Gulf war though lol
  • BakerMan @ BakerMan:
    GUYS I JUST COMMENTED A YOUR MOM JOKE ON A GACHA YT COMMUNITY POST (the algorithm has cursed me in terms of community posts, bc I fuck around on that sort of community post, just commenting and being a jackass)
    +1
  • BakerMan @ BakerMan:
    IT FELT SO GOOD
    +1
  • BakerMan @ BakerMan:
    the OP made a couple vocaloid characters, and the post had the caption "Guess who I did 💙💛❤️

    hint: they're from vocaloid"
    +1
  • BakerMan @ BakerMan:
    to which I responded:
    "Guess who I did 💙💛❤️

    hint: it's uremum"
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I studied IPV6 if they hadn't passed the cyber terrorism laws omg.... In theory I have some awesome pranks but I'm afraid to test them lol
  • BigOnYa @ BigOnYa:
    Thank goodness for VPN nowadays
    BigOnYa @ BigOnYa: Thank goodness for VPN nowadays