Loader & HLE: harden VEH crash handler, PE prep/exports/TLS, and allow oleaut32 #216
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!216
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-216"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@wbkepler on GitHub · 2026-11-24 01:30 UTC · original
wbkepler:loader/veh-safety-and-oleaut32→main· +794 −133 · 7 files · 1 commits · openSummary
emulate_amd_only,clwb_len, andsse4a(fixing page-endclwbemulation in the last 14 bytes of a page).thrown()against C++ rethrows (nullThrowInfo), null object pointers, and out-of-range catchable-type tables.report_crashes()idempotent viaOnce, serializescrashes.logwrites with aMutex, and reserves overflow stack viaSetThreadStackGuaranteeon handler install, title main thread, and thread attach.IMAGE_DLLCHARACTERISTICS_GUARD_CFalongsideFORCE_INTEGRITYinprepare.rs.victory-peExportInfoandImportResolver(with recursion depth guard) instead of hostGetProcAddress/LdrpResolveForwarder._tls_indexzeroing inVirtualProtectand callsFlushInstructionCacheafter emitting TLS thunks.oleaut32.dllsupport:oleaut32.dllin defaultHostPolicyso standard OLE Automation/BSTR imports (including ordinals#4SysAllocStringLenand#6SysFreeString) resolve to the host.Verification
cargo clippy --workspace --all-targets— passed (zero new warnings)cargo clippy -p victory --features diagnostics --all-targets— passedcargo test --workspace— passed (including new tests for page-end emulation, C++ rethrow/ThrowInfoguards, idempotentreport_crashes/stack guarantee,GUARD_CFstripping, forwarded/cyclic export resolution, read-only_tls_indexpatching, andoleaut32ordinals)cargo xtask policy— passed (151 files ok)@jeremygold02 on GitHub · 2026-11-24 05:08 UTC · original
Thanks @wbkepler for the broad hardening across the loader’s exception handling, PE preparation, TLS, export resolution, and HLE API lookup.
I tested commit
6269b57090f44a54be9b4b861f2e83b13a20ae73with:Both library suites passed: 25 loader tests and 87 HLE tests, with 0 failures.
Representative coverage of the changed paths includes:
oleaut32ordinals resolve to the host.This is unit-test coverage of the affected code paths. It does not launch a full title or validate the complete runtime integration with title binaries.
@wbkepler on GitHub · 2026-11-24 20:37 UTC · original
Rebased onto current main (
ffe310e) as58e267e; the only conflict was in the crash.rs tests (kept both the upstream page-end test and this PR's tests), no code redesign. Gate (clippy -D warnings, tests, policy) clean.AI-assisted (Claude Code); checked on Windows 11 / RTX 5090.
@Marvisak on GitHub · 2026-11-25 00:20 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-loader/src/crash.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.