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

#include <elf_notes.h>

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

Public Member Functions

Constructors and destructor
 ElfNoteSecSeg (const SecSeg *assocSecSeg)
 
Setters
void setMalformed (const std::string &message="corrupted note")
 
Add notes
void addNote (ElfNoteEntry &&note)
 
void addNote (const ElfNoteEntry &note)
 
Getters
std::vector< ElfNoteEntrygetNotes () const
 
std::string getErrorMessage () const
 
std::size_t getSecSegOffset () const
 
std::size_t getSecSegLength () const
 
std::string getSectionName () const
 
Query methods
bool isNamedSection () const
 
bool isMalformed () const
 
bool isEmpty () const
 

Private Attributes

const SecSegsecSeg
 associated section or segment More...
 
std::vector< ElfNoteEntrynotes
 notes in segment or section More...
 
bool malformed = false
 set to true if notes are malformed More...
 
std::string error
 possible error message More...
 

Detailed Description

Class describing one ELF note section or segment

Constructor & Destructor Documentation

◆ ElfNoteSecSeg()

retdec::fileformat::ElfNoteSecSeg::ElfNoteSecSeg ( const SecSeg assocSecSeg)

Constructor

Parameters
assocSecSegpointer to associated section or segment

Member Function Documentation

◆ addNote() [1/2]

void retdec::fileformat::ElfNoteSecSeg::addNote ( const ElfNoteEntry note)

Add one note entry (copy)

Parameters
notenote entry

◆ addNote() [2/2]

void retdec::fileformat::ElfNoteSecSeg::addNote ( ElfNoteEntry &&  note)

Add one note entry (move)

Parameters
notenote entry

◆ getErrorMessage()

std::string retdec::fileformat::ElfNoteSecSeg::getErrorMessage ( ) const

Get error message for malformed binaries

Returns
error message or empty string if notes are not malformed

◆ getNotes()

std::vector< ElfNoteEntry > retdec::fileformat::ElfNoteSecSeg::getNotes ( ) const

Get notes for segment or section

Returns
vector of notes

◆ getSecSegLength()

std::size_t retdec::fileformat::ElfNoteSecSeg::getSecSegLength ( ) const

Get length of section or segment in file

Returns
size in file

◆ getSecSegOffset()

std::size_t retdec::fileformat::ElfNoteSecSeg::getSecSegOffset ( ) const

Get file offset of section or segment

Returns
file offset

◆ getSectionName()

std::string retdec::fileformat::ElfNoteSecSeg::getSectionName ( ) const

Get name of section (only sections have name)

Returns
section name or empty string if name is missing

◆ isEmpty()

bool retdec::fileformat::ElfNoteSecSeg::isEmpty ( ) const

Check if object contains any notes

Returns
true if object contains any notes, false otherwise

◆ isMalformed()

bool retdec::fileformat::ElfNoteSecSeg::isMalformed ( ) const

Check if notes are malformed

Returns
true if notes are malformed, false otherwise

◆ isNamedSection()

bool retdec::fileformat::ElfNoteSecSeg::isNamedSection ( ) const

Check if notes belong to named section

Returns
true if notes belong to named section, false otherwise

◆ setMalformed()

void retdec::fileformat::ElfNoteSecSeg::setMalformed ( const std::string &  message = "corrupted note")

Set malformed bit for notes

Parameters
messageoptional error message

Member Data Documentation

◆ error

std::string retdec::fileformat::ElfNoteSecSeg::error
private

possible error message

◆ malformed

bool retdec::fileformat::ElfNoteSecSeg::malformed = false
private

set to true if notes are malformed

◆ notes

std::vector<ElfNoteEntry> retdec::fileformat::ElfNoteSecSeg::notes
private

notes in segment or section

◆ secSeg

const SecSeg* retdec::fileformat::ElfNoteSecSeg::secSeg
private

associated section or segment


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