This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/memory/module.hpp

40 lines
793 B
C++
Raw Normal View History

2019-03-21 20:18:31 +01:00
#pragma once
#include "range.hpp"
namespace memory
{
class module : public range
{
public:
explicit module(const std::string_view name);
2019-03-21 20:18:31 +01:00
/**
* @brief Get the export address of the current module given a symbol name
*
* @param symbol_name
* @return memory::handle
*/
2019-03-21 20:18:31 +01:00
memory::handle get_export(std::string_view symbol_name);
bool loaded() const;
2023-04-16 18:28:49 +00:00
size_t size() const;
DWORD timestamp() const;
2023-04-16 18:28:49 +00:00
/**
* @brief Waits till the given module is loaded.
*
* @param time Time to wait before giving up.
* @return true
* @return false
*/
bool wait_for_module(std::optional<std::chrono::high_resolution_clock::duration> time = std::nullopt);
protected:
bool try_get_module();
private:
const std::string_view m_name;
bool m_loaded;
2019-03-21 20:18:31 +01:00
};
}