ExeFS: Difference between revisions

3dsguy (talk | contribs)
mNo edit summary
Neimod (talk | contribs)
No edit summary
Line 1: Line 1:
ExeFS or Executable Filesystem, is the part of the CXI, which is executed when the CXI is run. And contains:
=== Overview ===
ExeFS or Executable Filesystem, is the part of the CXI, which is executed when the CXI is run.  


The ExeFS usually contains one or more of the following files:
* .code Contains the code binary, which can be optionally reverse-LZSS compressed via an exheader flag.
* .code Contains the code binary, which can be optionally reverse-LZSS compressed via an exheader flag.
* [[logo]] Contains distribution licensing Binary data.
* [[logo|.logo]] Contains distribution licensing Binary data.
* [[File Formats|banner]] Contains the banner which homemenu uses for this CXI.
* [[File Formats|.banner]] Contains the banner which homemenu uses for this CXI.
* [[SMDH|icon]] Contains the icon which homemenu displays for this CXI.
* [[SMDH|.icon]] Contains the icon which homemenu displays for this CXI.


=== AFTER DECRYPTION ===
=== Format ===


The ExeFS header is 0x200 bytes long and follows this structure:
The ExeFS header is 0x200 bytes long and follows this simple structure:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 17: Line 19:
|-
|-
|  0x00
|  0x00
0x05
0x80
Always '.code'
File headers (8 headers maximum, 16 bytes each)
|-
|-
0x05   
0x80
0x03
0x80
|  Reserved
|  Reserved
|-
|-
0x08
0x100
0x04
0x100
ARM Code Offset*
File hashes (8 hashes maximum, 32 bytes each, one for each header)
|-
|}
|  0x0C   
 
|  0x04
==== File headers ====
| ARM Code Length 
There are a maximum of 8 file headers in the ExeFS format, which have the following structure:
 
{| class="wikitable" border="1"
|-
|-
| 0x10     
! START
| 0x06
! SIZE
| Always 'banner'
! DESCRIPTION
|-
|  0x16   
|  0x02
|  Reserved
|-
|  0x18   
|  0x04
|  Banner Offset*
|-
|-
0x1C   
0x0
0x04
0x8
Banner Length
File name
|-
|-
0x20   
0x8
0x04
0x4
Always 'icon'
File offset
|-
|  0x24   
|  0x04
|  Reserved
|-
|  0x28   
|  0x04
|  Icon Offset
|-
|  0x2C   
|  0x04
|  Icon Length
|-
|  0x30   
|  0x04
|  Always 'logo'**
|-
|  0x34   
|  0x04
|  Reserved
|-
|  0x38   
|  0x04
|  Logo Offset* **
|-
|  0x3C   
|  0x04
|  Logo Length**
|-
|  0x40   
|  0x140
|  Reserved
|-
|  0x180   
|  0x20
|  Logo Hash**
|-
|  0x1A0   
|  0x20
|  Icon Hash
|-
|  0x1C0   
|  0x20
|  Banner Hash
|-
|  0x1E0   
|  0x20
|  ARM Code Hash
|-
|-
|  0xC
|  0x4
|  File size
|}
|}
==== File hashes ====
Each file header has a corresponding file hash, which is the SHA256 hash calculated over the entire file contents.


<nowiki>* Offsets are non-inclusive of the header's size(0x200 bytes).</nowiki>
<nowiki>* Offsets are non-inclusive of the header's size(0x200 bytes).</nowiki>