Skip to content

docs: the executable's host probes (ConsoleMode registry read, Media Foundation init) - #9682

Closed
JaRoLoz wants to merge 1 commit into
ProjectLeonida:mainfrom
JaRoLoz:docs/exe-probes
Closed

JaRoLoz wants to merge 1 commit into
ProjectLeonida:mainfrom
JaRoLoz:docs/exe-probes

Conversation

@JaRoLoz

@JaRoLoz JaRoLoz commented Nov 23, 2026

Copy link
Copy Markdown

Claimed in the coordination issue as: the executable's host probes (ConsoleMode, Media Foundation) — #7049

Depends on: (none; cross-references the open #6990)

What and why

New page docs/exe_probes.md (plus its docs/README.md row) recording two host probes the retail executable makes at startup, measured from the file (the image docs/runtime_imports.md names, SHA-256 matching):

  1. ConsoleMode under HKCU\Software\Microsoft\Windows NT\CurrentVersion\OEM (RVA 0x55deb88): a RegQueryValueExW into a zeroed 8-byte buffer, then an eleven-constant ladder over the value's first dword (16/32/33/48/49→2, 64→3, 80→4, 88→5, 96→6, 100→7, 104→8, other→0; a failed query answers 1). The ladder is live — the helper's three direct calls test it (one sets a flag to class != 6, one proceeds only for classes 1, 5, 6, one passes the class on). Class 1 is the plain-PC answer, and the offline answer to this key comes from LEONIDA_DEVICE_TYPE (runtime: answer the console-type registry key (ConsoleMode) from LEONIDA_DEVICE_TYPE #6990): the value that PR writes must carry a dword this build expects.
  2. Media Foundation, started LITE (RVA 0x33a41d0): CoInitializeEx(NULL, MTA) retried with APARTMENTTHREADED | DISABLE_OLE1DDE on RPC_E_CHANGED_MODE (a COM that still fails answers 0), then MFStartup(MF_VERSION, MFSTARTUP_LITE) — MFSTARTUP_NOSOCKET in the SDK's mfapi.h — answering 3 on success, 1 on failure. All seven imported MF functions are bound to the host; whether the helper runs before the first frame, and what the source resolver then opens, is a --trace question.

Tested

Static measurement only: Ghidra on the user's local copy of the executable (analysis complete; call-site counts also via tools/import_call_sites.py), constants verified against Windows SDK 10.0.26100.0 headers (mfapi.h, objbase.h, winerror.h). python -I over the whole tests/test_docs_*.py suite plus tests/test_i18n_index.py: everything passes except three failures that are already red on main (duplicated docs/README.md rows, docs/embedded_shaders.md naming absent spirv-opt flags, the gpu_test_results.md link) — all filed in #7049. The docs/README.md row this adds sits two lines below #9669's changed row; a trivial rebase if both land. python -I scripts/check_no_game_data.py docs passes. No game files in the PR, no GPU.

AI-assisted: yes (measured by the agent with Ghidra; no game data is committed).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (not applicable)

@catminou4

Copy link
Copy Markdown
Contributor

Tested 1274fae on macOS 26 arm64, Python 3.12, CPU only, no game files: pass. docs tests on this head: test_docs_env_vars OK, test_docs_table_rows OK; test_docs_links FAILS (1) — the same failure as on main (5d74c272: docs/dev-tools.md anchor + docs/gpu_test_results.md RX9070GRE link), not caused by this PR. AI-assisted (Devin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants