mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-25 20:53:15 +00:00
Updated LoadLibrary() to specify system32 path only
This commit is contained in:
@@ -480,7 +480,7 @@ int TouchInit()
|
|||||||
{
|
{
|
||||||
_InitializeTouchInjection init = NULL;
|
_InitializeTouchInjection init = NULL;
|
||||||
if (g_TouchLoadLibraryState > 0) return g_TouchLoadLibraryState;
|
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; }
|
if (g_TouchLoadLibrary == NULL) { g_TouchLoadLibraryState = 2; return 2; }
|
||||||
init = (_InitializeTouchInjection)GetProcAddress(g_TouchLoadLibrary, "InitializeTouchInjection");
|
init = (_InitializeTouchInjection)GetProcAddress(g_TouchLoadLibrary, "InitializeTouchInjection");
|
||||||
g_TouchInjectionCall = (_InjectTouchInput)GetProcAddress(g_TouchLoadLibrary, "InjectTouchInput");
|
g_TouchInjectionCall = (_InjectTouchInput)GetProcAddress(g_TouchLoadLibrary, "InjectTouchInput");
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ DWORD WINAPI kvm_ctrlaltdel(LPVOID Param)
|
|||||||
typedef VOID (WINAPI *SendSas)(BOOL asUser);
|
typedef VOID (WINAPI *SendSas)(BOOL asUser);
|
||||||
SendSas sas;
|
SendSas sas;
|
||||||
HMODULE sm = NULL;
|
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");
|
sas = (SendSas)GetProcAddress(sm, "SendSAS");
|
||||||
kvm_setupSasPermissions();
|
kvm_setupSasPermissions();
|
||||||
|
|||||||
@@ -1573,7 +1573,7 @@ duk_ret_t ILibDuktape_ScriptContainer_OS_arch(duk_context *ctx)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HMODULE hm = LoadLibraryA("Kernel32.dll");
|
HMODULE hm = LoadLibraryExA("Kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
void *func = (void*)GetProcAddress(hm, "IsWow64Process");
|
void *func = (void*)GetProcAddress(hm, "IsWow64Process");
|
||||||
BOOL isWow = FALSE;
|
BOOL isWow = FALSE;
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
// Add more random seeding in Windows (This is probably useful since OpenSSL in Windows has weaker seeding)
|
||||||
#if defined(WIN32) && !defined(_MINCORE)
|
#if defined(WIN32) && !defined(_MINCORE)
|
||||||
//RAND_screen(); // On Windows, add more random seeding using a screen dump (this is very expensive).
|
//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_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);
|
if (g_hAdvLib != NULL) FreeLibrary(g_hAdvLib);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9149,7 +9149,7 @@ long long ILibGetUptime()
|
|||||||
|
|
||||||
// Windows 7 & Vista
|
// Windows 7 & Vista
|
||||||
if (ILibGetUptimeFirst) {
|
if (ILibGetUptimeFirst) {
|
||||||
HMODULE hlib = LoadLibrary(TEXT("KERNEL32.DLL"));
|
HMODULE hlib = LoadLibraryExA((LPCSTR)"KERNEL32.DLL", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
if (hlib == NULL) return 0;
|
if (hlib == NULL) return 0;
|
||||||
pILibGetUptimeGetTickCount64 = (ULONGLONG(*)())GetProcAddress(hlib, "GetTickCount64");
|
pILibGetUptimeGetTickCount64 = (ULONGLONG(*)())GetProcAddress(hlib, "GetTickCount64");
|
||||||
ILibGetUptimeFirst = 0;
|
ILibGetUptimeFirst = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user