#pragma once #include #include #include #include #include #include #include #include #include #include #include #define XED_ENCODER extern "C" { #include #include } /// /// The outer most encompassing namespace of this project. /// namespace theo { /// /// tuple of functions used by theo to allocate, copy, and resolve symbols. /// using lnk_fns_t = std::tuple; /// /// the main class which encapsulates a symbol table, decomp, and recomp /// objects. This class is a bridge that connects all three: decomp, obf, /// recomp. /// /// You will create an object of this type when using theo. /// class theo_t { public: /// /// explicit constructor for theo class. /// /// a vector of bytes consisting of a lib /// /// the name of the function which will be used as the entry point explicit theo_t(std::vector& lib, lnk_fns_t lnkr_fns, const std::string&& entry_sym); /// /// decomposes the lib file and return the number of symbols that are used. /// /// optional amount of symbols that are used. no value if decomposition fails. std::optional decompose(); /// /// compose the decomposed module. This will run obfuscation passes, the map and resolve symbols to each other. /// /// returns the address of the entry point symbol std::uintptr_t compose(); /// /// given the name of a symbol, it returns the address of where its mapped. /// /// the name of the symbol /// the address of the symbol 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