diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 10:39:20 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 10:39:20 -0500 |
| commit | 001981b743690ec0952c7eec93f23296c7937ea0 (patch) | |
| tree | 8a98fdccee357c1b47f10948f66aa5d1bf2018dc /runtime/src/pe_loader.cpp | |
| parent | 68aa9eba02f342b11502b12629cadf13237288e5 (diff) | |
| parent | 56fd84b2740f92a04154da8b1d8b90f10920b3ff (diff) | |
Merge pull request #1910 from Dominik
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index f153acdb1..e4a66a263 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -725,10 +725,12 @@ void* Loader::resolve_forwarder(const std::string& spec, Binding& binding, int d | |||
| 725 | } | 725 | } |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | // shim_key, not the bare module name: forwarder strings usually leave out ".dll" ("MSVCP140.?foo"), and the host | ||
| 729 | // CRT copies are named with it, so a forwarded CRT symbol must skip the bundled Xbox build as a direct import does. | ||
| 728 | const std::filesystem::path candidates[] = {game_dir_ / module, game_dir_ / (module + ".dll")}; | 730 | const std::filesystem::path candidates[] = {game_dir_ / module, game_dir_ / (module + ".dll")}; |
| 729 | for (const auto& candidate : candidates) { | 731 | for (const auto& candidate : candidates) { |
| 730 | std::error_code ec; | 732 | std::error_code ec; |
| 731 | if (prefer_host_copy(lower(module)) || !std::filesystem::exists(candidate, ec)) continue; | 733 | if (prefer_host_copy(shim_key) || !std::filesystem::exists(candidate, ec)) continue; |
| 732 | Module& dep = load(candidate); | 734 | Module& dep = load(candidate); |
| 733 | if (auto it = dep.exports.find(symbol); it != dep.exports.end()) { | 735 | if (auto it = dep.exports.find(symbol); it != dep.exports.end()) { |
| 734 | binding = Binding::Module; | 736 | binding = Binding::Module; |