diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 30543a79..35294f96 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -356,8 +356,8 @@ namespace Components QuickPatch::QuickPatch() { - // quit_hard - Command::Add("quit_hard", [](Command::Params*) + // quitHard + Command::Add("quitHard", [](Command::Params*) { int data = false; const Utils::Library ntdll("ntdll.dll"); @@ -841,6 +841,7 @@ namespace Components } }); +#ifdef DEBUG AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader asset, const std::string& /*name*/, bool* /*restrict*/) { if (type == Game::XAssetType::ASSET_TYPE_GFXWORLD) @@ -855,6 +856,7 @@ namespace Components Utils::IO::WriteFile("userraw/logs/matlog.txt", buffer); } }); +#endif // Dvars Dvar::Register("ui_streamFriendly", false, Game::DVAR_FLAG_SAVED, "Stream friendly UI"); diff --git a/src/Utils/Library.cpp b/src/Utils/Library.cpp index 0cf9ab67..1b10bf40 100644 --- a/src/Utils/Library.cpp +++ b/src/Utils/Library.cpp @@ -19,15 +19,9 @@ namespace Utils return Library(handle); } - Library::Library(const std::string& buffer, bool _freeOnDestroy) : _module(nullptr), freeOnDestroy(_freeOnDestroy) + Library::Library(const std::string& name, bool _freeOnDestroy) : _module(nullptr), freeOnDestroy(_freeOnDestroy) { - this->_module = LoadLibraryExA(buffer.data(), nullptr, 0); - } - - Library::Library(const std::string& buffer) - { - this->_module = GetModuleHandleA(buffer.data()); - this->freeOnDestroy = true; + this->_module = LoadLibraryExA(name.data(), nullptr, 0); } Library::Library(const HMODULE handle) @@ -49,7 +43,7 @@ namespace Utils return this->_module != nullptr; } - HMODULE Library::getModule() + HMODULE Library::getModule() const { return this->_module; } diff --git a/src/Utils/Library.hpp b/src/Utils/Library.hpp index 2262987d..a736b987 100644 --- a/src/Utils/Library.hpp +++ b/src/Utils/Library.hpp @@ -9,14 +9,14 @@ namespace Utils static Library Load(const std::filesystem::path& path); static Library GetByAddress(void* address); - Library() : _module(nullptr), freeOnDestroy(false) {}; - Library(const std::string& buffer, bool freeOnDestroy); - explicit Library(const std::string& name); + Library() : _module(GetModuleHandleA(nullptr)), freeOnDestroy(false) {}; + explicit Library(const std::string& name, bool freeOnDestroy); + explicit Library(const std::string& name) : _module(GetModuleHandleA(name.data())), freeOnDestroy(true) {}; explicit Library(HMODULE handle); ~Library(); bool isValid() const; - HMODULE getModule(); + HMODULE getModule() const; template T getProc(const std::string& process) const