MOD

From Nintendo Switch Brew
Revision as of 21:35, 25 September 2024 by Hexkyz (talk | contribs) (→‎ModuleVersion)
Jump to navigation Jump to search

MOD describes a module object. It is essentially a replacement for a PT_DYNAMIC program header.

ModuleHeaderLocation

This is "nn::rocrt::ModuleHeaderLocation".

Offset Size Description
0x0 0x4 [17.0.0+] Version ([1.0.0-16.1.0] Padding)
0x4 0x4 HeaderOffset
0x8 0x4 [17.0.0+] VersionOffset

ModuleHeader

This is "nn::rocrt::ModuleHeader".

Offset Size Description
0x0 0x4 Signature ("MOD0")
0x4 0x4 DynamicOffset
0x8 0x4 BssStartOffset
0xC 0x4 BssEndOffset
0x10 0x4 ExceptionInfoStartOffset
0x14 0x4 ExceptionInfoEndOffset
0x18 0x4 ModuleOffset (offset to runtime-generated module object, typically equal to .bss base)

ModuleVersion

With [17.0.0+] this structure is normally located immediately after the ModuleHeader. This stores the nnSdk version.

Offset Size Description
0x0 0x4 Major
0x4 0x4 Minor
0x8 0x4 Micro