[Question] Dragon Quest 7 RSF CCI Building Help

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by Helmax, Mar 18, 2015.

  1. Helmax

    Helmax GBAtemp Regular

    Feb 17, 2011
    United States
    I am having a heck of a time rebuilding an RSF to help recompile my CCI for this game.

    Here is my RSF

      Title                  : "CtrApp"
      CompanyCode            : "GD"
      ProductCode            : "CTR-P-AD7J"
      ContentType            : Application
      Logo                  : Nintendo
      UniqueId              : 0x0065e
      Category              : Application
      MediaSize              : 2GB
      MediaType              : Card1
      CardDevice            : NorFlash
      UseOnSD                : false
      EnableCompress        : true
      FreeProductCode        : true
      EnableCrypt            : false
      MediaFootPadding      : true # If true CCI files are created with padding
    ExeFs: # these are the program segments from the ELF, check your elf for the appropriate segment names
      - .rodata
      - RO
      - .data
      - RO
      - .init
      - .text
      - STUP_ENTRY
      UseOtherVariationSaveData : false
      #UseExtSaveData : true
      ExtSaveDataId: 0x00000000
      SystemSaveDataId1: 0x00000000
      SystemSaveDataId2: 0x00000000
      OtherUserSaveDataId1: 0x00000
      OtherUserSaveDataId2: 0x00000
      OtherUserSaveDataId3: 0x00000
      #UseExtendedSaveDataAccessControl: true
      #AccessibleSaveDataIds: [0x101, 0x202, 0x303, 0x404, 0x505, 0x606]
      #- CategorySystemApplication
      #- CategoryHardwareCheck
      #- CategoryFileSystemTool
      - Debug
      #- TwlCardBackup
      #- TwlNandData
      #- Boss
      - DirectSdmc 
      #- Core
      #- CtrNandRo
      #- CtrNandRw
      #- CtrNandRoWrite
      #- CategorySystemSettings
      #- CardBoard
      #- ExportImportIvs
      #- DirectSdmcWrite
      #- SwitchCleanup
      #- SaveDataMove
      #- Shop
      #- Shell
      #- CategoryHomeMenu 
      - FsMountNand
      - FsMountNandRoWrite
      - FsMountTwln
      - FsMountWnand
      - FsMountCardSpi
      - UseSdif3
      - CreateSeed
      - UseCardSpi
      IdealProcessor                : 0
      AffinityMask                  : 1
      Priority                      : 48
      MaxCpu                        : 0x9E # Default
      DisableDebug                  : false
      EnableForceDebug              : false
      CanWriteSharedPage            : false
      CanUsePrivilegedPriority      : false
      CanUseNonAlphabetAndNumber    : false
      PermitMainFunctionArgument    : false
      CanShareDeviceMemory          : false
      RunnableOnSleep              : false
      SpecialMemoryArrange          : false
      CoreVersion                  : 2
      DescVersion                  : 2
      ReleaseKernelMajor            : "02"
      ReleaseKernelMinor            : "35"
      MemoryType                    : Application
      HandleTableSize: 200
      - 1ff50000-1ff57fff
      - 1ff70000-1ff77fff
      - 1f000000-1f5fffff:r
        ArbitrateAddress: 34
        Break: 60
        CancelTimer: 28
        ClearEvent: 25
        ClearTimer: 29
        CloseHandle: 35
        ConnectToPort: 45
        ControlMemory: 1
        CreateAddressArbiter: 33
        CreateEvent: 23
        CreateMemoryBlock: 30
        CreateMutex: 19
        CreateSemaphore: 21
        CreateThread: 8
        CreateTimer: 26
        DuplicateHandle: 39
        ExitProcess: 3
        ExitThread: 9
        GetCurrentProcessorNumber: 17
        GetHandleInfo: 41
        GetProcessId: 53
        GetProcessIdOfThread: 54
        GetProcessIdealProcessor: 6
        GetProcessInfo: 43
        GetResourceLimit: 56
        GetResourceLimitCurrentValues: 58
        GetResourceLimitLimitValues: 57
        GetSystemInfo: 42
        GetSystemTick: 40
        GetThreadContext: 59
        GetThreadId: 55
        GetThreadIdealProcessor: 15
        GetThreadInfo: 44
        GetThreadPriority: 11
        MapMemoryBlock: 31
        OutputDebugString: 61
        QueryMemory: 2
        ReleaseMutex: 20
        ReleaseSemaphore: 22
        SendSyncRequest1: 46
        SendSyncRequest2: 47
        SendSyncRequest3: 48
        SendSyncRequest4: 49
        SendSyncRequest: 50
        SetThreadPriority: 12
        SetTimer: 27
        SignalEvent: 24
        SleepThread: 10
        UnmapMemoryBlock: 32
        WaitSynchronization1: 36
        WaitSynchronizationN: 37
      - APT:U
      - $hioFIO
      - $hostio0
      - $hostio1
      - ac:u
      - boss:U
      - cam:u
      - cecd:u
      - cfg:u
      - dlp:FKCL
      - dlp:SRVR
      - dsp::DSP
      - frd:u
      - fs:USER
      - gsp::Gpu
      - hid:USER
      - http:C
      - mic:u
      - ndm:u
      - news:u
      - nwm::UDS
      - ptm:u
      - pxi:dev
      - soc:U
      - ssl:C
      - y2r:u
      - ldr:ro
      - ir:USER
      SaveDataSize: 128KB
      RemasterVersion: 0
      StackSize: 0x40000
      JumpId: 0x0004000000065e00
        ac: 0x0004013000002402L
        am: 0x0004013000001502L
        boss: 0x0004013000003402L
        camera: 0x0004013000001602L
        cecd: 0x0004013000002602L
        cfg: 0x0004013000001702L
        codec: 0x0004013000001802L
        csnd: 0x0004013000002702L
        dlp: 0x0004013000002802L
        dsp: 0x0004013000001a02L
        friends: 0x0004013000003202L
        gpio: 0x0004013000001b02L
        gsp: 0x0004013000001c02L
        hid: 0x0004013000001d02L
        http: 0x0004013000002902L
        i2c: 0x0004013000001e02L
        ir: 0x0004013000003302L
        mcu: 0x0004013000001f02L
        mic: 0x0004013000002002L
        ndm: 0x0004013000002b02L
        news: 0x0004013000003502L
        nim: 0x0004013000002c02L
        nwm: 0x0004013000002d02L
        pdn: 0x0004013000002102L
        ps: 0x0004013000003102L
        ptm: 0x0004013000002202L
        ro: 0x0004013000003702L
        socket: 0x0004013000002e02L
        spi: 0x0004013000002302L
        ssl: 0x0004013000002f02L
    Here is my Rom Tool Information
    [+] CCI Image Details
    Media Type:            CARD1
    Media Size:            2 GB (16 Gbit)
    CCI Data Size:        1439 MB (0x59f31200 bytes)
    CCI File:
      > Size                2048 MB
      > Status              Full Size
    Additional Device:    EEPROM
    Partition Count:      3
    Min 3DS Firm:          4.4.0-XJ
    Save Crypto:          2.2.0-4 KeyY Method
    [+] CXI Partition
    Product Code:          CTR-P-AD7J
    Company Code:          GD
    Unique ID:            0065e
    Build Type:            Release
    SDK Version:          4.2.3 Release
    Req. Kernel Version:  2.35-0
    [+] CFA Partitions
    E-Manual:              Yes
    DLP Child:            No
    Update Data:          Yes
    [*] Completed Successfully
    Here is my exheader text:
    Extended header:
    Signature:              79FEB5CBC5C9FB606A1E836E60D8994A54D22C1818A076D60FCDB3556A526DEB
    NCCH Hdr RSA Modulus:  B79C6AD97DF06536F8660CE772A55840B1007C4A7046D018C0DBE8129A31CAAB
    Name:                  CtrApp
    Flag:                  01 [compressed]
    Remaster version:      0000
    Code text address:      0x00100000
    Code text size:        0x002A683C
    Code text max pages:    0x000002A7 (0x002A7000)
    Code ro address:        0x003A7000
    Code ro size:          0x0003D1E0
    Code ro max pages:      0x0000003E (0x0003E000)
    Code data address:      0x003E5000
    Code data size:        0x00024FE0
    Code data max pages:    0x00000025 (0x00025000)
    Code bss size:          0x00AA870C
    Code stack size:        0x00040000
    Dependency:            0004013000002402
    Dependency:            0004013000001502
    Dependency:            0004013000003402
    Dependency:            0004013000001602
    Dependency:            0004013000002602
    Dependency:            0004013000001702
    Dependency:            0004013000001802
    Dependency:            0004013000002702
    Dependency:            0004013000002802
    Dependency:            0004013000001a02
    Dependency:            0004013000003202
    Dependency:            0004013000001b02
    Dependency:            0004013000001c02
    Dependency:            0004013000001d02
    Dependency:            0004013000002902
    Dependency:            0004013000001e02
    Dependency:            0004013000003302
    Dependency:            0004013000001f02
    Dependency:            0004013000002002
    Dependency:            0004013000002b02
    Dependency:            0004013000003502
    Dependency:            0004013000002c02
    Dependency:            0004013000002d02
    Dependency:            0004013000002102
    Dependency:            0004013000003102
    Dependency:            0004013000002202
    Dependency:            0004013000003702
    Dependency:            0004013000002e02
    Dependency:            0004013000002302
    Dependency:            0004013000002f02
    Savedata size:          128K
    Jump id:                0004000000065e00
    Program id:            0004000000065e00
    Core version:          0x2
    System mode:            0x0
    Ideal processor:        0
    Affinity mask:          1
    Main thread priority:  48
    Ext savedata id:        0x00000000
    System savedata id 1:  0x00000000
    System savedata id 2:  0x00000000
    OtherUserSaveDataId1:  0x00000
    OtherUserSaveDataId2:  0x00000
    OtherUserSaveDataId3:  0x00000
    Accessible Savedata Ids:
    Other Variation Saves:  Inaccessible
    Access info:            00000000000000
    Other attributes:      00
    Mapping static address: 0x1FF50000 (RW)
    Mapping static address: 0x1FF58000 (RW)
    Mapping static address: 0x1FF70000 (RW)
    Mapping static address: 0x1FF78000 (RW)
    Mapping static address: 0x1F000000 (RO)
    Mapping static address: 0x1F600000 (RO)
    Kernel flags:         
    > Allow debug:        YES
    > Force debug:        NO
    > Allow non-alphanum:  NO
    > Shared page writing: NO
    > Privilege priority:  NO
    > Allow main() args:  NO
    > Shared device mem:  NO
    > Runnable on sleep:  NO
    > Special memory:      NO
    > Memory type:        APPLICATION
    Handle table size:      0x200
    Kernel release version: 2.33
    Allowed systemcalls:    0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0A, 0x0B
                            0x0C, 0x0F, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17
                            0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F
                            0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28
                            0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30
                            0x31, 0x32, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A
                            0x3B, 0x3C, 0x3D
    Allowed interrupts:    none
    ARM9 Desc. version:    0x2
    Mount NAND fs:          NO
    Mount NAND RO write fs: NO
    Mount NAND TWL fs:      NO
    Mount NAND W fs:        NO
    Mount CARD SPI fs:      NO
    Use SDIF3:              NO
    Create seed:            NO
    Use CARD SPI:          NO
    SD Application:        NO
    Use Direct SDMC:        NO
    Service access:        APT:U
    Service access:        $hioFIO
    Service access:        $hostio0
    Service access:        $hostio1
    Service access:        ac:u
    Service access:        boss:U
    Service access:        cam:u
    Service access:        cecd:u
    Service access:        cfg:u
    Service access:        dlp:FKCL
    Service access:        dlp:SRVR
    Service access:        dsp::DSP
    Service access:        frd:u
    Service access:        fs:USER
    Service access:        gsp::Gpu
    Service access:        hid:USER
    Service access:        http:C
    Service access:        mic:u
    Service access:        ndm:u
    Service access:        news:u
    Service access:        nwm::UDS
    Service access:        ptm:u
    Service access:        pxi:dev
    Service access:        soc:U
    Service access:        ssl:C
    Service access:        y2r:u
    Service access:        ldr:ro
    Service access:        ir:USER
    Reslimit category:      00
    Ultimately I am recompiling my CCI using this RSF, desc app:7 (tried 2 and 4 because i thought it corresponded to the kernel minor/major), used target g (for GW keys) and fed it my decrypted icon.bin, banner.bin, code.bin and my exheader.bin (I gave it the decrypted exheader.bin)

    Exheader.txt came from the decrypted exheader (which gave me the odd title I thought, CtrApp is strange since it is Dragon Quest VII).

    Can anyone give me a hand? I've been trying to figure this whole process out for 2 days.
    I should note that I've been editting game files (they are just text files) as well, as we are working on a translation. BUT..... I have just been trying to rebuild the initial uneditted dump.

    Thanks in advance.
  2. Helmax

    Helmax GBAtemp Regular

    Feb 17, 2011
    United States
    Anyone? Im bumping this back up.
  3. liomajor

    liomajor GBAtemp Maniac

    Jun 10, 2008
    United States
  4. Helmax

    Helmax GBAtemp Regular

    Feb 17, 2011
    United States
    Thanks Lio, I'll check it out
  5. Helmax

    Helmax GBAtemp Regular

    Feb 17, 2011
    United States
    So I checked out the tool, and it still requires me to create an RSF, which I've tried multiple variations of.
    Is the Rsfgen.py script what's being used for the AUTO RSF? And it looks like that is probably only being used for the CIA file generation, since you need a 1:1 rsf for a 3ds file.

    Everytime this 3DS file gets repacked, and i drop it on my gateway, it has a white icon, no title underneath, and doesnt load (even before and after using your tool).
    The original 3DS pack I found worked fine, but decrypted with a smaller code.bin file.
    The CIA i found unpacks and has what I would expect for a code.bin file, and I can actually see a ton of function references.

    I would love to write a tool using your knowledge to auto generate 1:1 RSF for 3DS files.
    There has got to be a good way, seeing as we can extract this information using ROM_TOOL, CTRTOOL and 3DSEXPLORER.

    Thoughts? Would you like to help with make something like this? Or are you thinking it's not possible yet with the scenes knowledge.
    I've been reading your posts on the subject, and reading about every type of file format on 3dsbrew, which still hasnt helped me make the correct RSF file for this.
  6. liomajor

    liomajor GBAtemp Maniac

    Jun 10, 2008
    United States
    Of course you need an .rsf

    Maybe you didn't see my hint for what needs to be changed if you use my template for .3ds

    It should be:
      Title                   : "CtrApp" #CHANGE ME
      CompanyCode             : "GD" #CHANGE ME
      ProductCode             : "CTR-P-AD7J" #CHANGE ME
      ContentType             : Application # Application / SystemUpdate / Manual / Child / Trial
      Logo                    : Nintendo # Nintendo / Licensed / Distributed / iQue / iQueForSystem
      UniqueId                : 0x0065e #CHANGE ME
      Category                : Application # Application / SystemApplication / Applet / Firmware / Base / DlpChild / Demo / Contents / SystemContents / SharedContents / AddOnContents / Patch / AutoUpdateContents
      MediaSize               : 2GB # 128MB / 256MB / 512MB / 1GB / 2GB / 4GB / 8GB / 16GB / 32GB #CHANGE ME
      MediaType               : Card1 # Card1 / Card2 #CHANGE ME
      CardDevice              : NorFlash # NorFlash(Pick this if you use savedata) / None (Choose None if it's a card2 game)
      UseOnSD                 : false # true if App is to be installed to SD #CHANGE ME
      EnableCompress          : true # Compresses exefs code #CHANGE ME
      FreeProductCode         : true # Removes limitations on ProductCode #CHANGE ME
      EnableCrypt             : true # Enables encryption for NCCH and CIA #CHANGE ME
      MediaFootPadding        : true # If true CCI files are created with padding #CHANGE ME
    ExeFs: # these are the program segments from the ELF, check your elf for the appropriate segment names
       - .rodata
       - RO
       - .data
       - RO
       - .init
       - .text
       - STUP_ENTRY
    PlainRegion: # only used with SDK ELFs 
     - .module_id
      ExtSaveDataId: 0x0000065e
      SystemSaveDataId1: 0x00000000
      SystemSaveDataId2: 0x00000000
      OtherUserSaveDataId1: 0x00000
      OtherUserSaveDataId2: 0x00000
      OtherUserSaveDataId3: 0x00000
      #UseOtherVariationSaveData : true
      #UseExtendedSaveDataAccessControl: true
      #AccessibleSaveDataIds: [0x101, 0x202, 0x303, 0x404, 0x505, 0x606]
       #- Boss
       #- CardBoard
       #- CategoryFileSystemTool
       #- CategoryHardwareCheck
       #- CategoryHomeMenu
       #- CategorySystemApplication
       #- CategorySystemSettings
       #- Core
       #- CtrNandRo
       #- CtrNandRoWrite
       #- CtrNandRw
        - Debug
        - DirectSdmc
       #- DirectSdmcWrite
       #- ExportImportIvs
       #- SaveDataMove
       #- Shell
       #- Shop
       #- SwitchCleanup
       #- TwlCardBackup
       #- TwlNandData
      SaveDataSize: 128KB #CHANGE ME
      RemasterVersion: 5
      StackSize: 0x40000
      JumpId: 0x0004000000065e00
  7. Helmax

    Helmax GBAtemp Regular

    Feb 17, 2011
    United States
    I did miss that! You should definately update your signature to include this link.
    I really like to the tool, I was actually making one myself, but you beat me to it!

    Ill give this a shot when i have a chance and let you know how it worked out for me.

    Thanks again Lio.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice