#include #include #include namespace theo { class engine_t { class swapchain_t { std::vector< std::uint8_t > front, back; std::vector< std::vector< std::uint8_t > > objs; public: class iff_t { /// /// swapchain_t is the only one who needs to call iff_t::flush... /// so its a friend class... flush is also private... /// friend class swapchain_t; public: struct section_t { coff::section_header_t header; std::vector< std::pair< std::uint32_t, coff::symbol_t > > symbols; }; explicit iff_t( coff::image_t *img ); std::vector< section_t > sections; private: /// /// flush changes from "sections" back to img... /// void flush(); coff::image_t *img; }; explicit swapchain_t( const std::vector< std::uint8_t > &img ); std::shared_ptr< swapchain_t > make( const std::vector< std::uint8_t > &img ); void swap( std::vector< iff_t > &iffs ); }; public: explicit engine_t( const std::vector< std::uint8_t > &lib_img ); void add_pass( const obf_pass_t &pass ); void run( std::vector< std::uint8_t > &result ); private: swapchain_t swap; std::vector< theo::obf_pass_t > passes; }; } // namespace theo