[Ready to merge] Build, game: cross-toolchain delayload in hle-probe, safe SGD5 offset arithmetic #903

Open
opened 2026-11-26 04:14:08 +00:00 by github-bot · 1 comment
Owner

@⁠atharvmantri on GitHub · 2026-11-24 13:50 UTC · original

Summary

Cross-toolchain delayload support for hle-probe and safe arithmetic in SGD5 record parsing against malformed offsets.

Because external PR creation is currently restricted (collaborators_only), the tested, CI-clean branch is ready on my fork for review / merge:

Changes

  1. Build ( ests/fixtures/hle-probe/build.rs):

    • hle-probe previously hardcoded /DELAYLOAD:victory-probe-delayed.dll and cargo:rustc-link-lib=delayimp. On non-MSVC toolchains (MinGW / Clang / LLD / Wine), clang failed with clang: error: no such file or directory: /DELAYLOAD:..., causing load_probe integration tests to fail.
    • Now checks CARGO_CFG_TARGET_ENV to pass -Wl,--delayload=victory-probe-delayed.dll on GNU/LLD targets while keeping /DELAYLOAD on MSVC.
  2. Game (crates/victory-game/src/sgd5.rs):

    • Hardened
      ecord() offset and size computations against integer overflows on malformed inputs or truncated files (using checked_add, checked_sub, and verified slice indexing).
    • Added unit test malformed_and_overflowing_markers_are_ignored.

Verification

  • cargo test --workspace: All unit and integration tests pass (including load_probe and sgd5).
  • cargo clippy --workspace: 0 warnings.
  • cargo xtask policy: 154 files ok.
**@⁠atharvmantri** on GitHub · 2026-11-24 13:50 UTC · [original](https://github.com/Marvisak/VIctory/issues/903) ### Summary Cross-toolchain delayload support for hle-probe and safe arithmetic in SGD5 record parsing against malformed offsets. Because external PR creation is currently restricted (collaborators_only), the tested, CI-clean branch is ready on my fork for review / merge: - **Branch**: [ ix/cross-toolchain-delayload-and-sgd5-overflow](https://github.com/atharvmantri/VIctory/tree/fix/cross-toolchain-delayload-and-sgd5-overflow) - **Commits**: tharvmantri/VIctory@bd04735 (based on main fe310e) - **Compare**: https://github.com/Marvisak/VIctory/compare/main...atharvmantri:VIctory:fix/cross-toolchain-delayload-and-sgd5-overflow ### Changes 1. **Build ( ests/fixtures/hle-probe/build.rs)**: - hle-probe previously hardcoded /DELAYLOAD:victory-probe-delayed.dll and cargo:rustc-link-lib=delayimp. On non-MSVC toolchains (MinGW / Clang / LLD / Wine), clang failed with clang: error: no such file or directory: /DELAYLOAD:..., causing load_probe integration tests to fail. - Now checks CARGO_CFG_TARGET_ENV to pass -Wl,--delayload=victory-probe-delayed.dll on GNU/LLD targets while keeping /DELAYLOAD on MSVC. 2. **Game (crates/victory-game/src/sgd5.rs)**: - Hardened ecord() offset and size computations against integer overflows on malformed inputs or truncated files (using checked_add, checked_sub, and verified slice indexing). - Added unit test malformed_and_overflowing_markers_are_ignored. ### Verification - cargo test --workspace: All unit and integration tests pass (including load_probe and sgd5). - cargo clippy --workspace: 0 warnings. - cargo xtask policy: 154 files ok.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:08 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:56 UTC · original

Automated triage for the maintainers.

Both changes are still open questions on main. tests/fixtures/hle-probe/build.rs still passes the MSVC-only /DELAYLOAD and delayimp, and record in crates/victory-game/src/sgd5.rs still adds offsets unchecked. Each already has an open pull request: #1631 (GNU delay-load and a prebuilt probe DLL, see #989) and #1436 (SGD5 record bounds and offset arithmetic, see #905). Review can continue there. Your branch can be compared with them, and pull requests are open to everyone again if yours differs.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:56 UTC · [original](https://github.com/Marvisak/VIctory/issues/903#issuecomment-7155319871) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T13:50:43Z at=2026-11-25T06:56:35Z --> Automated triage for the maintainers. Both changes are still open questions on `main`. `tests/fixtures/hle-probe/build.rs` still passes the MSVC-only `/DELAYLOAD` and `delayimp`, and `record` in `crates/victory-game/src/sgd5.rs` still adds offsets unchecked. Each already has an open pull request: #1631 (GNU delay-load and a prebuilt probe DLL, see #989) and #1436 (SGD5 record bounds and offset arithmetic, see #905). Review can continue there. Your branch can be compared with them, and pull requests are open to everyone again if yours differs. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/Marvisak--VIctory#903
No description provided.