Can you make a ROM hack load automatically?

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by mashers, Aug 23, 2016.

  1. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Call me old fashioned, but I like to have my games on cart. I do have some eShop purchases, but only for games that aren't available on cart.

    I've made a ROM hack for MK7 (to replace the princesses) but I still want to play the game from my cart. I realise I can boot HBL and use HANS to run the game with romfs redirected to SD card, but I'm wondering if it is possible through CFW to do this automatically from the home menu. Ideally, I would like to be able to boot the cart as normal and CFW detects the title ID, checks for an SD-based romfs for that title, and if it exists, use it instead of the romfs on the cart.

    Is any of this possible? If it matters I am on a New 3DS with A9LH and Luma 5.something.

    TIA!

    Edit - before anyone suggests it, I know I could just package up the romfs to a CIA and install that on the home menu, but I don't want to do that. I want to use the cart.
     


  2. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,451
    4,770
    Mar 17, 2010
    Norway
    Alola
    NTR-CFW does this with LayeredFS.
     
  3. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    you could create custom update data. since MK7 already has an update, you can decrypt/extract the existing update, add/replace files, and rebuild it.
     
    cearp likes this.
  4. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Thanks! Would I need to run Boot NTR first, or can I have NTR launched when I boot the console? I did search for this but couldn't find an answer.

    That's also a really good idea. So, do 3DS game updates just replace the romfs of the cart? Or at least have one which maps over the top of the one in the cart to replace the files present in the update?
     
  5. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    the way updates work (I think) is that if the game tries to access a file and it exists in the update's romfs, it uses that instead, otherwise from the original romfs. that's why you don't have updates that are the size of the entire game :P
     
  6. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,451
    4,770
    Mar 17, 2010
    Norway
    Alola
    No way to run it at boot that I know of. Luma seems to be aiming to replace NTR-CFW so in the future it probably won't be needed at all (for now you can only redirect code.bin to SD with Luma I think, and not romfs)
     
  7. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    That sounds ideal. Is custom update data already a thing I can look into, or is it uncharted territory? I'm guessing it would involve downloading the update in CIA format, extracting the romfs, making the changes, repacking the CIA and then installing it. Would that be the process?

    Thanks. Hopefully Luma will add the LayeredFS support at some point. For now I'll look into @ihaveamac's suggestion.
     
  8. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    custom update data is not exactly new, but I don't think many people do it. it's *almost* the same as rebuilding a game CIA, except I probably wouldn't use rsf files (last time I did, the game would hang the system if I closed it and started another one), instead extract the existing update and build on that. if you can give me the changed files somewhere I can give it a shot. if you use discord/steam/something that would be good (or just PMs :P)?
     
    Last edited by ihaveamac, Aug 23, 2016
  9. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Thanks buddy! I'd like to give it a go myself as I'll probably have a few changes I want to make. I'll google around for some info on how to locate, extract and decrypt the existing update data. I'll post back with updates and inevitable questions :P
     
  10. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    I have my own work in progress guides here: https://github.com/ihaveamac/3DS-rom-tools/wiki
    not complete but should work fine, if you can use the terminal. probably better than trying to use tools that do things for you (e.g. packhack)
     
  11. cearp

    cearp the ticket master

    Member
    7,406
    4,658
    May 26, 2008
    Tuvalu
    custom updates have been made, i'm not sure how many though. i don't really care much for rom hacks or follow them but i think the first i remember was actually a while a go, at least a year i think.
    a monster hunter 4g update that lets you manipulate items.

    so, yeah it's not just possible, but people have done it
     
  12. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Oh, nice! Thanks mate! Terminal is my preferred method actually. I've had a look through and can't see any info about extracting the game updates. I also had a look through the options in D9 but couldn't see anything in there. Do you know how do extract the game updates?
     
  13. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    you can extract game updates the same way as games. they are probably rebuilt the same way too, if you rebuild w/ NCCH header and things.
     
  14. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Good to know it's been done. I'm working on it! (I really hate those princesses)

    — Posts automatically merged - Please don't double post! —

    Ok, so is it just a case of finding out the title ID of the update and dumping with braindump?
     
    cearp likes this.
  15. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    braindump does not dump updates so you need to get a CIA of it. download the update for Mario Kart 7 EUR (0004000e00030700) from Nintendo's CDN (like FunKeyCIA, or my own crappy script that doesn't need make_cdn_cia). you need to get the encrypted titlekey somewhere (there's a site full of these), and get the encrypted titlekey for 0004000e00030700.

    decrypt the CIA using the 3DS, extract it (including NCCH header), make your changes in the RomFS, rebuild it.

    I honestly have not thoroughly tested my guides yet (especially updates), but they should be good enough. I might be able to answer any questions you have.
     
    zoogie likes this.
  16. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    Ahh ok, so you can't dump the update, right? You have to download from Nintendo's server directly? Ok, I can do that and work with the CIA.

    Do I have to bump the version number or anything before I install the modified CIA?

    I'll let you know if it worked ;)
     
  17. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    that, or find the CIA online. getting it from CDN is the easiest (and fastest) method though.
    probably doesn't matter all that much when you're testing, but when you're finished you might want to add "-ver 1040" to makerom to match the title version of the original update (so you can play online, if that works)
     
  18. cearp

    cearp the ticket master

    Member
    7,406
    4,658
    May 26, 2008
    Tuvalu
    yes, mario kart has a 1.1 update, unless you are using it from eshop (and have redownloaded, after they commmbined that update to the game) - or using a revised cart -> yes, bump up the version in the update, it can't hurt.
    i guess any update will be used for a game, and the version number is not important.
    it's not like we can have multiple update patches for a game at the same time, and that the latest one is the only one used. - we can only have one.
     
    Last edited by cearp, Aug 23, 2016
  19. mashers
    OP

    mashers Stubborn ape

    Member
    3,837
    5,154
    Jun 10, 2015
    Kongo Jungle
    ... if bloody python works. None of the versions I've got on my Mac work (they all result in syntax errors for both FunkeyCIA and your script). That's with python 2.6, 2.7, 3 and 3.5. I fucking hate python.

    So the version number of the modified update should be the same as the most recent genuine update, right? Will it override the real update if it's installed, or should I remove the genuine one first?

    Ahh I think that answers my question above. So I remove the official update, then install mine, right?
     
  20. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,342
    5,765
    Apr 20, 2015
    United States
    Tigard, OR
    you could try installing it with brew. what syntax errors do you get? my script uses 3.5.
    I don't think it matters but you might want to remove the current update.