Notify mod DLLs once the title is mapped #292

Closed
Korothi wants to merge 0 commits from upstream-pr/292 into main
Korothi commented 2026-12-01 10:35:44 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by Korothi on 2026-12-01T10:35:44Z.


## 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

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:5583920398 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/292). Originally posted by [Korothi](https://github.com/Korothi) on 2026-12-01T10:35:44Z. --- ## 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)
readmet3xt-lab commented 2026-12-01 12:27:41 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by readmet3xt-lab on 2026-12-01T12:27:41Z.


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.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7311164427 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/292#issuecomment-7311164427). Originally posted by [readmet3xt-lab](https://github.com/readmet3xt-lab) on 2026-12-01T12:27:41Z. --- 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.
Korothi commented 2026-12-01 22:10:01 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by Korothi on 2026-12-01T22:10:01Z.


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.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7327361891 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/292#issuecomment-7327361891). Originally posted by [Korothi](https://github.com/Korothi) on 2026-12-01T22:10:01Z. --- 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
readmet3xt-lab/foxhound!292
No description provided.