Difference between revisions of "3DSX Format"

From 3dbrew
Jump to navigation Jump to search
(Created page with "The 3DSX format is an executable file-format designed for homebrew applications on the 3DS. The file is structured like this: * Header * Code segment * Rodata segment * Data seg...")
 
m (typography hype!)
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
The file is structured like this:
 
The file is structured like this:
 
* Header
 
* Header
 +
* Extended Header, if the header size field is greater than 32.
 +
* Code relocation table header
 +
* Rodata relocation table header
 +
* Data relocation table header
 
* Code segment
 
* Code segment
 
* Rodata segment
 
* Rodata segment
 
* Data segment
 
* Data segment
* Relocation Header for code
+
* Code relocation table
* Relocation Header for rodata
+
* Rodata relocation table
* Relocation Header for data
+
* Data relocation table
 +
* [[SMDH]] data, if there is an extended header.
 +
* [[RomFS]] data, if there is an extended header.
  
 
== Header ==
 
== Header ==
Line 22: Line 28:
 
|-
 
|-
 
|  0x4
 
|  0x4
4
+
2
 
|  Header size
 
|  Header size
 +
|-
 +
|  0x6
 +
|  2
 +
|  Relocation Header size
 
|-
 
|-
 
|  0x8
 
|  0x8
 
|  4
 
|  4
Relocation Header size
+
Format version
 
|-
 
|-
 
|  0xC
 
|  0xC
 
|  4
 
|  4
Format version
+
Flags
 
|-
 
|-
 
|  0x10
 
|  0x10
 
|  4
 
|  4
Flags
+
Code segment size
 
|-
 
|-
 
|  0x14
 
|  0x14
 
|  4
 
|  4
Code segment size
+
Rodata segment size
 
|-
 
|-
 
|  0x18
 
|  0x18
 
|  4
 
|  4
Rodata segment size
+
Data segment size (including bss)
 
|-
 
|-
 
|  0x1C
 
|  0x1C
 
|  4
 
|  4
Data segment size (including bss)
+
Bss segment size
 +
|}
 +
 
 +
== Extended Header ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
|  0x0
 +
|  4
 +
|  [[SMDH]] offset
 +
|-
 +
|  0x4
 +
|  4
 +
|  [[SMDH]] size
 
|-
 
|-
0x20
+
0x8
 
|  4
 
|  4
Bss segment size
+
[[RomFS]] offset
 
|}
 
|}
  

Latest revision as of 22:34, 21 November 2015

The 3DSX format is an executable file-format designed for homebrew applications on the 3DS.

The file is structured like this:

  • Header
  • Extended Header, if the header size field is greater than 32.
  • Code relocation table header
  • Rodata relocation table header
  • Data relocation table header
  • Code segment
  • Rodata segment
  • Data segment
  • Code relocation table
  • Rodata relocation table
  • Data relocation table
  • SMDH data, if there is an extended header.
  • RomFS data, if there is an extended header.

Header[edit]

Offset Size Description
0x0 4 Magic (3DSX)
0x4 2 Header size
0x6 2 Relocation Header size
0x8 4 Format version
0xC 4 Flags
0x10 4 Code segment size
0x14 4 Rodata segment size
0x18 4 Data segment size (including bss)
0x1C 4 Bss segment size

Extended Header[edit]

Offset Size Description
0x0 4 SMDH offset
0x4 4 SMDH size
0x8 4 RomFS offset

Relocation Header[edit]

Offset Size Description
0x0 4 Number of absolute relocations
0x4 4 Number of relative relocations

Relocation[edit]

Offset Size Description
0x0 2 Number of words to skip
0x2 2 Number of words to patch