Repository navigation
Fix automatic DLL discovery matching short filename aliases - #32
DeathFishAtEase wants to merge 3 commits into
Conversation
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
it looks to me as a workaround rather than a proper solution. is there a way to exclude short filenames from the paths maybe? they're useless for modern apps anyway |
I looked into whether we could exclude short aliases through the enumeration API. The Remarks section of Microsoft's
There is no documented option in
I verified this with compiled Syringe.exe variants: I removed the extension check and switched the enumeration to The returned filename is already the long name. Windows matches an alias such as The extension check therefore enforces the intended automatic discovery rule against the long filename. We could instead enumerate Do you know of an API or approach that avoids short-alias matching directly, or have you handled something similar before? I'd appreciate any pointers or practical experience that could help improve this. |
|
what a stupid limitation from the API side... I don't have much idea, but I think you have to filter everything to be matching that, not just default case. does Windows expose some way to check whether the path matches the wildcard? maybe we could double-check every matched path to match the |
Use PathMatchSpecEx for every returned filename, including explicit -i patterns, so 8.3 aliases cannot select unintended extensions. Replace the default-scan-only suffix check with the same filter for all selections.
Use the native DOS wildcard matcher for the long-name recheck so existing -i patterns keep FindFirstFile behavior, including question marks, extensionless names, and trailing-dot normalization.
I’ve updated the default DLL discovery so every Commit e340029 additionally preserves |
Renaming a DLL to
.dllican appear to disable it, then unexpectedly stop working after copying the game directory to another drive or machine.Windows file searches match both long filenames and their 8.3 short aliases. On a volume that generates short names,
PatcherLoader.dllican receive an alias such asPATCHE~1.DLL, which still matches*.dll. Windows then returns the long filename, and Syringe accepts it for injection. Files without such aliases remain excluded, so even two.dllifiles in the same directory can behave differently.Automatic discovery now checks that the returned long filename ends in
.dll, case insensitively. Explicit-i=selections continue to allow other extensions.Verified with a test executable and hook DLL, including renamed files with
.DLLshort aliases, mixed-case extensions, and explicit selections. The existing test suite also passes.