LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
LIEF::MachO::Parser Class Reference

The main interface to parse a Mach-O binary. More...

#include <Parser.hpp>

Inheritance diagram for LIEF::MachO::Parser:
Collaboration diagram for LIEF::MachO::Parser:

Public Member Functions

Parseroperator= (const Parser &copy)=delete
 
 Parser (const Parser &copy)=delete
 
 ~Parser () override
 

Static Public Member Functions

static std::unique_ptr< FatBinaryparse (const std::string &filename, const ParserConfig &conf=ParserConfig::deep())
 Parse a Mach-O file from the path provided by the filename parameter.
 
static std::unique_ptr< FatBinaryparse (const std::vector< uint8_t > &data, const ParserConfig &conf=ParserConfig::deep())
 Parse a Mach-O file from the raw content provided by the data parameter.
 
static std::unique_ptr< FatBinaryparse (std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::deep())
 Parser a Mach-O binary from the provided BinaryStream.
 
static std::unique_ptr< FatBinaryparse_from_memory (uintptr_t address, const ParserConfig &conf=ParserConfig::deep())
 Parse the Mach-O binary from the address given in the first parameter.
 
static std::unique_ptr< FatBinaryparse_from_memory (uintptr_t address, size_t size, const ParserConfig &conf=ParserConfig::deep())
 Parse the Mach-O binary from the address given in the first parameter and the size given in the second parameter.
 
- Static Public Member Functions inherited from LIEF::Parser
static std::unique_ptr< Binaryparse (const std::string &filename)
 Construct an LIEF::Binary from the given filename.
 
static std::unique_ptr< Binaryparse (const std::vector< uint8_t > &raw)
 Construct an LIEF::Binary from the given raw data.
 
static std::unique_ptr< Binaryparse (std::unique_ptr< BinaryStream > stream)
 Construct an LIEF::Binary from the given stream.
 

Detailed Description

The main interface to parse a Mach-O binary.

This class is used to parse both Fat & non-Fat binary. Non-fat binaries are considerated as a fat with only one architecture. This is why MachO::Parser::parse outputs a FatBinary object.

Constructor & Destructor Documentation

◆ Parser()

LIEF::MachO::Parser::Parser ( const Parser & copy)
delete

◆ ~Parser()

LIEF::MachO::Parser::~Parser ( )
overridevirtual

Reimplemented from LIEF::Parser.

Member Function Documentation

◆ operator=()

Parser & LIEF::MachO::Parser::operator= ( const Parser & copy)
delete

◆ parse() [1/3]

static std::unique_ptr< FatBinary > LIEF::MachO::Parser::parse ( const std::string & filename,
const ParserConfig & conf = ParserConfig::deep() )
static

Parse a Mach-O file from the path provided by the filename parameter.

The conf parameter can be used to tweak the configuration of the parser

Parameters
[in]filenamePath to the Mach-O file
[in]confParser configuration (Defaut: ParserConfig::deep)

◆ parse() [2/3]

static std::unique_ptr< FatBinary > LIEF::MachO::Parser::parse ( const std::vector< uint8_t > & data,
const ParserConfig & conf = ParserConfig::deep() )
static

Parse a Mach-O file from the raw content provided by the data parameter.

The conf parameter can be used to tweak the configuration of the parser

Parameters
[in]dataMach-O file as a vector of bytes
[in]confParser configuration (Defaut: ParserConfig::deep)

◆ parse() [3/3]

static std::unique_ptr< FatBinary > LIEF::MachO::Parser::parse ( std::unique_ptr< BinaryStream > stream,
const ParserConfig & conf = ParserConfig::deep() )
static

Parser a Mach-O binary from the provided BinaryStream.

◆ parse_from_memory() [1/2]

static std::unique_ptr< FatBinary > LIEF::MachO::Parser::parse_from_memory ( uintptr_t address,
const ParserConfig & conf = ParserConfig::deep() )
static

Parse the Mach-O binary from the address given in the first parameter.

◆ parse_from_memory() [2/2]

static std::unique_ptr< FatBinary > LIEF::MachO::Parser::parse_from_memory ( uintptr_t address,
size_t size,
const ParserConfig & conf = ParserConfig::deep() )
static

Parse the Mach-O binary from the address given in the first parameter and the size given in the second parameter.


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