1. Startropic1

    Startropic1 GBAtemp Regular
    Member

    Joined:
    May 1, 2013
    Messages:
    134
    Country:
    United States
    Nice tutorial, but one critical thing is missing: How to put the files you edit BACK into the .CIA

    I just had to edit a config.ini to fix resolution for an unofficial VC .CIA (ie. SeedDB is not applicable.) The mount appears to be read only, and deleting the file I'm going to replace appears to leave insufficient space in the mount to copy the edited file over. So how to I re-inject the edited config.ini ?
     
    beats1234 likes this.
  2. ihaveamac

    OP ihaveamac GBAtemp Guru
    Member

    Joined:
    Apr 20, 2015
    Messages:
    5,879
    Country:
    United States
    You can't edit the contents of files except NAND and SD (which are designed to be written to). Formats like CIA, RomFS, etc. are read-only and not designed to be changed. Changes require rebuilding the file.
     
  3. Startropic1

    Startropic1 GBAtemp Regular
    Member

    Joined:
    May 1, 2013
    Messages:
    134
    Country:
    United States
    Ok then, once I have everything extracted from the mount, how do I rebuild the .cia?
    I tried the tutorial here: https://gbatemp.net/threads/tutorial-how-to-decrypt-extract-rebuild-3ds-cia-cxi-files.383055/
    However, it was pretty useless. The tools in that tutorial don't do much. I either ended up with nothing or corrupted extractions. 3dsexplorer either crashes or reports that the files I extracted from those other tools are corrupted. Fuse-3DS finally granted me access to the config.ini I had to edit. Now I just need to rebuild the .CIA It's not a licensed 3DS .CIA so there are no keys or anything to worry about.
     
  4. ihaveamac

    OP ihaveamac GBAtemp Guru
    Member

    Joined:
    Apr 20, 2015
    Messages:
    5,879
    Country:
    United States
    3dstool and makerom could probably help out with that. If you know how to use the command line/terminal, you can probably get this quickly. I've not used other rebuilders.

    Quick example:
    Code:
    # copy all the RomFS contents out and put your changes in
    # then rebuild it with 3dstool
    3dstool -cvtf romfs romfs-custom.bin --romfs-dir romfs
    # rebuild the CXI (if logo doesn't exist, ignore and don't add it)
    3dstool -cvtf cxi custom.cxi --header ncch.bin --exh extheader.bin --logo logo.bin --plain plain.bin --exefs exefs.bin --romfs romfs-custom.bin
    # build CIA with CXI
    makerom -f cia -o custom.cia -content custom.cxi:0:0
    
    3dstool can be obtained from: https://github.com/dnasdw/3dstool/releases
    Latest makerom build is attached here (commit 046bb35, built with mingw-w64)
     

    Attached Files:

  5. Startropic1

    Startropic1 GBAtemp Regular
    Member

    Joined:
    May 1, 2013
    Messages:
    134
    Country:
    United States
    I know how to do command line stuff. (I am a little bit of a programmer.) The one possible complication here is when I used Fuse-3DS, I got some .bins but not a romfs.bin for example. These got extracted as folders within a folder called 0000.00000000

    Do I need extra command line options to handle this structure?
     
  6. ihaveamac

    OP ihaveamac GBAtemp Guru
    Member

    Joined:
    Apr 20, 2015
    Messages:
    5,879
    Country:
    United States
    You would use the files in 0000.00000000, since it's the first content (0000) of the CIA. The root of the mount is about the CIA, the sub-folders are the individual contents.
     
  7. Startropic1

    Startropic1 GBAtemp Regular
    Member

    Joined:
    May 1, 2013
    Messages:
    134
    Country:
    United States
    I'm getting an error:
    Code:
    I:\editing>makerom -f cia -o custom.cia -content custom.cxi:0:0
    [NCCH ERROR] Failed to load ncch aes key
    [CIA WARNING] CXI AES Key could not be loaded
          Meta Region, SaveDataSize, Remaster Version cannot be obtained
    Since this is an unofficial/custom .cia I suppose aes key wouldn't exist, thus I can just ignore this error?
     
  8. KaiH

    KaiH Newbie
    Newcomer

    Joined:
    Aug 7, 2018
    Messages:
    2
    Country:
    United States
    Hey, I'm a total noob when it comes to this stuff so this might be a dumb problem but I can't seem to find movable.sed
     
  9. SirNapkin1334

    SirNapkin1334 Renound Aritst
    Member

    Joined:
    Aug 20, 2017
    Messages:
    1,666
    Country:
    United States
    1:/private/movable.sed on GodMode9
     
  10. KaiH

    KaiH Newbie
    Newcomer

    Joined:
    Aug 7, 2018
    Messages:
    2
    Country:
    United States
    I don't see it. Is there something specific I'm supposed to be doing?
     
  11. Kwyjor

    Kwyjor GBAtemp Advanced Fan
    Member

    Joined:
    May 23, 2018
    Messages:
    679
    Country:
    Canada
    You can also mount essential.exefs (which gm9 creates automatically) in fuse-3DS and extract movable.sed from there . (It might be called movable.bin.)
     
    SirNapkin1334 likes this.
  12. SirNapkin1334

    SirNapkin1334 Renound Aritst
    Member

    Joined:
    Aug 20, 2017
    Messages:
    1,666
    Country:
    United States
    No, it’s called movable (with no extension), but yes, this works too.

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

    It can also be mounted from inside GM9.
     
  13. ihaveamac

    OP ihaveamac GBAtemp Guru
    Member

    Joined:
    Apr 20, 2015
    Messages:
    5,879
    Country:
    United States
    Last edited: Sep 17, 2018
  14. Ezegardiz

    Ezegardiz Newbie
    Newcomer

    Joined:
    Oct 20, 2018
    Messages:
    2
    Country:
    Spain
    Hi! I need help, because my head is going to explode in a few minutes.
    I had mounted a cia as a new drive. Now, I want to replace 2 songs in .bcstm format, when I tried it for the first time, it gave me an error, saying that the drive hasn´t enough memory. I edited the song that will replace the game's one to have the same number of Kb, but, when I delete the cia's file, and add the new one, the memory error is there again. What should I do? Can I edit the RomFs with this program? because is the only one that worked
     
  15. ZeroHunta

    ZeroHunta Member
    Newcomer

    Joined:
    Oct 20, 2016
    Messages:
    29
    Country:
    United States
    Hi @ihaveamac.
    It's possible to use this tool alongside Luma to extract and insert custom images in games?
    I can mount the games as cias but when looking for the images using the Kukki editor I can't find any.
    Idk if I am missing a step and the files are still encrypted because the game that I'm trying to edit (Etrian Odyssey) is supposed to be compatible with the Kukki editor. Can you help me? Thanks.

    PS: I'm a newbie in this things so sorry if I say something that don't make sense :P
     
  16. Kwyjor

    Kwyjor GBAtemp Advanced Fan
    Member

    Joined:
    May 23, 2018
    Messages:
    679
    Country:
    Canada
    It looks like Kukki was released long before fuse-3DS, so you probably don't need to mount the cia.

    I would try to help you further, but https://gbatemp.net/threads/release...olkit-for-authors-of-fan-translations.452375/ is 23 pages long. The answer is probably in there somewhere.
     
    ZeroHunta likes this.
  17. richardZeldaModder

    Newcomer

    Joined:
    Sep 11, 2018
    Messages:
    47
    Country:
    United States
    I'm able to get this running, and tested mounting a nand backup.... But I'm confused. If I want to set up a 2nd 3DS/2DS to use the files from my broken 2DS (from the old SD card), where do I start? Is there a tutorial specifically for this?

    I'm guessing, first I would need to set up all the custom firmware like I did on the 1st 2DS. And then what? :wacko:
     
  18. Kwyjor

    Kwyjor GBAtemp Advanced Fan
    Member

    Joined:
    May 23, 2018
    Messages:
    679
    Country:
    Canada
    That depends on exactly what you want to use. If you want to re-use save data, then after you decrypt the save data on the SD card, you will have to unpack it using 3ds-save-tool. That will give you files that you can then import on your second 3DS using JKSM or Checkpoint.

    Alternatively, I think you can use ninfs to copy the decrypted save data to the appropriate folder on your new SD card (re-encrypting it in the process) and then use gm9 to fix the CMAC.
     
    Last edited: May 2, 2019
  19. richardZeldaModder

    Newcomer

    Joined:
    Sep 11, 2018
    Messages:
    47
    Country:
    United States
    I might restore everything, but it seems risky. Actually I'm just interested in copying a few games that I had modded and didn't back up the files on my computer. Is it possible to extract cias from this to be reinstalled on a different 3ds/2ds? I don't care about save data.
     
  20. Kwyjor

    Kwyjor GBAtemp Advanced Fan
    Member

    Joined:
    May 23, 2018
    Messages:
    679
    Country:
    Canada
    I might be mistaken, but I don't think there's a way to extract CIAs. It might be possible to inject the old moveable.sed into the NAND on your new 3DS, and that will let you use your old SD card as-is, but I don't know how well that works – certainly, I've never tried it.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - contents, Extract, Decrypt