1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-26 05:03:15 +00:00

Updated LoadLibrary() to specify system32 path only

This commit is contained in:
Bryan Roe
2020-07-06 18:46:48 -07:00
parent bc6aa93ddc
commit f2cbf1f10d
5 changed files with 5 additions and 5 deletions

View File

@@ -480,7 +480,7 @@ int TouchInit()
{
_InitializeTouchInjection init = NULL;
if (g_TouchLoadLibraryState > 0) return g_TouchLoadLibraryState;
g_TouchLoadLibrary = LoadLibrary(TEXT("User32.dll"));
g_TouchLoadLibrary = LoadLibraryExA((LPCSTR)"User32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (g_TouchLoadLibrary == NULL) { g_TouchLoadLibraryState = 2; return 2; }
init = (_InitializeTouchInjection)GetProcAddress(g_TouchLoadLibrary, "InitializeTouchInjection");
g_TouchInjectionCall = (_InjectTouchInput)GetProcAddress(g_TouchLoadLibrary, "InjectTouchInput");

View File

@@ -210,7 +210,7 @@ DWORD WINAPI kvm_ctrlaltdel(LPVOID Param)
typedef VOID (WINAPI *SendSas)(BOOL asUser);
SendSas sas;
HMODULE sm = NULL;
if ((sm = LoadLibrary("sas.dll")) != NULL)
if ((sm = LoadLibraryExA((LPCSTR)"sas.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32)) != NULL)
{
sas = (SendSas)GetProcAddress(sm, "SendSAS");
kvm_setupSasPermissions();

View File

@@ -1573,7 +1573,7 @@ duk_ret_t ILibDuktape_ScriptContainer_OS_arch(duk_context *ctx)
}
else
{
HMODULE hm = LoadLibraryA("Kernel32.dll");
HMODULE hm = LoadLibraryExA("Kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
void *func = (void*)GetProcAddress(hm, "IsWow64Process");
BOOL isWow = FALSE;

View File

@@ -464,7 +464,7 @@ void __fastcall util_openssl_init()
// Add more random seeding in Windows (This is probably useful since OpenSSL in Windows has weaker seeding)
#if defined(WIN32) && !defined(_MINCORE)
//RAND_screen(); // On Windows, add more random seeding using a screen dump (this is very expensive).
if ((g_hAdvLib = LoadLibrary(TEXT("ADVAPI32.DLL"))) != 0) g_CryptGenRandomPtr = (BOOLEAN(APIENTRY *)(void*, ULONG))GetProcAddress(g_hAdvLib, "SystemFunction036");
if ((g_hAdvLib = LoadLibraryExA((LPCSTR)"ADVAPI32.DLL", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32)) != 0) g_CryptGenRandomPtr = (BOOLEAN(APIENTRY *)(void*, ULONG))GetProcAddress(g_hAdvLib, "SystemFunction036");
if (g_CryptGenRandomPtr != 0 && g_CryptGenRandomPtr(tbuf, 64) != 0) RAND_add(tbuf, 64, 64); // Use this high quality random as added seeding
if (g_hAdvLib != NULL) FreeLibrary(g_hAdvLib);
#endif

View File

@@ -9149,7 +9149,7 @@ long long ILibGetUptime()
// Windows 7 & Vista
if (ILibGetUptimeFirst) {
HMODULE hlib = LoadLibrary(TEXT("KERNEL32.DLL"));
HMODULE hlib = LoadLibraryExA((LPCSTR)"KERNEL32.DLL", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (hlib == NULL) return 0;
pILibGetUptimeGetTickCount64 = (ULONGLONG(*)())GetProcAddress(hlib, "GetTickCount64");
ILibGetUptimeFirst = 0;