Possible to extract from DLC CIA files?

Discussion in '3DS - Flashcards & Custom Firmwares' started by Aveyn Knight, Jan 28, 2015.

  1. Aveyn Knight
    OP

    Aveyn Knight Member

    Newcomer
    25
    21
    Oct 20, 2011
    I wanted to tinker around with the Fire Emblem Awakening DLC files, so I grabbed the CIA files online.

    However I'm unsure if I can even do anything with these files.

    The furthest I've gotten (if you can call it that) is trying to use ctrtool to extract the contents, but I get an error "Common key could not be found" (or something similar).

    Are these files encrypted? Or is there some easy way I could break them apart again?
     
  2. geddanof

    geddanof Member

    Newcomer
    47
    17
    Jul 11, 2016
    Otoko no Ko
    That's what I want to know as well, I can't find a working guide anywhere... :(

    I'm trying to edit DLC files for Fire Emblem If (specifically the translation patch).


    EDIT:
    I've figured it out! :D
    You'll need:
    - Decrypt9 installed into your 3DS
    - ctrtool
    - makerom
    - RomFS Extractor (can also be found in Asia81's HackingToolkit3DS tool)
    - RomFS Builder (can also be found Asia81's HackingToolkit3DS tool)



    Extracting:
    1. First follow the Decrypting step of this guide.

    2. Extract the contents of the decrypted CIA; check out this page for more details.
    In short, just enter this command, after opening Command Prompt in the folder with the decrypted CIA (Shift -> Right-click -> "Open command window here"):

    ctrtool *name of CIA* --content=*beginning name of all extracted files*

    e.g. : (--content can be anything you want, really)
    Code:
    ctrtool FireEmblemIFdlc.cia --content=c


    3. Extract the romfs of the desired content file; check out this thread for more details.
    In short, just enter this command into command prompt:

    ctrtool *name of content file to extract* --romfs=*output name of romfs*

    e.g. :
    Code:
    ctrtool c.0004.0000001a --romfs=0004.0000001a.bin


    4. Open RomFS Extractor, select the newly made romfs file(s) (in my case, 0004.0000001a.bin ), press go & you successfully extracted the content in File Hierarchy structure! Now you can replace the files with your translation patch, mod etc.



    Rebuilding:
    Follow & adapt to RainThunder's example here, from step 5 onward.


    Tip: Make sure ctrtool & makerom .exe are in the same folder as the target files!
    Tip: This guide here contains some explanation of the arguments used within the makerom command.
    Tip: You can quickly get the list of all files in a folder (sorted in hexadecimal order) by "Open command window here" in the folder, and then type in the command:

    Code:
    dir /B > filelist.txt


    ------------------------------------------------------------------------------------------

    Example:
    To apply Team If's translation patch over Fire Emblem If DLC, you need to:

    - Decrypt your Fire Emblem If DLC cia file.
    - Extract both c.0003.00000019 & c.0004.0000001a .
    - Apply the latest patch to both extracted romfs folders ( Patch\rom\m\C --> local\m\C )
    - Rebuild both folders back to c.0003.00000019 & c.0004.0000001a , one at a time.
    - Rebuild the entire cia file.

    The contents of the DLC cia might also be different depending on the version of the DLC, so you will have to edit the rebuilding CIA command slightly.
    Code:
    makerom -f cia -rsf rom.rsf -o 0004008c0012dc00.cia -ckeyid 0 -major 0 -minor 10 -micro 0 -DSaveSize=0 -dlc -i c.0000.0000005b:0x0000:0x0000005b -i c.0001.00000017:0x0001:0x00000017      ...
    
    TO
    Code:
    makerom -f cia -rsf rom.rsf -o 0004008c0012dc00.cia -ckeyid 0 -major 0 -minor 13 -micro 0 -DSaveSize=0 -dlc -i c.0000.0000006b:0x0000:0x0000006b -i c.0001.00000017:0x0001:0x00000017      ...
     
    Last edited by geddanof, Feb 8, 2017