|
|
|
@ -28,9 +28,9 @@ int __cdecl main( int argc, const char *argv[] )
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto file_name{ cli_parser.get< std::string >( "input" ) };
|
|
|
|
|
auto name{ cli_parser.get< std::string >( "input" ) };
|
|
|
|
|
|
|
|
|
|
if ( !std::filesystem::exists( file_name ) )
|
|
|
|
|
if ( !std::filesystem::exists( name ) )
|
|
|
|
|
{
|
|
|
|
|
std::printf( "[!] input file does not exist...\n" );
|
|
|
|
|
return -1;
|
|
|
|
@ -38,7 +38,7 @@ int __cdecl main( int argc, const char *argv[] )
|
|
|
|
|
|
|
|
|
|
std::vector< std::uint8_t > image;
|
|
|
|
|
|
|
|
|
|
if ( !llo::utils::open_binary_file( file_name, image ) )
|
|
|
|
|
if ( !llo::utils::open_binary_file( name, image ) )
|
|
|
|
|
{
|
|
|
|
|
std::printf( "[!] failed to read file off disk...\n" );
|
|
|
|
|
return -1;
|
|
|
|
@ -61,7 +61,7 @@ int __cdecl main( int argc, const char *argv[] )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr< llo::s1::dctor_base_t > file_dctor = nullptr;
|
|
|
|
|
std::filesystem::path file_path{ file_name };
|
|
|
|
|
std::filesystem::path file_path{ name };
|
|
|
|
|
|
|
|
|
|
if ( file_path.extension().compare( ".exe" ) || file_path.extension().compare( ".dll" ) ||
|
|
|
|
|
file_path.extension().compare( ".sys" ) )
|
|
|
|
@ -79,16 +79,18 @@ int __cdecl main( int argc, const char *argv[] )
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
llo::lloiff_t iff( file_name );
|
|
|
|
|
llo::lloiff_t iff( name, image );
|
|
|
|
|
file_dctor->generate( iff );
|
|
|
|
|
|
|
|
|
|
const auto §ions = iff.get_sections();
|
|
|
|
|
std::printf( "> number of sections = %d\n", sections.size() );
|
|
|
|
|
std::printf( "> number of sections = %d\n", iff.sections.size() );
|
|
|
|
|
if ( iff.entry )
|
|
|
|
|
std::printf( "> entry section name = %s, section offest = 0x%x\n", iff.entry->section_name.get_data().c_str(),
|
|
|
|
|
iff.entry->offset );
|
|
|
|
|
|
|
|
|
|
for ( auto §ion : sections )
|
|
|
|
|
for ( auto §ion : iff.sections )
|
|
|
|
|
{
|
|
|
|
|
std::printf( "> section name = %s\n", section.section_name.get_data().c_str() );
|
|
|
|
|
std::printf( "> size of raw section = %d\n", section.section_raw.size() );
|
|
|
|
|
std::printf( "> size of raw section = %d\n", section.raw.size() );
|
|
|
|
|
std::printf( "> number of symbols = %d\n", section.symbols.size() );
|
|
|
|
|
}
|
|
|
|
|
}
|