16#ifndef LIEF_MACHO_FAT_BINARY_H
17#define LIEF_MACHO_FAT_BINARY_H
22#include "LIEF/visibility.h"
23#include "LIEF/iterators.hpp"
24#include "LIEF/MachO/Header.hpp"
60 return binaries_.size();
65 return binaries_.empty();
71 it_const_binaries begin()
const {
76 return it_binaries(binaries_).end();
79 it_const_binaries end()
const {
80 return it_const_binaries(binaries_).end();
83 void release_all_binaries();
92 const Binary* at(
size_t index)
const;
95 const Binary* back()
const;
98 const Binary* front()
const;
100 Binary* operator[](
size_t index) {
103 const Binary* operator[](
size_t index)
const {
111 std::unique_ptr<Binary>
take(
size_t index);
115 std::unique_ptr<Binary>
take(Header::CPU_TYPE cpu);
119 void write(
const std::string& filename);
122 std::vector<uint8_t>
raw();
124 LIEF_API
friend std::ostream& operator<<(std::ostream& os,
const FatBinary& fatbinary);
Class which represents a MachO binary.
Definition MachO/Binary.hpp:73
Class used to rebuild a Mach-O file.
Definition MachO/Builder.hpp:54
Class which represent a Mach-O (fat) binary This object is also used for representing Mach-O binaries...
Definition FatBinary.hpp:36
std::unique_ptr< Binary > pop_back()
Get a pointer to the last MachO::Binary object presents in this Fat Binary. It returns a nullptr if n...
bool empty() const
Checks whether this object contains MachO::Binary.
Definition FatBinary.hpp:64
std::unique_ptr< Binary > take(Header::CPU_TYPE cpu)
Take the underlying MachO::Binary that matches the given architecture If no binary with the architect...
std::vector< uint8_t > raw()
Reconstruct the Fat binary object and return his content as bytes.
std::unique_ptr< Binary > take(size_t index)
Extract a MachO::Binary object. Gives ownership to the caller, and remove it from this FatBinary obje...
std::vector< std::unique_ptr< Binary > > binaries_t
Internal containter used to store Binary objects within a Fat Mach-O.
Definition FatBinary.hpp:45
void write(const std::string &filename)
Reconstruct the Fat binary object and write it in filename
Binary * at(size_t index)
Get a pointer to the MachO::Binary specified by the index. It returns a nullptr if the binary does no...
size_t size() const
Number of MachO::Binary wrapped by this object.
Definition FatBinary.hpp:59
The main interface to parse a Mach-O binary.
Definition MachO/Parser.hpp:42
Main interface to parse an executable regardless of its format.
Definition Abstract/Parser.hpp:30
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32