Go to the documentation of this file.
16#ifndef LIEF_MACHO_BUIDLER_H
17#define LIEF_MACHO_BUIDLER_H
59 public:
struct config_t {
68 static ok_error_t write(Binary& binary,
const std::string& filename, config_t config);
71 static ok_error_t write(Binary& binary, std::vector<uint8_t>& out, config_t config);
77 static ok_error_t write(FatBinary& fat,
const std::string& filename, config_t config);
80 static ok_error_t write(FatBinary& fat, std::vector<uint8_t>& out, config_t config);
89 LIEF_LOCAL const std::vector<uint8_t>& get_build();
93 LIEF_LOCAL Builder(Binary& binary, config_t config);
94 LIEF_LOCAL Builder(std::vector<Binary*> binaries, config_t config);
96 LIEF_LOCAL static std::vector<uint8_t> build_raw(Binary& binary, config_t config);
97 LIEF_LOCAL static std::vector<uint8_t> build_raw(FatBinary& binary, config_t config);
184 template <
typename T>
190 template <
typename T>
195 template <
typename T>
198 std::vector<Binary*> binaries_;
199 Binary* binary_ =
nullptr;
200 mutable vector_iostream raw_;
201 uint64_t linkedit_offset_ = 0;
202 mutable vector_iostream linkedit_;
Class which represents the LC_ATOM_INFO command.
Definition AtomInfo.hpp:36
Class which represents a MachO binary.
Definition MachO/Binary.hpp:86
Definition BuildVersion.hpp:34
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:58
static ok_error_t write(FatBinary &fat, std::ostream &out)
static ok_error_t write(Binary &binary, const std::string &filename)
static ok_error_t write(FatBinary &fat, std::vector< uint8_t > &out, config_t config)
static ok_error_t write(FatBinary &fat, const std::string &filename, config_t config)
static ok_error_t write(FatBinary &fat, const std::string &filename)
static ok_error_t write(FatBinary &fat, std::vector< uint8_t > &out)
static ok_error_t write(Binary &binary, std::ostream &out, config_t config)
static ok_error_t write(FatBinary &fat, std::ostream &out, config_t config)
static ok_error_t write(Binary &binary, std::vector< uint8_t > &out, config_t config)
static ok_error_t write(Binary &binary, std::ostream &out)
static ok_error_t write(Binary &binary, std::vector< uint8_t > &out)
static ok_error_t write(Binary &binary, const std::string &filename, config_t config)
Definition CodeSignatureDir.hpp:36
Definition CodeSignature.hpp:37
Interface of the LC_DATA_IN_CODE command This command is used to list slices of code sections that co...
Definition DataInCode.hpp:42
Class that represents the LC_DYLD_CHAINED_FIXUPS command.
Definition DyldChainedFixups.hpp:49
Class that represents a LC_DYLD_ENVIRONMENT command which is used by the Mach-O linker/loader to init...
Definition DyldEnvironment.hpp:34
Class that represents the LC_DYLD_EXPORTS_TRIE command.
Definition DyldExportsTrie.hpp:40
Class that represents the LC_DYLD_INFO and LC_DYLD_INFO_ONLY commands.
Definition DyldInfo.hpp:50
Class which represents a library dependency.
Definition DylibCommand.hpp:34
Class that represents the Mach-O linker, also named loader. Most of the time, DylinkerCommand::name()...
Definition DylinkerCommand.hpp:34
Class that represents the LC_DYSYMTAB command.
Definition DynamicSymbolCommand.hpp:40
Class which represent a Mach-O (fat) binary This object is also used for representing Mach-O binaries...
Definition FatBinary.hpp:36
Class which represents the LC_FUNCTION_STARTS command.
Definition FunctionStarts.hpp:39
Class which represents the LC_LINKER_OPTIMIZATION_HINT command.
Definition LinkerOptHint.hpp:37
Class that represent the LC_MAIN command. This kind of command can be used to determine the entrypoin...
Definition MainCommand.hpp:33
Class that represents the LC_RPATH command.
Definition RPathCommand.hpp:36
Class that represents the LC_ROUTINE/LC_ROUTINE64 commands. Accodring to the Mach-O loader....
Definition Routine.hpp:38
Class that represents the LoadCommand::TYPE::SEGMENT_SPLIT_INFO command.
Definition SegmentSplitInfo.hpp:35
Class that represents the MachO LoadCommand::TYPE::SOURCE_VERSION This command is used to provide the...
Definition SourceVersion.hpp:35
Class that represents the SubClient command. Accodring to the Mach-O loader.h documentation:
Definition SubClient.hpp:43
Class that represents the SubFramework command. Accodring to the Mach-O loader.h documentation:
Definition SubFramework.hpp:46
Class that represents the LC_SYMTAB command.
Definition SymbolCommand.hpp:35
Class that represents the LC_THREAD / LC_UNIXTHREAD commands and that can be used to get the binary e...
Definition ThreadCommand.hpp:41
Class which represents the LC_TWOLEVEL_HINTS command.
Definition TwoLevelHints.hpp:39
Class that wraps the LC_VERSION_MIN_MACOSX, LC_VERSION_MIN_IPHONEOS, ... commands.
Definition VersionMin.hpp:33
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:36
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:109
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42