Loader & HLE: harden VEH crash handler, PE prep/exports/TLS, and allow oleaut32 #216
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T01:30:04Z.
Summary
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)Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T05:08:28Z.
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.
Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T20:37:53Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:20:56Z.
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
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.