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.
|
|
|
#pragma once
|
|
|
|
#include <spdlog/spdlog.h>
|
|
|
|
#include <comp/comp.hpp>
|
|
|
|
#include <decomp/decomp.hpp>
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
#include <tuple>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#define XED_ENCODER
|
|
|
|
extern "C" {
|
|
|
|
#include <xed-decode.h>
|
|
|
|
#include <xed-interface.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace theo {
|
|
|
|
using lnk_fns_t =
|
|
|
|
std::tuple<comp::allocator_t, comp::copier_t, comp::resolver_t>;
|
|
|
|
|
|
|
|
class theo_t {
|
|
|
|
public:
|
|
|
|
explicit theo_t(std::vector<std::uint8_t>& lib, lnk_fns_t lnkr_fns);
|
|
|
|
|
|
|
|
std::optional<std::uint32_t> decompose();
|
|
|
|
std::uintptr_t compose(const std::string&& entry_sym);
|
|
|
|
std::uintptr_t resolve(const std::string&& sym);
|
|
|
|
|
|
|
|
private:
|
|
|
|
decomp::decomp_t m_dcmp;
|
|
|
|
comp::comp_t m_cmp;
|
|
|
|
comp::symbol_table_t m_sym_tbl;
|
|
|
|
};
|
|
|
|
} // namespace theo
|