Hacking Creating "Patches" for Cia-installed games?

  • Thread starter Thread starter ChrisX930
  • Start date Start date
  • Views Views 13,908
  • Replies Replies 52
Looking at the differences between the exheader for majora's mask, and the update for it,
it looks like you need to set:
flag to 03 [compressed][sd app]
Remaster version: 0001 or whatever
jump id: whatever the titleID of your patch is
program id: title id of the game you're patching

it looks like you can set the jumpID in the rsf file, but how you set a specific full titleID in makerom, I don't know. Not sure aout the remaster version either.
Try setting the jumpID to the titleID of your patch, and try to see if you can change the applicationID to the one for the game you're patching?

I'm going to bed. Will look at this more when I get up and can comprehend things.

Thanks for the help.
 
Thanks for the help.
Flakeway is apparently refusing to boot my emunand right now, I might have messed it up some how. When I get home I'll restore it and try again. Think I might have gotten the correct settings in the rsf though. Should know in a couple of hours
 
So, I can't be 100% certain, but there appears to be a couple gotcha's with creating custom patches...

First, they apparently have to include an exefs, which is important because...
Second, it appears the game has to manually mount the patch's romFS (Majora's Mask mounts it as "patch:")
Third, You have to specifically load the modified files from "patch:"(or whatever you mounted the patch's romFS as), so if the game is loading "rom:/something.bin" you have to change it to load it from "patch:/something.bin", which, in my tests with cubic ninja, wasn't going to work out so well because the string length didn't match.

Kind of explains why we haven't seen custom patches for games that haven't gotten updates.
If I'm wrong about any of this, someone please tell me, because I'd really love to be.
 
Second, it appears the game has to manually mount the patch's romFS (Majora's Mask mounts it as "patch:")

Does this mean that the "patch-loading" part of the game needs to be baked in? This would mean the developers have to plan to make patches ahead of time. Otherwise, the game itself would have no idea what to do with the patch files. So, without that part already in a game's code, the developers couldn't put out a patch later on even if they wanted to.

Am I following that correctly? That seems like a really backwards way of doing things.
 
No, since the patches have to have an exefs(and a .code segment), they just code in the patch stuff, re-compile, etc. The .code segment in the patch's exefs apparently gets used instead of the game's normal .code segment. Not sure about the icon and banner though.

If the developer loses the source to their game they'd probably have to hack it in.
 
No, since the patches have to have an exefs(and a .code segment), they just code in the patch stuff, re-compile, etc. The .code segment in the patch's exefs apparently gets used instead of the game's normal .code segment. Not sure about the icon and banner though.

If the developer loses the source to their game they'd probably have to hack it in.

Excellent idea!
...
Soooooo which bits do we flip? :huh:
 
That'd seriously suck if it's not possible if patches haven't been released. The only games I'm interested in messing with never had patches.
 
Well, we'd have to look at various updates and see how they mount the patch's romFS. I'm looking at Majora's Mask right now, but my ARM-fu isn't quite as strong as it needs to be.

I wonder if insane linker would be of any use...
 
I had installed a decrypted the updates for Smash Bros. SD_gen->xorpads->decrypt and then ctrKeyGen->xorpads->decrypt from Relys' tools. I treated the update as a regular game, extracted the romfs, threw in some music edits, rebuilt with the same version information as the legit update, and successfully installed.
 
I had installed a decrypted the updates for Smash Bros. SD_gen->xorpads->decrypt and then ctrKeyGen->xorpads->decrypt from Relys' tools. I treated the update as a regular game, extracted the romfs, threw in some music edits, rebuilt with the same version information as the legit update, and successfully installed.

Yeah, creating custom updates out of already existing updates is easy. Creating them when an update never existed is the part we're trying to work out
 
Hi, i found this thread because I searched for a way to build a patch for a game which does not have any patches yet. I'm using pastacfw on my new3ds and i want to modify some games but i dont want to rebuild the cia everytime. is there a way to create patches for games which don't already have any patches? would be cool if pastacfw had a plugin like layeredfs
 
I was looking into it, but my skills with arm assembly aren't as strong as with mips assembly, and so far, I haven't been able to make any progress. The game's code need to be modified to mount the patch's romfs (it still has to mount the game's romfs too), and the file name strings have to be changed for the new file path inside the patch's romfs. If I could just figure out how to mount the patch romfs, we'd be able to make some progress.
 
  • Like
Reactions: piratesephiroth

Site & Scene News

Popular threads in this forum