Add support for loading custom dlls in the experimental build.

Put them in steam_settings\load_dlls\
This commit is contained in:
Mr_Goldberg 2020-12-25 21:00:36 -05:00
parent 147ff1b5da
commit 4cb55c52e2
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
3 changed files with 15 additions and 12 deletions

View File

@ -31,5 +31,5 @@ All ips except these ranges are blocked:
224.0.0.0 - 255.255.255.255 224.0.0.0 - 255.255.255.255
Luma CEG support: Support for loading any dlls:
If LumaCEG_Plugin_x86.dll (steam_api.dll) or LumaCEG_Plugin_x64.dll (steam_api64.dll) is present it will be loaded automatically. Any files put in the steam_settings\load_dlls\ folder will be loaded automatically using the LoadLibraryA function.

View File

@ -639,14 +639,19 @@ static void load_dll()
} }
} }
static void load_lumaCEG() #include "local_storage.h"
static void load_dlls()
{ {
std::string path = get_full_program_path(); std::string path = Local_Storage::get_game_settings_path();
path += LUMA_CEG_DLL_NAME; path += "load_dlls";
if (file_exists(path)) { path += PATH_SEPARATOR;
PRINT_DEBUG("loading luma ceg dll %s\n", path.c_str());
if (LoadLibraryA(path.c_str())) { std::vector<std::string> paths = Local_Storage::get_filenames_path(path);
PRINT_DEBUG("Loaded luma ceg dll file\n"); for (auto & p: paths) {
std::string full_path = path + p;
PRINT_DEBUG("Trying to load %s\n", full_path.c_str());
if (LoadLibraryA(full_path.c_str())) {
PRINT_DEBUG("LOADED %s\n", full_path.c_str());
} }
} }
} }
@ -765,7 +770,7 @@ BOOL WINAPI DllMain( HINSTANCE, DWORD dwReason, LPVOID ) {
network_functions_attached = true; network_functions_attached = true;
} }
load_dll(); load_dll();
load_lumaCEG(); load_dlls();
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:

View File

@ -78,10 +78,8 @@
#include "../detours/detours.h" #include "../detours/detours.h"
#ifdef DETOURS_64BIT #ifdef DETOURS_64BIT
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x64.dll"
#define DLL_NAME "steam_api64.dll" #define DLL_NAME "steam_api64.dll"
#else #else
#define LUMA_CEG_DLL_NAME "LumaCEG_Plugin_x86.dll"
#define DLL_NAME "steam_api.dll" #define DLL_NAME "steam_api.dll"
#endif #endif
#endif #endif