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.
37 lines
1.0 KiB
37 lines
1.0 KiB
3 years ago
|
#pragma once
|
||
3 years ago
|
#include <obf/engine.hpp>
|
||
|
#include <recomp/symbol_table.hpp>
|
||
3 years ago
|
#include <decomp/decomp.hpp>
|
||
|
|
||
3 years ago
|
namespace theo::recomp {
|
||
3 years ago
|
using resolver_t = std::function<std::uintptr_t(std::string)>;
|
||
|
using copier_t = std::function<void(std::uintptr_t, void*, std::uint32_t)>;
|
||
3 years ago
|
using allocator_t =
|
||
|
std::function<std::uintptr_t(std::uint32_t,
|
||
|
coff::section_characteristics_t)>;
|
||
3 years ago
|
|
||
3 years ago
|
class recomp_t {
|
||
3 years ago
|
public:
|
||
3 years ago
|
explicit recomp_t(decomp::decomp_t* dcmp);
|
||
|
explicit recomp_t(decomp::decomp_t* dcmp,
|
||
3 years ago
|
allocator_t alloc,
|
||
|
copier_t copy,
|
||
|
resolver_t resolve);
|
||
3 years ago
|
|
||
3 years ago
|
void allocate();
|
||
|
void resolve();
|
||
|
void copy_syms();
|
||
|
|
||
3 years ago
|
void allocator(allocator_t alloc);
|
||
|
void copier(copier_t copy);
|
||
|
void resolver(resolver_t resolve);
|
||
3 years ago
|
std::uintptr_t resolve(const std::string&& sym);
|
||
3 years ago
|
|
||
|
private:
|
||
3 years ago
|
void gen_reloc_trans(decomp::symbol_t* sym);
|
||
3 years ago
|
decomp::decomp_t* m_dcmp;
|
||
|
resolver_t m_resolver;
|
||
|
copier_t m_copier;
|
||
|
allocator_t m_allocator;
|
||
3 years ago
|
};
|
||
|
} // namespace theo::comp
|