Notify mod DLLs once the title is mapped #292

Closed
github-bot wants to merge 0 commits from github-bot/gh-292 into main AGit
Owner

@⁠Korothi on GitHub · 2026-12-01 10:35 UTC · original
Korothi:mod-title-mapped-callback → main · +56 −10 · 5 files · 73 commits · closed without merging

## What

A mod loaded from %LOCALAPPDATA%\victory\mods can now find out where the title was mapped. Mods are only loaded with LoadLibraryW today, so a mod that has to hook the title's code has no way to know its address or size.

After the title is mapped and before any title code runs, run.rs calls victory_on_title_mapped(&TitleInfo) in every mod DLL the layer already loaded that exports it. A mod without the export is left alone. A nonzero return is logged and the title runs on. No new switch or environment variable, and the launcher works unchanged.

The callback's contract (when it is called, what a nonzero return means, how the struct may grow under a new version) is written down in the README's Mods section, as asked in the earlier review. Mods are named by role in the code comments.

Where the files go

The mod DLL goes in %LOCALAPPDATA%\victory\mods\. Anything else a mod needs goes where that mod's own documentation says, for example beside <exe>; the layer does not look at it.

Notes

  • This is the same code as my earlier pull request, which GitHub closed when main's history was rewritten. It is rebased onto the current main and updated for the review comments.
  • Whether the layer should support mods this far is your decision. The change only notifies DLLs the layer already loads.

Testing

Tested on Windows with the supported build, 1440p, DLSS Quality, started through the launcher with a custom victory.exe:

  • With a mod that hooks the title in the mods folder, the game runs and the mod's in-game menu opens.
  • Without that mod in the folder, the game behaves as before.

Not tested: other mods, other builds.

🤖 Generated with Claude Code

**@⁠Korothi** on GitHub · 2026-12-01 10:35 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/292) `Korothi:mod-title-mapped-callback` → `main` · +56 −10 · 5 files · 73 commits · closed without merging ## What A mod loaded from `%LOCALAPPDATA%\victory\mods` can now find out where the title was mapped. Mods are only loaded with `LoadLibraryW` today, so a mod that has to hook the title's code has no way to know its address or size. After the title is mapped and before any title code runs, `run.rs` calls `victory_on_title_mapped(&TitleInfo)` in every mod DLL the layer already loaded that exports it. A mod without the export is left alone. A nonzero return is logged and the title runs on. No new switch or environment variable, and the launcher works unchanged. The callback's contract (when it is called, what a nonzero return means, how the struct may grow under a new `version`) is written down in the README's Mods section, as asked in the earlier review. Mods are named by role in the code comments. ## Where the files go The mod DLL goes in `%LOCALAPPDATA%\victory\mods\`. Anything else a mod needs goes where that mod's own documentation says, for example beside `<exe>`; the layer does not look at it. ## Notes - This is the same code as my earlier pull request, which GitHub closed when main's history was rewritten. It is rebased onto the current main and updated for the review comments. - Whether the layer should support mods this far is your decision. The change only notifies DLLs the layer already loads. ## Testing Tested on Windows with the supported build, 1440p, DLSS Quality, started through the launcher with a custom `victory.exe`: - With a mod that hooks the title in the mods folder, the game runs and the mod's in-game menu opens. - Without that mod in the folder, the game behaves as before. Not tested: other mods, other builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
After the title is mapped and before any title code runs, call victory_on_title_mapped(&TitleInfo) in every mod DLL of %LOCALAPPDATA%\victory\mods that exports it, and document the callback in the README.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 10:38:34 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 12:27 UTC · original

Checked: nothing harmful in the change, a run without mods is untouched, and it only calls into DLLs the layer already loads. The answer to "whether the layer should support mods this far" is yes, after the release now in testing, with three conditions:

  1. Reports must show a mod was present. The mods a run loaded are named in the first lines of the log and in the crash context, not only on the console.
  2. Marked experimental. The README section and the struct say that the callback is experimental and may change between releases, so nobody builds on it as a stable interface yet.
  3. Reports from modded runs. The notes (and the issue template) say that a fault seen with mods has to be reproduced without them before it is reported.

If you add the first two to this pull request, it goes onto the batch for the release after the frozen one; the third is ours to add.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 12:27 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/292#issuecomment-7311164427) Checked: nothing harmful in the change, a run without mods is untouched, and it only calls into DLLs the layer already loads. The answer to "whether the layer should support mods this far" is yes, after the release now in testing, with three conditions: 1. **Reports must show a mod was present.** The mods a run loaded are named in the first lines of the log and in the crash context, not only on the console. 2. **Marked experimental.** The README section and the struct say that the callback is experimental and may change between releases, so nobody builds on it as a stable interface yet. 3. **Reports from modded runs.** The notes (and the issue template) say that a fault seen with mods has to be reproduced without them before it is reported. If you add the first two to this pull request, it goes onto the batch for the release after the frozen one; the third is ours to add.
github-bot force-pushed github-bot/gh-292 from 125c41cddb to cc80b75784 2026-12-01 15:45:48 +00:00 Compare
Author
Owner

@⁠Korothi on GitHub · 2026-12-01 22:10 UTC · original

Added the first two conditions: the first lines of the log now say 'Mods: none' or list the loaded mods, every crash report has a 'mods loaded:' line, and the callback and its struct are marked experimental in the README and in the code. Not yet run on a real build with these lines.

**@⁠Korothi** on GitHub · 2026-12-01 22:10 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/292#issuecomment-7327361891) Added the first two conditions: the first lines of the log now say 'Mods: none' or list the loaded mods, every crash report has a 'mods loaded:' line, and the callback and its struct are marked experimental in the README and in the code. Not yet run on a real build with these lines.
github-bot closed this pull request 2026-12-02 07:54:50 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.