diff --git a/shared/sdk/CVar.hpp b/shared/sdk/CVar.hpp index ff8cce32..e95d0ce4 100644 --- a/shared/sdk/CVar.hpp +++ b/shared/sdk/CVar.hpp @@ -55,6 +55,7 @@ struct TConsoleVariableData { // The functions will actually dynamically scan the vtable for the right index struct IConsoleObject { virtual ~IConsoleObject() {} + virtual wchar_t* GetHelp() const = 0; }; struct IConsoleVariable : IConsoleObject { diff --git a/shared/sdk/ConsoleManager.cpp b/shared/sdk/ConsoleManager.cpp index b7b0c1f5..e3d233e7 100644 --- a/shared/sdk/ConsoleManager.cpp +++ b/shared/sdk/ConsoleManager.cpp @@ -6,8 +6,8 @@ #include "ConsoleManager.hpp" namespace sdk { -IConsoleManager* get_console_manager() { - static auto result = []() -> IConsoleManager** { +FConsoleManager* FConsoleManager::get() { + static auto result = []() -> FConsoleManager** { SPDLOG_INFO("Finding IConsoleManager..."); const auto core_module = sdk::get_ue_module(L"Core"); @@ -81,7 +81,7 @@ IConsoleManager* get_console_manager() { SPDLOG_INFO("Found IConsoleManager**: {:x}", (uintptr_t)std::get<0>(*highest_global_variable_reference)); SPDLOG_INFO("Points to IConsoleManager*: {:x}", *(uintptr_t*)std::get<0>(*highest_global_variable_reference)); - return (IConsoleManager**)std::get<0>(*highest_global_variable_reference); + return (FConsoleManager**)std::get<0>(*highest_global_variable_reference); }(); if (result == nullptr) { diff --git a/shared/sdk/ConsoleManager.hpp b/shared/sdk/ConsoleManager.hpp index c37f4bb8..0c22ea32 100644 --- a/shared/sdk/ConsoleManager.hpp +++ b/shared/sdk/ConsoleManager.hpp @@ -1,7 +1,44 @@ #pragma once namespace sdk { -class IConsoleManager; +struct IConsoleObject; -IConsoleManager* get_console_manager(); +struct ConsoleObjectElement { + wchar_t* key; + int32_t unk[2]; + IConsoleObject* value; + int32_t unk2[2]; +}; + +struct ConsoleObjectArray { + ConsoleObjectElement* elements; + uint32_t count; + uint32_t capacity; + + // begin end + ConsoleObjectElement* begin() { + return elements; + } + + ConsoleObjectElement* end() { + return elements + count; + } +}; + +class IConsoleManager { +public: + virtual ~IConsoleManager() {} +}; + +class FConsoleManager : public IConsoleManager { +public: + static FConsoleManager* get(); + + ConsoleObjectArray& get_console_objects() { + return m_console_objects; + } + +private: + ConsoleObjectArray m_console_objects; +}; } \ No newline at end of file