#pragma once #include "utility/address.hpp" #include #include #include namespace process { bool attach(std::string_view process_name) noexcept; [[nodiscard]] std::optional find_pattern(std::string_view module_name, std::string_view pattern) noexcept; [[nodiscard]] std::optional get_module_base_by_name(std::string_view module_name) noexcept; std::optional get_module_export_by_name(std::uintptr_t module_base, std::string_view function_name) noexcept; [[nodiscard]] std::optional> loaded_modules() noexcept; bool read_memory(std::uintptr_t address, void* buffer, std::size_t size) noexcept; bool write_memory(std::uintptr_t address, const void* buffer, std::size_t size) noexcept; [[nodiscard]] std::string read_string(std::uintptr_t address, std::size_t length) noexcept; template T read_memory(const std::uintptr_t address) noexcept { T buffer{}; read_memory(address, &buffer, sizeof(T)); return buffer; } template bool write_memory(const std::uintptr_t address, const T& buffer) noexcept { return write_memory(address, &buffer, sizeof(T)); } }