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.

37 lines
1.1 KiB

#include <coff/archive.hpp>
#include <coff/image.hpp>
#include <llodctor/llodctor_base.hpp>
namespace llo::s1
{
class dctor_lib_t : public dctor_base_t
{
struct obj_t
{
std::string_view name;
std::vector< std::uint8_t > raw;
coff::image_t *operator->()
{
return reinterpret_cast< coff::image_t * >( raw.data() );
}
};
std::vector< obj_t > objs;
public:
explicit dctor_lib_t( const std::vector< std::uint8_t > &image,
llo::s1::symbol_loader_base_t *symbol_loader = nullptr )
: dctor_base_t( image, symbol_loader )
{
ar::view lib( image.data(), image.size() );
for ( auto itr = lib.begin(); itr != lib.end(); ++itr )
{
std::vector obj_data( itr->begin(), itr->end() );
objs.push_back( { itr->to_string( lib.string_table ), obj_data } );
}
}
void generate( lloiff_t &iff ) override;
};
} // namespace llo::s1