pe: initialize the default x64 security cookie before startup #899

Manually merged
github merged 1 commit from gh-pr/899/head into gh-pr/899/base 2026-11-26 22:26:56 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-23 16:28 UTC · original
R0Y00:codex/pe-load-security-cookie → main · +213 −0 · 5 files · 1 commits · merged 2026-11-23 16:41 UTC

Refs #870.

On a CRT-free DLL and EXE, Windows 11 initializes the default x64 security cookie before guest entry. The original mapper left the file value in place. Initialize the eligible slot with the Windows system random generator after relocation and before callbacks or entry, and reject a destination outside an aligned writable image section.

The fixture checks both loaders on the default cookie, short load-config prefixes, an unused-cookie flag and a preinitialized value. It also checks the mapper's refusal of a read-only destination. Running the new fixture against the original mapper fails on the default cookie.

Windows x64, MSVC 19.51, Release:

ctest --preset release --no-tests=error -R '^(cpu_native_(load_cookie|mutation|reloc_free|seh|section|tls|tls_value))$' --output-on-failure

7/7 passed with normal Windows process permissions. Documentation links, bidi controls and git diff --check passed.

**@⁠R0Y00** on GitHub · 2026-11-23 16:28 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/899) `R0Y00:codex/pe-load-security-cookie` → `main` · +213 −0 · 5 files · 1 commits · merged 2026-11-23 16:41 UTC Refs #870. On a CRT-free DLL and EXE, Windows 11 initializes the default x64 security cookie before guest entry. The original mapper left the file value in place. Initialize the eligible slot with the Windows system random generator after relocation and before callbacks or entry, and reject a destination outside an aligned writable image section. The fixture checks both loaders on the default cookie, short load-config prefixes, an unused-cookie flag and a preinitialized value. It also checks the mapper's refusal of a read-only destination. Running the new fixture against the original mapper fails on the default cookie. Windows x64, MSVC 19.51, Release: ```powershell ctest --preset release --no-tests=error -R '^(cpu_native_(load_cookie|mutation|reloc_free|seh|section|tls|tls_value))$' --output-on-failure ``` 7/7 passed with normal Windows process permissions. Documentation links, bidi controls and `git diff --check` passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:26:56 +00:00
github manually merged commit 62c7536bc4 into gh-pr/899/base 2026-11-26 22:26:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.