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.
30 lines
1.2 KiB
30 lines
1.2 KiB
#include <llodctor/llodctor_pe.hpp>
|
|
|
|
void llo::s1::dctor_pe_t::generate( lloiff_t &iff )
|
|
{
|
|
// lift section information to iff...
|
|
for ( auto idx = 0u; idx < section_count; ++idx )
|
|
{
|
|
llo::utils::hash_t< std::string > section_name{ std::string( sections[ idx ].name.to_string() ) };
|
|
llo::lloiff_t::iff_section_t section{ section_name };
|
|
section.protections.native = sections[ idx ].prots.flags;
|
|
|
|
// check to see if this section contains the entry point of the module...
|
|
if ( entry_point >= sections[ idx ].virtual_address &&
|
|
entry_point < sections[ idx ].virtual_address + sections[ idx ].virtual_size )
|
|
{
|
|
// lift entry point to iff...
|
|
iff.entry =
|
|
llo::disposition_t::make( iff.name, section_name, ( entry_point - sections[ idx ].virtual_address ) );
|
|
}
|
|
|
|
// copy the sections raw bytes...
|
|
section.raw.insert( section.raw.begin(), raw_img.data(), raw_img.data() + sections[ idx ].ptr_raw_data );
|
|
iff.sections.push_back( section );
|
|
}
|
|
|
|
// run symbol loader pass... this could be pdb, map, etc...
|
|
if ( symbol_loader )
|
|
symbol_loader->load( iff );
|
|
}
|