Changes

3,777 bytes added ,  18:04, 27 November 2014
Added relevant cli argument explainations.
Line 55: Line 55:     
=== CIA ===
 
=== CIA ===
The native format for packaging NCCH files for install is [[CIA]], which is also a NCCH container format. CIA files are limited to containing 65535 NCCH files and can be used to contain NCCH files for any title type. CIA files also contain data used by the 3DS for general title management and DRM. Installing custom CIA files on a 3DS which also uses eShop/SysUpdates is unwise as conflicts will likely occur.
+
The native format for packaging NCCH files for install is [[CIA]], which is also a NCCH container format. CIA files are limited to containing 65535 NCCH files and can be used to contain NCCH files for any title type. CIA files also contain '''signed''' data used by the 3DS for general title management and DRM. Installing custom CIA files on a 3DS which also uses eShop/SysUpdates is unwise as conflicts will likely occur.
    
==== NCCH configurations for CIA ====
 
==== NCCH configurations for CIA ====
Line 123: Line 123:     
=== Command line ===
 
=== Command line ===
Since CCI and CIA are NCCH containers, makerom was built so CXIs could be built stand alone or straight into a container format. It is also possible rebuild CXIs from an ELF file. As a result there are many combinations which can be used; for simplicity, specific functions will be explained by breaking them up into argument groups:
     −
'''Creating CXIs from scratch:'''
+
  makerom [general args] [rsf args] [crypto args] [ncch 0 build args] [cci args] [cia args]
  -elf <elf path> -rsf <rsf path> [-icon <[[SMDH|icon]] path> -banner <banner path>]
     −
'''Rebuilding CXIs:'''
+
'''General Arguments'''
-code <decompressed exefs .code> -exheader <exheader from original CXI> -rsf <rsf path> [-icon <[[SMDH|icon]] path> -banner <banner path> -romfs <cleartext romfs binary>]
+
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -f <format>
 +
| 'ncch'/'cxi'/'cfa'/'cci'/'cia'
 +
| Specify the output file format. 'ncch'/'cxi'/'cfa' has no affect, probably parsed without error for legacy support.
 +
|-
 +
| -o <path>
 +
| Valid file path.
 +
| Specify name/path for output file. Makerom will decided a name if this is not specified.
 +
|-
 +
| -v
 +
| not required
 +
| Enables verbose output.
 +
|}
 +
 
 +
'''RSF Arguments'''
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -rsf <path>
 +
| Valid file path
 +
| Specify the path to Rom Specification File(RSF). See below for creating RSF.
 +
|-
 +
| -D<NAME>=<VALUE>
 +
|
 +
| This is used to substitute where "$(<NAME>)" exists in the RSF files with "<VALUE>". (Uppercase isn't a requirement)
 +
|}
 +
 
 +
'''Crypto Arguments'''
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -target <target>
 +
| 't'/'d'/'p'
 +
| Specify key-chain. This affects encryption, signing and '-desc' template availability. t=test, suitable for homebrew. d=devkit(incomplete), suitable for devkits. p=retail(unusable), suitable for signing retail software?
 +
|-
 +
| -ckeyid <index>
 +
| Any value between 0-255 (inclusive).
 +
| Overrides the default common key used to encrypt CIA title keys.
 +
|-
 +
| -showkeys
 +
| none
 +
| Dumps loaded key-chain to stdout.
 +
|}
 +
 
 +
'''NCCH Build Arguments'''
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -elf <file>
 +
| Valid file path
 +
| Specify ELF. See below for creating ELF.
 +
|-
 +
| -icon <file>
 +
| Valid file path
 +
| Specify [[SMDH|icon]].
 +
|-
 +
| -banner <file>
 +
| Valid file path
 +
| Specify banner.
 +
|-
 +
| -desc <apptype>:<fw>
 +
| <apptype>='app'/'ecapp'/'demo'/'dlpchild'. <fw>='kernel version minor'.
 +
| Use a template for [[Exheader|exheader/accessdesc]]. These are hard-coded, so not all firmwares have a template. A value from 1-7 can be used in place of 'kernel version minor'. A template shouldn't be used if the title needs "special" permissions, the RSF must be configured fully.
 +
|-
 +
| -exefslogo
 +
| none
 +
| Include logo in ExeFS. Required for usage on <5.0 systems.
 +
|}
 +
 
 +
Arguments useful for rebuilding a NCCH file:
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -code <file>
 +
| Valid file path
 +
| Specify decompressed/plaintext exefs code binary.
 +
|-
 +
| -exheader <file>
 +
| Valid file path
 +
| Specify plaintext exheader binary.
 +
|-
 +
| -logo <file>
 +
| Valid file path
 +
| Specify logo.
 +
|-
 +
| -plainrgn <file>
 +
| Valid file path
 +
| Specify NCCH plain-region.
 +
|-
 +
| -romfs <file>
 +
| Valid file path
 +
| Specify an unencrypted RomFS binary.
 +
|}
 +
 
 +
'''CCI Arguments'''
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -content <path>:<index>
 +
| <path>=Valid file path. <index>=Any value between 0-7 (inclusive)
 +
| Include a built NCCH file in the CCI container. "-i" can be used instead of "-content".
 +
|-
 +
| -devcci
 +
| none
 +
| Build a debug CCI?
 +
|-
 +
| -nomodtid
 +
| none
 +
| Don't modify the TitleIds of NCCH files included to match NCCH0
 +
|-
 +
| -alignwr
 +
| none
 +
| Align the offset for the Card2 writable region to the end of the last NCCH in the CCI.
 +
|}
 +
 
 +
'''CIA Arguments'''
 +
{| class="wikitable"
 +
|-
 +
! Argument
 +
! Acceptable values
 +
! Notes
 +
|-
 +
| -content <path>:<index>:<id>
 +
| <path>=Valid file path. <index>=Any value between 0x0-0xFFFF (inclusive). <id>=Any value between 0x0-0xFFFFFFFF (inclusive)
 +
| Include a built NCCH file in the CIA container. If <id> isn't specified, it will be generated randomly. "-i" can be used instead of "-content".
 +
|-
 +
| -major <version>
 +
| Any value between 0-63 (inclusive)
 +
| Specify the version major for the title. This cannot be used with "-dver".
 +
|-
 +
| -minor <version>
 +
| Any value between 0-63 (inclusive)
 +
| Specify the version minor for the title. This cannot be used with "-dver".
 +
|-
 +
| -micro <version>
 +
| Any value between 0-15 (inclusive)
 +
| Specify the version micro for the title.
 +
|-
 +
| -dver <version>
 +
| Any value between 0-4095 (inclusive)
 +
| Specify the data-title version for the title. This cannot be used with "-major" or "-minor".
 +
|-
 +
| -dlc
 +
| none
 +
| Specify this flag when building a DLC CIA.
 +
|-
 +
| -rand
 +
| none
 +
| Use a random title key to encrypt CIA content.
 +
|}
 +
 
 +
==== Examples ====
 +
 
 +
General examples:
   −
'''Creating CFAs:'''
+
'''Create CXI'''
  -f cfa -rsf <rsf path> [-icon <[[SMDH|icon]] path> -romfs <romfs binary>]
+
  makerom -o sample.cxi -rsf sample.rsf -target t -elf sample.elf -icon sample.icn -banner sample.bnr -desc app:4
   −
'''Creating CCIs:'''
+
'''Create CFA'''
  -f cci [-content <path>:<index> ...]
+
  makerom -o sample.cfa -rsf sample.rsf -target t
   −
'''Creating CIAs:'''
+
'''Create CCI'''
  -f cia [-content <path>:<index>:<id> ...]
+
  makerom -f cci -o sample.cci -target t -i sample.cxi:0 -i sample.cfa:1
   −
'''Using Desc presets:'''
+
'''Create CIA'''
  -desc <app type>:<firm version>
+
  makerom -f cia -o sample.cia -target t -i sample.cxi:0:0 -i sample.cfa:1:1
   −
* 'app type' can be SDApp / ECApp / Demo / DlpChild
  −
* 'firm version' is the target kernel version minor for the intended 3DS system.
     −
'''Examples:'''
+
Makerom supports building a NCCH file and including it automatically (as index 0) into a NCCH container:
Create a CCI, using a manual CFA, and a desc preset:
  −
makerom -f cci -elf homebrew.elf -rsf app.rsf -desc sdapp:33 -icon homebrew.icn -banner homebrew.bnr -content manual.cfa:1 -o homebrew.cci
     −
Create a CIA using an already built application CXI and manual CFA:
+
'''Create CCI and CXI at the same time and include a CFA'''
  makerom -f cia -content homebrew.cxi:0:0 -content manual.cfa:1:1 -o homebrew.cia
+
  makerom -f cci -o sample.cia -rsf sample.rsf -target t -elf sample.elf -icon sample.icn -banner sample.bnr -desc app:4 -i sample.cfa:1
   −
Rebuild a CXI:
+
'''Create CIA and CXI at the same time and include a CFA'''
  makerom -code code.bin -exheader exheader.bin -icon icon.bin -banner banner.bin -romfs romfs.bin -rsf app.rsf -desc sdapp:33 -o rebuild.cxi
+
  makerom -f cia -o sample.cia -rsf sample.rsf -target t -elf sample.elf -icon sample.icn -banner sample.bnr -desc app:4 -i sample.cfa:1:1
    +
Rebuilding CXI:
 +
makerom -o rebuild.cxi -rsf rebuild.rsf -target t -code rebuild/code.bin -exheader rebuild/exheader.bin -icon rebuild/icon.bin -banner rebuild/banner.bin -romfs rebuild/romfs.bin
    
=== Creating RSF files ===
 
=== Creating RSF files ===
Line 162: Line 331:  
For CXI, RSF files can be used to specify permissions, and access control settings. Makerom can use default settings by use of the "-desc" option, which removes the requirement for specifying them in the RSF file.
 
For CXI, RSF files can be used to specify permissions, and access control settings. Makerom can use default settings by use of the "-desc" option, which removes the requirement for specifying them in the RSF file.
   −
Sample RSF to be used with "-desc": [https://gist.githubusercontent.com/3DSGuy/83e12e0ae3dcccb9827f/raw/sample0.rsf download]
+
Sample RSF to be used with "-desc": [https://gist.githubusercontent.com/3DSGuy/83e12e0ae3dcccb9827f/raw/sample0.rsf download] (link broken)
   −
Sample RSF to be used without "-desc": [https://gist.githubusercontent.com/3DSGuy/83e12e0ae3dcccb9827f/raw/sample1.rsf download]
+
Sample RSF to be used without "-desc": [https://gist.githubusercontent.com/3DSGuy/83e12e0ae3dcccb9827f/raw/sample1.rsf download] (link broken)
    
=== Creating ELF files ===
 
=== Creating ELF files ===
8

edits