PE-level shape of a GDK console executable (sections, imports, no version resource) #908
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#908
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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 needsSizeOfImageworth 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 fromSizeOfUninitializedData, will under-allocate.Build-metadata sections. Two sections share the name
.xbldand 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_VERSIONINFOfinds nothing.Imports are console-side. They go through the OneCore API sets plus GDK console modules (for example
AcpHal.dlland the Xbox D3D12 module) and some third-party middleware modules. Asset I/O uses the ordinary Win32 file calls (CreateFileW,ReadFile,FindFirstFileW,FindNextFileW,GetFileAttributesW), andDStorageGetFactoryis 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 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.
@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: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.pyreaders. 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
MachineAMD64,MagicPE32+,CharacteristicsEXECUTABLE_IMAGE | LARGE_ADDRESS_AWARE(not a DLL; relocations not stripped).DllCharacteristicshasHIGH_ENTROPY_VA | DYNAMIC_BASE | NX_COMPAT | TERMINAL_SERVER_AWARE, but noGUARD_CF, noAPPCONTAINERand noFORCE_INTEGRITY.link.exe; see.xbldbelow) and no overlay.Sections
.datais the mapping trap. Its virtual size is about an order of magnitude larger than its file-backed size, whileSizeOfUninitializedDatais 0. A mapper that sizes committed memory from that header field under-allocates; it must zero the section's full virtual size..xbldcarry GDK build metadata..retplneand.voltbl(retpoline and volatile metadata) are mapped with characteristics 0..rsrc,.edata,.idata,.bssor.gfidssection.Imports
api-ms-win-*andext-ms-win-*API sets plus the MSVC runtime. There are nokernel32,user32ord3d12imports.xmem.dll,d3d12_xs.dll,AcpHal.dll,xapu.dll,xg_xs.dll,XCRDAPI.dll(DStorageGetFactory),GameInput.dllandlibHttpClient.GDK.dll, plus third-party middleware.xmem.dll: theXMemAlloc/XMemFreefamily and the physical-page APIs (XMemAllocatePhysicalPages,XMemMapPhysicalPages, scatter variants and so on).d3d12_xs.dll:D3D12XboxCreateDevice,D3D12ConfigureVirtualMemoryXandD3D12SerializeVersionedRootSignature.CreateFileW/ReadFile/FindFirstFileWthroughapi-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.textaddresses, consistent with an allocator hook table.Directories of interest
.pdata): a large number of runtime-function records, with unwind data in.rdata, covering the entry point and the TLS callbacks..text. The TLS index slot lies in.data's zero-fill, which is another reason the whole virtual size of.datamust be committed and writable before TLS initialization.pe_map.cpp'sseed_security_cookie()expects). It carries CFG/XFG/cast-guard pointer slots, butGuardFlags == 0, the CFG table is empty and there is noGUARD_CFbit, so don't infer CFG enforcement from the slots.MicrosoftGame.Config/appxmanifest.xml, so a tool expecting a version resource in the EXE will find nothing.What marks it as GDK/Xbox rather than desktop
.xbldrecords 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 MSVClink.exe.__XMemAllocationHooks__data export;.retplne/.voltblmetadata retained in a shipping image;.rdata.Consequences for a mapper or recompiler
SizeOfImageand zero each section's full virtual size; don't trustSizeOfUninitializedData == 0..data's zero-fill before TLS, since the index lives there..pdatarecords.Reproduce: open the file read-only with the
out/pe-envPython and pefile; imports and exports viatools/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 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.
@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.