diff --git a/usermode/src/utils/memory.hpp b/usermode/src/utils/memory.hpp index 37324e7..ffdfb0d 100644 --- a/usermode/src/utils/memory.hpp +++ b/usermode/src/utils/memory.hpp @@ -28,22 +28,22 @@ class c_memory } bool setup(); - std::optional get_process_id(const std::string_view &process_name); - std::optional hijack_handle(); - std::optional find_pattern(const std::string_view &module_name, const std::string_view &pattern); - std::pair, std::optional> get_module_info(const std::string_view &module_name); + std::optional get_process_id(const std::string_view& process_name); + std::optional hijack_handle(); + std::optional find_pattern(const std::string_view& module_name, const std::string_view& pattern); + std::pair, std::optional> get_module_info(const std::string_view& module_name); bool is_anticheat_running(); - bool read_t(const uintptr_t address, void *buffer, uintptr_t size) + bool read_t(const uintptr_t address, void* buffer, uintptr_t size) { - this->read_memory(reinterpret_cast(address), buffer, size); + this->read_memory(reinterpret_cast(address), buffer, size); return true; } template - t read_t(void *address) + t read_t(void* address) { - t value{0}; + t value{ 0 }; this->read_memory(address, &value, sizeof(t)); return value; } @@ -52,7 +52,7 @@ class c_memory T read_t(const uintptr_t address) noexcept { T buffer{}; - this->read_memory(reinterpret_cast(address), &buffer, sizeof(T)); + this->read_memory(reinterpret_cast(address), &buffer, sizeof(T)); return buffer; } @@ -62,9 +62,9 @@ class c_memory static const int length = 64; std::vector buffer(length); - this->read_memory(reinterpret_cast(address), buffer.data(), length); + this->read_memory(reinterpret_cast(address), buffer.data(), length); - const auto &it = find(buffer.begin(), buffer.end(), '\0'); + const auto& it = find(buffer.begin(), buffer.end(), '\0'); if (it != buffer.end()) buffer.resize(distance(buffer.begin(), it)); @@ -74,12 +74,12 @@ class c_memory private: bool m_initialized = false; - void *m_handle = nullptr; + void* m_handle = nullptr; uint32_t m_id = 0; - bool read_memory(void *address, void *buffer, const size_t size) + bool read_memory(void* address, void* buffer, const size_t size) { - return ReadProcessMemory(this->m_handle, reinterpret_cast(address), buffer, size, nullptr); + return ReadProcessMemory(this->m_handle, reinterpret_cast(address), buffer, size, nullptr); } };