XGameUi: a Password text entry shows what is typed in clear text #881

Closed
opened 2026-11-24 13:17:32 +00:00 by BastienRodz · 4 comments
BastienRodz commented 2026-11-24 13:17:32 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-24T13:17:32Z.


What's wrong

Microsoft's GDK documentation for XGameUiTextEntryInputScope specifies for Password (31):

This will be a fully localized keyboard where the textbox hides characters as the user types.

In VIctory, text_entry_async ignores the input scope parameter (crates/victory-hle/src/modules/xgameui.rs:60, _scope: u32) and never passes it to ask (crates/victory-hle/src/modules/xgameui.rs:66). The Win32 dialog template in dialog::ask always builds the edit control with wm::WS_BORDER | tab | wm::ES_AUTOHSCROLL as u32 (crates/victory-hle/src/modules/xgameui.rs:176-177), without ES_PASSWORD.

Concretely, calling XGameUiShowTextEntryAsync with inputScope = XGameUiTextEntryInputScope::Password (31) and typing "abc123" displays "abc123" in clear text instead of masking the characters.

Impact

Anyone looking at the screen sees a password a title asks the user to enter. Whether GTA VI uses the Password input scope is unknown.

Fix

Define const PASSWORD: u32 = 31, pass scope == PASSWORD into ask as password: bool, and OR windows_sys::Win32::UI::WindowsAndMessaging::ES_PASSWORD into the edit control's window style when password is true (factored into dialog::edit_style(password: bool) -> u32 and covered by a unit test). Open PR #370 also renames _scope to scope and defines const PASSWORD: u32 = 31 for length-limit handling; keeping the same parameter name and constant lets both changes combine cleanly so text_entry_async passes scope to the limit logic and scope == PASSWORD to ask.

The fix is ready on a branch of my fork, since PR creation is limited to collaborators: https://github.com/BastienRodz/VIctory/commits/hle/password-entry-hides-characters (one commit on main ffe310e, xgameui.rs +53/-8).

Tests

a_password_entry_hides_what_is_typed checks the edit-box style:

  • without password: WS_BORDER | ES_AUTOHSCROLL, no ES_PASSWORD;
  • with it: the same plus ES_PASSWORD.

On main, the edit box is always built without ES_PASSWORD, whatever the scope.

On GitHub's windows-latest, with the upstream CI's commands (clippy -D warnings with and without --all-features, then cargo test --workspace --locked): everything passes; victory-hle 95 passed, 0 failed (https://github.com/BastienRodz/VIctory/actions/runs/45401505829).

Not tested: the dialog shown interactively; a title that uses the Password scope.

No game data used. AI-assisted: found with GPT-6.2 Astra, written with Gemini 4 Neon, reviewed and verified with Claude Code.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6582664953 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/881). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-24T13:17:32Z. --- ## What's wrong Microsoft's GDK documentation for [`XGameUiTextEntryInputScope`](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgameui/enums/xgameuitextentryinputscope) specifies for `Password` (`31`): > This will be a fully localized keyboard where the textbox hides characters as the user types. In VIctory, `text_entry_async` ignores the input scope parameter (`crates/victory-hle/src/modules/xgameui.rs:60`, `_scope: u32`) and never passes it to `ask` (`crates/victory-hle/src/modules/xgameui.rs:66`). The Win32 dialog template in `dialog::ask` always builds the edit control with `wm::WS_BORDER | tab | wm::ES_AUTOHSCROLL as u32` (`crates/victory-hle/src/modules/xgameui.rs:176-177`), without `ES_PASSWORD`. Concretely, calling `XGameUiShowTextEntryAsync` with `inputScope = XGameUiTextEntryInputScope::Password` (`31`) and typing `"abc123"` displays `"abc123"` in clear text instead of masking the characters. ## Impact Anyone looking at the screen sees a password a title asks the user to enter. Whether GTA VI uses the `Password` input scope is unknown. ## Fix Define `const PASSWORD: u32 = 31`, pass `scope == PASSWORD` into `ask` as `password: bool`, and OR `windows_sys::Win32::UI::WindowsAndMessaging::ES_PASSWORD` into the edit control's window style when `password` is true (factored into `dialog::edit_style(password: bool) -> u32` and covered by a unit test). Open PR #370 also renames `_scope` to `scope` and defines `const PASSWORD: u32 = 31` for length-limit handling; keeping the same parameter name and constant lets both changes combine cleanly so `text_entry_async` passes `scope` to the limit logic and `scope == PASSWORD` to `ask`. The fix is ready on a branch of my fork, since PR creation is limited to collaborators: https://github.com/BastienRodz/VIctory/commits/hle/password-entry-hides-characters (one commit on `main` `ffe310e`, `xgameui.rs` +53/-8). ## Tests `a_password_entry_hides_what_is_typed` checks the edit-box style: - without `password`: `WS_BORDER | ES_AUTOHSCROLL`, no `ES_PASSWORD`; - with it: the same plus `ES_PASSWORD`. On `main`, the edit box is always built without `ES_PASSWORD`, whatever the scope. On GitHub's `windows-latest`, with the upstream CI's commands (clippy `-D warnings` with and without `--all-features`, then `cargo test --workspace --locked`): everything passes; `victory-hle` 95 passed, 0 failed (https://github.com/BastienRodz/VIctory/actions/runs/45401505829). **Not tested:** the dialog shown interactively; a title that uses the `Password` scope. No game data used. AI-assisted: found with GPT-6.2 Astra, written with Gemini 4 Neon, reviewed and verified with Claude Code.
Sunkiller-qc commented 2026-11-24 14:04:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Sunkiller-qc on 2026-11-24T13:25:21Z.


Checked against main (ffe310e), and it's real. text_entry_async takes the scope as _scope: u32 and never uses it (xgameui.rs:60). The dialog's edit control is always WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL (xgameui.rs:176), with no ES_PASSWORD.

I also looked at the open PRs that touch xgameui.rs. #370 renames it to scope and adds PASSWORD = 31, but only uses it for the length limit. #519 and #237 leave _scope alone. So nothing open masks the input yet. And since your branch uses the same name and constant as #370, the two should combine without trouble.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132806660 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7132806660). Originally posted by [Sunkiller-qc](https://github.com/Sunkiller-qc) on 2026-11-24T13:25:21Z. --- Checked against main (`ffe310e`), and it's real. `text_entry_async` takes the scope as `_scope: u32` and never uses it (`xgameui.rs:60`). The dialog's edit control is always `WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL` (`xgameui.rs:176`), with no `ES_PASSWORD`. I also looked at the open PRs that touch `xgameui.rs`. #370 renames it to `scope` and adds `PASSWORD = 31`, but only uses it for the length limit. #519 and #237 leave `_scope` alone. So nothing open masks the input yet. And since your branch uses the same name and constant as #370, the two should combine without trouble.
MichaelSmithAI commented 2026-11-24 14:04:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T13:31:08Z.


Melissa checked the actual Win32 edit control on your a4bafe5 branch under Wine 11.22, with an isolated prefix and Xvfb display. The test opened the dialog through the guest async text-entry method. EM_GETPASSWORDCHAR returned a nonzero masking character for Password (31) and zero for ordinary text (0). After the test entered the same synthetic ten-character string and accepted each dialog, the async result returned that string and reported 11 bytes including the terminator in both cases.

All three focused XGameUi checks passed. A local combination with #370 also passed all four focused checks, including its length-limit test. With a requested maximum of 16 for both scopes, EM_GETLIMITTEXT on the live control returned 16 for ordinary text and 1024 for Password. The dialog was driven programmatically; this verifies the control setting and returned text on Wine. GTA VI use of Password scope remains unknown.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132945015 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7132945015). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T13:31:08Z. --- Melissa checked the actual Win32 edit control on your a4bafe5 branch under Wine 11.22, with an isolated prefix and Xvfb display. The test opened the dialog through the guest async text-entry method. EM_GETPASSWORDCHAR returned a nonzero masking character for Password (31) and zero for ordinary text (0). After the test entered the same synthetic ten-character string and accepted each dialog, the async result returned that string and reported 11 bytes including the terminator in both cases. All three focused XGameUi checks passed. A local combination with #370 also passed all four focused checks, including its length-limit test. With a requested maximum of 16 for both scopes, EM_GETLIMITTEXT on the live control returned 16 for ordinary text and 1024 for Password. The dialog was driven programmatically; this verifies the control setting and returned text on Wine. GTA VI use of Password scope remains unknown.
NATON4 commented 2026-11-24 16:05:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by NATON4 on 2026-11-24T15:12:17Z.


Opened #1027 for this: one commit on ffe310e, xgameui.rs only. The scope reaches the dialog, Password (31) gets ES_PASSWORD, other scopes keep the same edit box. Same names as #370 (scope, PASSWORD), so they combine. Thanks @BastienRodz for the report.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135630346 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7135630346). Originally posted by [NATON4](https://github.com/NATON4) on 2026-11-24T15:12:17Z. --- Opened #1027 for this: one commit on `ffe310e`, `xgameui.rs` only. The scope reaches the dialog, `Password` (31) gets `ES_PASSWORD`, other scopes keep the same edit box. Same names as #370 (`scope`, `PASSWORD`), so they combine. Thanks @BastienRodz for the report.
Marvisak commented 2026-11-25 07:03:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:58:48Z.


Automated triage for the maintainers.

Confirmed on main: in crates/victory-hle/src/modules/xgameui.rs, text_entry_async now uses scope only for the length limit (max_length_for), and the dialog in ask always builds the edit box as WS_BORDER | tab | ES_AUTOHSCROLL, with no ES_PASSWORD, so a Password entry is shown in clear text. Open PR #2067 (fuzeofficlal) masks it; #1027, which carried the same change, was closed unmerged. Whether the title ever asks for a Password entry is not known.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155358027 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7155358027). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:58:48Z. --- <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T15:12:17Z at=2026-11-25T06:58:47Z --> Automated triage for the maintainers. Confirmed on `main`: in `crates/victory-hle/src/modules/xgameui.rs`, `text_entry_async` now uses `scope` only for the length limit (`max_length_for`), and the dialog in `ask` always builds the edit box as `WS_BORDER | tab | ES_AUTOHSCROLL`, with no `ES_PASSWORD`, so a Password entry is shown in clear text. Open PR #2067 (fuzeofficlal) masks it; #1027, which carried the same change, was closed unmerged. Whether the title ever asks for a Password entry is not known. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No labels
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.

Reference
Marvisak/VIctory#881
No description provided.