|
using | commands_t = std::vector<std::unique_ptr<LoadCommand>> |
| Internal container for storing Mach-O LoadCommand.
|
|
using | it_commands = ref_iterator<commands_t&, LoadCommand*> |
| Iterator that outputs LoadCommand&.
|
|
using | it_const_commands = const_ref_iterator<const commands_t&, LoadCommand*> |
| Iterator that outputs const LoadCommand&.
|
|
using | symbols_t = std::vector<std::unique_ptr<Symbol>> |
| Internal container for storing Mach-O Symbol.
|
|
using | it_symbols = ref_iterator<symbols_t&, Symbol*> |
| Iterator that outputs Symbol&.
|
|
using | it_const_symbols = const_ref_iterator<const symbols_t&, const Symbol*> |
| Iterator that outputs const Symbol&.
|
|
using | it_exported_symbols = filter_iterator<symbols_t&, Symbol*> |
| Iterator that outputs exported Symbol&.
|
|
using | it_const_exported_symbols = const_filter_iterator<const symbols_t&, const Symbol*> |
| Iterator that outputs exported const Symbol&.
|
|
using | it_imported_symbols = filter_iterator<symbols_t&, Symbol*> |
| Iterator that outputs imported Symbol&.
|
|
using | it_const_imported_symbols = const_filter_iterator<const symbols_t&, const Symbol*> |
| Iterator that outputs imported const Symbol&.
|
|
using | sections_cache_t = std::vector<Section*> |
| Internal container for caching Mach-O Section.
|
|
using | it_sections = ref_iterator<sections_cache_t&> |
| Iterator that outputs Section&.
|
|
using | it_const_sections = const_ref_iterator<const sections_cache_t&> |
| Iterator that outputs const Section&.
|
|
using | segments_cache_t = std::vector<SegmentCommand*> |
| Internal container for storing Mach-O SegmentCommand.
|
|
using | it_segments = ref_iterator<segments_cache_t&> |
| Iterator that outputs SegmentCommand&.
|
|
using | it_const_segments = const_ref_iterator<const segments_cache_t&> |
| Iterator that outputs const SegmentCommand&.
|
|
using | libraries_cache_t = std::vector<DylibCommand*> |
| Internal container for storing Mach-O DylibCommand.
|
|
using | it_libraries = ref_iterator<libraries_cache_t&> |
| Iterator that outputs DylibCommand&.
|
|
using | it_const_libraries = const_ref_iterator<const libraries_cache_t&> |
| Iterator that outputs const DylibCommand&.
|
|
using | fileset_binaries_t = std::vector<std::unique_ptr<Binary>> |
| Internal container for storing Mach-O Fileset Binary.
|
|
using | it_fileset_binaries = ref_iterator<fileset_binaries_t&, Binary*> |
| Iterator that outputs Binary&.
|
|
using | it_const_fileset_binaries = const_ref_iterator<const fileset_binaries_t&, Binary*> |
| Iterator that outputs const Binary&.
|
|
using | relocations_t = std::set<Relocation*, KeyCmp> |
| Internal container that store all the relocations found in a Mach-O. The relocations are actually owned by Section & SegmentCommand and these references are used for convenience.
|
|
using | it_relocations = ref_iterator<relocations_t&, Relocation*> |
| Iterator which outputs Relocation&.
|
|
using | it_const_relocations = const_ref_iterator<const relocations_t&, const Relocation*> |
| Iterator which outputs const Relocation&.
|
|
using | it_rpaths = filter_iterator<commands_t&, RPathCommand*> |
| Iterator which outputs RPathCommand&.
|
|
using | it_const_rpaths = const_filter_iterator<const commands_t&, const RPathCommand*> |
| Iterator which outputs const RPathCommand&.
|
|
using | it_sub_clients = filter_iterator<commands_t&, SubClient*> |
| Iterator which outputs SubClient&.
|
|
using | it_const_sub_clients = const_filter_iterator<const commands_t&, const SubClient*> |
| Iterator which outputs const SubClient&.
|
|
using | it_bindings = iterator_range<BindingInfoIterator> |
|
using | stub_iterator = iterator_range<Stub::Iterator> |
| Iterator type for Symbol's stub.
|
|
enum class | VA_TYPES { AUTO = 0
, RVA = 1
, VA = 2
} |
| Type of a virtual address. More...
|
|
enum | FORMATS {
UNKNOWN = 0
, ELF
, PE
, MACHO
,
OAT
} |
|
using | functions_t = std::vector<Function> |
|
using | sections_t = std::vector<Section*> |
| Internal container.
|
|
using | it_sections = ref_iterator<sections_t> |
| Iterator that outputs LIEF::Section&.
|
|
using | it_const_sections = const_ref_iterator<sections_t> |
| Iterator that outputs const LIEF::Section&.
|
|
using | symbols_t = std::vector<Symbol*> |
| Internal container.
|
|
using | it_symbols = ref_iterator<symbols_t> |
| Iterator that outputs LIEF::Symbol&.
|
|
using | it_const_symbols = const_ref_iterator<symbols_t> |
| Iterator that outputs const LIEF::Symbol&.
|
|
using | relocations_t = std::vector<Relocation*> |
| Internal container.
|
|
using | it_relocations = ref_iterator<relocations_t> |
| Iterator that outputs LIEF::Relocation&.
|
|
using | it_const_relocations = const_ref_iterator<relocations_t> |
| Iterator that outputs const LIEF::Relocation&.
|
|
using | instructions_it = iterator_range<assembly::Instruction::Iterator> |
| Instruction iterator.
|
|
template<class T > |
using | output_t = add_pointer_t<decay_t<T>> |
|
template<class T > |
using | output_const_t = add_pointer_t<add_const_t<decay_t<T>>> |
|
|
| Binary (const Binary &)=delete |
|
Binary & | operator= (const Binary &)=delete |
|
Header & | header () |
| Return a reference to the MachO::Header.
|
|
const Header & | header () const |
|
it_commands | commands () |
| Return an iterator over the MachO LoadCommand present in the binary.
|
|
it_const_commands | commands () const |
|
it_fileset_binaries | filesets () |
| Return an iterator over the MachO::Binary associated with the LoadCommand::TYPE::FILESET_ENTRY commands.
|
|
it_const_fileset_binaries | filesets () const |
|
it_symbols | symbols () |
| Return binary's symbols .
|
|
it_const_symbols | symbols () const |
|
bool | has_symbol (const std::string &name) const |
| Check if a symbol with the given name exists.
|
|
const Symbol * | get_symbol (const std::string &name) const |
| Return Symbol from the given name. If the symbol does not exists, it returns a null pointer.
|
|
Symbol * | get_symbol (const std::string &name) |
|
it_exported_symbols | exported_symbols () |
| Return binary's exported symbols (iterator over LIEF::MachO::Symbol)
|
|
it_const_exported_symbols | exported_symbols () const |
|
it_imported_symbols | imported_symbols () |
| Return binary's imported symbols (iterator over LIEF::MachO::Symbol)
|
|
it_const_imported_symbols | imported_symbols () const |
|
it_libraries | libraries () |
| Return binary imported libraries (MachO::DylibCommand)
|
|
it_const_libraries | libraries () const |
|
it_segments | segments () |
| Return an iterator over the SegmentCommand.
|
|
it_const_segments | segments () const |
|
it_sections | sections () |
| Return an iterator over the MachO::Section.
|
|
it_const_sections | sections () const |
|
it_relocations | relocations () |
| Return an iterator over the MachO::Relocation.
|
|
it_const_relocations | relocations () const |
|
void | write (const std::string &filename) override |
| Reconstruct the binary object and write the result in the given filename
|
|
void | write (const std::string &filename, Builder::config_t config) |
| Reconstruct the binary object and write the result in the given filename .
|
|
void | write (std::ostream &os) override |
| Reconstruct the binary object and write the result in the given os stream.
|
|
std::vector< uint8_t > | raw () |
| Reconstruct the binary object and return its content as bytes.
|
|
bool | has (LoadCommand::TYPE type) const |
| Check if the current binary has the given MachO::LoadCommand::TYPE.
|
|
const LoadCommand * | get (LoadCommand::TYPE type) const |
| Return the LoadCommand associated with the given LoadCommand::TYPE or a nullptr if the command can't be found.
|
|
LoadCommand * | get (LoadCommand::TYPE type) |
|
LoadCommand * | add (std::unique_ptr< LoadCommand > command) |
|
LoadCommand * | add (const LoadCommand &command) |
| Insert a new LoadCommand.
|
|
LoadCommand * | add (const LoadCommand &command, size_t index) |
| Insert a new LoadCommand at the specified index
|
|
LoadCommand * | add (const DylibCommand &library) |
| Insert the given DylibCommand.
|
|
LoadCommand * | add (const SegmentCommand &segment) |
| Add a new LC_SEGMENT command from the given SegmentCommand.
|
|
LoadCommand * | add_library (const std::string &name) |
| Insert a new shared library through a LC_LOAD_DYLIB command.
|
|
Section * | add_section (const Section §ion) |
| Add a new MachO::Section in the __TEXT segment.
|
|
Section * | add_section (const SegmentCommand &segment, const Section §ion) |
| Add a section in the given MachO::SegmentCommand.
|
|
void | remove_section (const std::string &name, bool clear=false) override |
| Remove the section with the name provided in the first parameter.
|
|
void | remove_section (const std::string &segname, const std::string &secname, bool clear=false) |
| Remove the section from the segment with the name given in the first parameter and with the section's name provided in the second parameter.
|
|
bool | remove (const LoadCommand &command) |
| Remove the given LoadCommand.
|
|
bool | remove (LoadCommand::TYPE type) |
| Remove all LoadCommand with the given type (MachO::LoadCommand::TYPE)
|
|
bool | remove_command (size_t index) |
| Remove the Load Command at the provided index
|
|
bool | remove_signature () |
| Remove the LC_SIGNATURE command.
|
|
bool | extend (const LoadCommand &command, uint64_t size) |
| Extend the size of the given LoadCommand.
|
|
bool | extend_segment (const SegmentCommand &segment, size_t size) |
| Extend the content of the given SegmentCommand.
|
|
bool | disable_pie () |
| Remove the PIE flag.
|
|
uint64_t | imagebase () const override |
| Return the binary's imagebase. 0 if not relevant.
|
|
uint64_t | virtual_size () const |
| Size of the binary in memory when mapped by the loader (dyld )
|
|
std::string | loader () const |
| Return the binary's loader (e.g. /usr/lib/dyld ) or an empty string if the binary does not use a loader/linker.
|
|
bool | has_section (const std::string &name) const |
| Check if a section with the given name exists.
|
|
Section * | get_section (const std::string &name) |
| Return the section from the given name of a nullptr if the section can't be found.
|
|
const Section * | get_section (const std::string &name) const |
| Return the section from the given name or a nullptr if the section can't be found.
|
|
Section * | get_section (const std::string &segname, const std::string &secname) |
| Return the section from the segment with the name given in the first parameter and with the section's name provided in the second parameter. If the section cannot be found, it returns a nullptr.
|
|
const Section * | get_section (const std::string &segname, const std::string &secname) const |
|
bool | has_segment (const std::string &name) const |
| Check if a segment with the given name exists.
|
|
const SegmentCommand * | get_segment (const std::string &name) const |
| Return the segment from the given name.
|
|
SegmentCommand * | get_segment (const std::string &name) |
| Return the segment from the given name.
|
|
bool | remove_symbol (const std::string &name) |
| Remove the symbol with the given name.
|
|
bool | remove (const Symbol &sym) |
| Remove the given symbol.
|
|
bool | can_remove (const Symbol &sym) const |
| Check if the given symbol can be safely removed.
|
|
bool | can_remove_symbol (const std::string &name) const |
| Check if the MachO::Symbol with the given name can be safely removed.
|
|
bool | unexport (const std::string &name) |
| Remove the given MachO::Symbol with the given name from the export table.
|
|
bool | unexport (const Symbol &sym) |
| Remove the given symbol from the export table.
|
|
Section * | section_from_offset (uint64_t offset) |
| Return the MachO::Section that encompasses the provided offset. If a section can't be found, it returns a null pointer (nullptr )
|
|
const Section * | section_from_offset (uint64_t offset) const |
|
Section * | section_from_virtual_address (uint64_t virtual_address) |
| Return the MachO::Section that encompasses the provided virtual address. If a section can't be found, it returns a null pointer (nullptr )
|
|
const Section * | section_from_virtual_address (uint64_t virtual_address) const |
|
result< uint64_t > | virtual_address_to_offset (uint64_t virtual_address) const |
| Convert a virtual address to an offset in the file.
|
|
result< uint64_t > | offset_to_virtual_address (uint64_t offset, uint64_t slide=0) const override |
| Convert the given offset into a virtual address.
|
|
SegmentCommand * | segment_from_offset (uint64_t offset) |
| Return the binary's SegmentCommand that encompasses the provided offset.
|
|
const SegmentCommand * | segment_from_offset (uint64_t offset) const |
|
size_t | segment_index (const SegmentCommand &segment) const |
| Return the index of the given SegmentCommand.
|
|
uint64_t | fat_offset () const |
| Return binary's fat offset. 0 if not relevant.
|
|
SegmentCommand * | segment_from_virtual_address (uint64_t virtual_address) |
| Return the binary's SegmentCommand which encompasses the given virtual address or a nullptr if not found.
|
|
const SegmentCommand * | segment_from_virtual_address (uint64_t virtual_address) const |
|
range_t | va_ranges () const |
| Return the range of virtual addresses.
|
|
range_t | off_ranges () const |
| Return the range of offsets.
|
|
bool | is_valid_addr (uint64_t address) const |
| Check if the given address is encompassed in the binary's virtual addresses range.
|
|
void | accept (LIEF::Visitor &visitor) const override |
| Method so that the visitor can visit us.
|
|
std::ostream & | print (std::ostream &os) const override |
|
void | patch_address (uint64_t address, const std::vector< uint8_t > &patch_value, LIEF::Binary::VA_TYPES addr_type=LIEF::Binary::VA_TYPES::AUTO) override |
| Patch the content at virtual address address with patch_value .
|
|
void | patch_address (uint64_t address, uint64_t patch_value, size_t size=sizeof(uint64_t), LIEF::Binary::VA_TYPES addr_type=LIEF::Binary::VA_TYPES::AUTO) override |
| Patch the address with the given value.
|
|
span< const uint8_t > | get_content_from_virtual_address (uint64_t virtual_address, uint64_t size, Binary::VA_TYPES addr_type=Binary::VA_TYPES::AUTO) const override |
| Return the content located at virtual address.
|
|
uint64_t | entrypoint () const override |
| The binary entrypoint.
|
|
bool | is_pie () const override |
| Check if the binary is position independent.
|
|
bool | has_nx () const override |
| Check if the binary uses NX protection.
|
|
bool | has_nx_stack () const |
| Return True if the heap is flagged as non-executable. False otherwise.
|
|
bool | has_nx_heap () const |
| Return True if the stack is flagged as non-executable. False otherwise.
|
|
bool | has_entrypoint () const |
| true if the binary has an entrypoint.
|
|
bool | has_uuid () const |
| true if the binary has a MachO::UUIDCommand command.
|
|
UUIDCommand * | uuid () |
| Return the MachO::UUIDCommand if present, a nullptr otherwise.
|
|
const UUIDCommand * | uuid () const |
|
bool | has_main_command () const |
| true if the binary has a MachO::MainCommand command.
|
|
MainCommand * | main_command () |
| Return the MachO::MainCommand if present, a nullptr otherwise.
|
|
const MainCommand * | main_command () const |
|
bool | has_dylinker () const |
| true if the binary has a MachO::DylinkerCommand.
|
|
DylinkerCommand * | dylinker () |
| Return the MachO::DylinkerCommand if present, a nullptr otherwise.
|
|
const DylinkerCommand * | dylinker () const |
|
bool | has_dyld_info () const |
| true if the binary has a MachO::DyldInfo command.
|
|
DyldInfo * | dyld_info () |
| Return the MachO::Dyld command if present, a nullptr otherwise.
|
|
const DyldInfo * | dyld_info () const |
|
bool | has_function_starts () const |
| true if the binary has a MachO::FunctionStarts command.
|
|
FunctionStarts * | function_starts () |
| Return the MachO::FunctionStarts command if present, a nullptr otherwise.
|
|
const FunctionStarts * | function_starts () const |
|
bool | has_source_version () const |
| true if the binary has a MachO::SourceVersion command.
|
|
SourceVersion * | source_version () |
| Return the MachO::SourceVersion command if present, a nullptr otherwise.
|
|
const SourceVersion * | source_version () const |
|
bool | has_version_min () const |
| true if the binary has a MachO::VersionMin command.
|
|
VersionMin * | version_min () |
| Return the MachO::VersionMin command if present, a nullptr otherwise.
|
|
const VersionMin * | version_min () const |
|
bool | has_thread_command () const |
| true if the binary has a MachO::ThreadCommand command.
|
|
ThreadCommand * | thread_command () |
| Return the MachO::ThreadCommand command if present, a nullptr otherwise.
|
|
const ThreadCommand * | thread_command () const |
|
bool | has_routine_command () const |
| true if the binary has a MachO::Routine command.
|
|
Routine * | routine_command () |
| Return the MachO::Routine command if present, a nullptr otherwise.
|
|
const Routine * | routine_command () const |
|
bool | has_rpath () const |
| true if the binary has a MachO::RPathCommand command.
|
|
RPathCommand * | rpath () |
| Return the MachO::RPathCommand command if present, a nullptr otherwise.
|
|
const RPathCommand * | rpath () const |
|
it_rpaths | rpaths () |
| Iterator over all the MachO::RPathCommand commands.
|
|
it_const_rpaths | rpaths () const |
|
bool | has_symbol_command () const |
| true if the binary has a MachO::SymbolCommand command.
|
|
SymbolCommand * | symbol_command () |
| Return the MachO::SymbolCommand if present, a nullptr otherwise.
|
|
const SymbolCommand * | symbol_command () const |
|
bool | has_dynamic_symbol_command () const |
| true if the binary has a MachO::DynamicSymbolCommand command.
|
|
DynamicSymbolCommand * | dynamic_symbol_command () |
| Return the MachO::SymbolCommand if present, a nullptr otherwise.
|
|
const DynamicSymbolCommand * | dynamic_symbol_command () const |
|
bool | has_code_signature () const |
| true if the binary is signed with LC_CODE_SIGNATURE command
|
|
CodeSignature * | code_signature () |
| Return the MachO::CodeSignature if present, a nullptr otherwise.
|
|
const CodeSignature * | code_signature () const |
|
bool | has_code_signature_dir () const |
| true if the binary is signed with the command DYLIB_CODE_SIGN_DRS
|
|
CodeSignatureDir * | code_signature_dir () |
| Return the MachO::CodeSignatureDir if present, a nullptr otherwise.
|
|
const CodeSignatureDir * | code_signature_dir () const |
|
bool | has_data_in_code () const |
| true if the binary has a MachO::DataInCode command.
|
|
DataInCode * | data_in_code () |
| Return the MachO::DataInCode if present, a nullptr otherwise.
|
|
const DataInCode * | data_in_code () const |
|
bool | has_segment_split_info () const |
| true if the binary has segment split info.
|
|
SegmentSplitInfo * | segment_split_info () |
| Return the MachO::SegmentSplitInfo if present, a nullptr otherwise.
|
|
const SegmentSplitInfo * | segment_split_info () const |
|
bool | has_sub_framework () const |
| true if the binary has a sub framework command.
|
|
bool | has_encryption_info () const |
| true if the binary has Encryption Info.
|
|
EncryptionInfo * | encryption_info () |
| Return the MachO::DyldEnvironment if present, a nullptr otherwise.
|
|
const EncryptionInfo * | encryption_info () const |
|
SubFramework * | sub_framework () |
| Return the MachO::SubFramework if present, a nullptr otherwise.
|
|
const SubFramework * | sub_framework () const |
|
it_sub_clients | subclients () |
| Iterator over all the MachO::SubClient commands.
|
|
it_const_sub_clients | subclients () const |
|
bool | has_subclients () const |
|
bool | has_dyld_environment () const |
| true if the binary has Dyld envrionment variables.
|
|
DyldEnvironment * | dyld_environment () |
| Return the MachO::DyldEnvironment if present, a nullptr otherwise.
|
|
const DyldEnvironment * | dyld_environment () const |
|
bool | has_build_version () const |
| true if the binary has the BuildVersion command.
|
|
BuildVersion * | build_version () |
| Return the MachO::BuildVersion if present, a nullptr otherwise.
|
|
const BuildVersion * | build_version () const |
|
BuildVersion::PLATFORMS | platform () const |
| Return the platform for which this Mach-O has been compiled for.
|
|
bool | is_ios () const |
| True if this binary targets iOS.
|
|
bool | is_macos () const |
| True if this binary targets macOS.
|
|
bool | has_dyld_chained_fixups () const |
| true if the binary has the command LC_DYLD_CHAINED_FIXUPS.
|
|
DyldChainedFixups * | dyld_chained_fixups () |
| Return the MachO::DyldChainedFixups if present, a nullptr otherwise.
|
|
const DyldChainedFixups * | dyld_chained_fixups () const |
|
bool | has_dyld_exports_trie () const |
| true if the binary has the command LC_DYLD_CHAINED_FIXUPS.
|
|
DyldExportsTrie * | dyld_exports_trie () |
| Return the MachO::DyldChainedFixups if present, a nullptr otherwise.
|
|
const DyldExportsTrie * | dyld_exports_trie () const |
|
bool | has_two_level_hints () const |
| true if the binary has the command LC_TWO_LEVEL_HINTS.
|
|
TwoLevelHints * | two_level_hints () |
| Return the MachO::DyldChainedFixups if present, a nullptr otherwise.
|
|
const TwoLevelHints * | two_level_hints () const |
|
bool | has_linker_opt_hint () const |
| true if the binary has the command LC_LINKER_OPTIMIZATION_HINT.
|
|
LinkerOptHint * | linker_opt_hint () |
| Return the MachO::LinkerOptHint if present, a nullptr otherwise.
|
|
const LinkerOptHint * | linker_opt_hint () const |
|
ExportInfo * | add_exported_function (uint64_t address, const std::string &name) |
| Add a symbol in the export trie of the current binary.
|
|
Symbol * | add_local_symbol (uint64_t address, const std::string &name) |
| Add a symbol in LC_SYMTAB command of the current binary.
|
|
std::unique_ptr< objc::Metadata > | objc_metadata () const |
| Return Objective-C metadata if present.
|
|
stub_iterator | symbol_stubs () const |
| Return an iterator over the symbol stubs.
|
|
bool | has_atom_info () const |
| true if the binary has the command LC_ATOM_INFO.
|
|
AtomInfo * | atom_info () |
| Return the MachO::AtomInfo if present, a nullptr otherwise.
|
|
const AtomInfo * | atom_info () const |
|
template<class T > |
bool | has_command () const |
|
template<class T > |
T * | command () |
|
template<class T > |
const T * | command () const |
|
template<class T > |
size_t | count_commands () const |
|
template<class CMD , class Func > |
Binary & | for_commands (Func f) |
|
LoadCommand * | operator[] (LoadCommand::TYPE type) |
|
const LoadCommand * | operator[] (LoadCommand::TYPE type) const |
|
LIEF::Binary::functions_t | ctor_functions () const override |
| Return the list of the MachO's constructors.
|
|
LIEF::Binary::functions_t | functions () const |
| Return all the functions found in this MachO.
|
|
LIEF::Binary::functions_t | unwind_functions () const |
| Return the functions found in the __unwind_info section.
|
|
bool | has_filesets () const |
| true if the binary has a LoadCommand::TYPE::FILESET_ENTRY command
|
|
const std::string & | fileset_name () const |
| Name associated with the LC_FILESET_ENTRY binary.
|
|
Symbol & | add (const Symbol &symbol) |
| Add a symbol to this binary.
|
|
| ~Binary () override |
|
ok_error_t | shift (size_t value) |
| Shift the content located right after the Load commands table. This operation can be used to add a new command.
|
|
ok_error_t | shift_linkedit (size_t width) |
| Shift the position on the __LINKEDIT data by width
|
|
uint64_t | memory_base_address () const |
| If this Mach-O binary has been parsed from memory, it returns the in-memory base address of this binary.
|
|
bool | support_arm64_ptr_auth () const |
| Check if the binary is supporting ARM64 pointer authentication (arm64e)
|
|
it_bindings | bindings () const |
| Return an iterator over the binding info which can come from either DyldInfo or DyldChainedFixups commands.
|
|
uint32_t | page_size () const |
|
span< const uint8_t > | overlay () const |
|
void | sort_segments () |
|
void | refresh_seg_offset () |
|
| Binary () |
|
| Binary (FORMATS fmt) |
|
| ~Binary () override |
|
Binary & | operator= (const Binary &)=delete |
|
| Binary (const Binary &)=delete |
|
FORMATS | format () const |
| Executable format (ELF, PE, Mach-O) of the underlying binary.
|
|
Header | header () const |
| Return the abstract header of the binary.
|
|
it_symbols | symbols () |
| Return an iterator over the abstracted symbols in which the elements can be modified.
|
|
it_const_symbols | symbols () const |
| Return an iterator over the abstracted symbols in which the elements can't be modified.
|
|
bool | has_symbol (const std::string &name) const |
| Check if a Symbol with the given name exists.
|
|
const Symbol * | get_symbol (const std::string &name) const |
| Return the Symbol with the given name If the symbol does not exist, return a nullptr.
|
|
Symbol * | get_symbol (const std::string &name) |
|
it_sections | sections () |
| Return an iterator over the binary's sections (LIEF::Section)
|
|
it_const_sections | sections () const |
|
it_relocations | relocations () |
| Return an iterator over the binary relocation (LIEF::Relocation)
|
|
it_const_relocations | relocations () const |
|
uint64_t | original_size () const |
| Binary's original size.
|
|
functions_t | exported_functions () const |
| Return the functions exported by the binary.
|
|
std::vector< std::string > | imported_libraries () const |
| Return libraries which are imported by the binary.
|
|
functions_t | imported_functions () const |
| Return functions imported by the binary.
|
|
virtual result< uint64_t > | get_function_address (const std::string &func_name) const |
| Return the address of the given function name.
|
|
std::vector< uint64_t > | xref (uint64_t address) const |
|
template<class T > |
LIEF::result< T > | get_int_from_virtual_address (uint64_t va, VA_TYPES addr_type=VA_TYPES::AUTO) const |
| Get the integer value at the given virtual address.
|
|
void | original_size (uint64_t size) |
| Change binary's original size.
|
|
DebugInfo * | debug_info () const |
| Return the debug info if present. It can be either a LIEF::dwarf::DebugInfo or a LIEF::pdb::DebugInfo.
|
|
instructions_it | disassemble (uint64_t address, size_t size) const |
| Disassemble code starting a the given virtual address and with the given size.
|
|
instructions_it | disassemble (uint64_t address) const |
| Disassemble code starting a the given virtual address.
|
|
instructions_it | disassemble (const std::string &function) const |
| Disassemble code for the given symbol name.
|
|
instructions_it | disassemble (const uint8_t *buffer, size_t size, uint64_t address=0) const |
| Disassemble code provided by the given buffer at the specified address parameter.
|
|
instructions_it | disassemble (const std::vector< uint8_t > &buffer, uint64_t address=0) const |
| Disassemble code provided by the given vector of bytes at the specified address parameter.
|
|
instructions_it | disassemble (LIEF::span< const uint8_t > buffer, uint64_t address=0) const |
|
instructions_it | disassemble (LIEF::span< uint8_t > buffer, uint64_t address=0) const |
|
std::vector< uint8_t > | assemble (uint64_t address, const std::string &Asm) |
| Assemble and patch the provided assembly code at the specified address.
|
|
| Object () |
|
| Object (const Object &other) |
|
Object & | operator= (const Object &other) |
|
template<class T > |
output_t< T > | as () |
|
template<class T > |
output_const_t< T > | as () const |
|
virtual bool | operator== (const Object &other) const |
|
virtual bool | operator!= (const Object &other) const |
|
virtual | ~Object () |
|