1
0
Fork 0

Always load VC runtime from application directory

#3616
This commit is contained in:
Duncan Ogilvie 2025-07-02 22:05:41 +02:00
parent 5cf93e0c3a
commit 03aebe8a50
2 changed files with 18 additions and 23 deletions

View File

@ -23,13 +23,13 @@ if(Qt5_FIND_REQUIRED AND MSVC)
set(FETCHCONTENT_QUIET OFF)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
FetchContent_Declare(Qt5
URL "https://github.com/x64dbg/deps/releases/download/dependencies/qt5.12.12-msvc2017_64.7z"
URL_HASH SHA256=bf302d02366dc09e112a1146e202429717c2097446edba8da3c3168d9a9996b4
URL "https://github.com/x64dbg/deps/releases/download/2025.07.02/qt5.12.12-msvc2017_64.7z"
URL_HASH SHA256=770490bf09514982c8192ebde9a1fac8821108ba42b021f167bac54e85ada48a
)
else()
FetchContent_Declare(Qt5
URL "https://github.com/x64dbg/deps/releases/download/dependencies/qt5.12.12-msvc2017.7z"
URL_HASH SHA256=0ea8bf7ea3ac5d7dfeb87af4ce471eefdadbf0809524fda2b0ca07aaf4654cfb
URL "https://github.com/x64dbg/deps/releases/download/2025.07.02/qt5.12.12-msvc2017.7z"
URL_HASH SHA256=3ff2a58e5ed772be475643cd7bb2df3e5499d7169d794ddf1ed5df5c5e862cb6
)
endif()
FetchContent_MakeAvailable(Qt5)

View File

@ -487,32 +487,27 @@ bool InitializeSignatureCheck()
return false;
#endif // DEBUG_SIGNATURE_CHECKS
if(bPerformSignatureChecks)
// Safely load the MSVC runtime DLLs (since they cannot be delay loaded)
auto loadRuntimeDll = [&szSystemDir](const wchar_t* szDll)
{
// Safely load the MSVC runtime DLLs (since they cannot be delay loaded)
auto loadRuntimeDll = [&szSystemDir](const wchar_t* szDll)
std::wstring fullDllPath = szApplicationDir;
fullDllPath += L'\\';
fullDllPath += szDll;
if(FileExists(fullDllPath.c_str()))
{
std::wstring fullSystemDllPath;
fullSystemDllPath = szSystemDir;
fullSystemDllPath += L'\\';
fullSystemDllPath += szDll;
if(FileExists(fullSystemDllPath.c_str()))
if(bPerformSignatureChecks)
{
LoadLibraryW(fullSystemDllPath.c_str());
LoadLibraryCheckedW(fullDllPath.c_str(), true);
}
else
{
std::wstring fullDllPath = szApplicationDir;
fullDllPath += L'\\';
fullDllPath += szDll;
if(FileExists(fullDllPath.c_str()))
LoadLibraryCheckedW(szDll, true);
LoadLibraryW(fullDllPath.c_str());
}
};
loadRuntimeDll(L"vcruntime140.dll");
loadRuntimeDll(L"vcruntime140_1.dll");
loadRuntimeDll(L"msvcp140.dll");
}
}
};
loadRuntimeDll(L"vcruntime140.dll");
loadRuntimeDll(L"vcruntime140_1.dll");
loadRuntimeDll(L"msvcp140.dll");
return true;
}