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.
Theodosius/include/theo.hpp

42 lines
984 B

#pragma once
#include <spdlog/spdlog.h>
#include <decomp/decomp.hpp>
#include <obf/engine.hpp>
#include <recomp/recomp.hpp>
#include <recomp/symbol_table.hpp>
#include <obf/passes/jcc_rewrite_pass.hpp>
#include <obf/passes/next_inst_pass.hpp>
#include <obf/passes/reloc_transform_pass.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<recomp::allocator_t, recomp::copier_t, recomp::resolver_t>;
class theo_t {
public:
explicit theo_t(std::vector<std::uint8_t>& lib,
lnk_fns_t lnkr_fns,
const std::string&& entry_sym);
std::optional<std::uint32_t> decompose();
std::uintptr_t compose();
std::uintptr_t resolve(const std::string&& sym);
private:
std::string m_entry_sym;
decomp::decomp_t m_dcmp;
recomp::recomp_t m_recmp;
recomp::symbol_table_t m_sym_tbl;
};
} // namespace theo