upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/pe_loader.cpp')
-rw-r--r--runtime/src/pe_loader.cpp4
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;