WIP Removal of potential offensive preloader #492

Closed
tragice wants to merge 11 commits from (deleted):main into Main
First-time contributor

WAS ABLE TO RECREATE SPLASH SCREEN WHEN NONE WERE BEING CALLED FOR FROM GAME FILES.

Where the art came from. The art window came from scripts/play-nvidia.ps1 and scripts/preload-window.ps1

By default it read the picture from the game's own folder (the SplashScreenImage entry in MicrosoftGame.config). If you passed -Splash , it downloaded the image into a splash folder under your Darner home. That is how it came back.

Contributor role (optional)

  • Fluxer ID: 1576470748871012355

What it changes

What I removed

preload-window.ps1

Only one script used it. I searched the whole repo, and play-nvidia.ps1 was the only thing that loaded that file.

What I changed

I've added the unblock step to play-nvidia.ps1

Files that came from a download or a zip carry Windows' "from the internet" mark, which the default execution

every .ps1 and .cmd file in the repository's top folder, which covers the launchers like Play-MyRig.cmd, and every .ps1 and .cmd file under scripts, including the subfolders. for the initial bypass compile.

play-nvidia.ps1: it no longer opens that window. During -Preload you get the plain progress lines in the PowerShell console, such as 23744 shaders in the cache, 94 % of bytes, 2 s

Play-nvidia.ps1 was also loading the language file. The deleted file loaded locale.ps1, which supplies the launcher's messages. If I had only deleted the file, the launcher would have lost its text. So play-nvidia.ps1 now loads locale.ps1 directly.

I removed every call to the old window code. The preload now just prints its lines to the console and records "done" or "ended with code N" afterward. The "skipped" outcome is gone, due to no access to Play now button without rust preloader.

-Splash and -NoPreloadWindow: both are still accepted but ignored. Old shortcuts and the F1 menu's restart pass these, so removing them would make those fail.

Things to know

Unblock command added to play-nvidia.ps1 for any files that may need it.
THIS MAY CREATE SECURITY ISSUES ON FURTHER PULLS AS THIS MAY BE ADDED TO A MALICIOUS FILE THAT IS ADDED AFTER THE FACT.

preload window should be consistent between all 3 build versions. If the rust loader fails to open in any way have a powershel/cmd environment lines describing process and updates.

quit button of the preload window is functioning but has a on/off setting (TrustNo1 said make sure quit button doesn't run command). When setting is changed you must compile the build again for the launcher to have the quit button function. The call to exit was split so it will still be made through an alt+f4 command or windows close button.
Play now still functioning properly across all 3 build loaders.
All 3 builds loaders reach 100% in steps 1 and 2.
Step 3 has not been fixed.

on initial load there is a slight pause before building pipelines step occurs, this is because the tracking does not update while the pipelines or initially warmed. Once pipelines are actually being built does step 2 properly show up and track.

Cache: a previously downloaded image may still sit in the splash folder under your Darner home (default %LOCALAPPDATA%\darner). It's harmless now, but you can delete the folder.
I HAVE NOT WRITTEN ANYTHING TO REMOVE THIS SPLASH FILE IF IT WAS DOWNLOADED ON EARLIER BUILDS.
There should be no call to find/download/use the splash from any source within this code.

All commits of this branch have detailed explanations of what changed other than
-Commit fe4ea414c4 is a main.rs edit I forgot to add description.
It fixes the return match line for preload ui.
Every arm of the old match already ended the process, so the return in front of it could never run.
This created an annoying WARNING DIVERGENT CALLS message in the command lines that caused no issues with the actual functioning of the code.

How it was tested

LAST COMMIT ACTION THIS REPO IS BASED ON IS f3840d73d3
ALL TESTS RAN ON THIS BUILD BEFORE IT WS REMADE FOR CURRENT MAIN.

First test was not saved properly these are all reruns after initial tests.

cargo test --workspace --locked

Test results =
failures:

---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ----

thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (27968) panicked at crates\darner-gpu\src\watch.rs:8614:13:
assertion left == right failed
left: Some(229126)
right: None

failures:
watch::tests::ask_once_by_res_splits_reservations_without_refusals

test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 22.91s

cargo test --workspace --locked -p darner-gpu --lib

Test results =
failures:

---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ----

thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (34756) panicked at crates\darner-gpu\src\watch.rs:8614:13:
assertion left == right failed
left: Some(237699)
right: None

failures:
watch::tests::ask_once_by_res_splits_reservations_without_refusals

test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 20.62s

I BELEIVE THES FAILED DUE TO KNOWN PARALLEL PROCESS UPDATE ERROR.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • [] This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs:
  • Replaces or overlaps: #N (why this one), or "none found"

THE PATCH TO BRING BUILD UP FROM f3840d73d3 TO d91d8e4d60 HAS NOT BEEN FULLY TESTED, BUT NO CONFLICTS WERE FOUND YET.
MANY EDITS MADE UNABLE TO DETAIL ALL DUE TO NOT KNOWING ALL THAT WAS ADDED BETWEEN f3840d73d3 & d91d8e4d60.

WAS ABLE TO RECREATE SPLASH SCREEN WHEN NONE WERE BEING CALLED FOR FROM GAME FILES. Where the art came from. The art window came from scripts/play-nvidia.ps1 and scripts/preload-window.ps1 By default it read the picture from the game's own folder (the SplashScreenImage entry in MicrosoftGame.config). If you passed -Splash <URL>, it downloaded the image into a splash folder under your Darner home. That is how it came back. ## Contributor role (optional) - Fluxer ID: 1576470748871012355 ## What it changes What I removed preload-window.ps1 Only one script used it. I searched the whole repo, and play-nvidia.ps1 was the only thing that loaded that file. What I changed I've added the unblock step to play-nvidia.ps1 # Files that came from a download or a zip carry Windows' "from the internet" mark, which the default execution every .ps1 and .cmd file in the repository's top folder, which covers the launchers like Play-MyRig.cmd, and every .ps1 and .cmd file under scripts\, including the subfolders. for the initial bypass compile. play-nvidia.ps1: it no longer opens that window. During -Preload you get the plain progress lines in the PowerShell console, such as 23744 shaders in the cache, 94 % of bytes, 2 s Play-nvidia.ps1 was also loading the language file. The deleted file loaded locale.ps1, which supplies the launcher's messages. If I had only deleted the file, the launcher would have lost its text. So play-nvidia.ps1 now loads locale.ps1 directly. I removed every call to the old window code. The preload now just prints its lines to the console and records "done" or "ended with code N" afterward. The "skipped" outcome is gone, due to no access to Play now button without rust preloader. -Splash and -NoPreloadWindow: both are still accepted but ignored. Old shortcuts and the F1 menu's restart pass these, so removing them would make those fail. Things to know Unblock command added to play-nvidia.ps1 for any files that may need it. THIS MAY CREATE SECURITY ISSUES ON FURTHER PULLS AS THIS MAY BE ADDED TO A MALICIOUS FILE THAT IS ADDED AFTER THE FACT. preload window should be consistent between all 3 build versions. If the rust loader fails to open in any way have a powershel/cmd environment lines describing process and updates. quit button of the preload window is functioning but has a on/off setting (TrustNo1 said make sure quit button doesn't run command). When setting is changed you must compile the build again for the launcher to have the quit button function. The call to exit was split so it will still be made through an alt+f4 command or windows close button. Play now still functioning properly across all 3 build loaders. All 3 builds loaders reach 100% in steps 1 and 2. Step 3 has not been fixed. on initial load there is a slight pause before building pipelines step occurs, this is because the tracking does not update while the pipelines or initially warmed. Once pipelines are actually being built does step 2 properly show up and track. Cache: a previously downloaded image may still sit in the splash folder under your Darner home (default %LOCALAPPDATA%\darner). It's harmless now, but you can delete the folder. I HAVE NOT WRITTEN ANYTHING TO REMOVE THIS SPLASH FILE IF IT WAS DOWNLOADED ON EARLIER BUILDS. There should be no call to find/download/use the splash from any source within this code. All commits of this branch have detailed explanations of what changed other than -Commit fe4ea414c4 is a main.rs edit I forgot to add description. It fixes the return match line for preload ui. Every arm of the old match already ended the process, so the return in front of it could never run. This created an annoying WARNING DIVERGENT CALLS message in the command lines that caused no issues with the actual functioning of the code. ## How it was tested LAST COMMIT ACTION THIS REPO IS BASED ON IS f3840d73d3 ALL TESTS RAN ON THIS BUILD BEFORE IT WS REMADE FOR CURRENT MAIN. First test was not saved properly these are all reruns after initial tests. cargo test --workspace --locked Test results = failures: ---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ---- thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (27968) panicked at crates\darner-gpu\src\watch.rs:8614:13: assertion `left == right` failed left: Some(229126) right: None failures: watch::tests::ask_once_by_res_splits_reservations_without_refusals test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 22.91s cargo test --workspace --locked -p darner-gpu --lib Test results = failures: ---- watch::tests::ask_once_by_res_splits_reservations_without_refusals stdout ---- thread 'watch::tests::ask_once_by_res_splits_reservations_without_refusals' (34756) panicked at crates\darner-gpu\src\watch.rs:8614:13: assertion `left == right` failed left: Some(237699) right: None failures: watch::tests::ask_once_by_res_splits_reservations_without_refusals test result: FAILED. 1772 passed; 1 failed; 81 ignored; 0 measured; 0 filtered out; finished in 20.62s I BELEIVE THES FAILED DUE TO KNOWN PARALLEL PROCESS UPDATE ERROR. ## Checklist - [X] I ran this change in the game, or say below why it can't be (docs, tests only). - [] This PR contains one change based on `main`. - [ ] The diff follows `docs/asset-policy.md`. - [ ] I recorded this PR's dependencies below. - Depends on: none <!-- Replace the indented item above with one item per prerequisite using "- Depends on #N (reason)". Keep this PR in draft while any prerequisite is unmerged. Add the same PRs in CodeFloe's Dependencies panel if you can edit it. --> <!-- Address review feedback in this PR. Open a new PR for follow-up work. --> ## Checked for overlap - [ ] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: <!-- List #N or write "none found". --> - Replaces or overlaps: #N (why this one), or "none found" THE PATCH TO BRING BUILD UP FROM f3840d73d3 TO d91d8e4d60 HAS NOT BEEN FULLY TESTED, BUT NO CONFLICTS WERE FOUND YET. MANY EDITS MADE UNABLE TO DETAIL ALL DUE TO NOT KNOWING ALL THAT WAS ADDED BETWEEN f3840d73d3 & d91d8e4d60.
The splash-style preload loader is now removed from the project, and a search of the whole project finds no references to it.

What I removed:

scripts/preload-window.ps1: deleted. That file was the whole GTA-splash window: it loaded the game's splash image and drew the progress bar over it.
scripts/play-nvidia.ps1:
The loading of that script and every call into it are gone.
The -Splash and -SplashWindow options are gone, and so is the image-fetching code.
The preload now always uses the green window. -NoPreloadWindow is still there if you want console-only progress.
locales/en.json and locales/zh-CN.json: I removed 34 text strings each that only the splash window used, such as "Skip and start the game" and "Translating the game's shaders". I kept the five the launcher still prints in its console summary.
README.md: the two places that described the "progress window over the game's splash" now describe the green window.

The only remaining "splash" text is two lines in crates/darner-hle/src/modules/icon.rs. That code reads the game's own config file for icon handling, so it has nothing to do with the loader and I left it alone.
The only remaining "splash" text is two lines in crates/darner-hle/src/modules/icon.rs. That code reads the game's own config file for icon handling, so it has nothing to do with the loader and I left it alone.

Other edits made include tracking shaders by the bytes completed in hash translation.
-One gap: a file with no shader sources prints nothing. The window then waits for the next file instead of moving forward, which is minor.
- only 2 files hold shaders on initial game load and preloading from main menu, file 13 holding 45 shaders & file 43 holding the majority of all of them. with the percentages being printed as often as they are there is no real gap between switching files and processing the hash size translation to be tracked in bytes.

cargo test --workspace --locked
test result: ok. 1756 passed; 0 failed; 81 ignored; 0 measured; 0 filtered out

Issue with quit button working while TrustNo1 states make sure quit button does not end process

34f90567 no longer present this has been moved to private branch for personal preference.
The quit button was functioning, I kept the command line to make the quit button work but removed the actual call to it when the button is pressed.

What changed in apps/darner/src/preload_ui.rs:

There is a new switch near the top: pub(crate) const QUIT_ENABLED: bool = false;
With it false, clicking Quit does nothing, and Quit no longer lights up when you hover over it.
The Outcome::Quit => 11 line in main.rs and the Quit handling in play.rs are untouched. They are never reached, so the exit command never runs.
To bring Quit back later, change false to true and rebuild. Nothing else needs to change.

Closing the window: the window's X button, and Alt+F4, also count as Quit. With the switch off they are ignored too. If I had left them working, they would still run that exit command. While the switch is off, the ways to leave the preload window are "Play now" (or Enter) or letting it finish.

Next commit will split the command to make alt+F4 command and X button on window to function.
Split the function to keep the ability to close window with the X on top right or ALT+F4 command, while leaving the quit button unable to call command.

Quit button: controlled by pub(crate) const QUIT_BUTTON_ENABLED: bool = false;. While it's false, clicking the button does nothing and it has no hover highlight.
X button and Alt+F4: work as they did originally. They close the window, stop the preload, and give Outcome::Quit. That means the launcher still reaches the Outcome::Quit => 11 line in main.rs and exits, and darner play still prints its quit message and exits. The exit line is still there.
Play now and Enter: unchanged.
The button is controlled by a new setting,
DARNER_PRELOAD_QUIT_BUTTON. It's off by default, so the button does nothing and has no hover highlight.
Set it to 1 (any value except 0) to make the button work. Closing the window with the X button or Alt+F4 works either way, as before.
It follows the same rule as the project's other on/off settings: set and not 0 means on.

apps/darner/src/preload_ui.rs: replaces the compile-time QUIT_BUTTON_ENABLED switch from last time with a function that reads the setting.
README.md: adds a row for the setting to the settings table and bumps that section's count from 112 to 113. I didn't find any check that validates the count, but the table has to match.
This reverts commit 3395e3851b.
Instead of text output reading "94% of shaders translated", it should read more like "23,744 shaders in cache (94%)"

Parsing: the preload already prints lines like 23744 shaders in the cache, 94 % of bytes, 2 s,  The window now also reads the shader count at the start of that line (preload_ui.rs).

Display: the count gets thousands separators, and the percentage is the same bytes-based figure the bar already used. Steps 2 and 3 (pipelines) are unchanged.

Locale text: I replaced the preload.progress.shader_percent string with preload.progress.shader_count in locales/en.json ({0} shaders in cache ({1}%)). I did the same in zh-CN.json (缓存中有 {0} 个着色器({1}%)). The Chinese wording is my own translation, so you may want to check it.

Tests: I added assertions to the existing test in preload_ui.rs. It feeds in 25000 shaders in the cache, 41 % of bytes, 173 s and expects 25,000 shaders in cache (41%).
assert_eq!((p.step, p.done, p.total), (1, 41, 100)); is still there above the new one. The new line checks the same three values plus p.shaders, so delete the old line. My version of the file replaces it rather than keeping both.
assert_eq!((p.step, p.done, p.total, p.shaders), (1, 41, 100, 25000)): after parsing the sample line, this checks that the window is on step 1 at 41% of 100, and that it picked up 25,000 as the shader count.
The last three lines: they check the text the window would show, "Step 1 of 3: Translating shaders" and "25,000 shaders in cache (41%)". This covers the locale string and the comma formatting

The 3 builds preloading should be the same. All should be tracked by % of bytes translated and shaders in cache. All should have the quit button functional with a setting to disable it for now (TrustNo1 stated quit button should not run command) alt+f4 and windows close buttons still run the exit command and will close window.
WAS ABLE TO RECREATE SPLASH SCREEN WHEN NONE WERE BEING CALLED FOR FROM GAME FILES.

Where the art came from. The art window came from scripts/play-nvidia.ps1 and scripts/preload-window.ps1

By default it read the picture from the game's own folder (the SplashScreenImage entry in MicrosoftGame.config). If you passed -Splash <URL>, it downloaded the image into a splash folder under your Darner home. That is how it came back.

What I removed

preload-window.ps1

Only one script used it. I searched the whole repo, and play-nvidia.ps1 was the only thing that loaded that file.

What I changed

I've added the unblock step to play-nvidia.ps1
# Files that came from a download or a zip carry Windows' "from the internet" mark, which the default execution
every .ps1 and .cmd file in the repository's top folder, which covers the launchers like Play-MyRig.cmd, and every .ps1 and .cmd file under scripts\, including the subfolders. for the initial bypass compile.

play-nvidia.ps1: it no longer opens that window. During -Preload you get the plain progress lines in the PowerShell console, such as 23744 shaders in the cache, 94 % of bytes, 2 s

Play-nvidia.ps1 was also loading the language file. The deleted file loaded locale.ps1, which supplies the launcher's messages. If I had only deleted the file, the launcher would have lost its text. So play-nvidia.ps1 now loads locale.ps1 directly.

I removed every call to the old window code. The preload now just prints its lines to the console and records "done" or "ended with code N" afterward. The "skipped" outcome is gone, since only the window's Skip button could produce it

-Splash and -NoPreloadWindow: both are still accepted but ignored. Old shortcuts and the F1 menu's restart pass these, so removing them would make those fail.

Things to know

Unblock command added to play-nvidia.ps1 for any files that may need it.
THIS MAY CREATE SECURITY ISSUES ON FURTHER PULLS AS THIS MAY BE ADDED TO A MALICIOUS FILE THAT IS ADDED AFTER THE FACT.

preload window should be consistent between all 3 build versions. If the rust loader fails to open in any way have a powershel/cmd environment lines describing process and updates.

quit button of the preload window is functioning but has a on/off setting (TrustNo1 said make sure quit button doesn't run command). When setting is changed you must compile the build again for the launcher to have the quit button function. The call to exit was split so it will still be made through an alt+f4 or windows close button.
Play now still functioning properly across all 3 build loaders.
All 3 builds laoders reach 100% in steps 1 and 2, step 3 has not been fixed.

on initial load there is a slight pause before building pipelines step occurs, this is because the tracking does not update while the pipelines or initially warmed. Once pipelines are actually being built does step 2 properly show up and track.

Cache: a previously downloaded image may still sit in the splash folder under your Darner home (default %LOCALAPPDATA%\darner). It's harmless now, but you can delete the folder.
I HAVE NOT WRITTEN ANYTHING TO REMOVE THIS SPLASH FILE IF IT WAS DOWNLOADED ON EARLIER BUILDS.
There should be no call to find/download/use the splash from any source within this code.

All commits of this branch have detailed explanations of what changed other than
-Commit fe4ea414c4 is a main.rs edit I forgot to add description.
 It fixes the return match line for preload ui.
Every arm of the old match already ended the process, so the return in front of it could never run.
This created an annoying WARNING DIVERGENT CALLS message in the command lines that caused no issues with the actual functioning of the code.
This is a merged file that brings together all of the DMCA fixes with new main build from commit d91d8e4d60
failures:

---- preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts stdout ----

thread 'preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts' (8112) panicked at apps\darner\src\preload_ui.rs:902:9:
assertion `left == right` failed
  left: "Step 1 of 3: Translating shaders  (0:00 in this step)"
 right: "Step 1 of 3: Translating shaders"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    preload_ui::tests::the_preloads_lines_are_read_as_steps_and_counts

test result: FAILED. 191 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.83s

Test's window now shows the time spent in each step, so lines() returns "Step 1 of 3: Translating shaders (0:00 in this step)". When I merged the fix's test, I kept its older assertion, which expects the text without the time. The code is fine. Only the assertion is stale.
Before it was going by bites of all files, much like the original 41 of 43 file. This should track by jobs to be done now.
tragice closed this pull request 2026-12-05 07:15:03 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!492
No description provided.