Browse Source

Add support for loading custom dlls in the experimental build.

Put them in steam_settings\load_dlls\
merge-requests/37/head
Mr_Goldberg 4 months ago
parent
commit
4cb55c52e2
No known key found for this signature in database GPG Key ID: 8597D87419DEF278
  1. 4
      Readme_experimental.txt
  2. 23
      dll/base.cpp
  3. 2
      dll/common_includes.h

4
Readme_experimental.txt

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

23
dll/base.cpp

@ -639,14 +639,19 @@ static void load_dll()
}
}
static void load_lumaCEG()
{
std::string path = get_full_program_path();
path += LUMA_CEG_DLL_NAME;
if (file_exists(path)) {
PRINT_DEBUG("loading luma ceg dll %s\n", path.c_str());
if (LoadLibraryA(path.c_str())) {
PRINT_DEBUG("Loaded luma ceg dll file\n");
#include "local_storage.h"
static void load_dlls()
{
std::string path = Local_Storage::get_game_settings_path();
path += "load_dlls";
path += PATH_SEPARATOR;
std::vector<std::string> paths = Local_Storage::get_filenames_path(path);
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;
}
load_dll();
load_lumaCEG();
load_dlls();
break;
case DLL_PROCESS_DETACH:

2
dll/common_includes.h

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

Loading…
Cancel
Save