retdec
Public Member Functions | Private Attributes | List of all members
retdec::fileinfo::MachODetector Class Reference

#include <macho_detector.h>

Inheritance diagram for retdec::fileinfo::MachODetector:
Inheritance graph
[legend]
Collaboration diagram for retdec::fileinfo::MachODetector:
Collaboration graph
[legend]

Public Member Functions

 MachODetector (std::string pathToInputFile, FileInformation &finfo, retdec::cpdetect::DetectParams &searchPar, retdec::fileformat::LoadFlags loadFlags)
 
bool isMachoUniversalArchive ()
 
- Public Member Functions inherited from retdec::fileinfo::FileDetector
 FileDetector (const std::string &pathToInputFile, FileInformation &finfo, retdec::cpdetect::DetectParams &searchPar, retdec::fileformat::LoadFlags loadFlags)
 
virtual ~FileDetector ()=default
 
void setConfigFile (retdec::config::Config &config)
 
void getAllInformation ()
 
const retdec::fileformat::FileFormatgetFileParser () const
 

Protected Member Functions

Auxiliary detection methods
void getEntryPoint ()
 
void getSegments ()
 
void getSections ()
 
void getSymbols ()
 
void getEncryption ()
 
void getOsInfo ()
 
void getRelocations ()
 
Detection methods
virtual void detectFileClass () override
 
virtual void detectArchitecture () override
 
virtual void detectFileType () override
 
virtual void getAdditionalInfo () override
 
virtual retdec::cpdetect::CompilerDetectorcreateCompilerDetector () const override
 
Pure virtual detection methods

Private Attributes

std::shared_ptr< MachOWrappermachoParser
 file parser More...
 

Additional Inherited Members

- Protected Attributes inherited from retdec::fileinfo::FileDetector
FileInformationfileInfo
 information about file More...
 
retdec::cpdetect::DetectParamscpParams
 parameters for detection of used compiler More...
 
retdec::config::ConfigfileConfig
 configuration of input file More...
 
std::shared_ptr< retdec::fileformat::FileFormatfileParser
 parser of input file More...
 
retdec::fileformat::LoadFlags loadFlags
 load flags for configurable running More...
 
bool loaded
 internal state of instance More...
 

Detailed Description

MachODetector - find info about MachO binary file

Constructor & Destructor Documentation

◆ MachODetector()

retdec::fileinfo::MachODetector::MachODetector ( std::string  pathToInputFile,
FileInformation finfo,
retdec::cpdetect::DetectParams searchPar,
retdec::fileformat::LoadFlags  loadFlags 
)

Constructor

Parameters
pathToInputFilePath to input file
finfoInstance of class for storing information about file
searchParParameters for detection of used compiler (or packer)
loadFlagsLoad flags

Member Function Documentation

◆ createCompilerDetector()

retdec::cpdetect::CompilerDetector * retdec::fileinfo::MachODetector::createCompilerDetector ( ) const
overrideprotectedvirtual

Pointer to detector is dynamically allocated and must be released (otherwise there is a memory leak) More detailed description of this method is in the super class

Implements retdec::fileinfo::FileDetector.

◆ detectArchitecture()

void retdec::fileinfo::MachODetector::detectArchitecture ( )
overrideprotectedvirtual

Detect of target architecture

Implements retdec::fileinfo::FileDetector.

◆ detectFileClass()

void retdec::fileinfo::MachODetector::detectFileClass ( )
overrideprotectedvirtual

Detect class of file

Implements retdec::fileinfo::FileDetector.

◆ detectFileType()

void retdec::fileinfo::MachODetector::detectFileType ( )
overrideprotectedvirtual

Detect of type of file

Implements retdec::fileinfo::FileDetector.

◆ getAdditionalInfo()

void retdec::fileinfo::MachODetector::getAdditionalInfo ( )
overrideprotectedvirtual

Get additional information about file

Implements retdec::fileinfo::FileDetector.

◆ getEncryption()

void retdec::fileinfo::MachODetector::getEncryption ( )
protected

Get information about encrypted files

◆ getEntryPoint()

void retdec::fileinfo::MachODetector::getEntryPoint ( )
protected

Get entry point info

◆ getOsInfo()

void retdec::fileinfo::MachODetector::getOsInfo ( )
protected

Get information about operating system

◆ getRelocations()

void retdec::fileinfo::MachODetector::getRelocations ( )
protected

Get relocation tables and relocations

◆ getSections()

void retdec::fileinfo::MachODetector::getSections ( )
protected

Get information about sections

Todo:
add section type, flags, reserved1/reserved2

◆ getSegments()

void retdec::fileinfo::MachODetector::getSegments ( )
protected

Get segments info

Todo:
add segment name, type and flags, memory protection

◆ getSymbols()

void retdec::fileinfo::MachODetector::getSymbols ( )
protected

Get information about symbols

Todo:
table offset, number of symbols
Todo:
value, type, bind, flags

◆ isMachoUniversalArchive()

bool retdec::fileinfo::MachODetector::isMachoUniversalArchive ( )

Check if file is Mach-O Universal Binary archive

Returns
true if file is Mach-O fat archive, false otherwise

Member Data Documentation

◆ machoParser

std::shared_ptr<MachOWrapper> retdec::fileinfo::MachODetector::machoParser
private

file parser


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