Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:NPDM

From ReverseEngineering.wiki
Format
Vendor Nintendo
Magic 4D 45 54 41 ("META") at offset 0; sub-blocks "ACI0" and "ACID"
Extensions main.npdm
Endianness little
On this wiki Facts · Code · Notes · Topics

Nintendo Switch process metadata (main.npdm, in the ExeFS of a program NCA): a META header with title name, main thread priority, core and stack size, pointing to an ACI0 block (title id and access control for this process) and an ACID block (signed limits: title id range, filesystem, service and kernel capability descriptors).

Overview

main.npdm is a file of the ExeFS (PFS0) next to the Format:NSO modules; hactool recognises an ExeFS by a main.npdm whose magic is META. It tells the loader how to create the process: name, main thread priority and default core, stack size, address space flags, and the access control data (filesystem permissions, service access, kernel capabilities). Initial processes in a KIP1 carry the kernel capabilities directly in their header instead.

META header

See Fact:NPDM/struct/META header (0x80 bytes). hactool's npdm_t and switch-tools' NpdmHeader (npdmtool) describe the same bytes with different names: hactool keeps the 0x50 bytes after the stack size as one title name, npdmtool splits them into a 0x10 name, a 0x10 product code and 0x30 reserved bytes.

Byte 0xC holds the META flags (64-bit instruction bit, process address space, and others) and 0xD a second flags byte; see Fact:NPDM/enum/META flags and address space. What Atmosphere's loader checks when it reads main.npdm: Fact:NPDM/behavior/Atmosphere NPDM validation.

ACI0 and ACID

Both are located by (offset, size) pairs at 0x70 of the META header. ACI0 ("access control info") describes this process: program id and offset/size pairs for the filesystem access header, service access control and kernel access control. ACID ("access control info descriptor") is the signed counterpart: a 0x100-byte RSA signature, a 0x100-byte modulus, the ACID magic at 0x200, flags, a title id range, and the same three offset/size pairs. See Fact:NPDM/struct/ACI0 and ACID.

The kernel access control section is an array of 32-bit descriptors, each decoded by its count of trailing 1 bits; see Fact:NPDM/enum/Kernel capability descriptor types and Fact:NPDM/behavior/Kernel capability descriptor fields. The service access control section lists service names the process may use; Unverified: its encoding (a length-prefixed name sequence) is from general knowledge, not read in a source here.

Related

Format:NSO, Format:KIP1, Format:NCA, Format:PFS0 and HFS0, Platform:Nintendo Switch.

Code & repositories

See below.

  • https://github.com/switchbrew/switch-tools @ 22756068dd0ed6ff9734c59cb4f99ebd3f62555b · license: ISC
    switch-tools (ISC): src/npdmtool.c (builds NPDM from JSON), src/elf2nso.c (NSO header and segments), src/elf2kip.c (KIP1 header and capability encoding).
    Tested on: source read, not run · checked 2026-10-19; last activity 2024-10-23
  • https://github.com/Atmosphere-NX/Atmosphere @ 6b0c077b4c608a3a2ee712b8dc35fee87ceb62e8 · license: GPL-2.0
    Atmosphere (GPL-2.0-or-later): libmesosphere kern_k_initial_process_reader.hpp (KIP1 header and flags) and kern_k_capabilities.hpp (capability descriptor encoding).
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries