GBAVCSM icon indicating copy to clipboard operation
GBAVCSM copied to clipboard

Feature request. If possible .gba rom injection

Open Kirit29 opened this issue 4 years ago • 1 comments

Would it be possible to inject a gba rom into a currently installed gba vc or a gba vc cia? It would be useful for people who want to play rom hacks and update them without having to re create a cia on pc every time there is an update to said gba hack.

Kirit29 avatar Jan 16 '20 21:01 Kirit29

It's technically possible, but extremely impractical to code something like this in a gm9 script.

Dumping the original *.gba rom from the GBA VC's content *.app is relatively easy like pushing a ball down a 20 stories flight of stairs that zigs and zags. Injecting an external *.gba rom back into that *.app would be you rolling that ball (or one like it but in different color) all the way back up. With no guard rails for safety.

Here's a quick example breakdown of what a CIA looks like when installed, or more specifically its *.app individual components. If you look in the Abstract Representation of the .app diagram, the gba rom is located in the .code. Changing the .code requires correcting the HeaderExeFS.bin, which then requires correcting the extheader.bin, that then requires correcting the ncch.bin, and finally (not shown) fixing the CMACs found in another file called the *.cmd (content metadata).

Basically, there are multiple layers of hash checks and CMACs that one would have work their ways backwards in order to appease the 3DS firmware to accept the modified *.app the injected rom as being valid.

TurdPooCharger avatar Jan 17 '20 11:01 TurdPooCharger