From 6dfe11503bbc9ea8bc68b50087f76319bfeafd97 Mon Sep 17 00:00:00 2001 From: Mr_Goldberg Date: Sat, 6 Feb 2021 22:37:59 -0500 Subject: [PATCH] Dll loading feature now only tries loading .dll files. --- dll/base.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dll/base.cpp b/dll/base.cpp index a5b3e5f..4e805e5 100644 --- a/dll/base.cpp +++ b/dll/base.cpp @@ -649,6 +649,13 @@ static void load_dlls() std::vector paths = Local_Storage::get_filenames_path(path); for (auto & p: paths) { std::string full_path = path + p; + size_t length = full_path.length(); + if (length < 4) continue; + if (std::toupper(full_path[length - 1]) != 'L') continue; + if (std::toupper(full_path[length - 2]) != 'L') continue; + if (std::toupper(full_path[length - 3]) != 'D') continue; + if (full_path[length - 4] != '.') continue; + 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());