diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index df633790..9dadd9ec 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -393,8 +393,8 @@ namespace Components { int data = false; const Utils::Library ntdll("ntdll.dll"); - ntdll.invoke_pascal("RtlAdjustPrivilege", 19, true, false, &data); - ntdll.invoke_pascal("NtRaiseHardError", 0xC000007B, 0, nullptr, nullptr, 6, &data); + ntdll.InvokePascal("RtlAdjustPrivilege", 19, true, false, &data); + ntdll.InvokePascal("NtRaiseHardError", 0xC000007B, 0, nullptr, nullptr, 6, &data); }); // bounce dvar diff --git a/src/Steam/Proxy.cpp b/src/Steam/Proxy.cpp index 07bd2abc..0da483bb 100644 --- a/src/Steam/Proxy.cpp +++ b/src/Steam/Proxy.cpp @@ -384,25 +384,25 @@ namespace Steam Proxy::LaunchWatchGuard(); Proxy::Overlay = ::Utils::Library(GAMEOVERLAY_LIB, false); - if (!Proxy::Overlay.is_valid()) return false; + if (!Proxy::Overlay.IsValid()) return false; } Proxy::Client = ::Utils::Library(STEAMCLIENT_LIB, false); - if (!Proxy::Client.is_valid()) return false; + if (!Proxy::Client.IsValid()) return false; - Proxy::SteamClient = Proxy::Client.get("CreateInterface")("SteamClient008", nullptr); + Proxy::SteamClient = Proxy::Client.Get("CreateInterface")("SteamClient008", nullptr); if(!Proxy::SteamClient) return false; - Proxy::SteamBGetCallback = Proxy::Client.get("Steam_BGetCallback"); + Proxy::SteamBGetCallback = Proxy::Client.Get("Steam_BGetCallback"); if (!Proxy::SteamBGetCallback) return false; - Proxy::SteamFreeLastCallback = Proxy::Client.get("Steam_FreeLastCallback"); + Proxy::SteamFreeLastCallback = Proxy::Client.Get("Steam_FreeLastCallback"); if (!Proxy::SteamFreeLastCallback) return false; - Proxy::SteamGetAPICallResult = Proxy::Client.get("Steam_GetAPICallResult"); + Proxy::SteamGetAPICallResult = Proxy::Client.Get("Steam_GetAPICallResult"); if (!Proxy::SteamGetAPICallResult) return false; - Proxy::SteamClient = Proxy::Client.get("CreateInterface")("SteamClient008", nullptr); + Proxy::SteamClient = Proxy::Client.Get("CreateInterface")("SteamClient008", nullptr); if (!Proxy::SteamClient) return false; Proxy::SteamPipe = Proxy::SteamClient->CreateSteamPipe(); @@ -411,7 +411,7 @@ namespace Steam Proxy::SteamUser = Proxy::SteamClient->ConnectToGlobalUser(Proxy::SteamPipe); if (!Proxy::SteamUser) return false; - Proxy::ClientEngine = Proxy::Client.get("CreateInterface")("CLIENTENGINE_INTERFACE_VERSION005", nullptr); + Proxy::ClientEngine = Proxy::Client.Get("CreateInterface")("CLIENTENGINE_INTERFACE_VERSION005", nullptr); if (!Proxy::ClientEngine) return false; Proxy::ClientUser = Proxy::ClientEngine->GetIClientUser(Proxy::SteamUser, Proxy::SteamPipe); @@ -526,17 +526,17 @@ namespace Steam void Proxy::SetOverlayNotificationPosition(uint32_t eNotificationPosition) { - if (Proxy::Overlay.is_valid()) + if (Proxy::Overlay.IsValid()) { - Proxy::Overlay.get("SetNotificationPosition")(eNotificationPosition); + Proxy::Overlay.Get("SetNotificationPosition")(eNotificationPosition); } } bool Proxy::IsOverlayEnabled() { - if (Proxy::Overlay.is_valid()) + if (Proxy::Overlay.IsValid()) { - return Proxy::Overlay.get("IsOverlayEnabled")(); + return Proxy::Overlay.Get("IsOverlayEnabled")(); } return false; @@ -544,9 +544,9 @@ namespace Steam bool Proxy::BOverlayNeedsPresent() { - if (Proxy::Overlay.is_valid()) + if (Proxy::Overlay.IsValid()) { - return Proxy::Overlay.get("BOverlayNeedsPresent")(); + return Proxy::Overlay.Get("BOverlayNeedsPresent")(); } return false; diff --git a/src/Utils/Library.cpp b/src/Utils/Library.cpp index 688ca236..c9afc9cd 100644 --- a/src/Utils/Library.cpp +++ b/src/Utils/Library.cpp @@ -2,17 +2,17 @@ namespace Utils { - Library Library::load(const std::string& name) + Library Library::Load(const std::string& name) { return Library(LoadLibraryA(name.data())); } - Library Library::load(const std::filesystem::path& path) + Library Library::Load(const std::filesystem::path& path) { - return Library::load(path.generic_string()); + return Library::Load(path.generic_string()); } - Library Library::get_by_address(void* address) + Library Library::GetByAddress(void* address) { HMODULE handle = nullptr; GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, static_cast(address), &handle); @@ -40,23 +40,23 @@ namespace Utils { if (this->freeOnDestroy) { - this->free(); + this->Free(); } } - bool Library::is_valid() const + bool Library::IsValid() const { return this->_module != nullptr; } - HMODULE Library::getModule() + HMODULE Library::GetModule() { return this->_module; } - void Library::free() + void Library::Free() { - if (this->is_valid()) + if (this->IsValid()) { FreeLibrary(this->_module); } diff --git a/src/Utils/Library.hpp b/src/Utils/Library.hpp index b479a6cf..fd108be2 100644 --- a/src/Utils/Library.hpp +++ b/src/Utils/Library.hpp @@ -5,9 +5,9 @@ namespace Utils class Library { public: - static Library load(const std::string& name); - static Library load(const std::filesystem::path& path); - static Library get_by_address(void* address); + static Library Load(const std::string& name); + 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); @@ -15,48 +15,48 @@ namespace Utils explicit Library(HMODULE handle); ~Library(); - bool is_valid() const; - HMODULE getModule(); + bool IsValid() const; + HMODULE GetModule(); template - T get_proc(const std::string& process) const + T GetProc(const std::string& process) const { - if (!this->is_valid()) T{}; + if (!this->IsValid()) T{}; return reinterpret_cast(GetProcAddress(this->_module, process.data())); } template - std::function get(const std::string& process) const + std::function Get(const std::string& process) const { - if (!this->is_valid()) return std::function(); - return static_cast(this->get_proc(process)); + if (!this->IsValid()) return std::function(); + return static_cast(this->GetProc(process)); } template - T invoke(const std::string& process, Args ... args) const + T Invoke(const std::string& process, Args ... args) const { - auto method = this->get(process); + auto method = this->Get(process); if (method) return method(args...); return T(); } template - T invoke_pascal(const std::string& process, Args ... args) const + T InvokePascal(const std::string& process, Args ... args) const { - auto method = this->get(process); + auto method = this->Get(process); if (method) return method(args...); return T(); } template - T invoke_this(const std::string& process, void* this_ptr, Args ... args) const + T InvokeThis(const std::string& process, void* this_ptr, Args ... args) const { - auto method = this->get(this_ptr, process); + auto method = this->Get(this_ptr, process); if (method) return method(args...); return T(); } - void free(); + void Free(); private: HMODULE _module;