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:XBE (Xbox executable)

From ReverseEngineering.wiki
Format
Platforms Platform:Xbox
Magic XBEH
Extensions .xbe
Endianness little
On this wiki Facts · Code · Notes · Topics

Executable of the original Xbox: magic XBEH, a fixed image header with a certificate, section headers, a library versions table naming the XDK build, and an XOR-obfuscated entry point and kernel thunk address.

Overview

An XBE is what the XDK linker (or nxdk's cxbe) produces from a PE image. Everything in the header is a virtual address (base normally in the 0x10000 range) rather than a file offset, so convert through the section headers.

Image header

Magic XBEH at 0, 256-byte digital signature at 4, base address at 0x104, then sizes, certificate address (0x118), section count (0x11C), section headers address (0x120), init flags (0x124), entry point (0x128, XOR-encoded), TLS directory (0x12C), PE stack/heap sizes, original PE base, size, checksum and timestamp, debug path name pointers (0x14C-0x154), kernel image thunk address (0x158, XOR-encoded), non-kernel import directory (0x15C), library versions count and address (0x160, 0x164), pointers to the kernel and XAPI library version records (0x168, 0x16C), logo bitmap (0x170, 0x174). Full table: Fact:XBE (Xbox executable)/struct/Image header.

Certificate

Title id, title name (UTF-16, 40 chars), 16 alternate title ids, allowed media, game region, ratings, disc number, version and keys. The first 32-bit word of the title id is publisher letters plus a number (folk knowledge, unverified here). Layout in the fact page.

Sections

Each section header holds flags (writable, preload, executable, inserted file, head/tail page read-only), virtual address and size, file offset and size, a name pointer, reference counters and a SHA-1 digest. The name pointer is a virtual address of a NUL-terminated string; nxdk's cxbe copies each name (up to 8 characters) from the PE section table, so homebrew names follow the PE (tools/cxbe/Xbe.cpp, Xbe.h). XDK library code lives in sections an XDK-aware scanner looks for by name: .text, FLASHROM, .rdata, D3D, D3DX, DSOUND, XACTENG, .XID, XPP, .XPP&Dat, XGRPH, XONLINE, XNET (Fact:XBE (Xbox executable)/identification/XDK section names, XbSymbolDatabase). Flag bits: Fact:XBE (Xbox executable)/enum/Section flags. Unverified: .data, .data1, .bss, XTIMAGE, XSIMAGE and WMADEC as typical names (from memory of common dumps, not found in the sources read).

Library versions: dating the XDK

The library versions table is an array of 16-byte records: 8-byte name (names that the XbSymbolDatabase library maps to libraries are D3D8, D3D8LTCG, D3DX8, DSOUND, JVS, XACTENG, XAPILIB, XGRAPHC, XNET, XNETN, XNETS, XONLINE, XONLINEN, XONLINES, XONLINLS (Fact:XBE (Xbox executable)/identification/XDK library names); nxdk's Xbe.h defines the record layout and the pointers to the kernel and XAPI records (header 0x168, 0x16C). Unverified: XBOXKRNL and LIBCMT as names in the table), major, minor and build (u16 each), then flags: QFE (13 bits), approval (2 bits: 0 no, 1 possibly, 2 yes) and a debug build bit. The build number (Unverified: 5849 for the last retail XDK) dates the SDK and tells which library revisions a title is statically linked against; compare against the same table in another title to find shared library code.

Entry point and kernel thunks

The entry point and the kernel image thunk address are stored XORed with a key that differs for retail and debug/devkit builds (nxdk tools/cxbe/Xbe.h: entry point 0xA8FC57AB retail, 0x94859D4B debug; kernel thunk 0x5B6D40B6 retail, 0xEFB1F152 debug); decode both and keep the one that falls inside the image. The kernel thunk table is an array of 32-bit values with the top bit set and the kernel export ordinal in the low bits, which the loader replaces with function addresses. See Fact:XBE (Xbox executable)/enum/Header XOR keys.

Sega Chihiro arcade XBEs use a third pair, entry 0x40B5C16E and thunk 0x2290059D, per Cxbx-Reloaded (Fact:XBE (Xbox executable)/enum/Chihiro XOR keys). The TLS directory (header 0x12C) is six u32: data start and end, TLS index address, callback table address, zero-fill size, characteristics (Fact:XBE (Xbox executable)/struct/TLS directory).

Tools

  • cxbe (in nxdk, GPL-2.0-or-later): PE to XBE converter, readable reference for all structures.
  • xemu (GPL-2) does not parse the XBE file to boot: it emulates the machine, and a helper reads the running title's header from guest virtual address 0x10000, checking XBEH and capping the headers at 8 pages (Fact:Xbox/behavior/xemu reads the XBE header at 0x10000). Cxbx-Reloaded (GPL-2) has its own Xbe.h with the same structures plus the Chihiro keys and its HLE scans library names to pick patches.

Related

Platform:Xbox, Format:XDVDFS (Xbox disc filesystem), Format:PE (Portable Executable).

Code & repositories

  • https://github.com/XboxDev/nxdk @ 14d5ee97e73347c973f1f57b68b79ec08c9e77f2 · license: MIT AND GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize a license file)
    Open Xbox homebrew toolchain (mixed licenses; tools/cxbe is GPL-2.0-or-later); tools/cxbe/Xbe.h documents the XBE header, certificate, section and library version structures
    Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-09-30
  • https://github.com/Cxbx-Reloaded/XbSymbolDatabase @ 20eced544726f5558c5a408458f38a086cc4e543 · license: MIT
    Library that identifies XDK library functions in XBEs; include/libXbSymbolDatabase.h lists the library and section names
    Tested on: source read, not run · checked 2026-10-19; last activity 2025-08-23; Note: the latest release ships binaries; the wiki links only the source, never the binaries
  • https://github.com/Cxbx-Reloaded/Cxbx-Reloaded @ 585c49a50af1255ab155099e06f24505f9c5a800 · license: GPL-2.0-only (declared by the contributor for the files used; GitHub reports GPL-2.0 for the repository)
    Xbox emulator; src/common/xbe/Xbe.h has the XBE structures, flags and XOR keys incl. Chihiro
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-04-19
  • https://github.com/xemu-project/xemu @ 2de2c2228df8669ff244f9137c75974e6927f43e · license: GPL-2.0-only (declared by the contributor; GitHub's detector did not recognize COPYING)
    Xbox emulator; xemu-xbe.c reads the XBE header of the running title from guest memory
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-19; Note: the latest release ships binaries; the wiki links only the source, never the binaries