plugify 1.2.8
Loading...
Searching...
No Matches
assembly.hpp
1#pragma once
2
3#include <filesystem>
4#include <memory>
5#include <string>
6
7#include "plugify/load_flag.hpp"
8#include "plugify/mem_addr.hpp"
9#include "plugify/types.hpp"
10
11#include "plg/expected.hpp"
12
13namespace plugify {
18 class IAssembly {
19 public:
20 virtual ~IAssembly() = default;
21
27 virtual Result<MemAddr> GetSymbol(std::string_view name) const = 0;
28
33 virtual bool IsValid() const = 0;
34
39 virtual const std::filesystem::path& GetPath() const = 0;
40
45 virtual MemAddr GetBase() const = 0;
46
51 virtual void* GetHandle() const = 0;
52 };
53
54 using AssemblyPtr = std::shared_ptr<IAssembly>;
55} // namespace plugify
Core interface for loaded assemblies.
Definition assembly.hpp:18
virtual Result< MemAddr > GetSymbol(std::string_view name) const =0
Get a symbol by name.
virtual bool IsValid() const =0
Check if assembly is valid.
virtual MemAddr GetBase() const =0
Get the base address of the assembly.
virtual void * GetHandle() const =0
Get raw platform handle.
virtual const std::filesystem::path & GetPath() const =0
Get the path of the loaded assembly.
A wrapper class for memory addresses, providing utility functions for pointer manipulation.
Definition mem_addr.hpp:12