#pragma once #include #include #include #include #include #include #include #include #include #include namespace theo::decomp { using sym_data_t = std::tuple; class decomp_t { public: explicit decomp_t(std::vector& lib, recomp::symbol_table_t* syms); std::vector rtns(); std::vector lib(); std::vector objs(); recomp::symbol_table_t* syms(); std::map& scn_hash_tbl(); std::optional decompose( const std::string&& entry_sym); private: std::uint32_t ext_used_syms(const std::string&& entry_sym); std::optional get_symbol(const std::string_view& name); std::uint32_t next_sym(coff::image_t* img, coff::section_header_t* hdr, coff::symbol_t* s); const std::vector m_lib; std::vector m_objs; std::vector m_rtns; std::set m_used_syms; std::set m_processed_objs; std::map m_scn_hash_tbl; std::map> m_lookup_tbl; recomp::symbol_table_t* m_syms; }; } // namespace theo::decomp