Skip to content

getfileattributesexw_detour refactor + Linux Wine fix #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

modestimpala
Copy link
Contributor

Linux Wine / Proton Fix

I was able to confirm and reproduce the panic from unreal-shimloader versions 1.0.8+

image

I tracked this down to a test bug and resolved it by updating my Rust Nightly installation.

No longer encountered issue on the following version:

rustc --version --verbose
rustc 1.88.0-nightly (38c560ae6 2025-04-15)
binary: rustc
commit-hash: 38c560ae681d5c0d3fd615eaedc537a282fb1086
commit-date: 2025-04-15
host: x86_64-pc-windows-msvc
release: 1.88.0-nightly
LLVM version: 20.1.2

getfileattributesexw_detour refactor

However, this led me to a new bug forwarded to UE4SS from an issue in the getfileattributesexw_detour function:

UE4SS.log
[2025-04-17 01:03:46] Fatal Error: exists: Insufficient buffer.: "Z:\home\moddy\Games\pa082b_0016\WindowsNoEditor\VotV\Binaries\Win64\Mods\ActorDumperMod\dlls"

This is actually a GetFileAttributesExW call, for what appears to be an existence check.

shimloader-log.txt
[2025-04-16 18:03:46.582 DEBUG src\hooks.rs:284] [getfileattributesexw_detour] "Z:\\home\\moddy\\Games\\pa082b_0016\\WindowsNoEditor\\VotV\\Binaries\\Win64\\Mods\\ActorDumperMod\\dlls" to "C:\\users\\moddy\\AppData\\Roaming\\r2modmanPlus-local\\VotV\\profiles\\Default\\shimloader\\mod\\ActorDumperMod\\dlls"

I confirmed this directory does not exist. So it seems when UE4SS attempts to check if a non-existent directory exists, it encounters an "Insufficient buffer" error from the reroutes and it causes UE4SS to halt.

Changes

  • Added an early existence check using GetFileAttributesW before attempting to call GetFileAttributesExW
  • Return early with the appropriate error code if the file/directory doesn't exist
  • Simplified a bit by removing some variable assignment/debug logging

Testing

  • Verified functionality works correctly on both Windows and Linux (via Proton)

Linux info:

uname -r
6.14.2-arch1-1

wine-ge-8-26-x86_64 added to Lutris via ProtonUp-Qt.

Installed R2Modman via .exe installer and Lutris automated installer prompts, then set up as you normally would for modding operations. First launch should install C++ Redist for VotV then it's good to go.

Also, if you wanted to float one final DLL my way to test on my Linux setup just let me know.

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.

1 participant