36 const std::string&& entry_sym)
37 : m_dcmp(lib, &m_sym_tbl),
38 m_recmp(&m_dcmp, {}, {}, {}),
39 m_entry_sym(entry_sym) {
41 m_recmp.
copier(std::get<1>(lnkr_fns));
42 m_recmp.
resolver(std::get<2>(lnkr_fns));
47 if (!res.has_value()) {
48 spdlog::error(
"failed to decompose...\n");
52 spdlog::info(
"decompose successful... {} symbols", res.value()->size());
53 return res.value()->size();
65 return m_recmp.
resolve(m_entry_sym.data());
73 return val.value()->allocated_at();
std::optional< recomp::symbol_table_t * > decompose(std::string &entry_sym)
decomposes (extracts) the symbols used. this function determines all used symbols given the entry poi...
symbol_t is an abstraction upon the coff symbol. this allows for easier manipulation of the symbol....
std::size_t hash()
gets the hash of the symbol name.
static engine_t * get()
get the singleton object of this class.
void copy_syms()
when called, this function copies symbols into allocations.
void allocator(allocator_t alloc)
setter for the allocater lambda function.
void resolver(resolver_t resolve)
setter for the resolve lambda function.
void resolve()
when called, this function resolves all relocations in every symbol.
void allocate()
when called, this function allocates space for every symbol.
void copier(copier_t copy)
setter for the copier lambda function.
std::optional< decomp::symbol_t * > sym_from_hash(std::size_t hash)
returns an optional pointer to a symbol from the symbol table given the symbols hash (hash of its nam...
void for_each(std::function< void(decomp::symbol_t &sym)> fn)
this function is a wrapper function that allows you to get at each entry in the symbol table by refer...
theo_t(std::vector< std::uint8_t > &lib, lnk_fns_t lnkr_fns, const std::string &&entry_sym)
explicit constructor for theo class.
std::uintptr_t compose()
compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each ...
std::optional< std::uint32_t > decompose()
decomposes the lib file and return the number of symbols that are used.
std::uintptr_t resolve(const std::string &&sym)
given the name of a symbol, it returns the address of where its mapped.
The outer most encompassing namespace of this project.
std::tuple< recomp::allocator_t, recomp::copier_t, recomp::resolver_t > lnk_fns_t
tuple of functions used by theo to allocate, copy, and resolve symbols.