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.
29 lines
1.2 KiB
29 lines
1.2 KiB
#include <llodctor/llodctor_lib.hpp>
|
|
|
|
void llo::s1::dctor_lib_t::generate( lloiff_t &iff )
|
|
{
|
|
// add obj as children to the IFF as the IFF passed in is simply
|
|
// the LIB... also add section information for each...
|
|
std::for_each( objs.begin(), objs.end(), [ & ]( llo::s1::dctor_lib_t::obj_t &obj ) {
|
|
// use llo::lloiff::make to make a std::shared_ptr...
|
|
iff.children.push_back( iff.make( std::string( obj.name ), obj.raw ) );
|
|
|
|
// add sections to last IFF...
|
|
for ( auto idx = 0u; idx < obj->file_header.num_sections; ++idx )
|
|
{
|
|
auto obj_section = obj->get_section( idx );
|
|
std::string section_name( obj_section->name.to_string( obj->get_strings() ) );
|
|
llo::lloiff_t::iff_section_t section{ section_name };
|
|
|
|
section.protections.native = obj_section->prots.flags;
|
|
section.raw.insert( section.raw.begin(), obj_section->ptr_raw_data + obj.raw.data(),
|
|
obj_section->size_raw_data + obj_section->ptr_raw_data + obj.raw.data() );
|
|
|
|
iff.children.back()->sections.push_back( section );
|
|
}
|
|
} );
|
|
|
|
// coff symbol loader...
|
|
if ( symbol_loader )
|
|
symbol_loader->load( iff );
|
|
} |