#include <break_fat.h>
|
|
bool | isArchive () |
| Auxiliary methods. More...
|
|
const char * | getFileBufferStart () |
|
bool | getByArchFamily (std::uint32_t cpuType, llvm::object::MachOUniversalBinary::object_iterator &res) |
|
bool | extract (llvm::object::MachOUniversalBinary::object_iterator &object, const std::string &outPath) |
|
bool | getObjectNamesForArchive (std::uintptr_t archOffset, std::size_t archSize, std::vector< std::string > &result) |
|
|
bool | valid = false |
|
bool | isStatic = false |
|
std::string | path |
|
std::unique_ptr< llvm::object::MachOUniversalBinary > | file |
|
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | buffer |
|
◆ BreakMachOUniversal()
retdec::macho_extractor::BreakMachOUniversal::BreakMachOUniversal |
( |
const std::string & |
filePath | ) |
|
◆ extract()
bool retdec::macho_extractor::BreakMachOUniversal::extract |
( |
llvm::object::MachOUniversalBinary::object_iterator & |
it, |
|
|
const std::string & |
outPath |
|
) |
| |
|
private |
Extract object by iterator
- Parameters
-
it | object iterator |
outPath | output file path |
- Returns
true
if object was created successfully, false
otherwise
◆ extractAllArchives()
bool retdec::macho_extractor::BreakMachOUniversal::extractAllArchives |
( |
| ) |
|
Extracting methods.
Extract all archives, simulates ar x behavior
- Returns
true
if extraction was successful, false
otherwise
◆ extractArchiveForArchitecture()
bool retdec::macho_extractor::BreakMachOUniversal::extractArchiveForArchitecture |
( |
const std::string & |
machoArchName, |
|
|
const std::string & |
outPath |
|
) |
| |
Extract archive by architecture
- Parameters
-
machoArchName | Mach-O specific architecture string |
outPath | path to output file |
- Returns
true
if extraction was successful, false
otherwise
◆ extractArchiveForFamily()
bool retdec::macho_extractor::BreakMachOUniversal::extractArchiveForFamily |
( |
const std::string & |
familyName, |
|
|
const std::string & |
outPath |
|
) |
| |
Extract archive by architecture family
- Parameters
-
familyName | family name |
outPath | path to output file |
- Returns
true
if extraction was successful, false
otherwise
◆ extractArchiveWithIndex()
bool retdec::macho_extractor::BreakMachOUniversal::extractArchiveWithIndex |
( |
unsigned |
index, |
|
|
const std::string & |
outPath |
|
) |
| |
Extract archive with selected index
- Parameters
-
index | index of archive to extract |
outPath | output file path |
- Returns
true
if extraction was successful, false
otherwise
◆ extractBestArchive()
bool retdec::macho_extractor::BreakMachOUniversal::extractBestArchive |
( |
const std::string & |
outPath | ) |
|
Extract archive with best architecture for decompilation
- Parameters
-
- Returns
true
if extraction was successful, false
otherwise
◆ getByArchFamily()
bool retdec::macho_extractor::BreakMachOUniversal::getByArchFamily |
( |
std::uint32_t |
cpuType, |
|
|
llvm::object::MachOUniversalBinary::object_iterator & |
res |
|
) |
| |
|
private |
Get Mach-O Universal object iterator by architecture
- Parameters
-
cpuType | Mach-O specific CPU type constant |
res | reference for storing result |
- Returns
true
if object with cpuType
was found, false
otherwise
◆ getFileBufferStart()
const char * retdec::macho_extractor::BreakMachOUniversal::getFileBufferStart |
( |
| ) |
|
|
private |
Get file memory buffer start
- Returns
- pointer to file memory buffer start
◆ getObjectNamesForArchive()
bool retdec::macho_extractor::BreakMachOUniversal::getObjectNamesForArchive |
( |
std::uintptr_t |
archOffset, |
|
|
std::size_t |
archSize, |
|
|
std::vector< std::string > & |
result |
|
) |
| |
|
private |
Get file names of objects stored in archive
- Parameters
-
archOffset | start of archive in Mach-O Universal Binary |
archSize | size of archive in Mach-O Universal Binary |
result | vector with names |
- Returns
true
if names were retrieved successfully, false
otherwise
Actual LLVM implementation is problematic but changed a lot in newer versions, so in future, it may be possible to remove this function and use getAsArchive function and llvm::Archive interface instead.
Function is fit only for Apple OS (BSD) archive variant used in Mach-O.
◆ isArchive()
bool retdec::macho_extractor::BreakMachOUniversal::isArchive |
( |
| ) |
|
|
private |
Auxiliary methods.
Check if input binary contains static libraries
- Returns
true
if file contains static libraries, false
otherwise
◆ isStaticLibrary()
bool retdec::macho_extractor::BreakMachOUniversal::isStaticLibrary |
( |
| ) |
|
Check if input binary contains static library
- Returns
true
if file is fat Mach-O static library, false
otherwise
◆ isValid()
bool retdec::macho_extractor::BreakMachOUniversal::isValid |
( |
| ) |
|
Information methods.
Verify state of instance after construction
- Returns
true
if file was read successfully, false
otherwise
◆ listArchitectures()
bool retdec::macho_extractor::BreakMachOUniversal::listArchitectures |
( |
std::ostream & |
output, |
|
|
bool |
withObjects = false |
|
) |
| |
List all architectures contained in fat Mach-O
- Parameters
-
output | stream to print result to |
withObjects | true when archive content is to be included |
- Returns
true
if all actions were successful, false
otherwise
◆ listArchitecturesJson()
bool retdec::macho_extractor::BreakMachOUniversal::listArchitecturesJson |
( |
std::ostream & |
output, |
|
|
bool |
withObjects = false |
|
) |
| |
List all architectures contained in fat Mach-O in JSON format
- Parameters
-
output | stream to print result to |
withObjects | true when archive content is to be included |
- Returns
true
if all actions were successful, false
otherwise
◆ buffer
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer> > retdec::macho_extractor::BreakMachOUniversal::buffer |
|
private |
◆ file
std::unique_ptr<llvm::object::MachOUniversalBinary> retdec::macho_extractor::BreakMachOUniversal::file |
|
private |
◆ isStatic
bool retdec::macho_extractor::BreakMachOUniversal::isStatic = false |
|
private |
◆ path
std::string retdec::macho_extractor::BreakMachOUniversal::path |
|
private |
◆ valid
bool retdec::macho_extractor::BreakMachOUniversal::valid = false |
|
private |
The documentation for this class was generated from the following files:
- /var/cache/acbs/build/acbs.6bu6osb6/retdec/include/retdec/macho-extractor/break_fat.h
- /var/cache/acbs/build/acbs.6bu6osb6/retdec/src/macho-extractor/break_fat.cpp