16#ifndef LIEF_MACHO_PARSER_H
17#define LIEF_MACHO_PARSER_H
58 static std::unique_ptr<FatBinary>
59 parse(std::string_view filename,
64 template<
class PathT, enable_if_path_t<PathT> = 0>
65 static std::unique_ptr<FatBinary>
68 return parse(filename.string(), conf);
79 static std::unique_ptr<FatBinary>
80 parse(
const std::vector<uint8_t>& data,
85 static std::unique_ptr<FatBinary>
86 parse(std::unique_ptr<BinaryStream> stream,
90 static std::unique_ptr<FatBinary>
96 static std::unique_ptr<FatBinary>
109 static std::unique_ptr<FatBinary>
115 template<
class PathT, enable_if_path_t<PathT> = 0>
116 static std::unique_ptr<FatBinary>
124 static std::unique_ptr<FatBinary>
130 static std::unique_ptr<FatBinary>
145 std::unique_ptr<BinaryStream> stream_;
146 std::vector<std::unique_ptr<Binary>> binaries_;
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:35
Class which represents a MachO binary.
Definition MachO/Binary.hpp:94
Class which represents a Mach-O (fat) binary This object is also used for representing Mach-O binarie...
Definition FatBinary.hpp:36
static std::unique_ptr< FatBinary > parse(std::string_view filename, const ParserConfig &conf=ParserConfig::deep())
Parse a Mach-O file from the path provided by the filename parameter.
static std::unique_ptr< FatBinary > parse_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 secon...
static std::unique_ptr< FatBinary > parse_from_dump(std::unique_ptr< BinaryStream > stream, uint64_t addr, const ParserConfig &conf=ParserConfig::deep())
Same as parse_from_dump(std::string_view, uint64_t, const ParserConfig&) but the dump is wrapped in t...
Parser(const Parser ©)=delete
static std::unique_ptr< FatBinary > parse_from_dump(std::string_view filepath, uint64_t addr, const ParserConfig &conf=ParserConfig::deep())
Parse a Mach-O binary from a memory dump located on disk.
static std::unique_ptr< FatBinary > parse(std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::deep())
Parse a Mach-O binary from the provided BinaryStream.
static std::unique_ptr< FatBinary > parse_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< FatBinary > parse(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< FatBinary > parse(const PathT &filename, const ParserConfig &conf=ParserConfig::deep())
Same as parse(std::string_view, const ParserConfig&) but the file is given as a std::filesystem::path...
Definition MachO/Parser.hpp:66
static std::unique_ptr< FatBinary > parse_from_dump(const PathT &filepath, uint64_t addr, const ParserConfig &conf=ParserConfig::deep())
Same as parse_from_dump(std::string_view, uint64_t, const ParserConfig&) but the dump file is given a...
Definition MachO/Parser.hpp:117
static std::unique_ptr< FatBinary > parse_from_dump(BinaryStream &stream, uint64_t addr, const ParserConfig &conf=ParserConfig::deep())
Same as parse_from_dump(std::string_view, uint64_t, const ParserConfig&) but the dump is wrapped in t...
Parser & operator=(const Parser ©)=delete
Main interface to parse an executable regardless of its format.
Definition Abstract/Parser.hpp:32
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:119
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:41
This structure is used to tweak the MachO Parser (MachO::Parser).
Definition MachO/ParserConfig.hpp:24
static ParserConfig deep()
Return a parser configuration such as all the objects supported by LIEF are parsed.
#define LIEF_API
Definition visibility.h:45
#define LIEF_LOCAL
Definition visibility.h:46