|
LIEF: Library to Instrument Executable Formats Version 1.0.0
|
Class which parses and transforms an ELF file into a ELF::Binary object. More...
#include <Parser.hpp>


Public Types | |
| enum | ELF_TYPE { ELF_UNKNOWN , ELF32 , ELF64 } |
Public Member Functions | |
| Parser & | operator= (const Parser &)=delete |
| Parser (const Parser &)=delete | |
| ~Parser () override | |
Static Public Member Functions | |
| static std::unique_ptr< Binary > | parse (const std::string &file, const ParserConfig &conf=ParserConfig::all()) |
| Parse an ELF file and return a LIEF::ELF::Binary object. | |
| static std::unique_ptr< Binary > | parse (const std::vector< uint8_t > &data, const ParserConfig &conf=ParserConfig::all()) |
| Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object. | |
| static std::unique_ptr< Binary > | parse (std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::all()) |
| Parse the ELF binary from the given stream and return a LIEF::ELF::Binary object. | |
| static std::unique_ptr< Binary > | parse_from_memory (uintptr_t address, const ParserConfig &conf=ParserConfig::all()) |
| Parse the ELF binary from the given memory address. | |
| static std::unique_ptr< Binary > | parse_from_memory (uintptr_t address, size_t size, const ParserConfig &conf=ParserConfig::all()) |
| Parse the ELF binary from the given memory address with the given size. | |
| static std::unique_ptr< Binary > | parse_from_dump (const std::string &filepath, uint64_t addr, const ParserConfig &conf=ParserConfig::all()) |
| Parse an ELF binary from a memory dump located on disk. | |
| static std::unique_ptr< Binary > | parse_from_dump (BinaryStream &stream, uint64_t addr, const ParserConfig &conf=ParserConfig::all()) |
| Same as parse_from_dump(const std::string&, uint64_t, const ParserConfig&) but the dump is wrapped in the given non-owned stream. | |
| static std::unique_ptr< Binary > | parse_from_dump (std::unique_ptr< BinaryStream > stream, uint64_t addr, const ParserConfig &conf=ParserConfig::all()) |
| Same as parse_from_dump(const std::string&, uint64_t, const ParserConfig&) but the dump is wrapped in the given owned stream. | |
| Static Public Member Functions inherited from LIEF::Parser | |
| static std::unique_ptr< Binary > | parse (const std::string &filename) |
| Construct an LIEF::Binary from the given filename. | |
| static std::unique_ptr< Binary > | parse (const std::vector< uint8_t > &raw) |
| Construct an LIEF::Binary from the given raw data. | |
| static std::unique_ptr< Binary > | parse (std::unique_ptr< BinaryStream > stream) |
| Construct an LIEF::Binary from the given stream. | |
Static Public Attributes | |
| static constexpr uint32_t | NB_MAX_SYMBOLS = 1000000 |
| static constexpr uint32_t | DELTA_NB_SYMBOLS = 3000 |
| static constexpr uint32_t | NB_MAX_BUCKETS = NB_MAX_SYMBOLS |
| static constexpr uint32_t | NB_MAX_CHAINS = 1000000 |
| static constexpr uint32_t | NB_MAX_SEGMENTS = 10000 |
| static constexpr uint32_t | NB_MAX_RELOCATIONS = 3000000 |
| static constexpr uint32_t | NB_MAX_DYNAMIC_ENTRIES = 1000 |
| static constexpr uint32_t | MAX_SEGMENT_SIZE = 3_GB |
Class which parses and transforms an ELF file into a ELF::Binary object.
|
delete |
References OAT::Parser.
|
overridevirtual |
Reimplemented from LIEF::Parser.
References LIEF_LOCAL, and OAT::Parser.
References OAT::Parser.
|
static |
Parse an ELF file and return a LIEF::ELF::Binary object.
For weird binaries (e.g. sectionless) you can choose which method to use for counting dynamic symbols
| [in] | file | Path to the ELF binary |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
static |
Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object.
For weird binaries (e.g. sectionless) you can choose which method to use to count dynamic symbols
| [in] | data | Raw ELF as a std::vector of uint8_t |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
static |
Parse the ELF binary from the given stream and return a LIEF::ELF::Binary object.
For weird binaries (e.g. sectionless) you can choose which method to use to count dynamic symbols
| [in] | stream | The stream which wraps the ELF binary |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
static |
Same as parse_from_dump(const std::string&, uint64_t, const ParserConfig&) but the dump is wrapped in the given non-owned stream.
References LIEF::ELF::ParserConfig::all().
|
static |
Parse an ELF binary from a memory dump located on disk.
A dump is a raw capture of the process memory that was mapped starting at the virtual address addr. This is typically used to parse an ELF image that has been dumped from memory (e.g. from a debugger or a runtime hook).
| [in] | filepath | Path to the file that contains the memory dump |
| [in] | addr | Virtual address at which the dump was mapped |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
static |
Same as parse_from_dump(const std::string&, uint64_t, const ParserConfig&) but the dump is wrapped in the given owned stream.
References LIEF::ELF::ParserConfig::all().
|
static |
Parse the ELF binary from the given memory address.
| [in] | address | Base address of the ELF binary in memory |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
static |
Parse the ELF binary from the given memory address with the given size.
| [in] | address | Base address of the ELF binary in memory |
| [in] | size | Size of the memory region |
| [in] | conf | Optional configuration for the parser |
References LIEF::ELF::ParserConfig::all().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |