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:ExeFS (3DS)

From ReverseEngineering.wiki
Format
Endianness little
On this wiki Facts · Code · Notes · Topics

Small filesystem inside an NCCH holding the executable `.code`, `icon`, `banner` and `logo`: a 0x200-byte header with eight (name, offset, size) entries and eight SHA-256 hashes.

Header

See Fact:ExeFS (3DS)/struct/Header: eight entries of an 8-byte name (zero padded), u32 offset (relative to the end of the 0x200-byte header) and u32 size, then 128 reserved bytes and eight 32-byte SHA-256 hashes stored in reverse order (hash 0 is last) - per 3dstool's exefs.h; ctrtool's exefs.h confirms the reverse order (Fact:ExeFS (3DS)/behavior/Hash table order: entry i's hash is slot 7 - i). Whether the .code file is compressed is not recorded in the ExeFS: it is bit 0 of the flags byte at 0xD of the Format:NCCH extended header, and azahar decodes only the entry named .code (Fact:ExeFS (3DS)/behavior/Compressed .code in azahar). The trailer-driven backward LZ it uses has the same 8-byte footer shape as the DS code compression in Format:Nintendo backward LZ (BLZ code compression); Unverified: that the two are byte-for-byte the same codec (the reference decoding in azahar adds 2 to a 12-bit field and reads before decrementing, which works out to field + 3, the same as ndspy's displacement).

Typical files: .code (the ARM11 binary, text+rodata+data concatenated according to the extended header; often compressed with the backward LZ77 "BLZ" variant, also LZ11 and others in 3dstool's backwardlz77.cpp), icon (an SMDH), banner (a CBMD banner), logo.

Related

Format:NCCH container, Platform:Nintendo 3DS.

Code & repositories

  • https://github.com/dnasdw/3dstool @ 3771ae967d64092370b646db86aa626401c279e8 · license: MIT
    3dstool: src/ncsd.h, ncch.h, extendedheader.h, exefs.h, romfs.h and compression codecs.
    Tested on: source read, not run: source read · checked 2026-10-18; last activity 2026-01-24; Note: the latest release ships binaries; the wiki links only the source, never the binaries
  • https://github.com/3DSGuy/Project_CTR @ d52c2b0e788c2d085763d7c5dcc4b2edd9ffb7d8 · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    Project_CTR (ctrtool, makerom): ctrtool/deps/libnintendo-n3ds/include/ntd/n3ds/ncch.h, exheader.h, exefs.h, cia.h, cro.h declare the NCCH, extended header, ExeFS, CIA and CRO structures with static size asserts. License taken from ctrtool/deps/libnintendo-n3ds/LICENSE (MIT); GitHub's detector found no top-level license.
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-11; Note: the latest release ships binaries; the wiki links only the source, never the binaries