retdec
Private Attributes | List of all members
retdec::fileformat::MachOSymbol Class Reference

#include <macho_symbol.h>

Collaboration diagram for retdec::fileformat::MachOSymbol:
Collaboration graph
[legend]

Public Member Functions

Setters
void makeFunction (FileFormat *fileParser)
 
void setAllValues (const llvm::MachO::nlist &nList, const llvm::StringRef &strTable, unsigned index)
 
void setAllValues (const llvm::MachO::nlist_64 &nList, const llvm::StringRef &strTable, unsigned index)
 
Interpretation methods
std::unique_ptr< ImportgetAsImport () const
 
Export getAsExport () const
 
std::shared_ptr< SymbolgetAsSymbol () const
 

Private Member Functions

Auxiliary methods
Symbol::Type getSymbolType () const
 
Symbol::UsageType getSymbolUsageType () const
 
template<typename T >
void setValues (const T &nList, const llvm::StringRef &strTable, unsigned index)
 

Private Attributes

std::string name
 Symbol name. More...
 
std::string altName
 Alternative name for weak symbols. More...
 
unsigned long long value
 Symbol value - various interpetation. More...
 
std::int16_t description
 Symbol description and library ordinal. More...
 
std::uint8_t section
 Section index. More...
 
std::uint8_t type
 Type of symbol. More...
 
unsigned index
 Index of symbol. More...
 
bool isFunction = false
 true if symbol is function false otherwise More...
 

Detailed Description

Class for one MachO symbol

Member Function Documentation

◆ getAsExport()

Export retdec::fileformat::MachOSymbol::getAsExport ( ) const

Get MachOSymbol as Export type

Returns
Export

◆ getAsImport()

std::unique_ptr< Import > retdec::fileformat::MachOSymbol::getAsImport ( ) const

Get MachOSymbol as Import type

Returns
Import

◆ getAsSymbol()

std::shared_ptr< Symbol > retdec::fileformat::MachOSymbol::getAsSymbol ( ) const

Get MachOSymbol as Symbol type

Returns
Symbol

◆ getSymbolType()

Symbol::Type retdec::fileformat::MachOSymbol::getSymbolType ( ) const
private

Get symbol type

Returns
Symbol type

◆ getSymbolUsageType()

Symbol::UsageType retdec::fileformat::MachOSymbol::getSymbolUsageType ( ) const
private

Get symbol usage type

Returns
Symbol usage type

◆ makeFunction()

void retdec::fileformat::MachOSymbol::makeFunction ( FileFormat fileParser)

Makes symbol a function if conditions are met (call only after setAllValues)

Parameters
fileParserPointer to FileFormat parser

◆ setAllValues() [1/2]

void retdec::fileformat::MachOSymbol::setAllValues ( const llvm::MachO::nlist &  nList,
const llvm::StringRef &  strTable,
unsigned  index 
)

Set all values of MachOSymbol

Parameters
nListSource structure 32-bit
strTablePointer to string table
indexIndex of symbol

◆ setAllValues() [2/2]

void retdec::fileformat::MachOSymbol::setAllValues ( const llvm::MachO::nlist_64 &  nList,
const llvm::StringRef &  strTable,
unsigned  index 
)

Set all values of MachOSymbol

Parameters
nListSource structure 64-bit
strTablePointer to string table
indexIndex of symbol

◆ setValues()

template<typename T >
void retdec::fileformat::MachOSymbol::setValues ( const T &  nList,
const llvm::StringRef &  strTable,
unsigned  index 
)
private

Set all values of MachOSymbol

Parameters
nListSource structure
strTablePointer to string table
indexIndex of symbol

Member Data Documentation

◆ altName

std::string retdec::fileformat::MachOSymbol::altName
private

Alternative name for weak symbols.

◆ description

std::int16_t retdec::fileformat::MachOSymbol::description
private

Symbol description and library ordinal.

◆ index

unsigned retdec::fileformat::MachOSymbol::index
private

Index of symbol.

◆ isFunction

bool retdec::fileformat::MachOSymbol::isFunction = false
private

true if symbol is function false otherwise

◆ name

std::string retdec::fileformat::MachOSymbol::name
private

Symbol name.

◆ section

std::uint8_t retdec::fileformat::MachOSymbol::section
private

Section index.

◆ type

std::uint8_t retdec::fileformat::MachOSymbol::type
private

Type of symbol.

◆ value

unsigned long long retdec::fileformat::MachOSymbol::value
private

Symbol value - various interpetation.


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