ROM Hack [RELEASE] 3DS TO CIA by Katsu

ryanjf97

not long now...
Member
Joined
Nov 29, 2014
Messages
297
Trophies
0
XP
404
Country
Australia
just tried this with the Badge Center .3ds, but it came up with an error and made me turn the console off. Probably just a game-specific problem, I'll try another game when my new SD card comes in :)
 

dubbz82

Well-Known Member
Member
Joined
Feb 2, 2014
Messages
1,572
Trophies
0
Age
41
XP
1,215
Country
United States
Citra doesnt emulate the aes engine and probably never will.



Too bad that it will likely remain an (at least partially) incomplete emulator, however I do realize that this would be a pretty massive undertaking, and might very well require some reverse engineering that would land in shady grey territory.
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,725
Trophies
2
XP
8,510
Country
Tuvalu
just tried this with the Badge Center .3ds, but it came up with an error and made me turn the console off. Probably just a game-specific problem, I'll try another game when my new SD card comes in :)
why do you take eshop content, convert to 3ds rom/card format, and then convert BACK to eshop format? :wacko:
 

liomajor

Well-Known Member
OP
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
3DS TO CIA updated to 2.04

Added Decrypt9 Bootstap Version for Ninjhax (new3DS .3dsx)
Added Option 8 "check .rsf for auto generation" (manual check before building cia if rsf fails)
Speedup when DLP and or Manual is included
Minor changes and Bugfixes
 

blindseer

Past Generation Gamer
Member
Joined
Jan 17, 2015
Messages
444
Trophies
0
Location
Earth
XP
912
Country
United States
3DS TO CIA updated to 2.04

Added Decrypt9 Bootstap Version for Ninjhax (new3DS .3dsx)
Added Option 8 "check .rsf for auto generation" (manual check before building cia if rsf fails)
Speedup when DLP and or Manual is included
Minor changes and Bugfixes
Yeah every time I run it, it crashes at the 3dstool.exe and when I tried downloading the dll, it still wont work. Any ideas?
 

liomajor

Well-Known Member
OP
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
3dstoolros7h.jpg

libeay32.dllhspr5.jpg


If you don't have the .dll, adding it should fix it.

Without 3dstool there will be no DLP & Manual if you comment the lines out in the batch.

PS:

Auto RSF is currently not fixed for new3DS, there are two changes i'll fix when there are more new3DS only games.
 
  • Like
Reactions: blindseer

blindseer

Past Generation Gamer
Member
Joined
Jan 17, 2015
Messages
444
Trophies
0
Location
Earth
XP
912
Country
United States
Okay, got it working, the first dll didn't work, but the one from the openssl for windows worked. Gonna try xenoblade again now.

Huh, still cant make xenoblade with it, gets rom cannot be opened at the end, not sure if that is the changes you were talking about, but god I hope I don't have to re redump my xorpads, that took 4 hours.
 

liomajor

Well-Known Member
OP
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
Check the errormessage before closing the batch. 'Missing File' should be because the .rsf has errors.

Its different from old3DS, the parsing auto rsf py breaks the .rsf file, check 8 before starting and fix it manualy.

Should be one ' " ' and two missing dependency's (you can get them from exheader.txt or my .rsf).
 
  • Like
Reactions: blindseer

blindseer

Past Generation Gamer
Member
Joined
Jan 17, 2015
Messages
444
Trophies
0
Location
Earth
XP
912
Country
United States
Check the errormessage before closing the batch. 'Missing File' should be because the .rsf has errors.

Its different from old3DS, the parsing auto rsf py breaks the .rsf file, check 8 before starting and fix it manualy.

Should be one ' " ' and two missing dependency's (you can get them from exheader.txt or my .rsf).
There are just too many differences between the eur rsf you posted and the one generated, and I was never good at fixing them, Ill just wait until you update it for n3ds.
 

blindseer

Past Generation Gamer
Member
Joined
Jan 17, 2015
Messages
444
Trophies
0
Location
Earth
XP
912
Country
United States
Post your "exheader.txt" + "rom_tool -i <gamename>.3ds >info.txt" and i'll fix your .rsf
Thanks for this, Ive been messing with the rsf for a little while, and I think I have it but here
Code:
Extended header:
Signature:              3260456CD8E993C8825384FB3BA230AECF38E4B53B633350785A98024EF22D63
                        92B63E175A4ED8D7E7F32E36D6D1A919507E8FB59DD9C516E243EB6ECCBB5374
                        2D9ACFFC5CE2D3E85DC5D37E748F160E54D5465237696F66B306297EEFF12D88
                        FA79BA3303FA30A8BEB77C6DABB00EFF12847B6E2680CAD72F6AF3F96C62495C
                        21E8F25D82ADEFC6B58E741158E9F3C91FCEF9C8C7144898056D71E5D9743759
                        CB6D7C17C9F323089C621E56689B447AB64DC7C267A917388B15EE0E6D37FE95
                        84EF345D7E3CA0A08B35DD743011774B701E0CDCD655F5D92D9C5491B964D5AA
                        4149FC977D7CC8FD4FB7A2D9CE57B8D7936566097FC925540A781BAC747B0E09
 
NCCH Hdr RSA Modulus:  D0B8F12057B268A9978782569D2036BD3A2122B80F80984EE0831379F77DB418
                        A6A58DD2013D0DAB42D914A6C8245F2CF5D01D2F3D661663F7423E5A90647184
                        5FAC19475488EA9343826B35616967B5F69256F2BD2793517F172EBE1D336F79
                        C109E84FE5F06CEEFBD1C1490BB7C0DEE829F99A2FF04B24DC18DE79D5FA48C6
                        DFDCEA260A426606FF0CEC93AD2EEA6DAF57080708D04CA85D940148C9442875
                        F1F54D84C1F67BC9A006C89963F43B0AB51B270C726079860D4919F92B12D09C
                        275589C21F2FC37385E8EE1D497DF69AF23FD72075D6BC214B1F150F5EAAECC1
                        C8964E9332CED0AD42DD4E7534FC414EBBB914C50A34040C2523C89344426E27
Name:                  smallfol
Flag:                  00
Remaster version:      0000
Code text address:      0x00100000
Code text size:        0x00378514
Code text max pages:    0x00000379 (0x00379000)
Code ro address:        0x00479000
Code ro size:          0x000436B4
Code ro max pages:      0x00000044 (0x00044000)
Code data address:      0x004BD000
Code data size:        0x0001F1A8
Code data max pages:    0x00000020 (0x00020000)
Code bss size:          0x001DB5C8
Code stack size:        0x00010000
Dependency:            0004013000002402
Dependency:            0004013000003802
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:            0004013000004002
Dependency:            0004013000002c02
Dependency:            0004013000002d02
Dependency:            0004013000002102
Dependency:            0004013000003102
Dependency:            0004013000002202
Dependency:            0004013020004202
Dependency:            0004013000003702
Dependency:            0004013000002e02
Dependency:            0004013000002302
Dependency:            0004013000002f02
Savedata size:          512K
Jump id:                000400000f700100
Program id:            000400000f700100
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)
Mapping static address: 0x1E800000 (RW)
Mapping static address: 0x1EA00000 (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.48
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:    0x3
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:        $hioFIO
Service access:        $hostio0
Service access:        $hostio1
Service access:        cfg:u
Service access:        fs:USER
Service access:        gsp::Gpu
Service access:        hid:USER
Service access:        ndm:u
Service access:        pxi:dev
Service access:        APT:A
Service access:        ac:u
Service access:        act:u
Service access:        am:app
Service access:        boss:U
Service access:        cam:u
Service access:        cecd:u
Service access:        dlp:FKCL
Service access:        dlp:SRVR
Service access:        dsp::DSP
Service access:        frd:u
Service access:        http:C
Service access:        ir:USER
Service access:        ldr:ro
Service access:        mic:u
Service access:        news:u
Service access:        nfc:u
Service access:        nim:aoc
Service access:        nwm::UDS
Service access:        ptm:u
Service access:        qtm:u
Service access:        soc:U
Service access:        ssl:C
Reslimit category:      00
Code:
[+] CCI Image Details
 Media Type:            CARD1
 Media Size:            4 GB (32 Gbit)
 CCI Data Size:         3641 MB (0xe39f3000 bytes)
 CCI File:
  > Size                4096 MB
  > Status              Full Size
 Additional Device:     EEPROM
 Partition Count:       4
 Min 3DS Firm:          9.4.0-XU
 Save Crypto:           6.0.0-11 KeyY Method
[+] CXI Partition
 Product Code:          KTR-P-CAFE
 Company Code:          01
 Unique ID:             f7001
 Build Type:            Release
 SDK Version:           11.1.0 Release
 Req. Kernel Version:   2.48-4
[+] CFA Partitions
 E-Manual:              Yes
 DLP Child:             No
 Update Data:           Yes
[*] Completed Successfully
 
  • Like
Reactions: Margen67

liomajor

Well-Known Member
OP
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
blindseer

Code:
BasicInfo:
  Title                   : "smallfol" #CHANGE ME
  CompanyCode             : "00" #CHANGE ME
  ProductCode             : "KTR-P-CAFE" #CHANGE ME
  ContentType             : Application # Application / SystemUpdate / Manual / Child / Trial
  Logo                    : Nintendo # Nintendo / Licensed / Distributed / iQue / iQueForSystem

TitleInfo:
  UniqueId                : 0xf7001 #CHANGE ME
  Category                : Application # Application / SystemApplication / Applet / Firmware / Base / DlpChild / Demo / Contents / SystemContents / SharedContents / AddOnContents / Patch / AutoUpdateContents

CardInfo:
  MediaSize               : 4GB # 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)
  

Option:
  UseOnSD                 : true # 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             : false # Enables encryption for NCCH and CIA #CHANGE ME
  MediaFootPadding        : false # 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
  ReadOnly: 
   - .rodata
   - RO
  ReadWrite: 
   - .data
   - RO
  Text: 
   - .init
   - .text
   - STUP_ENTRY
   
AccessControlInfo:
  #UseOtherVariationSaveData : false
  #UseExtSaveData : true
  ExtSaveDataId: 0x000f7001
  #SystemSaveDataId1: 0x220
  #SystemSaveDataId2: 0x00040010
  #OtherUserSaveDataId1: 0x220
  #OtherUserSaveDataId2: 0x330
  #OtherUserSaveDataId3: 0x440
  #UseExtendedSaveDataAccessControl: true
  #AccessibleSaveDataIds: [0x101, 0x202, 0x303, 0x404, 0x505, 0x606]
  FileSystemAccess:
   #- CategorySystemApplication
   #- CategoryHardwareCheck
   #- CategoryFileSystemTool
   - Debug
   #- TwlCardBackup
   #- TwlNandData
   #- Boss
   - DirectSdmc
   - DirectSdmcWrite
   #- Core
   #- CtrNandRo
   #- CtrNandRw
   #- CtrNandRoWrite
   #- CategorySystemSettings
   #- CardBoard
   #- ExportImportIvs
   #- DirectSdmcWrite
   #- SwitchCleanup
   #- SaveDataMove
   #- Shop
   #- Shell
   #- CategoryHomeMenu
  IoAccessControl:
   #- 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            : "48" 
  MemoryType                    : Application # Application / System / Base
  HandleTableSize: 200
  IORegisterMapping: 
   - 1ff50000-1ff57fff
   - 1ff70000-1ff77fff
  MemoryMapping: 
   - 1f000000-1f5fffff:r
   - 1e800000-1E9fffff:r
  SystemCallAccess: 
    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
  InterruptNumbers:
  ServiceAccessControl: 
   - $hioFIO
   - $hostio0
   - $hostio1
   - cfg:u
   - fs:USER
   - gsp::Gpu
   - hid:USER
   - ndm:u
   - pxi:dev
   - APT:A
   - ac:u
   - act:u
   - am:app
   - boss:U
   - cam:u
   - cecd:u
   - dlp:FKCL
   - dlp:SRVR
   - dsp::DSP
   - frd:u
   - http:C
   - ir:USER
   - ldr:ro
   - mic:u
   - news:u
   - nfc:u
   - nim:aoc
   - nwm::UDS
   - ptm:u
   - qtm:u
   - soc:U
   - ssl:C
  
   
SystemControlInfo:
  SaveDataSize: 512KB #CHANGE ME
  RemasterVersion: 0
  StackSize: 0x10000
  JumpId: 0x000400000f700100
  Dependency: 
    ac: 0x0004013000002402L
    act: 0x0004013000003802L
    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
    qtm: 0x0004013020004202L
    ro: 0x0004013000003702L
    socket: 0x0004013000002e02L
    spi: 0x0004013000002302L
    ssl: 0x0004013000002f02L
 

blindseer

Past Generation Gamer
Member
Joined
Jan 17, 2015
Messages
444
Trophies
0
Location
Earth
XP
912
Country
United States
Awesome, thanks for the help, when I was messing with the rsf, I found everything but these
Code:
  #SystemSaveDataId1: 0x220
  #SystemSaveDataId2: 0x00040010
  #OtherUserSaveDataId1: 0x220
  #OtherUserSaveDataId2: 0x330
  #OtherUserSaveDataId3: 0x440
Where exactly were they located if you have the time?
 
  • Like
Reactions: Margen67

Ichii Giki

Well-Known Member
Member
Joined
Mar 12, 2015
Messages
284
Trophies
0
XP
231
Country
United States
So I've tried to create a Xenoblade CIA about 5 times now with no success between various methods.

1. Dumped rom (in 2 parts) with Gateway launcher
2. Combined with "copy /b CAFE.3D0 + CAFE.3D1 CAFE.3DS" command prompt command
3. Generated "ncchinfo.bin" with "ncchinfo_gen.py" script from rxTools scripts
4. Generated Xorpads with new Decrypt9 (Brahma based distro from this post: http://gbatemp.net/threads/xenoblade-chronicle-3d-xorpads.388470/page-2#post-5486607)
(this ncchinfo.bin seemed odd as it wanted to make 16 xorpads, 1MB, 4MB, 4MB, 3598MB, and then the 5th one was going to be 1MILLION+ MB [Manual Xorpad according to name, only got to 95MB before card filled], which obviously failed on a 4GB SD card)
5. Used Xorpads and rom from previous steps (minus the manual xorpad) with various different CIA creation programs/scripts, with varying levels of success trying to install with FBI
A. 3ds_to_cia_v2.04 by Katsu - using the US RSF from this post: http://gbatemp.net/threads/release-3ds-to-cia-by-katsu.384381/page-2#post-5486880
I got the CIA to install with FBI but it would hang at launch with the 3DS logo and red bars
B. 3ds_to_cia_v2.05 by Katsu - using auto-generated RSF and installing with FBI again received hang at launch with 3DS logo and red bars
C. 3DS To CIA Converter v4.1 - using auto-generated RSF and installing with FBI loaded past 3DS logo and red bars, but then presented "an Error has occurred" screen prompting to power down the system and restart
D. 3DS Simple CIA Converter v2.0b (windows executable) - generated ncchinfo.bin from rom with this app (single xorpad) and made xorpad with rxTools on O3DS (as described in this post: http://gbatemp.net/threads/official...way-or-sky-thread.385251/page-32#post-5479206) - install with FBI failed at the end citing NCCH error
E. 240148-QuenoPack 3DS to CIA v5.1.4b (which I have used to create almost all my other installed CIAs from my dumped 3DS roms) - failed to create CIA with all possible build options

Am I doing something wrong for this specific game? I have successfully dumped and installed CIAs for 14 of my other cart-based games with little to no issue. I would appreciate any step by step help people could offer me for getting Xenoblade specifically from Cart to CIA. Thanks in advance! ^_^
 
  • Like
Reactions: Margen67

liomajor

Well-Known Member
OP
Member
Joined
Jun 10, 2008
Messages
1,468
Trophies
0
XP
1,373
Country
United States
Ichii Giki

The main problem why Xenoblade Chronicles didn't work was because ROMFS xorpad was
faulty and didn't create a proper decrypted romfs.bin.

This was fixed with the last commit of Decrypt9 Bootstrap or Brahma for new3DS.

To create the xorpads it took me ~3h45min with a speed of around 0,3MB/s, after fixing a
minor bug in autocreating rsf it worked properly and the cia runs smoothly on my new3DS.

I've added option 8 for two main reasons, first is to stop the process and interact with the
files before building up cia, second is to check and make last minute edits to your .rsf.

I suggest to enable 8 and check your decrypted files and rsf.

3DS to CIA is very clean and has directorys for the files.

Main directory for your conversion is: <file you want to convert> , example: xenoblade.3ds > xenoblade
Decrypted files before building cia is: <file you want to convert>/decrypted

To check if all files got decrypted properly, you can check their Header (HxD or another Tool you prefer)

banner.bin starts with: CBMD
exefs.bin has readable: .code / banner / icon / logo
exheader.bin should produce a fine readable exheader.txt
icon.bin starts with: SMDH
romfs.bin starts with: IVFC

If they didn't decrypt properly, cia creation will fail most likely because
xorpads are invalid and game will not work after installation.

The other chance is bad .rsf (might need manual fixes) or exheader (inject original might help).

In my signature is a small how-to for creating rsf if you need to check it up.
 
  • Like
Reactions: Margen67

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: @OctoAori20, Cool. Same here.