Changes

no edit summary
Line 216: Line 216:  
The MOD structure is designed such that it can be placed at image base and point to itself.
 
The MOD structure is designed such that it can be placed at image base and point to itself.
 
The 2 fields preceding the magic field get copied around with the structure, even if it is relocated to somewhere besides the image base. If MOD is not located at image base, the value at offset 4 must still point to the MOD magic. In the case of .text being at image base, this implies that the first instruction can only be an unconditional branch over the offset literal.
 
The 2 fields preceding the magic field get copied around with the structure, even if it is relocated to somewhere besides the image base. If MOD is not located at image base, the value at offset 4 must still point to the MOD magic. In the case of .text being at image base, this implies that the first instruction can only be an unconditional branch over the offset literal.
 +
 +
== nnSdk Version ==
 +
With [17.0.0+] this structure is normally located immediately after the [[#MOD|MOD0]]. This stores the nnSdk version.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0
 +
| 0x4
 +
| Major
 +
|-
 +
| 0x4
 +
| 0x4
 +
| Minor
 +
|-
 +
| 0x8
 +
| 0x4
 +
| Micro
 +
|}
    
= Arguments =
 
= Arguments =