retdec
Private Types | Private Attributes | List of all members
retdec::common::FileFormat Class Reference

#include <file_format.h>

Public Member Functions

File format query methods.
bool isUnknown () const
 
bool isKnown () const
 
bool isElf () const
 
bool isElf32 () const
 
bool isElf64 () const
 
bool isPe () const
 
bool isPe32 () const
 
bool isPe64 () const
 
bool isCoff () const
 
bool isCoff32 () const
 
bool isCoff64 () const
 
bool isMacho () const
 
bool isMacho32 () const
 
bool isMacho64 () const
 
bool isIntelHex () const
 
bool isIntelHex16 () const
 
bool isIntelHex32 () const
 
bool isIntelHex64 () const
 
bool isRaw () const
 
bool isRaw32 () const
 
bool isRaw64 () const
 
bool is16bit () const
 
bool is32bit () const
 
bool is64bit () const
 
bool isFileClassBits (unsigned b) const
 
File format set methods.
void setIsUnknown ()
 
void setIsElf ()
 
void setIsElf32 ()
 
void setIsElf64 ()
 
void setIsPe ()
 
void setIsPe32 ()
 
void setIsPe64 ()
 
void setIsCoff ()
 
void setIsCoff32 ()
 
void setIsCoff64 ()
 
void setIsMacho ()
 
void setIsMacho32 ()
 
void setIsMacho64 ()
 
void setIsIntelHex ()
 
void setIsIntelHex16 ()
 
void setIsIntelHex32 ()
 
void setIsIntelHex64 ()
 
void setIsRaw ()
 
void setIsRaw32 ()
 
void setIsRaw64 ()
 
void setName (const std::string &n)
 
void setIs16bit ()
 
void setIs32bit ()
 
void setIs64bit ()
 
void setFileClassBits (unsigned b)
 
File format get methods.
std::string getName () const
 
unsigned getFileClassBits () const
 

Private Types

enum  eFileFormat {
  FF_UNKNOWN = 0 , FF_ELF , FF_PE , FF_COFF ,
  FF_IHEX , FF_MACHO , FF_RAW
}
 

Private Attributes

eFileFormat _fileFormat = FF_UNKNOWN
 
unsigned _fileClassBits = 0
 

Detailed Description

Represents input binary's file format. In particular its type (i.e ELF, PE, COFF) and bit size (i.e. 32, 64).

Member Enumeration Documentation

◆ eFileFormat

Enumerator
FF_UNKNOWN 
FF_ELF 
FF_PE 
FF_COFF 
FF_IHEX 
FF_MACHO 
FF_RAW 

Member Function Documentation

◆ getFileClassBits()

unsigned retdec::common::FileFormat::getFileClassBits ( ) const

Get bit size associated with the file format. It does not have to be the same as target architecture bit size.

Returns
Bit size. If not set return default value = 0.

◆ getName()

std::string retdec::common::FileFormat::getName ( ) const

Get file format name.

Returns
File format name from this set of possible values: {unknown, elf, pe, coff}.

◆ is16bit()

bool retdec::common::FileFormat::is16bit ( ) const

◆ is32bit()

bool retdec::common::FileFormat::is32bit ( ) const

◆ is64bit()

bool retdec::common::FileFormat::is64bit ( ) const

◆ isCoff()

bool retdec::common::FileFormat::isCoff ( ) const

◆ isCoff32()

bool retdec::common::FileFormat::isCoff32 ( ) const

◆ isCoff64()

bool retdec::common::FileFormat::isCoff64 ( ) const

◆ isElf()

bool retdec::common::FileFormat::isElf ( ) const

◆ isElf32()

bool retdec::common::FileFormat::isElf32 ( ) const

◆ isElf64()

bool retdec::common::FileFormat::isElf64 ( ) const

◆ isFileClassBits()

bool retdec::common::FileFormat::isFileClassBits ( unsigned  b) const

Check bit size associated with the file format value. It does not have to be the same as target architecture bit size.

Parameters
bBit size.

◆ isIntelHex()

bool retdec::common::FileFormat::isIntelHex ( ) const

◆ isIntelHex16()

bool retdec::common::FileFormat::isIntelHex16 ( ) const

◆ isIntelHex32()

bool retdec::common::FileFormat::isIntelHex32 ( ) const

◆ isIntelHex64()

bool retdec::common::FileFormat::isIntelHex64 ( ) const

◆ isKnown()

bool retdec::common::FileFormat::isKnown ( ) const

◆ isMacho()

bool retdec::common::FileFormat::isMacho ( ) const

◆ isMacho32()

bool retdec::common::FileFormat::isMacho32 ( ) const

◆ isMacho64()

bool retdec::common::FileFormat::isMacho64 ( ) const

◆ isPe()

bool retdec::common::FileFormat::isPe ( ) const

◆ isPe32()

bool retdec::common::FileFormat::isPe32 ( ) const

◆ isPe64()

bool retdec::common::FileFormat::isPe64 ( ) const

◆ isRaw()

bool retdec::common::FileFormat::isRaw ( ) const

◆ isRaw32()

bool retdec::common::FileFormat::isRaw32 ( ) const

◆ isRaw64()

bool retdec::common::FileFormat::isRaw64 ( ) const

◆ isUnknown()

bool retdec::common::FileFormat::isUnknown ( ) const

◆ setFileClassBits()

void retdec::common::FileFormat::setFileClassBits ( unsigned  b)

Set bit size associated with the file format. It does not have to be the same as target architecture bit size.

Parameters
bBit size.

◆ setIs16bit()

void retdec::common::FileFormat::setIs16bit ( )

◆ setIs32bit()

void retdec::common::FileFormat::setIs32bit ( )

◆ setIs64bit()

void retdec::common::FileFormat::setIs64bit ( )

◆ setIsCoff()

void retdec::common::FileFormat::setIsCoff ( )

◆ setIsCoff32()

void retdec::common::FileFormat::setIsCoff32 ( )

◆ setIsCoff64()

void retdec::common::FileFormat::setIsCoff64 ( )

◆ setIsElf()

void retdec::common::FileFormat::setIsElf ( )

◆ setIsElf32()

void retdec::common::FileFormat::setIsElf32 ( )

◆ setIsElf64()

void retdec::common::FileFormat::setIsElf64 ( )

◆ setIsIntelHex()

void retdec::common::FileFormat::setIsIntelHex ( )

◆ setIsIntelHex16()

void retdec::common::FileFormat::setIsIntelHex16 ( )

◆ setIsIntelHex32()

void retdec::common::FileFormat::setIsIntelHex32 ( )

◆ setIsIntelHex64()

void retdec::common::FileFormat::setIsIntelHex64 ( )

◆ setIsMacho()

void retdec::common::FileFormat::setIsMacho ( )

◆ setIsMacho32()

void retdec::common::FileFormat::setIsMacho32 ( )

◆ setIsMacho64()

void retdec::common::FileFormat::setIsMacho64 ( )

◆ setIsPe()

void retdec::common::FileFormat::setIsPe ( )

◆ setIsPe32()

void retdec::common::FileFormat::setIsPe32 ( )

◆ setIsPe64()

void retdec::common::FileFormat::setIsPe64 ( )

◆ setIsRaw()

void retdec::common::FileFormat::setIsRaw ( )

◆ setIsRaw32()

void retdec::common::FileFormat::setIsRaw32 ( )

◆ setIsRaw64()

void retdec::common::FileFormat::setIsRaw64 ( )

◆ setIsUnknown()

void retdec::common::FileFormat::setIsUnknown ( )

◆ setName()

void retdec::common::FileFormat::setName ( const std::string &  n)

Set file format with provided name. Supported names are: {elf, elf32, elf64, pe, pe32, pe64, coff, coff32, coff64}.

Parameters
nFile format name.

Member Data Documentation

◆ _fileClassBits

unsigned retdec::common::FileFormat::_fileClassBits = 0
private

This is bit size associated with file format. It does not have to be the same as target architecture bit size.

◆ _fileFormat

eFileFormat retdec::common::FileFormat::_fileFormat = FF_UNKNOWN
private

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