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

Closed
opened 2026-11-26 22:27:22 +00:00 by github-bot · 5 comments
Owner

@⁠JoshRob297 on GitHub · 2026-11-23 16:45 UTC · original

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.

**@⁠JoshRob297** on GitHub · 2026-11-23 16:45 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908) 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._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:27:22 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-23 16:50 UTC · original

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.

**@⁠R0Y00** on GitHub · 2026-11-23 16:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7107746314) 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.
Author
Owner

@⁠triggered02 on GitHub · 2026-11-23 21:49 UTC · original

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** on GitHub · 2026-11-23 21:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7114964515) 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.
Author
Owner

@⁠triggered02 on GitHub · 2026-11-23 21:50 UTC · original · edited 2026-11-25 21:02 UTC

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.

**@⁠triggered02** on GitHub · 2026-11-23 21:50 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7114980535) · edited 2026-11-25 21:02 UTC 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._
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-23 22:06 UTC · original

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.

**@⁠R0Y00** on GitHub · 2026-11-23 22:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7115324484) 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.
Author
Owner

@⁠MasterDomino on GitHub · 2026-11-25 21:02 UTC · original

@⁠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.

**@⁠MasterDomino** on GitHub · 2026-11-25 21:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/908#issuecomment-7174519029) @⁠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.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#908
No description provided.