Format:Z3DS
| On this wiki | Facts · Code · Notes · Topics |
|---|
Azahar's seekable zstd wrapper for 3DS files (.z3dsx and similar): a 0x20-byte header with magic Z3DS and the magic of the wrapped file, then zstd seekable data; azahar's 3DSX loader accepts a Z3DS file whose wrapped magic is 3DSX.
Header
See Fact:Z3DS/struct/Header and Fact:3DSX/identification/Loader accepts Z3DS wrapper. The format is defined by the azahar emulator's Z3DSFileHeader (src/common/file_derived.h): a plain C++ struct of 0x20 bytes (static_assert). Azahar declares no byte order for it, so Unverified: that the integer fields are little endian in the file (azahar only builds for little-endian hosts).
The writer uses the seekable variant of zstd (ZSTD_seekable_*), with a default frame size of 256 KiB and, for CIA, 32 MiB (DEFAULT_FRAME_SIZE, DEFAULT_CIA_FRAME_SIZE). A metadata block of metadata_size bytes sits in the file; I did not read its layout (Unverified).
The 3DSX loader's recommended compressed extension is z3dsx and plain extension 3dsx (src/core/loader/3dsx.cpp). To get the original Format:3DSX bytes, decompress the zstd seekable stream; no key or protection is involved.
Unverified: that the same wrapper is used for NCCH, NCSD and CIA files (a comment in azahar's file_derived.cpp says legacy mode will only allow NCCH, NCSD or Z3DS, and the CIA frame constant suggests CIA too), and which extensions those use.