#include #include #include #include #include using namespace geode::prelude; #include #include "gdTimestampMap.hpp" std::string Loader::Impl::getGameVersion() { if (m_gdVersion.empty()) { auto dosHeader = reinterpret_cast(geode::base::get()); auto ntHeader = reinterpret_cast(geode::base::get() + dosHeader->e_lfanew); auto timestamp = ntHeader->FileHeader.TimeDateStamp; m_gdVersion = timestampToVersion(timestamp); } return m_gdVersion; } bool Loader::Impl::userTriedToLoadDLLs() const { static std::unordered_set KNOWN_MOD_DLLS { "betteredit-v4.0.5.dll", "betteredit-v4.0.5-min.dll", "betteredit-v4.0.3.dll", "betteredit.dll", "gdshare-v0.3.4.dll", "gdshare.dll", "hackpro.dll", "hackproldr.dll", "quickldr.dll", "minhook.x32.dll", "iconsave.dll", "menuanim.dll", "volumecontrol.dll", "customsplash.dll", "scrollanyinput-v1.1.dll", "alttabfix-v1.0.dll", "sceneswitcher-v1.1.dll", "gdantialiasing.dll", "textureldr.dll", "run-info.dll", }; bool triedToLoadDLLs = false; // Check for .DLLs in mods dir if (auto files = file::readDirectory(dirs::getModsDir(), true)) { for (auto& file : files.unwrap()) { if (file.extension() == ".dll") { triedToLoadDLLs = true; } } } // Check all loaded DLLs in the process std::array mods; DWORD needed; auto process = GetCurrentProcess(); if (EnumProcessModules(process, mods.data(), mods.size(), &needed)) { for (auto i = 0; i < (needed / sizeof(HMODULE)); i++) { std::array modName; if (GetModuleFileNameExA(process, mods[i], modName.data(), modName.size())) { if (KNOWN_MOD_DLLS.count(string::trim(string::toLower( ghc::filesystem::path(modName.data()).filename().string() )))) { triedToLoadDLLs = true; } } } } return triedToLoadDLLs; }