Format:XEX2 (Xbox 360 executable)
| Platforms | Platform:Xbox 360 |
|---|---|
| Magic | XEX2 |
| Extensions | .xex |
| Endianness | big |
| On this wiki | Facts · Code · Notes · Topics |
Executable of the Xbox 360: big-endian header with magic XEX2, a list of optional headers (key/value pairs, offset or inline value) giving entry point, base address, execution info and import libraries with versions, then a security block and a possibly compressed and encrypted PE.
Overview
All fields are big-endian. A XEX wraps a PowerPC PE image; the PE is stored after the header, optionally compressed (none, basic, normal LZX, delta patch) and AES encrypted. This page documents only the public header structure as defined in xenia's xex2_info.h.
Fixed header (0x18 bytes)
magic XEX2 (0x58455832; older XEX1 0x58455831 has a different security block), module flags, header size (offset of the PE data), reserved, security info offset, optional header count, then count pairs of (key, value-or-offset). See Fact:XEX2 (Xbox 360 executable)/struct/Fixed header and Fact:XEX2 (Xbox 360 executable)/enum/Optional header keys.
Optional headers
The low byte of the key says how the value is stored: 0x00 and 0x01 mean the 32-bit value is inline, 0xFF means it is the offset of a structure whose first u32 is its size, other low bytes give the size in words for fixed structures. Important ones: entry point 0x00010100, image base 0x00010201, original base 0x00010001, import libraries 0x000103FF, static libraries 0x000200FF, execution info 0x00040006, file format info 0x000003FF (encryption and compression type), TLS info 0x00020104, default stack/heap sizes, system flags 0x00030000, original PE name 0x000183FF, ratings 0x00040310.
Resource info (key 0x000002FF): u32 size, then (size - 4) / 16 entries of 8-byte name, u32 address, u32 size (big-endian; xenia xex2_info.h at 95a5c3ee250f80c3b9d139658649d9ffb6db3eec lines 427-437). The resource named with the title id in 8 upper-case hex digits is the title's Format:XDBF (Xbox 360 database) (icon, localized title, achievements); xenia reads it from the loaded image at the guest virtual address in the entry, see Fact:XEX2 (Xbox 360 executable)/identification/Title XDBF resource. Unverified: whether address is a file offset or a virtual address in the raw XEX2 file (xenia only uses it after loading the image).
Execution info (0x18 bytes)
media id, version, base version, title id, platform, executable table, disc number and count, savegame id. The same struct is reused in the Format:STFS (Xbox 360 package) header.
Import libraries: finding the XDK build
The import record lists libraries (xboxkrnl.exe, xam.xex, xbdm.xex...) with a version and a minimum version (major 4 bits, minor 4, build 16, QFE 8). The static libraries header lists 16-byte records (8-char name such as XAPILIB, D3DX9, XGRAPHC, XAUDIO2, XMCORE, version, approval) that date the XDK used and reveal which middleware is statically linked. Imports are by ordinal: map them with the kernel export tables of the emulators.
Security block
At the security offset: header size, image size, 0x100-byte RSA signature, image flags (e.g. 0x10000000 uses 4 KB pages, else 64 KB), load address, digests, the (encrypted) image key, export table, region and allowed media, then page descriptors (type in 4 bits: 1 code, 2 data, 3 read-only data; page count in 28 bits; SHA-1). Fields: Fact:XEX2 (Xbox 360 executable)/struct/Security info.
Related
Platform:Xbox 360, Format:PE (Portable Executable), Format:XDBF (Xbox 360 database) (title resources), Format:XBE (Xbox executable) (original Xbox equivalent).
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