LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::dsc::Dylib Class Reference

This class represents a library embedded in a dyld shared cache. It mirrors the original dyld_cache_image_info structure. More...

#include <Dylib.hpp>

Classes

struct  extract_opt_t
 This structure is used to tweak the extraction process while calling Dylib::get. These options allow to deoptimize the dylib and get an accurate representation of the origin Mach-O binary. More...
 
class  Iterator
 Dylib Iterator. More...
 

Public Member Functions

 Dylib (std::unique_ptr< details::Dylib > impl)
 
 ~Dylib ()
 
std::string path () const
 Original path of the library (e.g. /usr/lib/libcryptex.dylib)
 
uint64_t address () const
 In-memory address of the library.
 
uint64_t modtime () const
 Modification time of the library matching stat.st_mtime, or 0.
 
uint64_t inode () const
 File serial number matching stat.st_ino or 0.
 
uint64_t padding () const
 Padding alignment value (should be 0)
 
std::unique_ptr< LIEF::MachO::Binaryget (const extract_opt_t &opt=extract_opt_t()) const
 Get a MachO::Binary representation for this Dylib.
 

Detailed Description

This class represents a library embedded in a dyld shared cache. It mirrors the original dyld_cache_image_info structure.

Constructor & Destructor Documentation

◆ Dylib()

LIEF::dsc::Dylib::Dylib ( std::unique_ptr< details::Dylib > impl)

◆ ~Dylib()

LIEF::dsc::Dylib::~Dylib ( )

Member Function Documentation

◆ address()

uint64_t LIEF::dsc::Dylib::address ( ) const

In-memory address of the library.

◆ get()

std::unique_ptr< LIEF::MachO::Binary > LIEF::dsc::Dylib::get ( const extract_opt_t & opt = extract_opt_t()) const

Get a MachO::Binary representation for this Dylib.

One can use this function to write back the Mach-O binary on the disk:

dyld_cache->libraries()[12]->get()->write("liblockdown.dylib");

◆ inode()

uint64_t LIEF::dsc::Dylib::inode ( ) const

File serial number matching stat.st_ino or 0.

Note that for shared cache targeting iOS, this value can hold a hash of the path (if modtime is set to 0)

◆ modtime()

uint64_t LIEF::dsc::Dylib::modtime ( ) const

Modification time of the library matching stat.st_mtime, or 0.

◆ padding()

uint64_t LIEF::dsc::Dylib::padding ( ) const

Padding alignment value (should be 0)

◆ path()

std::string LIEF::dsc::Dylib::path ( ) const

Original path of the library (e.g. /usr/lib/libcryptex.dylib)


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