<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://xboxdevwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thrimbor</id>
		<title>xboxdevwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://xboxdevwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Thrimbor"/>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/Special:Contributions/Thrimbor"/>
		<updated>2026-05-21T04:05:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=NV2A/Vertex_Shader&amp;diff=7422</id>
		<title>NV2A/Vertex Shader</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=NV2A/Vertex_Shader&amp;diff=7422"/>
				<updated>2025-12-19T21:34:40Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Add pipeline diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Xbox implements the 2 GL extensions [https://www.opengl.org/registry/specs/NV/vertex_program.txt NV_vertex_program] and [https://www.opengl.org/registry/specs/NV/vertex_program1_1.txt NV_vertex_program1_1] (with some modifications).&lt;br /&gt;
This article will mainly focus on actual encoding on hardware as the behaviour is mostly outlined in those GL extensions already.&lt;br /&gt;
&lt;br /&gt;
== Operating modes ==&lt;br /&gt;
&lt;br /&gt;
* Fixed / Programmable&lt;br /&gt;
* Writeable / Read-Only constants&lt;br /&gt;
* Low-constants only / all constants&lt;br /&gt;
* Vertex processing / State program&lt;br /&gt;
&lt;br /&gt;
== Pipeline ==&lt;br /&gt;
&lt;br /&gt;
[[File:Vertex_processor.png|352px]]&lt;br /&gt;
&lt;br /&gt;
== Registers ==&lt;br /&gt;
&lt;br /&gt;
=== Input registers ===&lt;br /&gt;
&lt;br /&gt;
There are 16 input registers v[0] to v[15].&lt;br /&gt;
&lt;br /&gt;
They normally [[NV2A/Vertex attributes|map to the vertex attributes]]. However, in the case of vertex state programs, v[0] is fed from LAUNCH_DATA (PGRAPH Methods 0x1E80, 0x1E84, 0x1E88, 0x1E8C for XYZW respectively) instead.&lt;br /&gt;
&lt;br /&gt;
=== Output registers ===&lt;br /&gt;
&lt;br /&gt;
11 output registers o[&amp;lt;RegName&amp;gt;] (initialized to XYZ=0x00000000 W=0x3F800000).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Output registers&lt;br /&gt;
|-&lt;br /&gt;
!Index&lt;br /&gt;
!GL Name&lt;br /&gt;
!D3D Name&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|HPOS&lt;br /&gt;
|oPos&lt;br /&gt;
|Homogeneous clip space position&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|COL0&lt;br /&gt;
|oD0&lt;br /&gt;
|Primary color (front-facing)&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|COL1&lt;br /&gt;
|oD1&lt;br /&gt;
|Secondary color (front-facing)&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|FOGC&lt;br /&gt;
|oFog&lt;br /&gt;
|Fog coordinate&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|PSIZ&lt;br /&gt;
|oPts&lt;br /&gt;
|Point size&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|BFC0&lt;br /&gt;
|oB0&lt;br /&gt;
|Back-facing primary color&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|BFC1&lt;br /&gt;
|oB1&lt;br /&gt;
|Back-facing secondary color&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|TEX0&lt;br /&gt;
|oT0&lt;br /&gt;
|Texture coordinate set 0&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|TEX1&lt;br /&gt;
|oT1&lt;br /&gt;
|Texture coordinate set 1&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|TEX2&lt;br /&gt;
|oT2&lt;br /&gt;
|Texture coordinate set 2&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|TEX3&lt;br /&gt;
|oT3&lt;br /&gt;
|Texture coordinate set 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Address register ===&lt;br /&gt;
&lt;br /&gt;
A0.x exists as documented in the GL extension.&lt;br /&gt;
&lt;br /&gt;
=== Temporary registers ===&lt;br /&gt;
&lt;br /&gt;
There are 12 temporary registers: R0 to R11 (initialized to XYZW=0x00000000), as documented in the GL extension.&lt;br /&gt;
Additionally, o[HPOS] is mirrored as R12 and can be used as source operand; so effectively you have 13 temporaries&lt;br /&gt;
&lt;br /&gt;
=== Constant space ===&lt;br /&gt;
&lt;br /&gt;
There are 192 constant registers in two seperate blocks with 96 constants each.&lt;br /&gt;
They can be accessed through the PGRAPH RDI: select=0x17. Each constant slot is 4x DWORD, ordered as WZYX.&lt;br /&gt;
Alternatively they can be uploaded through PGRAPH method [FIXME], with 4x DWORD, ordered XYZW.&lt;br /&gt;
&lt;br /&gt;
In nvidia vertex programs only 96 constants are normally accessible. Microsoft exposed the 96 additional constant registers in D3D shaders through c[-96] to c[-1].&lt;br /&gt;
This documentation uses the GL terminology instead and expose the new registers as c[96] to c[191]. This means c[0] to c[191] valid.&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
In total, there are 136 instruction slots.&lt;br /&gt;
&lt;br /&gt;
Each slot consists of 16 bytes, we consider those as 4 seperate little-endian DWORDS describing the operation. Word 0 is inused.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Fields&lt;br /&gt;
|-&lt;br /&gt;
!Meaning&lt;br /&gt;
!Word&lt;br /&gt;
!Offset (bits)&lt;br /&gt;
!Size (bits)&lt;br /&gt;
|-&lt;br /&gt;
|ILU Operation&lt;br /&gt;
|1&lt;br /&gt;
|25&lt;br /&gt;
|3&lt;br /&gt;
|-&lt;br /&gt;
|MAC Operation&lt;br /&gt;
|1&lt;br /&gt;
|21&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Constant index&lt;br /&gt;
|1&lt;br /&gt;
|13&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|Input index&lt;br /&gt;
|1&lt;br /&gt;
|9&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 negate&lt;br /&gt;
|1&lt;br /&gt;
|8&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 swizzle X&lt;br /&gt;
|1&lt;br /&gt;
|6&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 swizzle Y&lt;br /&gt;
|1&lt;br /&gt;
|4&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 swizzle Z&lt;br /&gt;
|1&lt;br /&gt;
|2&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 swizzle W&lt;br /&gt;
|1&lt;br /&gt;
|0&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 register&lt;br /&gt;
|2&lt;br /&gt;
|28&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Source 1 mux&lt;br /&gt;
|2&lt;br /&gt;
|26&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 negate&lt;br /&gt;
|2&lt;br /&gt;
|25&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 swizzle X&lt;br /&gt;
|2&lt;br /&gt;
|23&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 swizzle Y&lt;br /&gt;
|2&lt;br /&gt;
|21&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 swizzle Z&lt;br /&gt;
|2&lt;br /&gt;
|19&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 swizzle W&lt;br /&gt;
|2&lt;br /&gt;
|17&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 register&lt;br /&gt;
|2&lt;br /&gt;
|13&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Source 2 mux&lt;br /&gt;
|2&lt;br /&gt;
|11&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 negate&lt;br /&gt;
|2&lt;br /&gt;
|10&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 swizzle X&lt;br /&gt;
|2&lt;br /&gt;
|8&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 swizzle Y&lt;br /&gt;
|2&lt;br /&gt;
|6&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 swizzle Z&lt;br /&gt;
|2&lt;br /&gt;
|4&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 swizzle W&lt;br /&gt;
|2&lt;br /&gt;
|2&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 register (Hi)&lt;br /&gt;
|2&lt;br /&gt;
|0&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 register (Lo)&lt;br /&gt;
|3&lt;br /&gt;
|30&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Source 3 mux&lt;br /&gt;
|3&lt;br /&gt;
|28&lt;br /&gt;
|2&lt;br /&gt;
|-&lt;br /&gt;
|Destination MAC mask&lt;br /&gt;
|3&lt;br /&gt;
|24&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Destination temporary register&lt;br /&gt;
|3&lt;br /&gt;
|20&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Destination ILU mask&lt;br /&gt;
|3&lt;br /&gt;
|16&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Destination overall mask&lt;br /&gt;
|3&lt;br /&gt;
|12&lt;br /&gt;
|4&lt;br /&gt;
|-&lt;br /&gt;
|Destination select&lt;br /&gt;
|3&lt;br /&gt;
|11&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Destination output register&lt;br /&gt;
|3&lt;br /&gt;
|3&lt;br /&gt;
|8&lt;br /&gt;
|-&lt;br /&gt;
|Destination mux&lt;br /&gt;
|3&lt;br /&gt;
|2&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Relative constant addressing&lt;br /&gt;
|3&lt;br /&gt;
|1&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|Final instruction marker (EOF)&lt;br /&gt;
|3&lt;br /&gt;
|0&lt;br /&gt;
|1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Swizzle table&lt;br /&gt;
|-&lt;br /&gt;
!Value&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|X&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Y&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|Z&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|W&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Functional units ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Inverse Logic Unit (ILU) ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ILU Operations&lt;br /&gt;
|-&lt;br /&gt;
!Value&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|NOP&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|MOV&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|RCP&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|RCC&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|RSQ&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|EXP&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|LOG&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|LIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Multiply-Accumulate (MAC) ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+MAC Operations&lt;br /&gt;
|-&lt;br /&gt;
!Value&lt;br /&gt;
!Meaning&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|NOP&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|MOV&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|MUL&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|ADD&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|MAD&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|DP3&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|DPH&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|DP4&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|DST&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|MIN&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|MAX&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|SLT&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|SGE&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|ARL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Related links ==&lt;br /&gt;
&lt;br /&gt;
* nvidia resources&lt;br /&gt;
** [https://web.archive.org/web/20191214200729/https://www.nvidia.com/attach/6559 WhereIsThatVertexShaderInstruction.pdf] / [https://web.archive.org/web/20191214200738/https://www.nvidia.com/attach/6560 WhereIsThatVertexShaderInstruction.doc]&lt;br /&gt;
* [https://github.com/envytools/envytools/blob/master/nvhw/pgraph_celsius_xfrm.c Code which appears to implement bit-accurate emulation of some instructions]{{FIXME|reason=Unconfirmed, needs testing}}&lt;br /&gt;
&lt;br /&gt;
[[Category:NV2A]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=File:Vertex_processor.png&amp;diff=7421</id>
		<title>File:Vertex processor.png</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=File:Vertex_processor.png&amp;diff=7421"/>
				<updated>2025-12-19T21:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Overview of the vertex processor pipeline&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of the vertex processor pipeline&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=APU&amp;diff=7415</id>
		<title>APU</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=APU&amp;diff=7415"/>
				<updated>2025-07-22T20:47:32Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Dead link fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MCPX]] contains an APU (Audio Processing Unit).&lt;br /&gt;
&lt;br /&gt;
The APU consists of 3 main components for audio-processing:&lt;br /&gt;
&lt;br /&gt;
* VP: A fixed-function block, that generates 32 channel mono audio from voices; the audio is output to the GP MIXBUF.&lt;br /&gt;
* GP: A programmable DSP, it is intended for general-purpose audio processing (programmable audio effects for example).&lt;br /&gt;
* EP: A programmable DSP, it is intended for audio encoding (5.1 AC3 encoding for example).&lt;br /&gt;
&lt;br /&gt;
VP and GP are connected by the MIXBUF, but GP and EP are entirely independent, and no special-purpose memory area connects them.&lt;br /&gt;
Therefore, the  communication between the GP and EP typically happens through programmable DMA transfers (via FIFO or scratch memory).&lt;br /&gt;
&lt;br /&gt;
The GP and EP are based on the same DSP architecture, run at the same clockrate, and have the same functionality (the EP has less memory, and no direct access to the MIXBUF). So, theoretically, nothing prevents the GP from doing EP tasks or vice versa{{FIXME|reason=I have not seen counter-arguments}}.&lt;br /&gt;
&lt;br /&gt;
The APU does only audio-processing but no audio output. Hence, one of the DSPs typically uses programmable DMA to transfer the finished audio to system memory, where it can be read by other components (such as AC97).&lt;br /&gt;
&lt;br /&gt;
All audio processing by the APU is typically done in 24bit PCM at 48000Hz.&lt;br /&gt;
An APU audio frame is 32 samples long. Therefore, there are 1500 frames per second, with a duration of 0.{{overline|6}}ms each.&lt;br /&gt;
The MIXBUF holds 1024 samples (32 channels * 32 samples/channel).&lt;br /&gt;
&lt;br /&gt;
=== Glossary ===&lt;br /&gt;
&lt;br /&gt;
* PRD = Physical Resource Descriptor (Same thing as SGE?!)&lt;br /&gt;
* SGE = Scatter Gather Entry&lt;br /&gt;
* SSL = Stream Segment List&lt;br /&gt;
&lt;br /&gt;
== Frontend Engine (FE) ==&lt;br /&gt;
&lt;br /&gt;
== Voice Processor (VP) ==&lt;br /&gt;
&lt;br /&gt;
A powerful voice processor. There can be up to 256 voices [http://www.gamasutra.com/blogs/BrianSchmidt/20111117/90625/Designing_the_Boot_Sound_for_the_Original_Xbox.php][https://web.archive.org/web/20010410003338/http://www.nvnews.net/previews/mcpx/mcpx.shtml] and 64[http://www.nvidia.com/object/IO_20010530_6177.html] of those can be 3D.&lt;br /&gt;
&lt;br /&gt;
Per-voice settings:&lt;br /&gt;
* Input type (8bit, 16bit, 24bit, ADPCM)&lt;br /&gt;
* 8 target bins, each with controllable volume for this voice&lt;br /&gt;
* [[wikipedia:Head-related transfer function|Head-related transfer function]] (HRTF)&lt;br /&gt;
* [[wikipedia:Low-frequency oscillation|Low-frequency oscillation]] (LFO)&lt;br /&gt;
* Pitch (~187.5 Hz to ~12285920.7 Hz)&lt;br /&gt;
* Optionally one of the following filters modes:&lt;br /&gt;
** For 2D Mono:&lt;br /&gt;
*** DLS2 Low-Pass&lt;br /&gt;
*** Parametric Equalizer&lt;br /&gt;
*** DLS2 Low-Pass + Parametric Equalizer&lt;br /&gt;
** For 2D Stereo:&lt;br /&gt;
*** DLS2 Low-Pass&lt;br /&gt;
*** Parametric Equalizer&lt;br /&gt;
** For 3D:&lt;br /&gt;
*** DLS2 Low-Pass + I3DL2 Reverb&lt;br /&gt;
*** Parametric Equalizer + I3DL2 Reverb&lt;br /&gt;
*** I3DL2 Reverb&lt;br /&gt;
* 2 Envelopes (DAHDSR: Delay, Attack, Hold, Decay, Sustain, Release)&lt;br /&gt;
** Amplitude Envelope&lt;br /&gt;
** Pitch / DLS2 Low-Pass Cutoff Envelope&lt;br /&gt;
* Tracking of certain parameters&lt;br /&gt;
** Volume&lt;br /&gt;
** LFO parameters&lt;br /&gt;
** DLS2 Low-Pass parameters?{{FIXME|reason=Not 100% sure, also not sure if this also works for the other filters}}&lt;br /&gt;
&lt;br /&gt;
There are 32 bins which these voices will be mixed into.&lt;br /&gt;
&lt;br /&gt;
=== Related APU memory ===&lt;br /&gt;
&lt;br /&gt;
* VPV = VP Voices&lt;br /&gt;
* VPHT = VP HRTF Target&lt;br /&gt;
* VPHC = VP HRTF Current&lt;br /&gt;
* VPSGE = VP SGEs&lt;br /&gt;
* VPSSL = VP SSLs&lt;br /&gt;
&lt;br /&gt;
=== Voice lists ===&lt;br /&gt;
&lt;br /&gt;
The voices are kept in a single-linked list. There are 3 voice lists:&lt;br /&gt;
&lt;br /&gt;
* 2D&lt;br /&gt;
* 3D&lt;br /&gt;
* MP (Multipass?)&lt;br /&gt;
&lt;br /&gt;
=== Voice structure ===&lt;br /&gt;
&lt;br /&gt;
This is 0x80 bytes&lt;br /&gt;
&lt;br /&gt;
==== Pitch calculation ====&lt;br /&gt;
&lt;br /&gt;
The 16 bit signed pitch value (''p'') can be converted to and from a unsigned frequency in Hz (''f'') using the following formulas:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
p = 4096 * log2(f / 48000)&lt;br /&gt;
f = pow2(p / 4096) * 48000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LFO ===&lt;br /&gt;
&lt;br /&gt;
=== Tracking ===&lt;br /&gt;
&lt;br /&gt;
Some of the parameters of the VP can be controlled by setting timing parameters.&lt;br /&gt;
New values will then be slowly be adapted over time.&lt;br /&gt;
{{FIXME}}&lt;br /&gt;
&lt;br /&gt;
=== Envelopes ===&lt;br /&gt;
&lt;br /&gt;
There are seperate segments of the envelopes, 2 registers (CUR and COUNT) per envelope keeps track of this and control the envelopes level (LVL):&lt;br /&gt;
&lt;br /&gt;
* 0: Off = Envelope is not used&lt;br /&gt;
* 1: Delay = Time where envelope stays at 0% until attack&lt;br /&gt;
** COUNT register counts down from DELAYTIME.&lt;br /&gt;
* 2: Attack = Rate at which the envelope goes from 0 to 100%&lt;br /&gt;
** COUNT register counts up to ATTACKRATE.&lt;br /&gt;
** LVL seems to be linear.&lt;br /&gt;
* 3: Hold = Time the envelope stays at 100%&lt;br /&gt;
** COUNT register counts down from HOLDTIME.&lt;br /&gt;
* 4: Decay = Rate at which the envelope goes from 100% to 0%&lt;br /&gt;
** COUNT register counts down from DECAYRATE.&lt;br /&gt;
** The LVL is not linear, it's a curve which drops steep at first and then slowly becomes level[https://docs.google.com/spreadsheets/d/1fNsfkvBfnlRQ9XplNnTgmh8jBaWJ56bvh2AVWn8B_k0/edit?usp=sharing]&lt;br /&gt;
** The best approximation I could come up with so far is: &amp;lt;code&amp;gt;255*pow(0.99988799,(DECAYRATE*16-COUNT)*4096/DECAYRATE)&amp;lt;/code&amp;gt;.&lt;br /&gt;
** When the output level (not LVL!) reaches the sustain level the decay section is over (In my example above, this happens when the output level is less than 0.2 away from the sustain level; so if sustain is 0, the voice would switch to the sustain segment when a value below 0.2 is reached)&lt;br /&gt;
** Writes to the LVL register are ignored&lt;br /&gt;
** Writes to count (any value?) impact the LVL&lt;br /&gt;
** If the COUNT is larger than the decayrate the envelope will switch to the sustain state&lt;br /&gt;
** If the COUNT results in a smaller output level than the sustainlevel the envelope will switch to the sustain state&lt;br /&gt;
* 5: Sustain = Level at which the envelope stays while the voice is being played&lt;br /&gt;
** COUNT register writes are ignored, it will stay at 0&lt;br /&gt;
** LVL register writes are ignored, it will stay at the current sustain level&lt;br /&gt;
* 6: Release = Rate at which the envelope goes from current level to 0%&lt;br /&gt;
** Can start at any time{{FIXME|reason=the voice state PERSIST has to do with this. Voice is released using NV1BA0_PIO_VOICE_RELEASE ?}}&lt;br /&gt;
** COUNT register starts at RELEASERATE, regardless of the current sustain level&lt;br /&gt;
** COUNT register counts down{{FIXME|reason=What happens when it reaches 0? DirectSound seems to turn off voice - or is the hw doing that?}}&lt;br /&gt;
** LVL is not updated during this phase (it will keep it's previous value)&lt;br /&gt;
** Writes to LVL have an impact on the output volume&lt;br /&gt;
** If the COUNT register is higher than the releaserate, the output will be silent and LVL will drop to zero&lt;br /&gt;
** The actual output level is probably determined like: &amp;lt;code&amp;gt;int(COUNT * LVL / (RELEASERATE * 16))&amp;lt;/code&amp;gt;{{FIXME|reason=Test..}}{{FIXME|reason=Unknown output shape}}&lt;br /&gt;
** COUNT will keep counting until 0 even after the output level has hit 0&lt;br /&gt;
* 7: Force Release = Unknown still{{FIXME}}&lt;br /&gt;
** Seems to happen during invalid conditions? Happened to me when modifying ebo during playback{{citation needed|reason=Need to find out why this happens}}&lt;br /&gt;
** LVL and COUNT seem to be ignored during this, but writes go through? Output level seems to stay at 100% ? (I only got repeating 32 samples during this and the whole Xbox crashed shortly after)&lt;br /&gt;
&lt;br /&gt;
All durations are described using unsigned 12-bit times/rates. The level of sustain is stored unsigned in 8-bit.&lt;br /&gt;
The COUNT register is stored in unsigned 16-bit.&lt;br /&gt;
&lt;br /&gt;
The 12-bit times/rates are multiplied by 16 when loading them into the 16-bit COUNT register.&lt;br /&gt;
The COUNT register counts at 1500 Hz[https://docs.google.com/spreadsheets/d/11jxeJ9aey_TVkyiMmmd6SKuow4j4GR9E9fRZ6HXc2WU/edit#gid=396423867].&lt;br /&gt;
A unit in the COUNT register is therefore 0.{{overline|6}} ms.&lt;br /&gt;
&lt;br /&gt;
The 12-bit values of the envelope sections are given in units of 0.{{overline|6}} ms * 16 = 10.{{overline|6}} ms.&lt;br /&gt;
This can also be written as 512 / (48000 Hz) = 10.{{overline|6}} ms.&lt;br /&gt;
The maximum length of an envelope section is therefore 4095 * 10.{{overline|6}} ms = 43.68 seconds.&lt;br /&gt;
&lt;br /&gt;
As the envelope counter runs at a fixed clock speed, it is independent of the voice pitch and duration.&lt;br /&gt;
&lt;br /&gt;
If the Amplitude Envelope COUNT hits 0 during release, DirectSound{{FIXME|reason=Is this a hardware thing? I guess it makes sense..}} already deletes the voice, regardless of the Filter Envelope.&lt;br /&gt;
&lt;br /&gt;
The sustain level can be changed during playback.&lt;br /&gt;
Also the attack register can be changed to a lower value while the counter is counting up, however, if the COUNTER does not compare equal to the set value, it will keep counting, even after an overflow. It will not leave the attack phase and keep counting until it sees value COUNTER / 16 in the attack register. If the attack register is set to a higher value while counting, the volume is going down again.&lt;br /&gt;
Also, if the attack register value is zero while counting, there won't be any audio output during the attack phase.&lt;br /&gt;
This indicates that the COUNT register is used to calculate the actual value from the current rates.&lt;br /&gt;
&lt;br /&gt;
The initial state of each envelope can be controlled by the NV1BA0_PIO_VOICE_ON command. It can either be: DISABLE, DELAY, ATTACK or HOLD.&lt;br /&gt;
&lt;br /&gt;
==== Amplitude Envelope ====&lt;br /&gt;
&lt;br /&gt;
The amplitude envelope is mixed with the volume during mixing. The volume registers are not modified.&lt;br /&gt;
{{FIXME|reason=Is it multiplied on? Is it added? subtracted?}}&lt;br /&gt;
It is not yet known how many bits of the envelope state are used.&lt;br /&gt;
&lt;br /&gt;
==== Filter Envelope ====&lt;br /&gt;
&lt;br /&gt;
{{FIXME|reason=Research}}&lt;br /&gt;
&lt;br /&gt;
The pitch scale is multiplied with the current envelope state and added to the current pitch during mixing. The pitch registers are not modified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
f = 2^((signed_pitch+signed_pitch_mod*32*envelope_state_float)/4096)*48000 # envelope_state_float: [0, 1]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not yet known how many bits of the envelope state are used.&lt;br /&gt;
&lt;br /&gt;
=== Filters ===&lt;br /&gt;
&lt;br /&gt;
==== DLS2 ====&lt;br /&gt;
&lt;br /&gt;
Formulas from DirectSound&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
FreqToHardwareCoeff(frequency): # Input in Hz&lt;br /&gt;
  if (frequency &amp;lt; 30) { return 0x8000 }&lt;br /&gt;
  if (frequency &amp;gt; 8000) { return 0x0000 }&lt;br /&gt;
  FC = 2 * sin(PI * frequency / 48000)&lt;br /&gt;
  octaves = 4096 * log2(FC)&lt;br /&gt;
  return octaves &amp;amp; 0xFFFF&lt;br /&gt;
hardware_coefficient[0] = FreqToHardwareCoeff(frequency)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dBToHardwareCoeff(resonance): # Input in dB&lt;br /&gt;
  resonance = min(resonance, 22.5)&lt;br /&gt;
  Q = pow(10, -0.05 * resonance)&lt;br /&gt;
  return min(0xFFFF)&lt;br /&gt;
hardware_coefficient[1] = dBToHardwareCoeff(resonance_in_db)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stuff from the DLS2 spec:{{FIXME|reason=Untested / unconfirmed. Most info comes from Merry of Citra}}&lt;br /&gt;
&lt;br /&gt;
There are 2 coeffiecents per channel:&lt;br /&gt;
&lt;br /&gt;
* F_c (Cutoff frequency)&lt;br /&gt;
* resonance&lt;br /&gt;
&lt;br /&gt;
From Page 8 of &amp;quot;DLS 2.2 Version 1.0&amp;quot;[https://www.midi.org/specifications/item/dls-level-2-specification]&lt;br /&gt;
&lt;br /&gt;
* b_1 = -2 * r * cos(θ)&lt;br /&gt;
* b_2 = r * r&lt;br /&gt;
* K =  g * (1 + b_1 + b_2)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
y[i] = K * x[i] - b_1 * y[i-1] - b_2 * y[i-2]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where y[i-2] and y[i-1] are the last two frames of the output and x[i] the current input.&lt;br /&gt;
&lt;br /&gt;
=== Operation ===&lt;br /&gt;
&lt;br /&gt;
Voices are stored in VPV.&lt;br /&gt;
Input data (from the CPU) is loaded using VPSGE.&lt;br /&gt;
Voices are then processed and written to the GP MIXBUF.&lt;br /&gt;
&lt;br /&gt;
== Global Processor (GP) ==&lt;br /&gt;
&lt;br /&gt;
The GP is a DSP to do programmable audio processing on the voice bins.&lt;br /&gt;
&lt;br /&gt;
The GP DSP seems to run at 160 MHz.&lt;br /&gt;
&lt;br /&gt;
=== MIXBUF ===&lt;br /&gt;
&lt;br /&gt;
The MIXBUF is a 0x400 word (24-Bit, stored as 32-Bit) section. It is split into 32 * 0x20 words.&lt;br /&gt;
Each 0x20 word block represents one of the 32 voice bins of the VP.&lt;br /&gt;
The 0x20 words are 24-Bit PCM mono samples to be played back at 48kHz. The duration of each frame is hence 0.{{overline|6}}ms.&lt;br /&gt;
&lt;br /&gt;
=== Memory map ===&lt;br /&gt;
&lt;br /&gt;
=== Related APU memory ===&lt;br /&gt;
&lt;br /&gt;
* GPS = GP Scratch (?)&lt;br /&gt;
* GPF = GP FIFO&lt;br /&gt;
&lt;br /&gt;
== Encode Processor (EP) ==&lt;br /&gt;
&lt;br /&gt;
The EP is a DSP to encode the audio signal.&lt;br /&gt;
&lt;br /&gt;
=== Memory map ===&lt;br /&gt;
&lt;br /&gt;
=== Related APU memory ===&lt;br /&gt;
&lt;br /&gt;
* EPS = EP Scratch (?)&lt;br /&gt;
* EPF = EP FIFO&lt;br /&gt;
&lt;br /&gt;
== Usage in DirectSound ==&lt;br /&gt;
&lt;br /&gt;
''This topic deserves it's own article{{FIXME}}''&lt;br /&gt;
&lt;br /&gt;
The bins are used {{FIXME|reason=How?}}&lt;br /&gt;
DirectSound allows to load custom GP DSP code for a filter / effects chain.&lt;br /&gt;
{{FIXME|reaon=Will GP DSP automatically download code or is code pushed to it?}}&lt;br /&gt;
The GP waits for the frame interrupt which signals that MIXBUF data is available. It then goes through the filter chain.&lt;br /&gt;
At the end of the chain, the GP DSP will verify that the execution didn't take longer than the frame duration.&lt;br /&gt;
&lt;br /&gt;
The GP will then issue 6 DMA requests to output the processed frames to a ringbuffer in scratch space.&lt;br /&gt;
The frameformat will be the same format as the GP MIXBUF format (also 0x20 words per channel).&lt;br /&gt;
Each ringbuffer is 0x200 words and therefore holds the last 16 frames.&lt;br /&gt;
Therefore, the ringbuffer region is 6 * 0x800 Bytes = 0x3000 Bytes in physical memory.&lt;br /&gt;
&lt;br /&gt;
The order of the channels in the ringbuffer is (also DMA order):&lt;br /&gt;
&lt;br /&gt;
* 0: Front Left&lt;br /&gt;
* 1: Center{{citation needed}}&lt;br /&gt;
* 2: Front Right&lt;br /&gt;
* 3: Rear Left{{citation needed}}&lt;br /&gt;
* 4: Rear Right{{citation needed}}&lt;br /&gt;
* 5: [[Wikipedia:Low-frequency effects|Low-frequency effects]] (LFE){{citation needed}}&lt;br /&gt;
&lt;br /&gt;
The EP maps the same data to its own scratch space. It is assumed that it will DMA this region to its own internal memory.&lt;br /&gt;
The EP then AC3 encodes the audio data{{citation needed}} and writes it to the EP FIFO memory{{FIXME|How does this happen? DMA?}}.&lt;br /&gt;
{{FIXME|reason=When does this happen and what happens to stereo? headphones? mono?}}&lt;br /&gt;
The data is then send to the ACI AC97 using EP FIFO channels 0 (PCM) and 1 (SPDIF){{citation needed}}.&lt;br /&gt;
The EP code is loaded by DirectSound. The EP is not programmable using DirectSound APIs.&lt;br /&gt;
&lt;br /&gt;
=== Modifications for Boot Animation ===&lt;br /&gt;
&lt;br /&gt;
During the [[Boot Animation]] a different version of DirectSound is used.&lt;br /&gt;
The EP is disabled in this case.&lt;br /&gt;
The data is send to the ACI AC97 using GP FIFO channel 0 (PCM).&lt;br /&gt;
There is no AC3 / SPDIF during the boot animation[https://web.archive.org/web/20190123092902/http://www.gamasutra.com/blogs/BrianSchmidt/20111117/90625/Designing_the_Boot_Sound_for_the_Original_Xbox.php]{{citation needed|reason=Link to brians gamasutra stuff}}.&lt;br /&gt;
&lt;br /&gt;
== Related notes ==&lt;br /&gt;
&lt;br /&gt;
* [[ACI]]&lt;br /&gt;
* [[DSP]]&lt;br /&gt;
* [[Xbox ADPCM]]&lt;br /&gt;
* [http://www.nvidia.com/object/apu.html Information at NVIDIAs website]&lt;br /&gt;
* [http://www.nvidia.com/attach/9004 &amp;quot;Technical Brief: NVIDIA nForce MCP Audio Processing Unit&amp;quot; by NVIDIA]&lt;br /&gt;
* [https://github.com/JayFoxRox/xbox-tools/blob/master/python-scripts/ Scripts to inspect APU registers and voice buffers]&lt;br /&gt;
* Filter information&lt;br /&gt;
** [https://de.mathworks.com/help/audio/examples/parametric-equalizer-design.html Something about Parametric Equalizers]&lt;br /&gt;
** [https://github.com/kcat/openal-soft/blob/master/Alc/effects/reverb.c Mentions I3DL2 Reverb]&lt;br /&gt;
** [https://www.midi.org/specifications/item/dls-level-2-specification DLS2 low-pass filter with resonance and dynamic filter cutoff frequency]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:APU]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=CPU&amp;diff=7347</id>
		<title>CPU</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=CPU&amp;diff=7347"/>
				<updated>2024-01-02T00:37:19Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Add links to the Intel Technology Journal talking about the P3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CPU in the Xbox was a custom Pentium III running at 733MHz. The 'custom' part of this was that the Pentium III in the Xbox only had a 128KB L2 cache instead of the usual 256KB. This allowed Microsoft to buy them at a bit of a discount and Intel to shift a few more CPUs{{citation needed}}.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.intel.com/content/dam/support/us/en/documents/processors/mobile/celeron/sb/28365403.pdf Mobile Intel® Celeron® Processor (0.18μ) in BGA2 and Micro-PGA2 Packages] This datasheet is for the mobile version Coppermine with 256kB L2 cache. It does not contain the Xbox Coppermine-128 with 128kB L2 cache at 733MHz (S-Spec SL5SN). No such datasheet exists. Both differences are pin compatible.&lt;br /&gt;
* [https://www.intel.com/content/dam/support/us/en/documents/processors/mobile/celeron/sb/24542154.pdf Mobile Intel® Celeron® Processor (0.18μ and 0.13μ) Specification Update] This document should contain the errata for the Xbox CPU.&lt;br /&gt;
* [https://en.wikipedia.org/wiki/List_of_Intel_Pentium_III_microprocessors#&amp;amp;quot;Coppermine&amp;amp;quot;_(180_nm) Wikipedia - List of Intel Pentium III microprocessors: &amp;quot;Coppermine&amp;quot; (180 nm)]&lt;br /&gt;
* [https://www.google.com/patents/US20050282621 CPU upgrading adapter for a Microsoft XboxTM game machine] US Patent Application 20050282621 by Friendtech, filed 2003-08-21.&lt;br /&gt;
&lt;br /&gt;
Articles from the Intel Technology Journal about the Pentium III architecture:&lt;br /&gt;
* [https://web.archive.org/web/20000815203117/http://developer.intel.com/technology/itj/q21999.htm Intel Technology Journal Q2 1999]&lt;br /&gt;
* [https://web.archive.org/web/20001006215908/http://developer.intel.com/technology/itj/q21999/pdf/simd_ext.pdf The Internet Streaming SIMD Extensions]&lt;br /&gt;
* [https://web.archive.org/web/20031104144423/http://developer.intel.com/technology/itj/q21999/pdf/impliment.pdf Pentium III Processor Implementation Tradeoffs]&lt;br /&gt;
* [https://web.archive.org/web/20001006220034/http://developer.intel.com/technology/itj/q21999/pdf/serial_number.pdf Pentium III Processor Serial Number Feature and Applications]&lt;br /&gt;
* [https://web.archive.org/web/20001006220114/http://developer.intel.com/technology/itj/q21999/pdf/3d_stack.pdf Architecture of a 3D Software Stack for Peak Pentium III Processor Performance]&lt;br /&gt;
* [https://web.archive.org/web/20001006220154/http://developer.intel.com/technology/itj/q21999/pdf/apps_simd.pdf Applications Tuning for Streaming SIMD Extensions]&lt;br /&gt;
* [https://web.archive.org/web/20030331192409/http://developer.intel.com/technology/itj/Q21999/pdf/vtune.pdf Programming Methods for the Pentium® III Processor’s Streaming SIMD Extensions Using the VTune Performance Enhancement Environment]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Resources&amp;diff=7338</id>
		<title>Resources</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Resources&amp;diff=7338"/>
				<updated>2023-10-25T14:06:04Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Fix dead links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Xbox Post-Mortems by developers ==&lt;br /&gt;
&lt;br /&gt;
=== Xbox Launch ===&lt;br /&gt;
&lt;br /&gt;
* GDC2002: [https://www.powershow.com/download/6f1ff7-NmE2O/Xbox_Launch_Lessons_Learned_powerpoint_ppt_presentation Xbox Launch: Lessons Learned] ([https://www.gdcvault.com/play/1022522/Xbox-Launch-Lessons Audio])&lt;br /&gt;
&lt;br /&gt;
=== Post processing ===&lt;br /&gt;
&lt;br /&gt;
* CEDEC2002: [https://web.archive.org/web/20031212044938/http://www.daionet.gr.jp/~masa/column/2002-09-22.html DOUBLE-S.T.E.A.L techniques] ''(Japanese)''&lt;br /&gt;
* GDC2003: [https://web.archive.org/web/20031212140633/http://www.daionet.gr.jp/~masa/column/2003-03-21.html Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)] ''(English)''&lt;br /&gt;
&lt;br /&gt;
=== HDR rendering ===&lt;br /&gt;
&lt;br /&gt;
* GDC2004: [https://web.archive.org/web/20060404103630/http://www.daionet.gr.jp/~masa/column/2004-04-04.html Practical Implementation of High Dynamic Range Rendering]&lt;br /&gt;
&lt;br /&gt;
=== Deferred Shading ===&lt;br /&gt;
&lt;br /&gt;
* https://web.archive.org/web/20201024153643/https://sites.google.com/site/richgel99/index#TOC-Shrek-Xbox-and-Deferred-Shading&lt;br /&gt;
* https://web.archive.org/web/20201024153427/https://sites.google.com/site/richgel99/home&lt;br /&gt;
* https://web.archive.org/web/20201123202956/https://sites.google.com/site/richgel99/home/xbox-1-g-buffer-attribute-packing-pixel-shader&lt;br /&gt;
* https://web.archive.org/web/20171008031141/http://www.tenacioussoftware.com/gdc_2004_deferred_shading.ppt&lt;br /&gt;
&lt;br /&gt;
== Random resources about Xbox hacking ==&lt;br /&gt;
* [https://events.ccc.de/congress/2005/fahrplan/attachments/591-paper_xbox.pdf Michael Steils Xbox Presentation from C3 in 2005]&lt;br /&gt;
* https://media.ccc.de/v/19C3-399-xbox-linux&lt;br /&gt;
* https://media.ccc.de/v/22C3-559-en-xbox_hacking&lt;br /&gt;
* https://www.youtube.com/watch?v=6fOjGLCctEY&lt;br /&gt;
* [http://www.bunniestudios.com/bunnie/proj/anatak/xboxmod.html Bunnies original Xbox page]&lt;br /&gt;
* [https://www.nostarch.com/xboxfree Bunnies &amp;quot;Hacking the Xbox&amp;quot; e-book for free]&lt;br /&gt;
* [http://web.archive.org/web/20010417064218/ddj.com/articles/2000/0008/0008a/0008a.htm?topic=graphics Article about Xbox Graphics (before release) from Dr. Dobbs]&lt;br /&gt;
* [http://www.anandtech.com/show/853 Technical article about the Xbox by AnandTech]&lt;br /&gt;
* [https://media.defcon.org/DEF%20CON%2030/DEF%20CON%2030%20video%20and%20slides/DEF%20CON%2030%20-%20Tristan%20Miller%20-%20Reversing%20the%20Original%20Xbox%20Live%20Protocols.mp4 Reversing the Original Xbox Live Protocols] presented by [[User:monocasa]] at DEF CON 30 (2022)&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
* [https://www.youtube.com/watch?v=rUODlNffWmU 3 Xbox Bosses Share Secrets of the Console's Past (Video)]&lt;br /&gt;
* [https://www.youtube.com/watch?v=iWQb7LGH71s Xbox Assembly Line Tour (Video)]&lt;br /&gt;
* [https://www.youtube.com/watch?v=_gOoI57q72M XBox Oral History Panel with Nick Baker, Todd Holmdahl, and Albert Penello (Video)]&lt;br /&gt;
* [https://www.youtube.com/watch?v=2VCb-y7MC5U?t=1248 Behind the Code - Interview with Nick Baker (Video) intresting xbox part starts 20:48]&lt;br /&gt;
&lt;br /&gt;
== Background knowledge about related topics ==&lt;br /&gt;
&lt;br /&gt;
=== Graphics programming ===&lt;br /&gt;
&lt;br /&gt;
* Meltdown 2001 (Microsoft Game development conference): [https://web.archive.org/web/20060203201117/https://www.microsoft.com/mscorp/corpevents/meltdown2001/presentations.asp Presentation slides]&lt;br /&gt;
* GDC2001: [http://developer.download.nvidia.com/assets/gamedev/docs/GDC2K1_DX8_Pixel_Shaders.pdf DirectX8 Pixel Shaders]&lt;br /&gt;
* [https://web.archive.org/web/20200130052343/http://download.nvidia.com/developer/Papers/ Papers by nvidia from Xbox era]&lt;br /&gt;
* [https://web.archive.org/web/20191214222749/http://download.nvidia.com/developer/presentations/ Presentation slides by nvidia from Xbox era]&lt;br /&gt;
* [https://web.archive.org/web/20200130053050/http://download.nvidia.com/developer/movies/ Presentation recordings by nvidia from Xbox era]&lt;br /&gt;
* [https://web.archive.org/web/20191214215356/http://download.nvidia.com/developer/NVTextureSuite/ Texturing tools by nvidia from Xbox era]&lt;br /&gt;
* [https://web.archive.org/web/20191214215706/http://download.nvidia.com/developer/Tools/ Tools by nvidia from Xbox era]&lt;br /&gt;
* https://web.archive.org/web/20191214215240/http://download.nvidia.com/developer/Third_Party/&lt;br /&gt;
* http://iquilezles.org/www/index.htm&lt;br /&gt;
* https://web.archive.org/web/20150408045127/http://freespace.virgin.net/hugo.elias/&lt;br /&gt;
* http://www.mvps.org/directx/indexes/&lt;br /&gt;
* https://www.gdcvault.com/play/247/CRYSIS-Next-Gen ''(Contains some parts which are also applicable to original Xbox)''&lt;br /&gt;
* [https://www.valvesoftware.com/en/publications Publications by Valve Software]&lt;br /&gt;
* http://graphics.uni-konstanz.de/publikationen/Luft2006ImageEnhancementUnsharp/Luft2006ImageEnhancementUnsharp.pdf&lt;br /&gt;
* [https://web.archive.org/web/20090518092325/http://www.daionet.gr.jp:80/~masa/column/index.html Masa's Column (DOUBLE-S.T.E.A.L / Wrecked developer)]&lt;br /&gt;
* [https://fgiesen.wordpress.com/ Blog by ryg]&lt;br /&gt;
* [http://filmicworlds.com/blog/ Filmic Worlds]&lt;br /&gt;
* [https://web.archive.org/web/20191208134031/https://gpuopen.com/archive/gamescgi/cubemapgen/ AMD CubeMapGen tool for mipmapping cubemaps]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=7289</id>
		<title>Xbe</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=7289"/>
				<updated>2022-07-30T17:52:20Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: &amp;quot;Standard Windows format&amp;quot; is actually a UNIX timestamp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:XBE}}&lt;br /&gt;
XBE files (XBox Executable) are the main files that are executed in the Xbox System. In official games, these files are created by game developers, and then signed by Microsoft. &lt;br /&gt;
&lt;br /&gt;
The file structure is adapted from Windows PE files. It is very similar, however it has important changes for the Xbox. The file is composed of an image header, a certificate, a collection of section headers, a collection of library versions, thread local storage data, a Microsoft bitmap, and the sections that contain the code and resources.&lt;br /&gt;
&lt;br /&gt;
= Image Header = &lt;br /&gt;
&lt;br /&gt;
The image header contains the information that describes where the other parts of the executable are located within the file, and how the executable should be treated and loaded. It has the following layout (all fields are little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Magic Number&lt;br /&gt;
| This field must always equal 0x48454258 (&amp;quot;XBEH&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0100&lt;br /&gt;
| Digital Signature&lt;br /&gt;
| 256 Bytes. This is where a game is signed. Only on officially signed games is this field worthwhile.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0104&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Base Address&lt;br /&gt;
| Address at which to load this .XBE. Typically this will be 0x00010000.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0108&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Headers&lt;br /&gt;
| Number of bytes that should be reserved for headers.&lt;br /&gt;
|-&lt;br /&gt;
! 0x010C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image&lt;br /&gt;
| Number of bytes that should be reserved for this image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0110&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image Header&lt;br /&gt;
| Number of bytes that should be reserved for the image header. The header size varies by XDK version, but is at least 0x178.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0114&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TimeDate&lt;br /&gt;
| Time and Date when this image was created. UNIX timestamp format.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0118&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Certificate Address&lt;br /&gt;
| Address to a [[#Certificate|Certificate]] structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x011C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Sections&lt;br /&gt;
| Number of sections contained in this .XBE.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0120&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Section Headers Address&lt;br /&gt;
| Address to an array of SectionHeader structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0124&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Initialization Flags&lt;br /&gt;
| Various flags for this .XBE file. Known flags are:&lt;br /&gt;
&lt;br /&gt;
  MountUtilityDrive  = 0x00000001&lt;br /&gt;
  FormatUtilityDrive = 0x00000002&lt;br /&gt;
  Limit64Megabytes   = 0x00000004&lt;br /&gt;
  DontSetupHarddisk  = 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
! 0x0128&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Entry Point&lt;br /&gt;
| Address to the Image entry point, after the .XBE is loaded into memory. This is where execution starts.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Beta = 0xE682F45B, Debug = 0x94859D4B, Retail = 0xA8FC57AB&lt;br /&gt;
&lt;br /&gt;
To encode an entry point, you simply XOR the real entry point with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode an entry point, you XOR with the debug key, then check if it is a valid entry point. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Kernel Image Thunk Address member of this header must also be encoded as described later in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x012C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TLS Address&lt;br /&gt;
| Address to a [[#TLS Table|TLS]] (Thread Local Storage) structure.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0130&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Stack Size&lt;br /&gt;
| Default stack size. As the Xbox does not allow for stacks to grow, this needs to be copied from the SizeOfStackReserve PE field, not SizeOfStackCommit!&lt;br /&gt;
|-&lt;br /&gt;
! 0x0134&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Reserve&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0138&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Commit&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x013C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Base Address&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0140&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Size of Image&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0144&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Checksum&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0148&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE TimeDate&lt;br /&gt;
| Copied from the PE file this .XBE was created from (UNIX timestamp format).&lt;br /&gt;
|-&lt;br /&gt;
! 0x014C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug PathName Address&lt;br /&gt;
| Address to the debug pathname (i.e. &amp;quot;D:\Nightlybuilds\011026.0\code\build\xbox\Release\simpsons.exe&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
! 0x0150&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug FileName Address&lt;br /&gt;
| Address to the debug filename (i.e. &amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0154&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address to the UTF-16 debug filename (i.e. L&amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
| UTF-16 Debug FileName Address&lt;br /&gt;
|-&lt;br /&gt;
! 0x0158&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Image Thunk Address&lt;br /&gt;
| Address to the Kernel Image Thunk Table, after the .XBE is loaded into memory. This is how .XBE files import kernel functions and data.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Beta = 0x46437DCD, Debug = 0xEFB1F152, Retail = 0x5B6D40B6&lt;br /&gt;
&lt;br /&gt;
To encode a kernel thunk address, you simply XOR the real address with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode a kernel thunk address, you XOR with the debug key, then check if it is a valid address. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
The Kernel Thunk Table itself is simply an array of pointers to Kernel imports. There are 366 possible imports, and the table is terminated with a zero dword (0x00000000). Typically the values in this table can be generated with the following formula:&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = ImportThunk + 0x80000000;&lt;br /&gt;
&lt;br /&gt;
so, for example, the import PsCreateSystemThreadEx, which has a thunk value of 255 (0xFF) would be...&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = 0xFF + 0x80000000; // (0x800000FF)&lt;br /&gt;
&lt;br /&gt;
When the .XBE is loaded by the OS (or the CXBX Emulator), all kernel imports are replaced by a valid function or data type address. In the case of CXBX, the import table entry at which (KernelThunkTable[v] &amp;amp; 0x1FF == 0xFF) will be replaced by &amp;amp;cxbx_PsCreateSystemThreadEx (which is a wrapper function).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Entry Point member of this header must also be encoded as described earlier in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x015C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Non-Kernel Import Directory Address&lt;br /&gt;
| Address to the Non-Kernel Import Directory. It is typically safe to set this to zero.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0160&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Library Versions&lt;br /&gt;
| Number of Library Versions pointed to by Library Versions Address.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0164&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Library Versions Address&lt;br /&gt;
| Address to an array of LibraryVersion structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0168&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x016C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| XAPI Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0170&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Address&lt;br /&gt;
| Address to the Logo Bitmap (Typically a &amp;quot;Microsoft&amp;quot; logo). The format of this image is described here. This field can be set to zero, meaning there is no bitmap present.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0174&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Size&lt;br /&gt;
| Size (in bytes) of the Logo Bitmap data. The format of this image is described here.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0178&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Unknown1&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5028.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0180&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Unknown2&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5455.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LibraryVersion Table ==&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Library Name&lt;br /&gt;
| 8-byte ASCII-name of this library. (i.e. &amp;quot;XAPILIB&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Major Version&lt;br /&gt;
| Major version for this library (2-byte WORD). &lt;br /&gt;
|-&lt;br /&gt;
! 0x000A&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Minor Version &lt;br /&gt;
| Minor version for this library (2-byte WORD). &lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Build Version&lt;br /&gt;
| Build version for this library (2-byte WORD).&lt;br /&gt;
|-&lt;br /&gt;
! 0x000E&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Library Flags&lt;br /&gt;
| Various flags for this library. The fields are:&lt;br /&gt;
&lt;br /&gt;
  QFEVersion  = 0x1FFF (13-Bit Mask)&lt;br /&gt;
  Approved    = 0x6000 (02-Bit Mask)&lt;br /&gt;
  Debug Build = 0x8000 (01-Bit Mask)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TLS Table ==&lt;br /&gt;
&lt;br /&gt;
The TLS Table contains all the information needed by the XBE to properly set up thread-local storage. It is structurally identical to the TLS Directory found in PE32 files&amp;lt;ref&amp;gt;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-tls-section&amp;lt;/ref&amp;gt;, and can be directly copied from there. If the XBE does not use any thread-local storage, this table may be omitted, and the respective field in the image header set to zero.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data Start&lt;br /&gt;
| Absolute (i.e. not an RVA) address of start of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data End&lt;br /&gt;
| Absolute (i.e. not an RVA) address of end of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Index&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the TLS Index variable.&lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Callbacks&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the null-terminated TLS callback functions table.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0010&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Zero Fill&lt;br /&gt;
| The number of bytes following the raw data that should be set to zero in memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0014&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Characteristics&lt;br /&gt;
| Describes alignment.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Certificate =&lt;br /&gt;
&lt;br /&gt;
Each Xbox executable has a certificate that contains information about the title.&lt;br /&gt;
&lt;br /&gt;
* Time and date when the certificate was created&lt;br /&gt;
* Title ID&lt;br /&gt;
* Title name&lt;br /&gt;
* Alternative title IDs&lt;br /&gt;
* Allowed types of media that the executable can be run from (HD, DVD, CD, etc.)&lt;br /&gt;
* Game region&lt;br /&gt;
* Game ratings&lt;br /&gt;
* Disk number&lt;br /&gt;
* Version&lt;br /&gt;
* LAN key raw data used for [[System Link]]&lt;br /&gt;
* Signature key raw data (used to sign [[Xbox Savegame System|savegames]])&lt;br /&gt;
* Alternate signature keys&lt;br /&gt;
* Original size of the certificate&lt;br /&gt;
* Online service name (not present in early executables)&lt;br /&gt;
* Run time security flags (not present in early executables)&lt;br /&gt;
&lt;br /&gt;
=== Title ID ===&lt;br /&gt;
&lt;br /&gt;
A title ID is usually 2 ASCII letters for the publisher, followed by a u16 integer game number (Above 2000 for non-original Xbox games)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Publisher ID !! Name&lt;br /&gt;
|-&lt;br /&gt;
| AC || Acclaim Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AH || ARUSH Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AQ || Aqua System&lt;br /&gt;
|-&lt;br /&gt;
| AS || ASK&lt;br /&gt;
|-&lt;br /&gt;
| AT || Atlus&lt;br /&gt;
|-&lt;br /&gt;
| AV || Activision&lt;br /&gt;
|-&lt;br /&gt;
| AY || Aspyr Media&lt;br /&gt;
|-&lt;br /&gt;
| BA || Bandai&lt;br /&gt;
|-&lt;br /&gt;
| BL || Black Box&lt;br /&gt;
|-&lt;br /&gt;
| BM || BAM! Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| BR || Broccoli Co.&lt;br /&gt;
|-&lt;br /&gt;
| BS || Bethesda Softworks&lt;br /&gt;
|-&lt;br /&gt;
| BU || Bunkasha Co.&lt;br /&gt;
|-&lt;br /&gt;
| BV || Buena Vista Games&lt;br /&gt;
|-&lt;br /&gt;
| BW || BBC Multimedia&lt;br /&gt;
|-&lt;br /&gt;
| BZ || Blizzard&lt;br /&gt;
|-&lt;br /&gt;
| CC || Capcom&lt;br /&gt;
|-&lt;br /&gt;
| CK || Kemco Corporation {{citation needed|reason=Did they realy swapped the ASCII letters? is KC a curced acroniem in Japan? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| CM || Codemasters&lt;br /&gt;
|-&lt;br /&gt;
| CV || Crave Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| DC || DreamCatcher Interactive&lt;br /&gt;
|-&lt;br /&gt;
| DX || Davilex&lt;br /&gt;
|-&lt;br /&gt;
| EA || Electronic Arts (EA)&lt;br /&gt;
|-&lt;br /&gt;
| EC || Encore inc&lt;br /&gt;
|-&lt;br /&gt;
| EL || Enlight Software&lt;br /&gt;
|-&lt;br /&gt;
| EM || Empire Interactive&lt;br /&gt;
|-&lt;br /&gt;
| ES || Eidos Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FI || Fox Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FS || From Software&lt;br /&gt;
|-&lt;br /&gt;
| GE || Genki Co.&lt;br /&gt;
|-&lt;br /&gt;
| GV || Groove Games&lt;br /&gt;
|-&lt;br /&gt;
| HE || Tru Blu (Entertainment division of Home Entertainment Suppliers)&lt;br /&gt;
|-&lt;br /&gt;
| HP || Hip games&lt;br /&gt;
|-&lt;br /&gt;
| HU || Hudson Soft&lt;br /&gt;
|-&lt;br /&gt;
| HW || Highwaystar&lt;br /&gt;
|-&lt;br /&gt;
| IA || Mad Catz Interactive&lt;br /&gt;
|-&lt;br /&gt;
| IF || Idea Factory&lt;br /&gt;
|-&lt;br /&gt;
| IG || Infogrames&lt;br /&gt;
|-&lt;br /&gt;
| IL || [[Interlex Corporation]]&lt;br /&gt;
|-&lt;br /&gt;
| IM || Imagine Media&lt;br /&gt;
|-&lt;br /&gt;
| IO || Ignition Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IP || Interplay Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IX || InXile Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| JA || Jaleco&lt;br /&gt;
|-&lt;br /&gt;
| JW || JoWooD&lt;br /&gt;
|-&lt;br /&gt;
| KB || Kemco {{citation needed|reason=CK is also Kemco, is this a diferent subsidairy or country based? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KI || Kids Station Inc. {{citation needed|reason=Games info page was in japanese, I dont read japanese. but this seemed very logicaly the publisher, can a japanese reader confirm?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KN || Konami&lt;br /&gt;
|-&lt;br /&gt;
| KO || KOEI&lt;br /&gt;
|-&lt;br /&gt;
| KU || Kobi and/or GAE (formerly Global A Entertainment){{citation needed|reason=What name did the publisher use at the time of release?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| LA || LucasArts&lt;br /&gt;
|-&lt;br /&gt;
| LS || Black Bean Games (publishing arm of Leader S.p.A.)&lt;br /&gt;
|-&lt;br /&gt;
| MD || Metro3D&lt;br /&gt;
|-&lt;br /&gt;
| ME || Medix&lt;br /&gt;
|-&lt;br /&gt;
| MI || Microïds&lt;br /&gt;
|-&lt;br /&gt;
| MJ || Majesco Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| MM || Myelin Media&lt;br /&gt;
|-&lt;br /&gt;
| MP || MediaQuest {{citation needed|reason=Where is the P? I dont trust my source yet... but seems close|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| MS || Microsoft Game Studios&lt;br /&gt;
|-&lt;br /&gt;
| MW || Midway Games&lt;br /&gt;
|-&lt;br /&gt;
| MX || Empire Interactive {{citation needed|reason=What happend to the publisher, who published this game?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| NK || NewKidCo&lt;br /&gt;
|-&lt;br /&gt;
| NL || NovaLogic&lt;br /&gt;
|-&lt;br /&gt;
| NM || Namco&lt;br /&gt;
|-&lt;br /&gt;
| OX || Oxygen Interactive&lt;br /&gt;
|-&lt;br /&gt;
| PC || Playlogic Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| PL || Phantagram Co., Ltd.&lt;br /&gt;
|-&lt;br /&gt;
| RA || Rage&lt;br /&gt;
|-&lt;br /&gt;
| SA || Sammy&lt;br /&gt;
|-&lt;br /&gt;
| SC || SCi Games&lt;br /&gt;
|-&lt;br /&gt;
| SE || SEGA&lt;br /&gt;
|-&lt;br /&gt;
| SN || SNK&lt;br /&gt;
|-&lt;br /&gt;
| SS || Simon &amp;amp; Schuster&lt;br /&gt;
|-&lt;br /&gt;
| SU || Success Corporation&lt;br /&gt;
|-&lt;br /&gt;
| SW || Swing! Deutschland&lt;br /&gt;
|-&lt;br /&gt;
| TA || Takara&lt;br /&gt;
|-&lt;br /&gt;
| TC || Tecmo&lt;br /&gt;
|-&lt;br /&gt;
| TD || The 3DO Company (or just 3DO)&lt;br /&gt;
|-&lt;br /&gt;
| TK || Takuyo&lt;br /&gt;
|-&lt;br /&gt;
| TM || TDK Mediactive&lt;br /&gt;
|-&lt;br /&gt;
| TQ || THQ&lt;br /&gt;
|-&lt;br /&gt;
| TS || Titus Interactive&lt;br /&gt;
|-&lt;br /&gt;
| TT || Take-Two Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| US || Ubisoft&lt;br /&gt;
|-&lt;br /&gt;
| VC || Victor Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| VN || Vivendi Universal (just took Interplays publishing rights) {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| VU || Vivendi Universal Games&lt;br /&gt;
|-&lt;br /&gt;
| VV || Vivendi Universal Games {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| WE || Wanadoo Edition&lt;br /&gt;
|-&lt;br /&gt;
| WR || Warner Bros. Interactive Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XI || XPEC Entertainment and Idea Factory &lt;br /&gt;
|-&lt;br /&gt;
| XK || ''Xbox kiosk disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XL || ''Xbox special bundled or live demo disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XM || Evolved Games {{citation needed|reason=Probably not, game &amp;quot;Malice&amp;quot;|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| XP || XPEC Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| XR || Panorama&lt;br /&gt;
|-&lt;br /&gt;
| YB || YBM Sisa (South-Korea)&lt;br /&gt;
|-&lt;br /&gt;
| ZD || Zushi Games (formerly Zoo Digital Publishing)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The title ID seems to double the information from the [[Xbox Game Disc]] mastering code etched into the ring or readable from the DMI.&lt;br /&gt;
The game number is expressed in 3 decimal digits here which suggests that it will always be below 1000.&lt;br /&gt;
&lt;br /&gt;
'''Examples''':&lt;br /&gt;
&lt;br /&gt;
[[FIFA Soccer 2003]]:&lt;br /&gt;
* DMI and mastering code: EA02302E (Meaning: publisher EA, game number 023, version 02, region Europe)&lt;br /&gt;
* Title ID: {{FIXME}}&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00402A (Meaning: publisher Microsoft, game number 004, version 02, region America)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00404E (Meaning: publisher Microsoft, game number 004, version 04, region Europe)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
== Allowed media types ==&lt;br /&gt;
Allowed media types off which the executable is allowed to be run from. The following values are known:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Media type !! Value&lt;br /&gt;
|-&lt;br /&gt;
|HARD_DISK        || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|DVD_X2           || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
|DVD_CD           || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
|CD               || 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RO         || 0x00000010&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RO         || 0x00000020&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RW         || 0x00000040&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RW         || 0x00000080&lt;br /&gt;
|-&lt;br /&gt;
|DONGLE           || 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_BOARD      || 0x00000200&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_HARD_DISK || 0x40000000&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_MODE   || 0x80000000&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_MASK       || 0x00FFFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Sections =&lt;br /&gt;
The sections are described by the section headers. The section headers start right after the certificate and contain describe where in the file the actual sections reside. Each header contains a hash of the section that is checked by the Xbox to ensure the integrity of the sections. &lt;br /&gt;
&lt;br /&gt;
At least two sections are always present in an Xbox executable: .text and .rdata. There might be more sections that contain either executable code or resources such as images, text, etc.&lt;br /&gt;
&lt;br /&gt;
== .text ==&lt;br /&gt;
&lt;br /&gt;
The .text section contains all x86 subroutines to be executed by the [[CPU|processor]].&lt;br /&gt;
&lt;br /&gt;
== .rdata ==&lt;br /&gt;
&lt;br /&gt;
The .rdata section contains the [[Kernel|kernel thunk table]]. The ordinals in the table are to be resolved to the kernel's actual calling routine, when loaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Xbox Alpha executable format =&lt;br /&gt;
&lt;br /&gt;
Binaries from early Xbox development (Alpha units), are using a different binary format. There are no known public tools that can read them.&lt;br /&gt;
Known differences include that the first bytes of the file are 'XE' instead the 'XBEH' from the final XBE format. The format is rumored to be more like the Windows PE format.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
= Resources and links =&lt;br /&gt;
* [http://www.caustik.com/cxbx/download/xbe.htm .XBE File Format 1.1]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fileformats]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6968</id>
		<title>Xbe</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6968"/>
				<updated>2021-10-06T17:13:26Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Add info about the LibraryVersion Table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:XBE}}&lt;br /&gt;
XBE files (XBox Executable) are the main files that are executed in the Xbox System. In official games, these files are created by game developers, and then signed by Microsoft. &lt;br /&gt;
&lt;br /&gt;
The file structure is adapted from Windows PE files. It is very similar, however it has important changes for the Xbox. The file is composed of an image header, a certificate, a collection of section headers, a collection of library versions, thread local storage data, a Microsoft bitmap, and the sections that contain the code and resources.&lt;br /&gt;
&lt;br /&gt;
= Image Header = &lt;br /&gt;
&lt;br /&gt;
The image header contains the information that describes where the other parts of the executable are located within the file, and how the executable should be treated and loaded. It has the following layout (all fields are little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Magic Number&lt;br /&gt;
| This field must always equal 0x48454258 (&amp;quot;XBEH&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0100&lt;br /&gt;
| Digital Signature&lt;br /&gt;
| 256 Bytes. This is where a game is signed. Only on officially signed games is this field worthwhile.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0104&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Base Address&lt;br /&gt;
| Address at which to load this .XBE. Typically this will be 0x00010000.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0108&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Headers&lt;br /&gt;
| Number of bytes that should be reserved for headers.&lt;br /&gt;
|-&lt;br /&gt;
! 0x010C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image&lt;br /&gt;
| Number of bytes that should be reserved for this image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0110&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image Header&lt;br /&gt;
| Number of bytes that should be reserved for the image header. The header size varies by XDK version, but is at least 0x178.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0114&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TimeDate&lt;br /&gt;
| Time and Date when this image was created. Standard windows format.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0118&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Certificate Address&lt;br /&gt;
| Address to a [[#Certificate|Certificate]] structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x011C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Sections&lt;br /&gt;
| Number of sections contained in this .XBE.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0120&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Section Headers Address&lt;br /&gt;
| Address to an array of SectionHeader structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0124&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Initialization Flags&lt;br /&gt;
| Various flags for this .XBE file. Known flags are:&lt;br /&gt;
&lt;br /&gt;
  MountUtilityDrive  = 0x00000001&lt;br /&gt;
  FormatUtilityDrive = 0x00000002&lt;br /&gt;
  Limit64Megabytes   = 0x00000004&lt;br /&gt;
  DontSetupHarddisk  = 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
! 0x0128&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Entry Point&lt;br /&gt;
| Address to the Image entry point, after the .XBE is loaded into memory. This is where execution starts.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0x94859D4B, Retail = 0xA8FC57AB&lt;br /&gt;
&lt;br /&gt;
To encode an entry point, you simply XOR the real entry point with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode an entry point, you XOR with the debug key, then check if it is a valid entry point. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Kernel Image Thunk Address member of this header must also be encoded as described later in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x012C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TLS Address&lt;br /&gt;
| Address to a [[#TLS Table|TLS]] (Thread Local Storage) structure.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0130&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Stack Size&lt;br /&gt;
| Default stack size. As the Xbox does not allow for stacks to grow, this needs to be copied from the SizeOfStackReserve PE field, not SizeOfStackCommit!&lt;br /&gt;
|-&lt;br /&gt;
! 0x0134&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Reserve&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0138&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Commit&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x013C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Base Address&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0140&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Size of Image&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0144&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Checksum&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0148&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE TimeDate&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x014C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug PathName Address&lt;br /&gt;
| Address to the debug pathname (i.e. &amp;quot;D:\Nightlybuilds\011026.0\code\build\xbox\Release\simpsons.exe&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
! 0x0150&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug FileName Address&lt;br /&gt;
| Address to the debug filename (i.e. &amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0154&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address to the UTF-16 debug filename (i.e. L&amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
| UTF-16 Debug FileName Address&lt;br /&gt;
|-&lt;br /&gt;
! 0x0158&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Image Thunk Address&lt;br /&gt;
| Address to the Kernel Image Thunk Table, after the .XBE is loaded into memory. This is how .XBE files import kernel functions and data.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0xEFB1F152, Retail = 0x5B6D40B6&lt;br /&gt;
&lt;br /&gt;
To encode a kernel thunk address, you simply XOR the real address with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode a kernel thunk address, you XOR with the debug key, then check if it is a valid address. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
The Kernel Thunk Table itself is simply an array of pointers to Kernel imports. There are 366 possible imports, and the table is terminated with a zero dword (0x00000000). Typically the values in this table can be generated with the following formula:&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = ImportThunk + 0x80000000;&lt;br /&gt;
&lt;br /&gt;
so, for example, the import PsCreateSystemThreadEx, which has a thunk value of 255 (0xFF) would be...&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = 0xFF + 0x80000000; // (0x800000FF)&lt;br /&gt;
&lt;br /&gt;
When the .XBE is loaded by the OS (or the CXBX Emulator), all kernel imports are replaced by a valid function or data type address. In the case of CXBX, the import table entry at which (KernelThunkTable[v] &amp;amp; 0x1FF == 0xFF) will be replaced by &amp;amp;cxbx_PsCreateSystemThreadEx (which is a wrapper function).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Entry Point member of this header must also be encoded as described earlier in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x015C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Non-Kernel Import Directory Address&lt;br /&gt;
| Address to the Non-Kernel Import Directory. It is typically safe to set this to zero.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0160&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Library Versions&lt;br /&gt;
| Number of Library Versions pointed to by Library Versions Address.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0164&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Library Versions Address&lt;br /&gt;
| Address to an array of LibraryVersion structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0168&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x016C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| XAPI Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0170&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Address&lt;br /&gt;
| Address to the Logo Bitmap (Typically a &amp;quot;Microsoft&amp;quot; logo). The format of this image is described here. This field can be set to zero, meaning there is no bitmap present.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0174&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Size&lt;br /&gt;
| Size (in bytes) of the Logo Bitmap data. The format of this image is described here.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0178&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Unknown1&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5028.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0180&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Unknown2&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5455.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LibraryVersion Table ==&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Library Name&lt;br /&gt;
| 8-byte ASCII-name of this library. (i.e. &amp;quot;XAPILIB&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Major Version&lt;br /&gt;
| Major version for this library (2-byte WORD). &lt;br /&gt;
|-&lt;br /&gt;
! 0x000A&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Minor Version &lt;br /&gt;
| Minor version for this library (2-byte WORD). &lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Build Version&lt;br /&gt;
| Build version for this library (2-byte WORD).&lt;br /&gt;
|-&lt;br /&gt;
! 0x000E&lt;br /&gt;
! 0x0002&lt;br /&gt;
| Library Flags&lt;br /&gt;
| Various flags for this library. The fields are:&lt;br /&gt;
&lt;br /&gt;
  QFEVersion  = 0x1FFF (13-Bit Mask)&lt;br /&gt;
  Approved    = 0x6000 (02-Bit Mask)&lt;br /&gt;
  Debug Build = 0x8000 (01-Bit Mask)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TLS Table ==&lt;br /&gt;
&lt;br /&gt;
The TLS Table contains all the information needed by the XBE to properly set up thread-local storage. It is structurally identical to the TLS Directory found in PE32 files&amp;lt;ref&amp;gt;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-tls-section&amp;lt;/ref&amp;gt;, and can be directly copied from there. If the XBE does not use any thread-local storage, this table may be omitted, and the respective field in the image header set to zero.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data Start&lt;br /&gt;
| Absolute (i.e. not an RVA) address of start of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data End&lt;br /&gt;
| Absolute (i.e. not an RVA) address of end of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Index&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the TLS Index variable.&lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Callbacks&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the null-terminated TLS callback functions table.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0010&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Zero Fill&lt;br /&gt;
| The number of bytes following the raw data that should be set to zero in memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0014&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Characteristics&lt;br /&gt;
| Describes alignment.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Certificate =&lt;br /&gt;
&lt;br /&gt;
Each Xbox executable has a certificate that contains information about the title.&lt;br /&gt;
&lt;br /&gt;
* Time and date when the certificate was created&lt;br /&gt;
* Title ID&lt;br /&gt;
* Title name&lt;br /&gt;
* Alternative title IDs&lt;br /&gt;
* Allowed types of media that the executable can be run from (HD, DVD, CD, etc.)&lt;br /&gt;
* Game region&lt;br /&gt;
* Game ratings&lt;br /&gt;
* Disk number&lt;br /&gt;
* Version&lt;br /&gt;
* LAN key raw data used for [[System Link]]&lt;br /&gt;
* Signature key raw data (used to sign [[Xbox Savegame System|savegames]])&lt;br /&gt;
* Alternate signature keys&lt;br /&gt;
* Original size of the certificate&lt;br /&gt;
* Online service name (not present in early executables)&lt;br /&gt;
* Run time security flags (not present in early executables)&lt;br /&gt;
&lt;br /&gt;
=== Title ID ===&lt;br /&gt;
&lt;br /&gt;
A title ID is usually 2 ASCII letters for the publisher, followed by a u16 integer game number (Above 2000 for non-original Xbox games)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Publisher ID !! Name&lt;br /&gt;
|-&lt;br /&gt;
| AC || Acclaim Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AH || ARUSH Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AQ || Aqua System&lt;br /&gt;
|-&lt;br /&gt;
| AS || ASK&lt;br /&gt;
|-&lt;br /&gt;
| AT || Atlus&lt;br /&gt;
|-&lt;br /&gt;
| AV || Activision&lt;br /&gt;
|-&lt;br /&gt;
| AY || Aspyr Media&lt;br /&gt;
|-&lt;br /&gt;
| BA || Bandai&lt;br /&gt;
|-&lt;br /&gt;
| BL || Black Box&lt;br /&gt;
|-&lt;br /&gt;
| BM || BAM! Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| BR || Broccoli Co.&lt;br /&gt;
|-&lt;br /&gt;
| BS || Bethesda Softworks&lt;br /&gt;
|-&lt;br /&gt;
| BU || Bunkasha Co.&lt;br /&gt;
|-&lt;br /&gt;
| BV || Buena Vista Games&lt;br /&gt;
|-&lt;br /&gt;
| BW || BBC Multimedia&lt;br /&gt;
|-&lt;br /&gt;
| BZ || Blizzard&lt;br /&gt;
|-&lt;br /&gt;
| CC || Capcom&lt;br /&gt;
|-&lt;br /&gt;
| CK || Kemco Corporation {{citation needed|reason=Did they realy swapped the ASCII letters? is KC a curced acroniem in Japan? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| CM || Codemasters&lt;br /&gt;
|-&lt;br /&gt;
| CV || Crave Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| DC || DreamCatcher Interactive&lt;br /&gt;
|-&lt;br /&gt;
| DX || Davilex&lt;br /&gt;
|-&lt;br /&gt;
| EA || Electronic Arts (EA)&lt;br /&gt;
|-&lt;br /&gt;
| EC || Encore inc&lt;br /&gt;
|-&lt;br /&gt;
| EL || Enlight Software&lt;br /&gt;
|-&lt;br /&gt;
| EM || Empire Interactive&lt;br /&gt;
|-&lt;br /&gt;
| ES || Eidos Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FI || Fox Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FS || From Software&lt;br /&gt;
|-&lt;br /&gt;
| GE || Genki Co.&lt;br /&gt;
|-&lt;br /&gt;
| GV || Groove Games&lt;br /&gt;
|-&lt;br /&gt;
| HE || Tru Blu (Entertainment division of Home Entertainment Suppliers)&lt;br /&gt;
|-&lt;br /&gt;
| HP || Hip games&lt;br /&gt;
|-&lt;br /&gt;
| HU || Hudson Soft&lt;br /&gt;
|-&lt;br /&gt;
| HW || Highwaystar&lt;br /&gt;
|-&lt;br /&gt;
| IA || Mad Catz Interactive&lt;br /&gt;
|-&lt;br /&gt;
| IF || Idea Factory&lt;br /&gt;
|-&lt;br /&gt;
| IG || Infogrames&lt;br /&gt;
|-&lt;br /&gt;
| IL || [[Interlex Corporation]]&lt;br /&gt;
|-&lt;br /&gt;
| IM || Imagine Media&lt;br /&gt;
|-&lt;br /&gt;
| IO || Ignition Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IP || Interplay Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IX || InXile Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| JA || Jaleco&lt;br /&gt;
|-&lt;br /&gt;
| JW || JoWooD&lt;br /&gt;
|-&lt;br /&gt;
| KB || Kemco {{citation needed|reason=CK is also Kemco, is this a diferent subsidairy or country based? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KI || Kids Station Inc. {{citation needed|reason=Games info page was in japanese, I dont read japanese. but this seemed very logicaly the publisher, can a japanese reader confirm?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KN || Konami&lt;br /&gt;
|-&lt;br /&gt;
| KO || KOEI&lt;br /&gt;
|-&lt;br /&gt;
| KU || Kobi and/or GAE (formerly Global A Entertainment){{citation needed|reason=What name did the publisher use at the time of release?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| LA || LucasArts&lt;br /&gt;
|-&lt;br /&gt;
| LS || Black Bean Games (publishing arm of Leader S.p.A.)&lt;br /&gt;
|-&lt;br /&gt;
| MD || Metro3D&lt;br /&gt;
|-&lt;br /&gt;
| ME || Medix&lt;br /&gt;
|-&lt;br /&gt;
| MI || Microïds&lt;br /&gt;
|-&lt;br /&gt;
| MJ || Majesco Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| MM || Myelin Media&lt;br /&gt;
|-&lt;br /&gt;
| MP || MediaQuest {{citation needed|reason=Where is the P? I dont trust my source yet... but seems close|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| MS || Microsoft Game Studios&lt;br /&gt;
|-&lt;br /&gt;
| MW || Midway Games&lt;br /&gt;
|-&lt;br /&gt;
| MX || Empire Interactive {{citation needed|reason=What happend to the publisher, who published this game?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| NK || NewKidCo&lt;br /&gt;
|-&lt;br /&gt;
| NL || NovaLogic&lt;br /&gt;
|-&lt;br /&gt;
| NM || Namco&lt;br /&gt;
|-&lt;br /&gt;
| OX || Oxygen Interactive&lt;br /&gt;
|-&lt;br /&gt;
| PC || Playlogic Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| PL || Phantagram Co., Ltd.&lt;br /&gt;
|-&lt;br /&gt;
| RA || Rage&lt;br /&gt;
|-&lt;br /&gt;
| SA || Sammy&lt;br /&gt;
|-&lt;br /&gt;
| SC || SCi Games&lt;br /&gt;
|-&lt;br /&gt;
| SE || SEGA&lt;br /&gt;
|-&lt;br /&gt;
| SN || SNK&lt;br /&gt;
|-&lt;br /&gt;
| SS || Simon &amp;amp; Schuster&lt;br /&gt;
|-&lt;br /&gt;
| SU || Success Corporation&lt;br /&gt;
|-&lt;br /&gt;
| SW || Swing! Deutschland&lt;br /&gt;
|-&lt;br /&gt;
| TA || Takara&lt;br /&gt;
|-&lt;br /&gt;
| TC || Tecmo&lt;br /&gt;
|-&lt;br /&gt;
| TD || The 3DO Company (or just 3DO)&lt;br /&gt;
|-&lt;br /&gt;
| TK || Takuyo&lt;br /&gt;
|-&lt;br /&gt;
| TM || TDK Mediactive&lt;br /&gt;
|-&lt;br /&gt;
| TQ || THQ&lt;br /&gt;
|-&lt;br /&gt;
| TS || Titus Interactive&lt;br /&gt;
|-&lt;br /&gt;
| TT || Take-Two Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| US || Ubisoft&lt;br /&gt;
|-&lt;br /&gt;
| VC || Victor Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| VN || Vivendi Universal (just took Interplays publishing rights) {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| VU || Vivendi Universal Games&lt;br /&gt;
|-&lt;br /&gt;
| VV || Vivendi Universal Games {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| WE || Wanadoo Edition&lt;br /&gt;
|-&lt;br /&gt;
| WR || Warner Bros. Interactive Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XI || XPEC Entertainment and Idea Factory &lt;br /&gt;
|-&lt;br /&gt;
| XK || ''Xbox kiosk disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XL || ''Xbox special bundled or live demo disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XM || Evolved Games {{citation needed|reason=Probably not, game &amp;quot;Malice&amp;quot;|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| XP || XPEC Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| XR || Panorama&lt;br /&gt;
|-&lt;br /&gt;
| YB || YBM Sisa (South-Korea)&lt;br /&gt;
|-&lt;br /&gt;
| ZD || Zushi Games (formerly Zoo Digital Publishing)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The title ID seems to double the information from the [[Xbox Game Disc]] mastering code etched into the ring or readable from the DMI.&lt;br /&gt;
The game number is expressed in 3 decimal digits here which suggests that it will always be below 1000.&lt;br /&gt;
&lt;br /&gt;
'''Examples''':&lt;br /&gt;
&lt;br /&gt;
[[FIFA Soccer 2003]]:&lt;br /&gt;
* DMI and mastering code: EA02302E (Meaning: publisher EA, game number 023, version 02, region Europe)&lt;br /&gt;
* Title ID: {{FIXME}}&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00402A (Meaning: publisher Microsoft, game number 004, version 02, region America)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00404E (Meaning: publisher Microsoft, game number 004, version 04, region Europe)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
== Allowed media types ==&lt;br /&gt;
Allowed media types off which the executable is allowed to be run from. The following values are known:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Media type !! Value&lt;br /&gt;
|-&lt;br /&gt;
|HARD_DISK        || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|DVD_X2           || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
|DVD_CD           || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
|CD               || 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RO         || 0x00000010&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RO         || 0x00000020&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RW         || 0x00000040&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RW         || 0x00000080&lt;br /&gt;
|-&lt;br /&gt;
|DONGLE           || 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_BOARD      || 0x00000200&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_HARD_DISK || 0x40000000&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_MODE   || 0x80000000&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_MASK       || 0x00FFFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Sections =&lt;br /&gt;
The sections are described by the section headers. The section headers start right after the certificate and contain describe where in the file the actual sections reside. Each header contains a hash of the section that is checked by the Xbox to ensure the integrity of the sections. &lt;br /&gt;
&lt;br /&gt;
At least two sections are always present in an Xbox executable: .text and .rdata. There might be more sections that contain either executable code or resources such as images, text, etc.&lt;br /&gt;
&lt;br /&gt;
== .text ==&lt;br /&gt;
&lt;br /&gt;
The .text section contains all x86 subroutines to be executed by the [[CPU|processor]].&lt;br /&gt;
&lt;br /&gt;
== .rdata ==&lt;br /&gt;
&lt;br /&gt;
The .rdata section contains the [[Kernel|kernel thunk table]]. The ordinals in the table are to be resolved to the kernel's actual calling routine, when loaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Xbox Alpha executable format =&lt;br /&gt;
&lt;br /&gt;
Binaries from early Xbox development (Alpha units), are using a different binary format. There are no known public tools that can read them.&lt;br /&gt;
Known differences include that the first bytes of the file are 'XE' instead the 'XBEH' from the final XBE format. The format is rumored to be more like the Windows PE format.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
= Resources and links =&lt;br /&gt;
* [http://www.caustik.com/cxbx/download/xbe.htm .XBE File Format 1.1]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fileformats]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6942</id>
		<title>Xbe</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6942"/>
				<updated>2021-05-11T18:59:18Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Resources and links shouldn't be a subsection of Xbox Alpha executable format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:XBE}}&lt;br /&gt;
XBE files (XBox Executable) are the main files that are executed in the Xbox System. In official games, these files are created by game developers, and then signed by Microsoft. &lt;br /&gt;
&lt;br /&gt;
The file structure is adapted from Windows PE files. It is very similar, however it has important changes for the Xbox. The file is composed of an image header, a certificate, a collection of section headers, a collection of library versions, thread local storage data, a Microsoft bitmap, and the sections that contain the code and resources.&lt;br /&gt;
&lt;br /&gt;
= Image Header = &lt;br /&gt;
&lt;br /&gt;
The image header contains the information that describes where the other parts of the executable are located within the file, and how the executable should be treated and loaded. It has the following layout (all fields are little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Magic Number&lt;br /&gt;
| This field must always equal 0x48454258 (&amp;quot;XBEH&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0100&lt;br /&gt;
| Digital Signature&lt;br /&gt;
| 256 Bytes. This is where a game is signed. Only on officially signed games is this field worthwhile.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0104&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Base Address&lt;br /&gt;
| Address at which to load this .XBE. Typically this will be 0x00010000.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0108&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Headers&lt;br /&gt;
| Number of bytes that should be reserved for headers.&lt;br /&gt;
|-&lt;br /&gt;
! 0x010C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image&lt;br /&gt;
| Number of bytes that should be reserved for this image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0110&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image Header&lt;br /&gt;
| Number of bytes that should be reserved for the image header. The header size varies by XDK version, but is at least 0x178.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0114&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TimeDate&lt;br /&gt;
| Time and Date when this image was created. Standard windows format.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0118&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Certificate Address&lt;br /&gt;
| Address to a [[#Certificate|Certificate]] structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x011C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Sections&lt;br /&gt;
| Number of sections contained in this .XBE.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0120&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Section Headers Address&lt;br /&gt;
| Address to an array of SectionHeader structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0124&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Initialization Flags&lt;br /&gt;
| Various flags for this .XBE file. Known flags are:&lt;br /&gt;
&lt;br /&gt;
  MountUtilityDrive  = 0x00000001&lt;br /&gt;
  FormatUtilityDrive = 0x00000002&lt;br /&gt;
  Limit64Megabytes   = 0x00000004&lt;br /&gt;
  DontSetupHarddisk  = 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
! 0x0128&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Entry Point&lt;br /&gt;
| Address to the Image entry point, after the .XBE is loaded into memory. This is where execution starts.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0x94859D4B, Retail = 0xA8FC57AB&lt;br /&gt;
&lt;br /&gt;
To encode an entry point, you simply XOR the real entry point with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode an entry point, you XOR with the debug key, then check if it is a valid entry point. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Kernel Image Thunk Address member of this header must also be encoded as described later in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x012C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TLS Address&lt;br /&gt;
| Address to a [[#TLS Table|TLS]] (Thread Local Storage) structure.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0130&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Stack Size&lt;br /&gt;
| Default stack size. As the Xbox does not allow for stacks to grow, this needs to be copied from the SizeOfStackReserve PE field, not SizeOfStackCommit!&lt;br /&gt;
|-&lt;br /&gt;
! 0x0134&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Reserve&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0138&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Commit&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x013C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Base Address&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0140&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Size of Image&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0144&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Checksum&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0148&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE TimeDate&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x014C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug PathName Address&lt;br /&gt;
| Address to the debug pathname (i.e. &amp;quot;D:\Nightlybuilds\011026.0\code\build\xbox\Release\simpsons.exe&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
! 0x0150&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug FileName Address&lt;br /&gt;
| Address to the debug filename (i.e. &amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0154&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address to the UTF-16 debug filename (i.e. L&amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
| UTF-16 Debug FileName Address&lt;br /&gt;
|-&lt;br /&gt;
! 0x0158&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Image Thunk Address&lt;br /&gt;
| Address to the Kernel Image Thunk Table, after the .XBE is loaded into memory. This is how .XBE files import kernel functions and data.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0xEFB1F152, Retail = 0x5B6D40B6&lt;br /&gt;
&lt;br /&gt;
To encode a kernel thunk address, you simply XOR the real address with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode a kernel thunk address, you XOR with the debug key, then check if it is a valid address. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
The Kernel Thunk Table itself is simply an array of pointers to Kernel imports. There are 366 possible imports, and the table is terminated with a zero dword (0x00000000). Typically the values in this table can be generated with the following formula:&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = ImportThunk + 0x80000000;&lt;br /&gt;
&lt;br /&gt;
so, for example, the import PsCreateSystemThreadEx, which has a thunk value of 255 (0xFF) would be...&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = 0xFF + 0x80000000; // (0x800000FF)&lt;br /&gt;
&lt;br /&gt;
When the .XBE is loaded by the OS (or the CXBX Emulator), all kernel imports are replaced by a valid function or data type address. In the case of CXBX, the import table entry at which (KernelThunkTable[v] &amp;amp; 0x1FF == 0xFF) will be replaced by &amp;amp;cxbx_PsCreateSystemThreadEx (which is a wrapper function).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Entry Point member of this header must also be encoded as described earlier in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x015C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Non-Kernel Import Directory Address&lt;br /&gt;
| Address to the Non-Kernel Import Directory. It is typically safe to set this to zero.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0160&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Library Versions&lt;br /&gt;
| Number of Library Versions pointed to by Library Versions Address.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0164&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Library Versions Address&lt;br /&gt;
| Address to an array of LibraryVersion structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0168&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x016C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| XAPI Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0170&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Address&lt;br /&gt;
| Address to the Logo Bitmap (Typically a &amp;quot;Microsoft&amp;quot; logo). The format of this image is described here. This field can be set to zero, meaning there is no bitmap present.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0174&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Size&lt;br /&gt;
| Size (in bytes) of the Logo Bitmap data. The format of this image is described here.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0178&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Unknown1&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5028.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0180&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Unknown2&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5455.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TLS Table ==&lt;br /&gt;
&lt;br /&gt;
The TLS Table contains all the information needed by the XBE to properly set up thread-local storage. It is structurally identical to the TLS Directory found in PE32 files&amp;lt;ref&amp;gt;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-tls-section&amp;lt;/ref&amp;gt;, and can be directly copied from there. If the XBE does not use any thread-local storage, this table may be omitted, and the respective field in the image header set to zero.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data Start&lt;br /&gt;
| Absolute (i.e. not an RVA) address of start of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data End&lt;br /&gt;
| Absolute (i.e. not an RVA) address of end of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Index&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the TLS Index variable.&lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Callbacks&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the null-terminated TLS callback functions table.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0010&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Zero Fill&lt;br /&gt;
| The number of bytes following the raw data that should be set to zero in memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0014&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Characteristics&lt;br /&gt;
| Describes alignment.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Certificate =&lt;br /&gt;
&lt;br /&gt;
Each Xbox executable has a certificate that contains information about the title.&lt;br /&gt;
&lt;br /&gt;
* Time and date when the certificate was created&lt;br /&gt;
* Title ID&lt;br /&gt;
* Title name&lt;br /&gt;
* Alternative title IDs&lt;br /&gt;
* Allowed types of media that the executable can be run from (HD, DVD, CD, etc.)&lt;br /&gt;
* Game region&lt;br /&gt;
* Game ratings&lt;br /&gt;
* Disk number&lt;br /&gt;
* Version&lt;br /&gt;
* LAN key raw data used for [[System Link]]&lt;br /&gt;
* Signature key raw data (used to sign [[Xbox Savegame System|savegames]])&lt;br /&gt;
* Alternate signature keys&lt;br /&gt;
* Original size of the certificate&lt;br /&gt;
* Online service name (not present in early executables)&lt;br /&gt;
* Run time security flags (not present in early executables)&lt;br /&gt;
&lt;br /&gt;
=== Title ID ===&lt;br /&gt;
&lt;br /&gt;
A title ID is usually 2 ASCII letters for the publisher, followed by a u16 integer game number (Above 2000 for non-original Xbox games)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Publisher ID !! Name&lt;br /&gt;
|-&lt;br /&gt;
| AC || Acclaim Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AH || ARUSH Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AQ || Aqua System&lt;br /&gt;
|-&lt;br /&gt;
| AS || ASK&lt;br /&gt;
|-&lt;br /&gt;
| AT || Atlus&lt;br /&gt;
|-&lt;br /&gt;
| AV || Activision&lt;br /&gt;
|-&lt;br /&gt;
| AY || Aspyr Media&lt;br /&gt;
|-&lt;br /&gt;
| BA || Bandai&lt;br /&gt;
|-&lt;br /&gt;
| BL || Black Box&lt;br /&gt;
|-&lt;br /&gt;
| BM || BAM! Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| BR || Broccoli Co.&lt;br /&gt;
|-&lt;br /&gt;
| BS || Bethesda Softworks&lt;br /&gt;
|-&lt;br /&gt;
| BU || Bunkasha Co.&lt;br /&gt;
|-&lt;br /&gt;
| BV || Buena Vista Games&lt;br /&gt;
|-&lt;br /&gt;
| BW || BBC Multimedia&lt;br /&gt;
|-&lt;br /&gt;
| BZ || Blizzard&lt;br /&gt;
|-&lt;br /&gt;
| CC || Capcom&lt;br /&gt;
|-&lt;br /&gt;
| CK || Kemco Corporation {{citation needed|reason=Did they realy swapped the ASCII letters? is KC a curced acroniem in Japan? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| CM || Codemasters&lt;br /&gt;
|-&lt;br /&gt;
| CV || Crave Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| DC || DreamCatcher Interactive&lt;br /&gt;
|-&lt;br /&gt;
| DX || Davilex&lt;br /&gt;
|-&lt;br /&gt;
| EA || Electronic Arts (EA)&lt;br /&gt;
|-&lt;br /&gt;
| EC || Encore inc&lt;br /&gt;
|-&lt;br /&gt;
| EL || Enlight Software&lt;br /&gt;
|-&lt;br /&gt;
| EM || Empire Interactive&lt;br /&gt;
|-&lt;br /&gt;
| ES || Eidos Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FI || Fox Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FS || From Software&lt;br /&gt;
|-&lt;br /&gt;
| GE || Genki Co.&lt;br /&gt;
|-&lt;br /&gt;
| GV || Groove Games&lt;br /&gt;
|-&lt;br /&gt;
| HE || Tru Blu (Entertainment division of Home Entertainment Suppliers)&lt;br /&gt;
|-&lt;br /&gt;
| HP || Hip games&lt;br /&gt;
|-&lt;br /&gt;
| HU || Hudson Soft&lt;br /&gt;
|-&lt;br /&gt;
| HW || Highwaystar&lt;br /&gt;
|-&lt;br /&gt;
| IA || Mad Catz Interactive&lt;br /&gt;
|-&lt;br /&gt;
| IF || Idea Factory&lt;br /&gt;
|-&lt;br /&gt;
| IG || Infogrames&lt;br /&gt;
|-&lt;br /&gt;
| IL || [[Interlex Corporation]]&lt;br /&gt;
|-&lt;br /&gt;
| IM || Imagine Media&lt;br /&gt;
|-&lt;br /&gt;
| IO || Ignition Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IP || Interplay Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IX || InXile Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| JA || Jaleco&lt;br /&gt;
|-&lt;br /&gt;
| JW || JoWooD&lt;br /&gt;
|-&lt;br /&gt;
| KB || Kemco {{citation needed|reason=CK is also Kemco, is this a diferent subsidairy or country based? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KI || Kids Station Inc. {{citation needed|reason=Games info page was in japanese, I dont read japanese. but this seemed very logicaly the publisher, can a japanese reader confirm?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KN || Konami&lt;br /&gt;
|-&lt;br /&gt;
| KO || KOEI&lt;br /&gt;
|-&lt;br /&gt;
| KU || Kobi and/or GAE (formerly Global A Entertainment){{citation needed|reason=What name did the publisher use at the time of release?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| LA || LucasArts&lt;br /&gt;
|-&lt;br /&gt;
| LS || Black Bean Games (publishing arm of Leader S.p.A.)&lt;br /&gt;
|-&lt;br /&gt;
| MD || Metro3D&lt;br /&gt;
|-&lt;br /&gt;
| ME || Medix&lt;br /&gt;
|-&lt;br /&gt;
| MI || Microïds&lt;br /&gt;
|-&lt;br /&gt;
| MJ || Majesco Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| MM || Myelin Media&lt;br /&gt;
|-&lt;br /&gt;
| MP || MediaQuest {{citation needed|reason=Where is the P? I dont trust my source yet... but seems close|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| MS || Microsoft Game Studios&lt;br /&gt;
|-&lt;br /&gt;
| MW || Midway Games&lt;br /&gt;
|-&lt;br /&gt;
| MX || Empire Interactive {{citation needed|reason=What happend to the publisher, who published this game?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| NK || NewKidCo&lt;br /&gt;
|-&lt;br /&gt;
| NL || NovaLogic&lt;br /&gt;
|-&lt;br /&gt;
| NM || Namco&lt;br /&gt;
|-&lt;br /&gt;
| OX || Oxygen Interactive&lt;br /&gt;
|-&lt;br /&gt;
| PC || Playlogic Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| PL || Phantagram Co., Ltd.&lt;br /&gt;
|-&lt;br /&gt;
| RA || Rage&lt;br /&gt;
|-&lt;br /&gt;
| SA || Sammy&lt;br /&gt;
|-&lt;br /&gt;
| SC || SCi Games&lt;br /&gt;
|-&lt;br /&gt;
| SE || SEGA&lt;br /&gt;
|-&lt;br /&gt;
| SN || SNK&lt;br /&gt;
|-&lt;br /&gt;
| SS || Simon &amp;amp; Schuster&lt;br /&gt;
|-&lt;br /&gt;
| SU || Success Corporation&lt;br /&gt;
|-&lt;br /&gt;
| SW || Swing! Deutschland&lt;br /&gt;
|-&lt;br /&gt;
| TA || Takara&lt;br /&gt;
|-&lt;br /&gt;
| TC || Tecmo&lt;br /&gt;
|-&lt;br /&gt;
| TD || The 3DO Company (or just 3DO)&lt;br /&gt;
|-&lt;br /&gt;
| TK || Takuyo&lt;br /&gt;
|-&lt;br /&gt;
| TM || TDK Mediactive&lt;br /&gt;
|-&lt;br /&gt;
| TQ || THQ&lt;br /&gt;
|-&lt;br /&gt;
| TS || Titus Interactive&lt;br /&gt;
|-&lt;br /&gt;
| TT || Take-Two Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| US || Ubisoft&lt;br /&gt;
|-&lt;br /&gt;
| VC || Victor Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| VN || Vivendi Universal (just took Interplays publishing rights) {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| VU || Vivendi Universal Games&lt;br /&gt;
|-&lt;br /&gt;
| VV || Vivendi Universal Games {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| WE || Wanadoo Edition&lt;br /&gt;
|-&lt;br /&gt;
| WR || Warner Bros. Interactive Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XI || XPEC Entertainment and Idea Factory &lt;br /&gt;
|-&lt;br /&gt;
| XK || ''Xbox kiosk disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XL || ''Xbox special bundled or live demo disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XM || Evolved Games {{citation needed|reason=Probably not, game &amp;quot;Malice&amp;quot;|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| XP || XPEC Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| XR || Panorama&lt;br /&gt;
|-&lt;br /&gt;
| YB || YBM Sisa (South-Korea)&lt;br /&gt;
|-&lt;br /&gt;
| ZD || Zushi Games (formerly Zoo Digital Publishing)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The title ID seems to double the information from the [[Xbox Game Disc]] mastering code etched into the ring or readable from the DMI.&lt;br /&gt;
The game number is expressed in 3 decimal digits here which suggests that it will always be below 1000.&lt;br /&gt;
&lt;br /&gt;
'''Examples''':&lt;br /&gt;
&lt;br /&gt;
[[FIFA Soccer 2003]]:&lt;br /&gt;
* DMI and mastering code: EA02302E (Meaning: publisher EA, game number 023, version 02, region Europe)&lt;br /&gt;
* Title ID: {{FIXME}}&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00402A (Meaning: publisher Microsoft, game number 004, version 02, region America)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00404E (Meaning: publisher Microsoft, game number 004, version 04, region Europe)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
== Allowed media types ==&lt;br /&gt;
Allowed media types off which the executable is allowed to be run from. The following values are known:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Media type !! Value&lt;br /&gt;
|-&lt;br /&gt;
|HARD_DISK        || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|DVD_X2           || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
|DVD_CD           || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
|CD               || 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RO         || 0x00000010&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RO         || 0x00000020&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RW         || 0x00000040&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RW         || 0x00000080&lt;br /&gt;
|-&lt;br /&gt;
|DONGLE           || 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_BOARD      || 0x00000200&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_HARD_DISK || 0x40000000&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_MODE   || 0x80000000&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_MASK       || 0x00FFFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Sections =&lt;br /&gt;
The sections are described by the section headers. The section headers start right after the certificate and contain describe where in the file the actual sections reside. Each header contains a hash of the section that is checked by the Xbox to ensure the integrity of the sections. &lt;br /&gt;
&lt;br /&gt;
At least two sections are always present in an Xbox executable: .text and .rdata. There might be more sections that contain either executable code or resources such as images, text, etc.&lt;br /&gt;
&lt;br /&gt;
== .text ==&lt;br /&gt;
&lt;br /&gt;
The .text section contains all x86 subroutines to be executed by the [[CPU|processor]].&lt;br /&gt;
&lt;br /&gt;
== .rdata ==&lt;br /&gt;
&lt;br /&gt;
The .rdata section contains the [[Kernel|kernel thunk table]]. The ordinals in the table are to be resolved to the kernel's actual calling routine, when loaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Xbox Alpha executable format =&lt;br /&gt;
&lt;br /&gt;
Binaries from early Xbox development (Alpha units), are using a different binary format. There are no known public tools that can read them.&lt;br /&gt;
Known differences include that the first bytes of the file are 'XE' instead the 'XBEH' from the final XBE format. The format is rumored to be more like the Windows PE format.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
= Resources and links =&lt;br /&gt;
* [http://www.caustik.com/cxbx/download/xbe.htm .XBE File Format 1.1]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fileformats]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6941</id>
		<title>Xbe</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6941"/>
				<updated>2021-05-11T18:57:25Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Add info about TLS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:XBE}}&lt;br /&gt;
XBE files (XBox Executable) are the main files that are executed in the Xbox System. In official games, these files are created by game developers, and then signed by Microsoft. &lt;br /&gt;
&lt;br /&gt;
The file structure is adapted from Windows PE files. It is very similar, however it has important changes for the Xbox. The file is composed of an image header, a certificate, a collection of section headers, a collection of library versions, thread local storage data, a Microsoft bitmap, and the sections that contain the code and resources.&lt;br /&gt;
&lt;br /&gt;
= Image Header = &lt;br /&gt;
&lt;br /&gt;
The image header contains the information that describes where the other parts of the executable are located within the file, and how the executable should be treated and loaded. It has the following layout (all fields are little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Magic Number&lt;br /&gt;
| This field must always equal 0x48454258 (&amp;quot;XBEH&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0100&lt;br /&gt;
| Digital Signature&lt;br /&gt;
| 256 Bytes. This is where a game is signed. Only on officially signed games is this field worthwhile.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0104&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Base Address&lt;br /&gt;
| Address at which to load this .XBE. Typically this will be 0x00010000.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0108&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Headers&lt;br /&gt;
| Number of bytes that should be reserved for headers.&lt;br /&gt;
|-&lt;br /&gt;
! 0x010C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image&lt;br /&gt;
| Number of bytes that should be reserved for this image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0110&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image Header&lt;br /&gt;
| Number of bytes that should be reserved for the image header. The header size varies by XDK version, but is at least 0x178.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0114&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TimeDate&lt;br /&gt;
| Time and Date when this image was created. Standard windows format.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0118&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Certificate Address&lt;br /&gt;
| Address to a [[#Certificate|Certificate]] structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x011C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Sections&lt;br /&gt;
| Number of sections contained in this .XBE.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0120&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Section Headers Address&lt;br /&gt;
| Address to an array of SectionHeader structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0124&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Initialization Flags&lt;br /&gt;
| Various flags for this .XBE file. Known flags are:&lt;br /&gt;
&lt;br /&gt;
  MountUtilityDrive  = 0x00000001&lt;br /&gt;
  FormatUtilityDrive = 0x00000002&lt;br /&gt;
  Limit64Megabytes   = 0x00000004&lt;br /&gt;
  DontSetupHarddisk  = 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
! 0x0128&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Entry Point&lt;br /&gt;
| Address to the Image entry point, after the .XBE is loaded into memory. This is where execution starts.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0x94859D4B, Retail = 0xA8FC57AB&lt;br /&gt;
&lt;br /&gt;
To encode an entry point, you simply XOR the real entry point with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode an entry point, you XOR with the debug key, then check if it is a valid entry point. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Kernel Image Thunk Address member of this header must also be encoded as described later in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x012C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TLS Address&lt;br /&gt;
| Address to a [[#TLS Table|TLS]] (Thread Local Storage) structure.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0130&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Stack Size&lt;br /&gt;
| Default stack size. As the Xbox does not allow for stacks to grow, this needs to be copied from the SizeOfStackReserve PE field, not SizeOfStackCommit!&lt;br /&gt;
|-&lt;br /&gt;
! 0x0134&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Reserve&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0138&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Commit&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x013C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Base Address&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0140&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Size of Image&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0144&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Checksum&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0148&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE TimeDate&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x014C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug PathName Address&lt;br /&gt;
| Address to the debug pathname (i.e. &amp;quot;D:\Nightlybuilds\011026.0\code\build\xbox\Release\simpsons.exe&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
! 0x0150&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug FileName Address&lt;br /&gt;
| Address to the debug filename (i.e. &amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0154&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address to the UTF-16 debug filename (i.e. L&amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
| UTF-16 Debug FileName Address&lt;br /&gt;
|-&lt;br /&gt;
! 0x0158&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Image Thunk Address&lt;br /&gt;
| Address to the Kernel Image Thunk Table, after the .XBE is loaded into memory. This is how .XBE files import kernel functions and data.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0xEFB1F152, Retail = 0x5B6D40B6&lt;br /&gt;
&lt;br /&gt;
To encode a kernel thunk address, you simply XOR the real address with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode a kernel thunk address, you XOR with the debug key, then check if it is a valid address. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
The Kernel Thunk Table itself is simply an array of pointers to Kernel imports. There are 366 possible imports, and the table is terminated with a zero dword (0x00000000). Typically the values in this table can be generated with the following formula:&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = ImportThunk + 0x80000000;&lt;br /&gt;
&lt;br /&gt;
so, for example, the import PsCreateSystemThreadEx, which has a thunk value of 255 (0xFF) would be...&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = 0xFF + 0x80000000; // (0x800000FF)&lt;br /&gt;
&lt;br /&gt;
When the .XBE is loaded by the OS (or the CXBX Emulator), all kernel imports are replaced by a valid function or data type address. In the case of CXBX, the import table entry at which (KernelThunkTable[v] &amp;amp; 0x1FF == 0xFF) will be replaced by &amp;amp;cxbx_PsCreateSystemThreadEx (which is a wrapper function).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Entry Point member of this header must also be encoded as described earlier in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x015C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Non-Kernel Import Directory Address&lt;br /&gt;
| Address to the Non-Kernel Import Directory. It is typically safe to set this to zero.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0160&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Library Versions&lt;br /&gt;
| Number of Library Versions pointed to by Library Versions Address.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0164&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Library Versions Address&lt;br /&gt;
| Address to an array of LibraryVersion structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0168&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x016C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| XAPI Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0170&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Address&lt;br /&gt;
| Address to the Logo Bitmap (Typically a &amp;quot;Microsoft&amp;quot; logo). The format of this image is described here. This field can be set to zero, meaning there is no bitmap present.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0174&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Size&lt;br /&gt;
| Size (in bytes) of the Logo Bitmap data. The format of this image is described here.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0178&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Unknown1&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5028.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0180&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Unknown2&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5455.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== TLS Table ==&lt;br /&gt;
&lt;br /&gt;
The TLS Table contains all the information needed by the XBE to properly set up thread-local storage. It is structurally identical to the TLS Directory found in PE32 files&amp;lt;ref&amp;gt;https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#the-tls-section&amp;lt;/ref&amp;gt;, and can be directly copied from there. If the XBE does not use any thread-local storage, this table may be omitted, and the respective field in the image header set to zero.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data Start&lt;br /&gt;
| Absolute (i.e. not an RVA) address of start of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Raw Data End&lt;br /&gt;
| Absolute (i.e. not an RVA) address of end of the TLS variable data in the program image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0008&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Index&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the TLS Index variable.&lt;br /&gt;
|-&lt;br /&gt;
! 0x000C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address of Callbacks&lt;br /&gt;
| Absolute (i.e. not an RVA) address of the null-terminated TLS callback functions table.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0010&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Zero Fill&lt;br /&gt;
| The number of bytes following the raw data that should be set to zero in memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0014&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Characteristics&lt;br /&gt;
| Describes alignment.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Certificate =&lt;br /&gt;
&lt;br /&gt;
Each Xbox executable has a certificate that contains information about the title.&lt;br /&gt;
&lt;br /&gt;
* Time and date when the certificate was created&lt;br /&gt;
* Title ID&lt;br /&gt;
* Title name&lt;br /&gt;
* Alternative title IDs&lt;br /&gt;
* Allowed types of media that the executable can be run from (HD, DVD, CD, etc.)&lt;br /&gt;
* Game region&lt;br /&gt;
* Game ratings&lt;br /&gt;
* Disk number&lt;br /&gt;
* Version&lt;br /&gt;
* LAN key raw data used for [[System Link]]&lt;br /&gt;
* Signature key raw data (used to sign [[Xbox Savegame System|savegames]])&lt;br /&gt;
* Alternate signature keys&lt;br /&gt;
* Original size of the certificate&lt;br /&gt;
* Online service name (not present in early executables)&lt;br /&gt;
* Run time security flags (not present in early executables)&lt;br /&gt;
&lt;br /&gt;
=== Title ID ===&lt;br /&gt;
&lt;br /&gt;
A title ID is usually 2 ASCII letters for the publisher, followed by a u16 integer game number (Above 2000 for non-original Xbox games)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Publisher ID !! Name&lt;br /&gt;
|-&lt;br /&gt;
| AC || Acclaim Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AH || ARUSH Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AQ || Aqua System&lt;br /&gt;
|-&lt;br /&gt;
| AS || ASK&lt;br /&gt;
|-&lt;br /&gt;
| AT || Atlus&lt;br /&gt;
|-&lt;br /&gt;
| AV || Activision&lt;br /&gt;
|-&lt;br /&gt;
| AY || Aspyr Media&lt;br /&gt;
|-&lt;br /&gt;
| BA || Bandai&lt;br /&gt;
|-&lt;br /&gt;
| BL || Black Box&lt;br /&gt;
|-&lt;br /&gt;
| BM || BAM! Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| BR || Broccoli Co.&lt;br /&gt;
|-&lt;br /&gt;
| BS || Bethesda Softworks&lt;br /&gt;
|-&lt;br /&gt;
| BU || Bunkasha Co.&lt;br /&gt;
|-&lt;br /&gt;
| BV || Buena Vista Games&lt;br /&gt;
|-&lt;br /&gt;
| BW || BBC Multimedia&lt;br /&gt;
|-&lt;br /&gt;
| BZ || Blizzard&lt;br /&gt;
|-&lt;br /&gt;
| CC || Capcom&lt;br /&gt;
|-&lt;br /&gt;
| CK || Kemco Corporation {{citation needed|reason=Did they realy swapped the ASCII letters? is KC a curced acroniem in Japan? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| CM || Codemasters&lt;br /&gt;
|-&lt;br /&gt;
| CV || Crave Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| DC || DreamCatcher Interactive&lt;br /&gt;
|-&lt;br /&gt;
| DX || Davilex&lt;br /&gt;
|-&lt;br /&gt;
| EA || Electronic Arts (EA)&lt;br /&gt;
|-&lt;br /&gt;
| EC || Encore inc&lt;br /&gt;
|-&lt;br /&gt;
| EL || Enlight Software&lt;br /&gt;
|-&lt;br /&gt;
| EM || Empire Interactive&lt;br /&gt;
|-&lt;br /&gt;
| ES || Eidos Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FI || Fox Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FS || From Software&lt;br /&gt;
|-&lt;br /&gt;
| GE || Genki Co.&lt;br /&gt;
|-&lt;br /&gt;
| GV || Groove Games&lt;br /&gt;
|-&lt;br /&gt;
| HE || Tru Blu (Entertainment division of Home Entertainment Suppliers)&lt;br /&gt;
|-&lt;br /&gt;
| HP || Hip games&lt;br /&gt;
|-&lt;br /&gt;
| HU || Hudson Soft&lt;br /&gt;
|-&lt;br /&gt;
| HW || Highwaystar&lt;br /&gt;
|-&lt;br /&gt;
| IA || Mad Catz Interactive&lt;br /&gt;
|-&lt;br /&gt;
| IF || Idea Factory&lt;br /&gt;
|-&lt;br /&gt;
| IG || Infogrames&lt;br /&gt;
|-&lt;br /&gt;
| IL || [[Interlex Corporation]]&lt;br /&gt;
|-&lt;br /&gt;
| IM || Imagine Media&lt;br /&gt;
|-&lt;br /&gt;
| IO || Ignition Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IP || Interplay Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IX || InXile Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| JA || Jaleco&lt;br /&gt;
|-&lt;br /&gt;
| JW || JoWooD&lt;br /&gt;
|-&lt;br /&gt;
| KB || Kemco {{citation needed|reason=CK is also Kemco, is this a diferent subsidairy or country based? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KI || Kids Station Inc. {{citation needed|reason=Games info page was in japanese, I dont read japanese. but this seemed very logicaly the publisher, can a japanese reader confirm?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KN || Konami&lt;br /&gt;
|-&lt;br /&gt;
| KO || KOEI&lt;br /&gt;
|-&lt;br /&gt;
| KU || Kobi and/or GAE (formerly Global A Entertainment){{citation needed|reason=What name did the publisher use at the time of release?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| LA || LucasArts&lt;br /&gt;
|-&lt;br /&gt;
| LS || Black Bean Games (publishing arm of Leader S.p.A.)&lt;br /&gt;
|-&lt;br /&gt;
| MD || Metro3D&lt;br /&gt;
|-&lt;br /&gt;
| ME || Medix&lt;br /&gt;
|-&lt;br /&gt;
| MI || Microïds&lt;br /&gt;
|-&lt;br /&gt;
| MJ || Majesco Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| MM || Myelin Media&lt;br /&gt;
|-&lt;br /&gt;
| MP || MediaQuest {{citation needed|reason=Where is the P? I dont trust my source yet... but seems close|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| MS || Microsoft Game Studios&lt;br /&gt;
|-&lt;br /&gt;
| MW || Midway Games&lt;br /&gt;
|-&lt;br /&gt;
| MX || Empire Interactive {{citation needed|reason=What happend to the publisher, who published this game?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| NK || NewKidCo&lt;br /&gt;
|-&lt;br /&gt;
| NL || NovaLogic&lt;br /&gt;
|-&lt;br /&gt;
| NM || Namco&lt;br /&gt;
|-&lt;br /&gt;
| OX || Oxygen Interactive&lt;br /&gt;
|-&lt;br /&gt;
| PC || Playlogic Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| PL || Phantagram Co., Ltd.&lt;br /&gt;
|-&lt;br /&gt;
| RA || Rage&lt;br /&gt;
|-&lt;br /&gt;
| SA || Sammy&lt;br /&gt;
|-&lt;br /&gt;
| SC || SCi Games&lt;br /&gt;
|-&lt;br /&gt;
| SE || SEGA&lt;br /&gt;
|-&lt;br /&gt;
| SN || SNK&lt;br /&gt;
|-&lt;br /&gt;
| SS || Simon &amp;amp; Schuster&lt;br /&gt;
|-&lt;br /&gt;
| SU || Success Corporation&lt;br /&gt;
|-&lt;br /&gt;
| SW || Swing! Deutschland&lt;br /&gt;
|-&lt;br /&gt;
| TA || Takara&lt;br /&gt;
|-&lt;br /&gt;
| TC || Tecmo&lt;br /&gt;
|-&lt;br /&gt;
| TD || The 3DO Company (or just 3DO)&lt;br /&gt;
|-&lt;br /&gt;
| TK || Takuyo&lt;br /&gt;
|-&lt;br /&gt;
| TM || TDK Mediactive&lt;br /&gt;
|-&lt;br /&gt;
| TQ || THQ&lt;br /&gt;
|-&lt;br /&gt;
| TS || Titus Interactive&lt;br /&gt;
|-&lt;br /&gt;
| TT || Take-Two Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| US || Ubisoft&lt;br /&gt;
|-&lt;br /&gt;
| VC || Victor Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| VN || Vivendi Universal (just took Interplays publishing rights) {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| VU || Vivendi Universal Games&lt;br /&gt;
|-&lt;br /&gt;
| VV || Vivendi Universal Games {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| WE || Wanadoo Edition&lt;br /&gt;
|-&lt;br /&gt;
| WR || Warner Bros. Interactive Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XI || XPEC Entertainment and Idea Factory &lt;br /&gt;
|-&lt;br /&gt;
| XK || ''Xbox kiosk disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XL || ''Xbox special bundled or live demo disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XM || Evolved Games {{citation needed|reason=Probably not, game &amp;quot;Malice&amp;quot;|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| XP || XPEC Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| XR || Panorama&lt;br /&gt;
|-&lt;br /&gt;
| YB || YBM Sisa (South-Korea)&lt;br /&gt;
|-&lt;br /&gt;
| ZD || Zushi Games (formerly Zoo Digital Publishing)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The title ID seems to double the information from the [[Xbox Game Disc]] mastering code etched into the ring or readable from the DMI.&lt;br /&gt;
The game number is expressed in 3 decimal digits here which suggests that it will always be below 1000.&lt;br /&gt;
&lt;br /&gt;
'''Examples''':&lt;br /&gt;
&lt;br /&gt;
[[FIFA Soccer 2003]]:&lt;br /&gt;
* DMI and mastering code: EA02302E (Meaning: publisher EA, game number 023, version 02, region Europe)&lt;br /&gt;
* Title ID: {{FIXME}}&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00402A (Meaning: publisher Microsoft, game number 004, version 02, region America)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00404E (Meaning: publisher Microsoft, game number 004, version 04, region Europe)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
== Allowed media types ==&lt;br /&gt;
Allowed media types off which the executable is allowed to be run from. The following values are known:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Media type !! Value&lt;br /&gt;
|-&lt;br /&gt;
|HARD_DISK        || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|DVD_X2           || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
|DVD_CD           || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
|CD               || 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RO         || 0x00000010&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RO         || 0x00000020&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RW         || 0x00000040&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RW         || 0x00000080&lt;br /&gt;
|-&lt;br /&gt;
|DONGLE           || 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_BOARD      || 0x00000200&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_HARD_DISK || 0x40000000&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_MODE   || 0x80000000&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_MASK       || 0x00FFFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Sections =&lt;br /&gt;
The sections are described by the section headers. The section headers start right after the certificate and contain describe where in the file the actual sections reside. Each header contains a hash of the section that is checked by the Xbox to ensure the integrity of the sections. &lt;br /&gt;
&lt;br /&gt;
At least two sections are always present in an Xbox executable: .text and .rdata. There might be more sections that contain either executable code or resources such as images, text, etc.&lt;br /&gt;
&lt;br /&gt;
== .text ==&lt;br /&gt;
&lt;br /&gt;
The .text section contains all x86 subroutines to be executed by the [[CPU|processor]].&lt;br /&gt;
&lt;br /&gt;
== .rdata ==&lt;br /&gt;
&lt;br /&gt;
The .rdata section contains the [[Kernel|kernel thunk table]]. The ordinals in the table are to be resolved to the kernel's actual calling routine, when loaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Xbox Alpha executable format=&lt;br /&gt;
&lt;br /&gt;
Binaries from early Xbox development (Alpha units), are using a different binary format. There are no known public tools that can read them.&lt;br /&gt;
Known differences include that the first bytes of the file are 'XE' instead the 'XBEH' from the final XBE format. The format is rumored to be more like the Windows PE format.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
== Resources and links ==&lt;br /&gt;
* [http://www.caustik.com/cxbx/download/xbe.htm .XBE File Format 1.1]&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Fileformats]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6940</id>
		<title>Xbe</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=Xbe&amp;diff=6940"/>
				<updated>2021-05-11T18:18:51Z</updated>
		
		<summary type="html">&lt;p&gt;Thrimbor: Add full image header table. Mostly taken from caustik, but with fixes and enhancements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:XBE}}&lt;br /&gt;
XBE files (XBox Executable) are the main files that are executed in the Xbox System. In official games, these files are created by game developers, and then signed by Microsoft. &lt;br /&gt;
&lt;br /&gt;
The file structure is adapted from Windows PE files. It is very similar, however it has important changes for the Xbox. The file is composed of an image header, a certificate, a collection of section headers, a collection of library versions, thread local storage data, a Microsoft bitmap, and the sections that contain the code and resources.&lt;br /&gt;
&lt;br /&gt;
= Image Header = &lt;br /&gt;
&lt;br /&gt;
The image header contains the information that describes where the other parts of the executable are located within the file, and how the executable should be treated and loaded. It has the following layout (all fields are little-endian):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&lt;br /&gt;
|-&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Name&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
! 0x0000&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Magic Number&lt;br /&gt;
| This field must always equal 0x48454258 (&amp;quot;XBEH&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0004&lt;br /&gt;
! 0x0100&lt;br /&gt;
| Digital Signature&lt;br /&gt;
| 256 Bytes. This is where a game is signed. Only on officially signed games is this field worthwhile.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0104&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Base Address&lt;br /&gt;
| Address at which to load this .XBE. Typically this will be 0x00010000.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0108&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Headers&lt;br /&gt;
| Number of bytes that should be reserved for headers.&lt;br /&gt;
|-&lt;br /&gt;
! 0x010C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image&lt;br /&gt;
| Number of bytes that should be reserved for this image.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0110&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Size of Image Header&lt;br /&gt;
| Number of bytes that should be reserved for the image header. The header size varies by XDK version, but is at least 0x178.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0114&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TimeDate&lt;br /&gt;
| Time and Date when this image was created. Standard windows format.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0118&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Certificate Address&lt;br /&gt;
| Address to a [[#Certificate|Certificate]] structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x011C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Sections&lt;br /&gt;
| Number of sections contained in this .XBE.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0120&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Section Headers Address&lt;br /&gt;
| Address to an array of SectionHeader structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0124&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Initialization Flags&lt;br /&gt;
| Various flags for this .XBE file. Known flags are:&lt;br /&gt;
&lt;br /&gt;
  MountUtilityDrive  = 0x00000001&lt;br /&gt;
  FormatUtilityDrive = 0x00000002&lt;br /&gt;
  Limit64Megabytes   = 0x00000004&lt;br /&gt;
  DontSetupHarddisk  = 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
! 0x0128&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Entry Point&lt;br /&gt;
| Address to the Image entry point, after the .XBE is loaded into memory. This is where execution starts.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0x94859D4B, Retail = 0xA8FC57AB&lt;br /&gt;
&lt;br /&gt;
To encode an entry point, you simply XOR the real entry point with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode an entry point, you XOR with the debug key, then check if it is a valid entry point. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Kernel Image Thunk Address member of this header must also be encoded as described later in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x012C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| TLS Address&lt;br /&gt;
| Address to a TLS (Thread Local Storage) structure.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0130&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Stack Size&lt;br /&gt;
| Default stack size. As the Xbox does not allow for stacks to grow, this needs to be copied from the SizeOfStackReserve PE field, not SizeOfStackCommit!&lt;br /&gt;
|-&lt;br /&gt;
! 0x0134&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Reserve&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0138&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Heap Commit&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x013C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Base Address&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0140&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Size of Image&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0144&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE Checksum&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0148&lt;br /&gt;
! 0x0004&lt;br /&gt;
| PE TimeDate&lt;br /&gt;
| Copied from the PE file this .XBE was created from.&lt;br /&gt;
|-&lt;br /&gt;
! 0x014C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug PathName Address&lt;br /&gt;
| Address to the debug pathname (i.e. &amp;quot;D:\Nightlybuilds\011026.0\code\build\xbox\Release\simpsons.exe&amp;quot;).&lt;br /&gt;
|-&lt;br /&gt;
! 0x0150&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Debug FileName Address&lt;br /&gt;
| Address to the debug filename (i.e. &amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
! 0x0154&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Address to the UTF-16 debug filename (i.e. L&amp;quot;simpsons.exe&amp;quot;)&lt;br /&gt;
| UTF-16 Debug FileName Address&lt;br /&gt;
|-&lt;br /&gt;
! 0x0158&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Image Thunk Address&lt;br /&gt;
| Address to the Kernel Image Thunk Table, after the .XBE is loaded into memory. This is how .XBE files import kernel functions and data.&lt;br /&gt;
&lt;br /&gt;
This value is encoded with an XOR key. Considering this is far too weak to be considered security, I assume this XOR is a clever method for discerning between Debug/Retail .XBE files without adding another field to the .XBE header. The XOR key is dependant on the build:&lt;br /&gt;
&lt;br /&gt;
  Debug = 0xEFB1F152, Retail = 0x5B6D40B6&lt;br /&gt;
&lt;br /&gt;
To encode a kernel thunk address, you simply XOR the real address with either Debug or Retail key, depending on if you want the XBox to see this as a Debug or Retail executable.&lt;br /&gt;
&lt;br /&gt;
To decode a kernel thunk address, you XOR with the debug key, then check if it is a valid address. If it is not, then you try again with the retail key.&lt;br /&gt;
&lt;br /&gt;
The Kernel Thunk Table itself is simply an array of pointers to Kernel imports. There are 366 possible imports, and the table is terminated with a zero dword (0x00000000). Typically the values in this table can be generated with the following formula:&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = ImportThunk + 0x80000000;&lt;br /&gt;
&lt;br /&gt;
so, for example, the import PsCreateSystemThreadEx, which has a thunk value of 255 (0xFF) would be...&lt;br /&gt;
&lt;br /&gt;
  KernelThunkTable[v] = 0xFF + 0x80000000; // (0x800000FF)&lt;br /&gt;
&lt;br /&gt;
When the .XBE is loaded by the OS (or the CXBX Emulator), all kernel imports are replaced by a valid function or data type address. In the case of CXBX, the import table entry at which (KernelThunkTable[v] &amp;amp; 0x1FF == 0xFF) will be replaced by &amp;amp;cxbx_PsCreateSystemThreadEx (which is a wrapper function).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: The Entry Point member of this header must also be encoded as described earlier in this document.&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0x015C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Non-Kernel Import Directory Address&lt;br /&gt;
| Address to the Non-Kernel Import Directory. It is typically safe to set this to zero.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0160&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Number of Library Versions&lt;br /&gt;
| Number of Library Versions pointed to by Library Versions Address.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0164&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Library Versions Address&lt;br /&gt;
| Address to an array of LibraryVersion structures, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0168&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Kernel Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x016C&lt;br /&gt;
! 0x0004&lt;br /&gt;
| XAPI Library Version Address&lt;br /&gt;
| Address to a LibraryVersion structure, after the .XBE is loaded into memory.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0170&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Address&lt;br /&gt;
| Address to the Logo Bitmap (Typically a &amp;quot;Microsoft&amp;quot; logo). The format of this image is described here. This field can be set to zero, meaning there is no bitmap present.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0174&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Logo Bitmap Size&lt;br /&gt;
| Size (in bytes) of the Logo Bitmap data. The format of this image is described here.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0178&lt;br /&gt;
! 0x0008&lt;br /&gt;
| Unknown1&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5028.&lt;br /&gt;
|-&lt;br /&gt;
! 0x0180&lt;br /&gt;
! 0x0004&lt;br /&gt;
| Unknown2&lt;br /&gt;
| The meaning of this field hasn't been figured out yet. It only exists on XBEs built with an XDK version &amp;gt;= 5455.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Certificate =&lt;br /&gt;
&lt;br /&gt;
Each Xbox executable has a certificate that contains information about the title.&lt;br /&gt;
&lt;br /&gt;
* Time and date when the certificate was created&lt;br /&gt;
* Title ID&lt;br /&gt;
* Title name&lt;br /&gt;
* Alternative title IDs&lt;br /&gt;
* Allowed types of media that the executable can be run from (HD, DVD, CD, etc.)&lt;br /&gt;
* Game region&lt;br /&gt;
* Game ratings&lt;br /&gt;
* Disk number&lt;br /&gt;
* Version&lt;br /&gt;
* LAN key raw data used for [[System Link]]&lt;br /&gt;
* Signature key raw data (used to sign [[Xbox Savegame System|savegames]])&lt;br /&gt;
* Alternate signature keys&lt;br /&gt;
* Original size of the certificate&lt;br /&gt;
* Online service name (not present in early executables)&lt;br /&gt;
* Run time security flags (not present in early executables)&lt;br /&gt;
&lt;br /&gt;
=== Title ID ===&lt;br /&gt;
&lt;br /&gt;
A title ID is usually 2 ASCII letters for the publisher, followed by a u16 integer game number (Above 2000 for non-original Xbox games)&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Publisher ID !! Name&lt;br /&gt;
|-&lt;br /&gt;
| AC || Acclaim Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AH || ARUSH Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| AQ || Aqua System&lt;br /&gt;
|-&lt;br /&gt;
| AS || ASK&lt;br /&gt;
|-&lt;br /&gt;
| AT || Atlus&lt;br /&gt;
|-&lt;br /&gt;
| AV || Activision&lt;br /&gt;
|-&lt;br /&gt;
| AY || Aspyr Media&lt;br /&gt;
|-&lt;br /&gt;
| BA || Bandai&lt;br /&gt;
|-&lt;br /&gt;
| BL || Black Box&lt;br /&gt;
|-&lt;br /&gt;
| BM || BAM! Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| BR || Broccoli Co.&lt;br /&gt;
|-&lt;br /&gt;
| BS || Bethesda Softworks&lt;br /&gt;
|-&lt;br /&gt;
| BU || Bunkasha Co.&lt;br /&gt;
|-&lt;br /&gt;
| BV || Buena Vista Games&lt;br /&gt;
|-&lt;br /&gt;
| BW || BBC Multimedia&lt;br /&gt;
|-&lt;br /&gt;
| BZ || Blizzard&lt;br /&gt;
|-&lt;br /&gt;
| CC || Capcom&lt;br /&gt;
|-&lt;br /&gt;
| CK || Kemco Corporation {{citation needed|reason=Did they realy swapped the ASCII letters? is KC a curced acroniem in Japan? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| CM || Codemasters&lt;br /&gt;
|-&lt;br /&gt;
| CV || Crave Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| DC || DreamCatcher Interactive&lt;br /&gt;
|-&lt;br /&gt;
| DX || Davilex&lt;br /&gt;
|-&lt;br /&gt;
| EA || Electronic Arts (EA)&lt;br /&gt;
|-&lt;br /&gt;
| EC || Encore inc&lt;br /&gt;
|-&lt;br /&gt;
| EL || Enlight Software&lt;br /&gt;
|-&lt;br /&gt;
| EM || Empire Interactive&lt;br /&gt;
|-&lt;br /&gt;
| ES || Eidos Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FI || Fox Interactive&lt;br /&gt;
|-&lt;br /&gt;
| FS || From Software&lt;br /&gt;
|-&lt;br /&gt;
| GE || Genki Co.&lt;br /&gt;
|-&lt;br /&gt;
| GV || Groove Games&lt;br /&gt;
|-&lt;br /&gt;
| HE || Tru Blu (Entertainment division of Home Entertainment Suppliers)&lt;br /&gt;
|-&lt;br /&gt;
| HP || Hip games&lt;br /&gt;
|-&lt;br /&gt;
| HU || Hudson Soft&lt;br /&gt;
|-&lt;br /&gt;
| HW || Highwaystar&lt;br /&gt;
|-&lt;br /&gt;
| IA || Mad Catz Interactive&lt;br /&gt;
|-&lt;br /&gt;
| IF || Idea Factory&lt;br /&gt;
|-&lt;br /&gt;
| IG || Infogrames&lt;br /&gt;
|-&lt;br /&gt;
| IL || [[Interlex Corporation]]&lt;br /&gt;
|-&lt;br /&gt;
| IM || Imagine Media&lt;br /&gt;
|-&lt;br /&gt;
| IO || Ignition Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IP || Interplay Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| IX || InXile Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| JA || Jaleco&lt;br /&gt;
|-&lt;br /&gt;
| JW || JoWooD&lt;br /&gt;
|-&lt;br /&gt;
| KB || Kemco {{citation needed|reason=CK is also Kemco, is this a diferent subsidairy or country based? Just want to be sure its Kemco|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KI || Kids Station Inc. {{citation needed|reason=Games info page was in japanese, I dont read japanese. but this seemed very logicaly the publisher, can a japanese reader confirm?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| KN || Konami&lt;br /&gt;
|-&lt;br /&gt;
| KO || KOEI&lt;br /&gt;
|-&lt;br /&gt;
| KU || Kobi and/or GAE (formerly Global A Entertainment){{citation needed|reason=What name did the publisher use at the time of release?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| LA || LucasArts&lt;br /&gt;
|-&lt;br /&gt;
| LS || Black Bean Games (publishing arm of Leader S.p.A.)&lt;br /&gt;
|-&lt;br /&gt;
| MD || Metro3D&lt;br /&gt;
|-&lt;br /&gt;
| ME || Medix&lt;br /&gt;
|-&lt;br /&gt;
| MI || Microïds&lt;br /&gt;
|-&lt;br /&gt;
| MJ || Majesco Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| MM || Myelin Media&lt;br /&gt;
|-&lt;br /&gt;
| MP || MediaQuest {{citation needed|reason=Where is the P? I dont trust my source yet... but seems close|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| MS || Microsoft Game Studios&lt;br /&gt;
|-&lt;br /&gt;
| MW || Midway Games&lt;br /&gt;
|-&lt;br /&gt;
| MX || Empire Interactive {{citation needed|reason=What happend to the publisher, who published this game?|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| NK || NewKidCo&lt;br /&gt;
|-&lt;br /&gt;
| NL || NovaLogic&lt;br /&gt;
|-&lt;br /&gt;
| NM || Namco&lt;br /&gt;
|-&lt;br /&gt;
| OX || Oxygen Interactive&lt;br /&gt;
|-&lt;br /&gt;
| PC || Playlogic Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| PL || Phantagram Co., Ltd.&lt;br /&gt;
|-&lt;br /&gt;
| RA || Rage&lt;br /&gt;
|-&lt;br /&gt;
| SA || Sammy&lt;br /&gt;
|-&lt;br /&gt;
| SC || SCi Games&lt;br /&gt;
|-&lt;br /&gt;
| SE || SEGA&lt;br /&gt;
|-&lt;br /&gt;
| SN || SNK&lt;br /&gt;
|-&lt;br /&gt;
| SS || Simon &amp;amp; Schuster&lt;br /&gt;
|-&lt;br /&gt;
| SU || Success Corporation&lt;br /&gt;
|-&lt;br /&gt;
| SW || Swing! Deutschland&lt;br /&gt;
|-&lt;br /&gt;
| TA || Takara&lt;br /&gt;
|-&lt;br /&gt;
| TC || Tecmo&lt;br /&gt;
|-&lt;br /&gt;
| TD || The 3DO Company (or just 3DO)&lt;br /&gt;
|-&lt;br /&gt;
| TK || Takuyo&lt;br /&gt;
|-&lt;br /&gt;
| TM || TDK Mediactive&lt;br /&gt;
|-&lt;br /&gt;
| TQ || THQ&lt;br /&gt;
|-&lt;br /&gt;
| TS || Titus Interactive&lt;br /&gt;
|-&lt;br /&gt;
| TT || Take-Two Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| US || Ubisoft&lt;br /&gt;
|-&lt;br /&gt;
| VC || Victor Interactive Software&lt;br /&gt;
|-&lt;br /&gt;
| VN || Vivendi Universal (just took Interplays publishing rights) {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| VU || Vivendi Universal Games&lt;br /&gt;
|-&lt;br /&gt;
| VV || Vivendi Universal Games {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| WE || Wanadoo Edition&lt;br /&gt;
|-&lt;br /&gt;
| WR || Warner Bros. Interactive Entertainment {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XI || XPEC Entertainment and Idea Factory &lt;br /&gt;
|-&lt;br /&gt;
| XK || ''Xbox kiosk disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XL || ''Xbox special bundled or live demo disk?'' {{citation needed}}&lt;br /&gt;
|-&lt;br /&gt;
| XM || Evolved Games {{citation needed|reason=Probably not, game &amp;quot;Malice&amp;quot;|date=May 2017}}&lt;br /&gt;
|-&lt;br /&gt;
| XP || XPEC Entertainment&lt;br /&gt;
|-&lt;br /&gt;
| XR || Panorama&lt;br /&gt;
|-&lt;br /&gt;
| YB || YBM Sisa (South-Korea)&lt;br /&gt;
|-&lt;br /&gt;
| ZD || Zushi Games (formerly Zoo Digital Publishing)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The title ID seems to double the information from the [[Xbox Game Disc]] mastering code etched into the ring or readable from the DMI.&lt;br /&gt;
The game number is expressed in 3 decimal digits here which suggests that it will always be below 1000.&lt;br /&gt;
&lt;br /&gt;
'''Examples''':&lt;br /&gt;
&lt;br /&gt;
[[FIFA Soccer 2003]]:&lt;br /&gt;
* DMI and mastering code: EA02302E (Meaning: publisher EA, game number 023, version 02, region Europe)&lt;br /&gt;
* Title ID: {{FIXME}}&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00402A (Meaning: publisher Microsoft, game number 004, version 02, region America)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
[[Halo: Combat Evolved]]:&lt;br /&gt;
* DMI and mastering code: MS00404E (Meaning: publisher Microsoft, game number 004, version 04, region Europe)&lt;br /&gt;
* Title ID: 4D530004 [MS-004]&lt;br /&gt;
&lt;br /&gt;
== Allowed media types ==&lt;br /&gt;
Allowed media types off which the executable is allowed to be run from. The following values are known:&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! Media type !! Value&lt;br /&gt;
|-&lt;br /&gt;
|HARD_DISK        || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
|DVD_X2           || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
|DVD_CD           || 0x00000004&lt;br /&gt;
|-&lt;br /&gt;
|CD               || 0x00000008&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RO         || 0x00000010&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RO         || 0x00000020&lt;br /&gt;
|-&lt;br /&gt;
|DVD_5_RW         || 0x00000040&lt;br /&gt;
|-&lt;br /&gt;
|DVD_9_RW         || 0x00000080&lt;br /&gt;
|-&lt;br /&gt;
|DONGLE           || 0x00000100&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_BOARD      || 0x00000200&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_HARD_DISK || 0x40000000&lt;br /&gt;
|-&lt;br /&gt;
|NONSECURE_MODE   || 0x80000000&lt;br /&gt;
|-&lt;br /&gt;
|MEDIA_MASK       || 0x00FFFFFF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Sections =&lt;br /&gt;
The sections are described by the section headers. The section headers start right after the certificate and contain describe where in the file the actual sections reside. Each header contains a hash of the section that is checked by the Xbox to ensure the integrity of the sections. &lt;br /&gt;
&lt;br /&gt;
At least two sections are always present in an Xbox executable: .text and .rdata. There might be more sections that contain either executable code or resources such as images, text, etc.&lt;br /&gt;
&lt;br /&gt;
== .text ==&lt;br /&gt;
&lt;br /&gt;
The .text section contains all x86 subroutines to be executed by the [[CPU|processor]].&lt;br /&gt;
&lt;br /&gt;
== .rdata ==&lt;br /&gt;
&lt;br /&gt;
The .rdata section contains the [[Kernel|kernel thunk table]]. The ordinals in the table are to be resolved to the kernel's actual calling routine, when loaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Xbox Alpha executable format=&lt;br /&gt;
&lt;br /&gt;
Binaries from early Xbox development (Alpha units), are using a different binary format. There are no known public tools that can read them.&lt;br /&gt;
Known differences include that the first bytes of the file are 'XE' instead the 'XBEH' from the final XBE format. The format is rumored to be more like the Windows PE format.{{citation needed}}&lt;br /&gt;
&lt;br /&gt;
== Resources and links ==&lt;br /&gt;
* [http://www.caustik.com/cxbx/download/xbe.htm .XBE File Format 1.1]&lt;br /&gt;
&lt;br /&gt;
[[Category:Fileformats]]&lt;/div&gt;</summary>
		<author><name>Thrimbor</name></author>	</entry>

	</feed>