PE-level shape of a GDK console executable (sections, imports, no version resource) #901

Closed
opened 2026-11-23 16:45:03 +00:00 by JoshRob297 · 5 comments
JoshRob297 commented 2026-11-23 16:45:03 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by JoshRob297 on 2026-11-23T16:45:03Z.


General PE-level observations about a GDK console executable, in case they save time on the PE side. Static only: the file is read as data and never executed.

Zero-fill in .data. The writable data section's virtual size is about an order of magnitude larger than its raw size. The image therefore needs SizeOfImage worth of committed memory, and the loader has to zero that range rather than just map file bytes. A mapping path that sizes memory from the raw section data, or from SizeOfUninitializedData, will under-allocate.

Build-metadata sections. Two sections share the name .xbld and carry build metadata, not code. One of them is writable and discardable.

No certificate directory and no resource directory. The file is unsigned and has no version resource, so a check that expects VS_VERSIONINFO finds nothing.

Imports are console-side. They go through the OneCore API sets plus GDK console modules (for example AcpHal.dll and the Xbox D3D12 module) and some third-party middleware modules. Asset I/O uses the ordinary Win32 file calls (CreateFileW, ReadFile, FindFirstFileW, FindNextFileW, GetFileAttributesW), and DStorageGetFactory is imported as well. DirectStorage on console and on desktop do not resolve to the same implementation.

Asset locations come from configuration, not code. The binary reads its archive directory from settings keys, so a compatibility layer could point those settings elsewhere instead of patching a mount path. Whether redirecting a path is sufficient still has to be shown with a source-built case.

Edited by @MasterDomino to keep this issue title-neutral, per the maintainer's request in this thread: exact sizes, names and other values taken from the private file were removed, and the general PE observations were kept.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6564164697 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908). Originally posted by [JoshRob297](https://github.com/JoshRob297) on 2026-11-23T16:45:03Z. --- General PE-level observations about a GDK console executable, in case they save time on the PE side. Static only: the file is read as data and never executed. **Zero-fill in `.data`.** The writable data section's virtual size is about an order of magnitude larger than its raw size. The image therefore needs `SizeOfImage` worth of committed memory, and the loader has to zero that range rather than just map file bytes. A mapping path that sizes memory from the raw section data, or from `SizeOfUninitializedData`, will under-allocate. **Build-metadata sections.** Two sections share the name `.xbld` and carry build metadata, not code. One of them is writable and discardable. **No certificate directory and no resource directory.** The file is unsigned and has no version resource, so a check that expects `VS_VERSIONINFO` finds nothing. **Imports are console-side.** They go through the OneCore API sets plus GDK console modules (for example `AcpHal.dll` and the Xbox D3D12 module) and some third-party middleware modules. Asset I/O uses the ordinary Win32 file calls (`CreateFileW`, `ReadFile`, `FindFirstFileW`, `FindNextFileW`, `GetFileAttributesW`), and `DStorageGetFactory` is imported as well. DirectStorage on console and on desktop do not resolve to the same implementation. **Asset locations come from configuration, not code.** The binary reads its archive directory from settings keys, so a compatibility layer could point those settings elsewhere instead of patching a mount path. Whether redirecting a path is sufficient still has to be shown with a source-built case. _Edited by @MasterDomino to keep this issue title-neutral, per the maintainer's request in this thread: exact sizes, names and other values taken from the private file were removed, and the general PE observations were kept._
R0Y00 commented 2026-11-24 06:49:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:50:13Z.


Thanks for the static observations. The mapper already allocates SizeOfImage and preserves zero-fill beyond the raw section extent. The existing source-built section and image-data fixtures cover that behavior. #890 has merged; it inventories import closure, including forwarded exports, so the full local list isn't needed here. Import names and configuration strings alone don't establish which storage calls execute or whether redirecting a path is sufficient. If you find a specific mismatch, a source-built case with the PE field, expected and actual values, and the first diagnostic would be useful. Please keep the executable and other local files private.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107746314 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7107746314). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T16:50:13Z. --- Thanks for the static observations. The mapper already allocates SizeOfImage and preserves zero-fill beyond the raw section extent. The existing source-built section and image-data fixtures cover that behavior. #890 has merged; it inventories import closure, including forwarded exports, so the full local list isn't needed here. Import names and configuration strings alone don't establish which storage calls execute or whether redirecting a path is sufficient. If you find a specific mismatch, a source-built case with the PE field, expected and actual values, and the first diagnostic would be useful. Please keep the executable and other local files private.
triggered02 commented 2026-11-24 06:49:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T21:49:25Z.


Answering this from a read-only parse of the entry image (pefile, independently spot-checked). Will post the section table, header fields, import/export summary, exception/TLS directories, and the version-resource finding below. Static only; nothing executed or uploaded.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7114964515 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7114964515). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T21:49:25Z. --- Answering this from a read-only parse of the entry image (pefile, independently spot-checked). Will post the section table, header fields, import/export summary, exception/TLS directories, and the version-resource finding below. Static only; nothing executed or uploaded.
triggered02 commented 2026-11-24 06:49:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T21:50:10Z.


Answering from a read-only parse of a GDK console entry image, using pefile and the repo's own tools/pe_inventory.py readers. Static only: nothing was executed, loaded or uploaded.

Bottom line: it is an ordinary, unsigned x64 PE32+ desktop-format image: DOS stub, COFF header, standard data directories, DIR64 relocations. Its section and import content are GDK-specific. It is AMD64, not ARM64/XBE/XEX; the packaging is Xbox, but the executable format is Windows PE. There is no resource section at all, hence no VS_VERSION_INFO, and no embedded certificate.

Header

  • Machine AMD64, Magic PE32+, Characteristics EXECUTABLE_IMAGE | LARGE_ADDRESS_AWARE (not a DLL; relocations not stripped).
  • Subsystem WINDOWS_GUI (not CONSOLE). DllCharacteristics has HIGH_ENTROPY_VA | DYNAMIC_BASE | NX_COMPAT | TERMINAL_SERVER_AWARE, but no GUARD_CF, no APPCONTAINER and no FORCE_INTEGRITY.
  • There is no Rich header (it wasn't linked by MSVC link.exe; see .xbld below) and no overlay.

Sections

  • .data is the mapping trap. Its virtual size is about an order of magnitude larger than its file-backed size, while SizeOfUninitializedData is 0. A mapper that sizes committed memory from that header field under-allocates; it must zero the section's full virtual size.
  • Two sections named .xbld carry GDK build metadata.
  • .retplne and .voltbl (retpoline and volatile metadata) are mapped with characteristics 0.
  • There is no .rsrc, .edata, .idata, .bss or .gfids section.

Imports

  • No delay-loads. Imports are by name, plus a few by ordinal.
  • Desktop side: all OneCore api-ms-win-* and ext-ms-win-* API sets plus the MSVC runtime. There are no kernel32, user32 or d3d12 imports.
  • Console side: GDK modules, including xmem.dll, d3d12_xs.dll, AcpHal.dll, xapu.dll, xg_xs.dll, XCRDAPI.dll (DStorageGetFactory), GameInput.dll and libHttpClient.GDK.dll, plus third-party middleware.
    • xmem.dll: the XMemAlloc/XMemFree family and the physical-page APIs (XMemAllocatePhysicalPages, XMemMapPhysicalPages, scatter variants and so on).
    • d3d12_xs.dll: D3D12XboxCreateDevice, D3D12ConfigureVirtualMemoryX and D3D12SerializeVersionedRootSignature.
  • Archive I/O is plain CreateFileW/ReadFile/FindFirstFileW through api-ms-win-core-file-l1-1-0.dll.

Export: exactly one, and it is data

__XMemAllocationHooks__, in .data. It's a data symbol, not a function: its first entries are relocated .text addresses, consistent with an allocator hook table.

Directories of interest

  • Exception (.pdata): a large number of runtime-function records, with unwind data in .rdata, covering the entry point and the TLS callbacks.
  • TLS: two callbacks in .text. The TLS index slot lies in .data's zero-fill, which is another reason the whole virtual size of .data must be committed and writable before TLS initialization.
  • Load config: the security cookie is the MSVC default (what pe_map.cpp's seed_security_cookie() expects). It carries CFG/XFG/cast-guard pointer slots, but GuardFlags == 0, the CFG table is empty and there is no GUARD_CF bit, so don't infer CFG enforcement from the slots.
  • Relocations: several hundred thousand DIR64 entries. The image is fully relocatable with high-entropy ASLR.
  • Resources: none. The resource directory is empty and there's no version information in the image. The version lives only in the package's MicrosoftGame.Config / appxmanifest.xml, so a tool expecting a version resource in the EXE will find nothing.
  • Debug: a single RSDS (CodeView) entry; the PDB itself is not embedded.
  • Security: none. The certificate directory is empty and there is no overlay; the file is not Authenticode-signed.

What marks it as GDK/Xbox rather than desktop

  • .xbld records hold _xbld_edition_* entries listing GRDK/GXDK SDK editions and a clang-based toolchain. Together with the missing Rich header, this explains a linker version of 14.0 without MSVC link.exe.
  • Other markers:
    • the console-only imports above;
    • the single __XMemAllocationHooks__ data export;
    • .retplne/.voltbl metadata retained in a shipping image;
    • platform enum strings in .rdata.

Consequences for a mapper or recompiler

  • Allocate SizeOfImage and zero each section's full virtual size; don't trust SizeOfUninitializedData == 0.
  • Commit .data's zero-fill before TLS, since the index lives there.
  • Run or record the TLS callbacks.
  • Handle a very large number of DIR64 fixups.
  • Register, or deliberately ignore, the .pdata records.
  • Read identity from the package XML, not the image.

Reproduce: open the file read-only with the out/pe-env Python and pefile; imports and exports via tools/pe_inventory.py (import_tables, exports). AI-assisted.

Edited by @MasterDomino per @R0Y00's request in this thread: exact offsets, sizes, hashes, paths, timestamps, toolchain and version details from the private file were removed, and the general PE observations were kept.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7114980535 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7114980535). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T21:50:10Z. --- Answering from a read-only parse of a GDK console entry image, using pefile and the repo's own `tools/pe_inventory.py` readers. Static only: nothing was executed, loaded or uploaded. **Bottom line:** it is an ordinary, **unsigned x64 PE32+** desktop-format image: DOS stub, COFF header, standard data directories, DIR64 relocations. Its section and import content are GDK-specific. It is AMD64, not ARM64/XBE/XEX; the packaging is Xbox, but the executable format is Windows PE. **There is no resource section at all, hence no `VS_VERSION_INFO`**, and no embedded certificate. ## Header - `Machine` AMD64, `Magic` PE32+, `Characteristics` `EXECUTABLE_IMAGE | LARGE_ADDRESS_AWARE` (not a DLL; relocations not stripped). - Subsystem **WINDOWS_GUI** (not CONSOLE). `DllCharacteristics` has `HIGH_ENTROPY_VA | DYNAMIC_BASE | NX_COMPAT | TERMINAL_SERVER_AWARE`, but **no `GUARD_CF`**, no `APPCONTAINER` and no `FORCE_INTEGRITY`. - There is no Rich header (it wasn't linked by MSVC `link.exe`; see `.xbld` below) and no overlay. ## Sections - **`.data` is the mapping trap.** Its virtual size is about an order of magnitude larger than its file-backed size, while `SizeOfUninitializedData` is **0**. A mapper that sizes committed memory from that header field under-allocates; it must zero the section's full virtual size. - **Two sections named `.xbld`** carry GDK build metadata. - **`.retplne` and `.voltbl`** (retpoline and volatile metadata) are mapped with characteristics 0. - There is no `.rsrc`, `.edata`, `.idata`, `.bss` or `.gfids` section. ## Imports - **No delay-loads.** Imports are by name, plus a few by ordinal. - **Desktop side:** all OneCore `api-ms-win-*` and `ext-ms-win-*` API sets plus the MSVC runtime. There are no `kernel32`, `user32` or `d3d12` imports. - **Console side:** GDK modules, including `xmem.dll`, `d3d12_xs.dll`, `AcpHal.dll`, `xapu.dll`, `xg_xs.dll`, `XCRDAPI.dll` (`DStorageGetFactory`), `GameInput.dll` and `libHttpClient.GDK.dll`, plus third-party middleware. - `xmem.dll`: the `XMemAlloc`/`XMemFree` family and the physical-page APIs (`XMemAllocatePhysicalPages`, `XMemMapPhysicalPages`, scatter variants and so on). - `d3d12_xs.dll`: `D3D12XboxCreateDevice`, `D3D12ConfigureVirtualMemoryX` and `D3D12SerializeVersionedRootSignature`. - **Archive I/O** is plain `CreateFileW`/`ReadFile`/`FindFirstFileW` through `api-ms-win-core-file-l1-1-0.dll`. ## Export: exactly one, and it is data **`__XMemAllocationHooks__`**, in `.data`. It's a data symbol, not a function: its first entries are relocated `.text` addresses, consistent with an allocator hook table. ## Directories of interest - **Exception (`.pdata`):** a large number of runtime-function records, with unwind data in `.rdata`, covering the entry point and the TLS callbacks. - **TLS:** two callbacks in `.text`. **The TLS index slot lies in `.data`'s zero-fill**, which is another reason the whole virtual size of `.data` must be committed and writable before TLS initialization. - **Load config:** the security cookie is the MSVC default (what `pe_map.cpp`'s `seed_security_cookie()` expects). It carries CFG/XFG/cast-guard pointer **slots**, but `GuardFlags == 0`, the CFG table is empty and there is no `GUARD_CF` bit, so don't infer CFG enforcement from the slots. - **Relocations:** several hundred thousand DIR64 entries. The image is fully relocatable with high-entropy ASLR. - **Resources: none.** The resource directory is empty and there's no version information in the image. The version lives only in the package's `MicrosoftGame.Config` / `appxmanifest.xml`, so **a tool expecting a version resource in the EXE will find nothing.** - **Debug:** a single RSDS (CodeView) entry; the PDB itself is not embedded. - **Security: none.** The certificate directory is empty and there is no overlay; the file is not Authenticode-signed. ## What marks it as GDK/Xbox rather than desktop - **`.xbld` records** hold `_xbld_edition_*` entries listing GRDK/GXDK SDK editions and a clang-based toolchain. Together with the missing Rich header, this explains a linker version of 14.0 without MSVC `link.exe`. - **Other markers:** - the console-only imports above; - the single `__XMemAllocationHooks__` data export; - `.retplne`/`.voltbl` metadata retained in a shipping image; - platform enum strings in `.rdata`. ## Consequences for a mapper or recompiler - Allocate `SizeOfImage` and zero each section's full virtual size; don't trust `SizeOfUninitializedData == 0`. - Commit `.data`'s zero-fill before TLS, since the index lives there. - Run or record the TLS callbacks. - Handle a very large number of DIR64 fixups. - Register, or deliberately ignore, the `.pdata` records. - Read identity from the package XML, not the image. Reproduce: open the file read-only with the `out/pe-env` Python and pefile; imports and exports via `tools/pe_inventory.py` (`import_tables`, `exports`). AI-assisted. _Edited by @MasterDomino per @R0Y00's request in this thread: exact offsets, sizes, hashes, paths, timestamps, toolchain and version details from the private file were removed, and the general PE observations were kept._
R0Y00 commented 2026-11-24 06:49:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T22:06:03Z.


Thanks for the format summary. Please edit the public comment down to the general PE observations and a source-built reproduction where possible. Remove exact offsets, sizes, fingerprints and other values taken from the private file. We can keep the generic header/section and tooling discussion in this thread.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7115324484 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7115324484). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T22:06:03Z. --- Thanks for the format summary. Please edit the public comment down to the general PE observations and a source-built reproduction where possible. Remove exact offsets, sizes, fingerprints and other values taken from the private file. We can keep the generic header/section and tooling discussion in this thread.
upstream-sync changed title from [GH #908] What the released console executable actually looks like at the PE level (sections, imports, no version resource) to [GH #908] PE-level shape of a GDK console executable (sections, imports, no version resource) 2026-11-25 22:01:43 +00:00
MasterDomino commented 2026-11-25 22:02:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T21:02:03Z.


@JoshRob297, @triggered02, a heads-up: following @R0Y00's request above, I edited the issue description and the long format-summary comment down to the general PE observations. Exact sizes, offsets, hashes, paths, names, toolchain and version details from the private file are removed; the mapper-relevant findings and the reproduction notes stay. AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174519029 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7174519029). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T21:02:03Z. --- @JoshRob297, @triggered02, a heads-up: following @R0Y00's request above, I edited the issue description and the long format-summary comment down to the general PE observations. Exact sizes, offsets, hashes, paths, names, toolchain and version details from the private file are removed; the mapper-relevant findings and the reproduction notes stay. AI-assisted.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#901
No description provided.