Format:STFS (Xbox 360 package)
| Platforms | Platform:Xbox 360 |
|---|---|
| Magic | CON / LIVE / PIRS |
| Endianness | big |
| On this wiki | Facts · Code · Notes · Topics |
Xbox 360 content package: magic CON , LIVE or PIRS, a signed header with licenses, content metadata and a volume descriptor, followed by 4 KB blocks interleaved with SHA-1 hash tables; holds saves, profiles, DLC and installed content.
Overview
STFS (Secure Transacted File System) files hold a small filesystem. The package signing type is the magic: CON (0x434F4E20, signed by a console, saves and profiles), LIVE (0x4C495645, signed by Xbox Live, marketplace content) and PIRS (0x50495253, signed by Microsoft, system and some title updates). Values are big-endian except for the 24-bit block numbers, which are little-endian.
Header
Base header 0x344 bytes (magic, 0x228 signature, 16 licenses, 0x14-byte content id, header size), then XContent metadata: content type (e.g. 1 saved game, 2 marketplace content, 0x1000 Xbox 360 title, 0x7000 Games on Demand, 0x10000 profile), metadata version, content size, execution info (as in Format:XEX2 (Xbox 360 executable)), console id, profile id, the volume descriptor at 0x379, data file count and size, volume type (0 STFS, 1 SVOD), display names and descriptions in 9 languages (UTF-16BE, 128 chars each), publisher and title name, thumbnails. Offsets: Fact:STFS (Xbox 360 package)/struct/Package header.
Volume descriptor (0x24 bytes)
length (0x24), version, flags (read-only format, root active index...), file table block count u16, file table start block (24-bit), top hash table hash (SHA-1), total and free block count.
Blocks and hash tables
Data blocks are 0x1000 bytes. A level-0 hash table (0x1000 bytes, 170 entries of 24 bytes: SHA-1 plus a 32-bit info word with next block in 24 bits and allocation state) precedes every 170 data blocks; a level-1 table follows every 170 level-0 groups, then level 2. The first block starts at the header size rounded to 0x1000 (0xA000/0xB000). File table entries are 0x40 bytes: 40-byte name, flags byte (name length 6 bits, contiguous, directory), allocated/valid block counts and start block (24-bit each), parent directory index u16, size u32, FAT-format create and modified timestamps. Details: Fact:STFS (Xbox 360 package)/struct/File table entry.
Reader behavior of xenia (source read at 95a5c3ee250f80c3b9d139658649d9ffb6db3eec, not run): see Fact:STFS (Xbox 360 package)/struct/Hash table and entry (info word bits), Fact:STFS (Xbox 360 package)/behavior/Block to file offset (170 / 28900 / 4913000 blocks per level; 1 backing block per hash table when the read_only_format flag is set, else 2: a primary and a secondary copy 0x1000 apart, chosen by the active-index bits, see Fact:STFS (Xbox 360 package)/behavior/Choosing the primary or secondary hash block), Fact:STFS (Xbox 360 package)/behavior/Reading the file table and file chains (chains end at 0xFFFFFF; directory_index 0xFFFF is the root; xenia does not use the contiguous flag) and Fact:STFS (Xbox 360 package)/behavior/Package open checks. The reader checks only the magic and the file size, no signature or hash. The file_table_block_count is little-endian, unlike the big-endian counts around it. The extra display-name and description slots for languages 10-12 live inside the thumbnail slots (metadata version 2), see Fact:STFS (Xbox 360 package)/struct/Package header and Fact:STFS (Xbox 360 package)/enum/Language ids.
SVOD (Games on Demand)
Volume type 1 uses a different descriptor and stores an XDVDFS image in Data0000... files with the MICROSOFT*XBOX*MEDIA magic at 0x2000, 0xD000 or 0x12000 depending on layout; blocks of 0x800 bytes with hash blocks every 0x198 blocks. See Format:XDVDFS (Xbox disc filesystem).
Xenia's SVOD reader (same commit): the volume descriptor is the union Fact:STFS (Xbox 360 package)/struct/SVOD device descriptor; the GDF root is found per Fact:STFS (Xbox 360 package)/behavior/SVOD layout detection (0x2000 for the enhanced layout flag, 0x12000 with an XSF header at 0x2000, 0xD000 for single-file packages) and blocks are located per Fact:STFS (Xbox 360 package)/behavior/SVOD block to file offset. Multi-file SVOD packages keep their data files in a folder named like the package file plus .data; xenia requires exactly data_file_count files there. The directory tree inside is an XDVDFS tree of little-endian records, see Format:XDVDFS (Xbox disc filesystem).
Related
Platform:Xbox 360, Format:XDBF (Xbox 360 database) (profile GPD files inside STFS profile packages use the same database layout).
Code & repositories
- https://github.com/xenia-project/xenia @
95a5c3ee250f80c3b9d139658649d9ffb6db3eec· license: BSD-3-Clause (declared by the contributor for the files used; GitHub reports BSD-3-Clause (read from LICENSE; GitHub's detector did not classify it) for the repository)
Xbox 360 emulator; src/xenia/kernel/util/xex2_info.h, vfs/devices/stfs_xbox.h and kernel/util/xdbf_utils.h hold the public header structures
Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-02-18