Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
arion::ElfParser Class Reference

Primary class for parsing ELF executables, shared objects, or core dumps. Inherits from ExecutableParser. More...

#include <elf_parser.hpp>

Inheritance diagram for arion::ElfParser:
arion::ExecutableParser

Public Member Functions

 ElfParser (std::weak_ptr< Arion > arion, std::vector< std::string > args)
 
void process ()
 
- Public Member Functions inherited from arion::ExecutableParser
 ExecutableParser (std::weak_ptr< Arion > arion)
 
std::shared_ptr< EXECUTABLE_PARSER_ATTRIBUTESget_attrs ()
 
std::vector< std::shared_ptr< struct SEGMENT > > get_segments ()
 

Private Member Functions

std::unique_ptr< LIEF::ELF::Binary > parse_general_data (std::unique_ptr< LIEF::ELF::Binary > elf)
 
std::unique_ptr< LIEF::ELF::Binary > parse_segments (std::unique_ptr< LIEF::ELF::Binary > elf)
 

Private Attributes

std::unique_ptr< ElfCoredumpParsercoredump_parser
 Instance of the core dump parser used if the file type is CORE.
 

Additional Inherited Members

- Protected Attributes inherited from arion::ExecutableParser
std::weak_ptr< Arionarion
 The Arion instance which requested the executable parsing.
 
std::shared_ptr< EXECUTABLE_PARSER_ATTRIBUTESattrs
 A structure of attributes which are filled during the parsing.
 
std::vector< std::shared_ptr< struct SEGMENT > > segments
 The memory segments in the executable.
 

Detailed Description

Primary class for parsing ELF executables, shared objects, or core dumps. Inherits from ExecutableParser.

Constructor & Destructor Documentation

◆ ElfParser()

arion::ElfParser::ElfParser ( std::weak_ptr< Arion arion,
std::vector< std::string >  args 
)
inline

Builder for ElfParser instances.

Parameters
[in]arionWeak pointer to the main Arion instance.
[in]argsVector of command-line arguments, where the first element is the target file path.
Exceptions
arion_exception::InvalidArgumentExceptionif args is empty.

Member Function Documentation

◆ parse_general_data()

std::unique_ptr< LIEF::ELF::Binary > arion::ElfParser::parse_general_data ( std::unique_ptr< LIEF::ELF::Binary >  elf)
private

Parses general ELF header data (magic, architecture, entry point, file type).

Parameters
[in]elfThe unique pointer to the LIEF ELF Binary representation.
Returns
The unique pointer to the LIEF ELF Binary.

◆ parse_segments()

std::unique_ptr< LIEF::ELF::Binary > arion::ElfParser::parse_segments ( std::unique_ptr< LIEF::ELF::Binary >  elf)
private

Parses the loadable segments (Program Headers of type PT_LOAD) and populates the segment list in attributes.

Parameters
[in]elfThe unique pointer to the LIEF ELF Binary representation.
Returns
The unique pointer to the LIEF ELF Binary.

◆ process()

void arion::ElfParser::process ( )
virtual

Main method to process and parse the entire ELF file, including loading, segment parsing, and core dump analysis.

Implements arion::ExecutableParser.

Member Data Documentation

◆ coredump_parser

std::unique_ptr<ElfCoredumpParser> arion::ElfParser::coredump_parser
private

Instance of the core dump parser used if the file type is CORE.


The documentation for this class was generated from the following file: