You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
912 B
32 lines
912 B
#pragma once
|
|
#include <comp/symbol_table.hpp>
|
|
#include <decomp/decomp.hpp>
|
|
|
|
namespace theo::comp {
|
|
using resolver_t = std::function<std::uintptr_t(std::string&&)>;
|
|
using copier_t = std::function<void(void*, std::uint32_t)>;
|
|
using allocator_t =
|
|
std::function<std::uintptr_t(std::uint32_t,
|
|
coff::section_characteristics_t)>;
|
|
|
|
class comp_t {
|
|
public:
|
|
explicit comp_t(decomp::decomp_t* dcmp);
|
|
explicit comp_t(decomp::decomp_t* dcmp,
|
|
allocator_t alloc,
|
|
copier_t copy,
|
|
resolver_t resolve);
|
|
|
|
std::optional<std::uint32_t> compose();
|
|
void allocator(allocator_t alloc);
|
|
void copier(copier_t copy);
|
|
void resolver(resolver_t resolve);
|
|
std::uintptr_t resolve(std::string&& sym);
|
|
|
|
private:
|
|
decomp::decomp_t* m_dcmp;
|
|
resolver_t m_resolver;
|
|
copier_t m_copier;
|
|
allocator_t m_allocator;
|
|
};
|
|
} // namespace theo::comp
|