runtime: emulate passwordless LSA policy state in-process #30

Closed
github-bot wants to merge 1 commit from gh-pr/30/head into gh-pr/30/base
Owner

@⁠figmasigma122343-bot on GitHub · 2026-11-21 18:15 UTC · original
figmasigma122343-bot:compat/console-policy-state → main · +129 −49 · 12 files · 1 commits · closed without merging

Change

Ports the two console LSA policy exports that XDefiant and Terraria import:

  • advapi32!LsaDisablePasswordLessCurrentUser
  • advapi32!LsaEnablePasswordLessCurrentUser

The console bodies are no-argument lsarpc NdrClientCall3 wrappers (opnum 0x7f and 0x7e in the 19041/22000 images). Calling the host LSA opnum would change the signed-in PC user's real sign-in options, so the operation now updates process-local emulated policy state in advapi32legacy::policy. The host LSA database, account and sign-in options are never touched.

advapi32 exports both names as PE forwarders to advapi32legacy, matching the console API-set resolution through ext-ms-win-advapi32-lsa-l1-1-3.

Updated map

Xbox console libraries: 97.15% (2080/2141)

Tests

cargo build -p advapi32legacy -p advapi32
cargo test -p advapi32legacy -p advapi32
python tools/progress/gen.py

Observed:

  • advapi32legacy: 9 unit tests passed, 4 export/forwarder tests passed.
  • advapi32: 4 export/forwarder tests passed, 1 real-name test passed. The real-name test now calls both functions while the compat DLL owns the advapi32.dll name.
  • Progress map: console exports 2080/2141 (97.15%), up from 2076/2141.
  • The new tests cover the enable/disable round trip and verify both names resolve through the PE forwarders.

Scope

This is the passwordless half of #7. The package xref pair (AddPackageToFamilyXref, RemovePackageFromFamilyXref) remains missing: the console ABI is not recovered yet. The x86 symbols are _AddPackageToFamilyXref@24 and _RemovePackageFromFamilyXref@8, and the public x64 PDB has no parameter types. Exporting a guessed layout would be fake success, so it is left for a follow-up with the console image.

Refs #7

**@⁠figmasigma122343-bot** on GitHub · 2026-11-21 18:15 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/30) `figmasigma122343-bot:compat/console-policy-state` → `main` · +129 −49 · 12 files · 1 commits · closed without merging ## Change Ports the two console LSA policy exports that XDefiant and Terraria import: - `advapi32!LsaDisablePasswordLessCurrentUser` - `advapi32!LsaEnablePasswordLessCurrentUser` The console bodies are no-argument `lsarpc` `NdrClientCall3` wrappers (opnum 0x7f and 0x7e in the 19041/22000 images). Calling the host LSA opnum would change the signed-in PC user's real sign-in options, so the operation now updates process-local emulated policy state in `advapi32legacy::policy`. The host LSA database, account and sign-in options are never touched. `advapi32` exports both names as PE forwarders to `advapi32legacy`, matching the console API-set resolution through `ext-ms-win-advapi32-lsa-l1-1-3`. ## Updated map ![Xbox console libraries: 97.15% (2080/2141)](https://raw.githubusercontent.com/figmasigma122343-bot/xbox-emulator/assets/progress-2080/progress-2080.png) ## Tests ```powershell cargo build -p advapi32legacy -p advapi32 cargo test -p advapi32legacy -p advapi32 python tools/progress/gen.py ``` Observed: - `advapi32legacy`: 9 unit tests passed, 4 export/forwarder tests passed. - `advapi32`: 4 export/forwarder tests passed, 1 real-name test passed. The real-name test now calls both functions while the compat DLL owns the `advapi32.dll` name. - Progress map: console exports 2080/2141 (97.15%), up from 2076/2141. - The new tests cover the enable/disable round trip and verify both names resolve through the PE forwarders. ## Scope This is the **passwordless half** of #7. The package xref pair (`AddPackageToFamilyXref`, `RemovePackageFromFamilyXref`) remains `missing`: the console ABI is not recovered yet. The x86 symbols are `_AddPackageToFamilyXref@24` and `_RemovePackageFromFamilyXref@8`, and the public x64 PDB has no parameter types. Exporting a guessed layout would be fake success, so it is left for a follow-up with the console image. Refs #7
The console advapi32/advapi32legacy LsaEnablePasswordLessCurrentUser and LsaDisablePasswordLessCurrentUser are no-argument lsarpc NdrClientCall3 wrappers (opnums 0x7e/0x7f). Calling the host LSA opnum would change the signed-in PC user's sign-in options, so the operation now updates process-local emulated policy state instead. advapi32 exports the two names as PE forwarders to advapi32legacy, matching the console API-set resolution.

This is the passwordless half of #7. The package xref pair stays missing: the console ABI is not recovered yet (x86 decorations _AddPackageToFamilyXref@24 and _RemovePackageFromFamilyXref@8; the public x64 PDB has no parameter types), so exporting a guessed layout would be fake success.

Tests: cargo build -p advapi32legacy -p advapi32; cargo test -p advapi32legacy -p advapi32 (all passed); python tools/progress/gen.py (console 2080/2141).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:07:49 +00:00
github-bot closed this pull request 2026-11-26 06:07:50 +00:00
Author
Owner

@⁠figmasigma122343-bot on GitHub · 2026-11-21 18:17 UTC · original

Updated console-library map after this change:

Xbox console libraries: 97.15% (2080/2141)

Verification on this machine:

cargo build -p advapi32legacy -p advapi32
cargo test -p advapi32legacy -p advapi32
python tools/progress/gen.py
  • advapi32legacy: 9 unit tests + 4 export/forwarder tests passed.
  • advapi32: 4 export/forwarder tests + 1 real-name test passed.
  • Console exports: 2080/2141 (97.15%), up from 2076/2141.
  • Host LSA is not called; the enable/disable state is process-local.

The package xref pair is intentionally left missing in this PR because the console ABI is not recovered (x86 _AddPackageToFamilyXref@24, _RemovePackageFromFamilyXref@8; the public x64 PDB has no parameter types). Guessing the layout would be fake success.

**@⁠figmasigma122343-bot** on GitHub · 2026-11-21 18:17 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/30#issuecomment-7067139397) Updated console-library map after this change: ![Xbox console libraries: 97.15% (2080/2141)](https://raw.githubusercontent.com/figmasigma122343-bot/xbox-emulator/assets/progress-2080/progress-2080.png) Verification on this machine: ```powershell cargo build -p advapi32legacy -p advapi32 cargo test -p advapi32legacy -p advapi32 python tools/progress/gen.py ``` - `advapi32legacy`: 9 unit tests + 4 export/forwarder tests passed. - `advapi32`: 4 export/forwarder tests + 1 real-name test passed. - Console exports: 2080/2141 (97.15%), up from 2076/2141. - Host LSA is not called; the enable/disable state is process-local. The package xref pair is intentionally left `missing` in this PR because the console ABI is not recovered (x86 `_AddPackageToFamilyXref@24`, `_RemovePackageFromFamilyXref@8`; the public x64 PDB has no parameter types). Guessing the layout would be fake success.
Author
Owner

@⁠figmasigma122343-bot on GitHub · 2026-11-21 18:29 UTC · original

Superseded by #32, which adds the KernelBase package-family xref and the formatted task list. Closing this one to keep a single reviewable PR.

**@⁠figmasigma122343-bot** on GitHub · 2026-11-21 18:29 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/30#issuecomment-7067290581) Superseded by #32, which adds the KernelBase package-family xref and the formatted task list. Closing this one to keep a single reviewable PR.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.