retdec
elf_notes.h
Go to the documentation of this file.
1 
7 #ifndef FILEINFO_FILE_INFORMATION_FILE_INFORMATION_TYPES_ELF_NOTES_H
8 #define FILEINFO_FILE_INFORMATION_FILE_INFORMATION_TYPES_ELF_NOTES_H
9 
10 #include <vector>
11 
13 
14 namespace retdec {
15 namespace fileinfo {
16 
21 {
22  public:
23  std::string owner;
24  std::size_t type;
25  std::size_t dataOffset;
26  std::size_t dataLength;
27  std::string description;
28 };
29 
33 class ElfNotes
34 {
35  private:
36  std::string sectionName;
37  std::size_t secSegOffset;
38  std::size_t secSegLength;
39  std::string errorMessage;
40  std::vector<ElfNoteEntry> notes;
41 
42  public:
45  std::string getSectionName() const;
46  std::size_t getSecSegOffset() const;
47  std::size_t getSecSegLength() const;
48  std::size_t getNumberOfNotes() const;
49  const std::string& getErrorMessage() const;
50  const std::vector<ElfNoteEntry>& getNotes() const;
52 
55  bool isNamedSection() const;
56  bool isMalformed() const;
58 
61  void setSectionName(const std::string& name);
62  void setSecSegOffset(const std::size_t& offset);
63  void setSecSegLength(const std::size_t& length);
64  void setErrorMessage(const std::string& message);
65  void addNoteEntry(const ElfNoteEntry& noteEntry);
67 };
68 
69 } // namespace fileinfo
70 } // namespace retdec
71 
72 #endif
Definition: elf_notes.h:21
std::size_t type
Definition: elf_notes.h:24
std::size_t dataOffset
Definition: elf_notes.h:25
std::size_t dataLength
Definition: elf_notes.h:26
std::string owner
Definition: elf_notes.h:23
std::string description
Definition: elf_notes.h:27
Definition: elf_notes.h:34
std::vector< ElfNoteEntry > notes
Definition: elf_notes.h:40
void setSecSegOffset(const std::size_t &offset)
Definition: elf_notes.cpp:59
std::size_t getSecSegLength() const
Definition: elf_notes.cpp:24
const std::vector< ElfNoteEntry > & getNotes() const
Definition: elf_notes.cpp:39
const std::string & getErrorMessage() const
Definition: elf_notes.cpp:34
bool isNamedSection() const
Definition: elf_notes.cpp:44
std::string getSectionName() const
Definition: elf_notes.cpp:14
std::string errorMessage
Definition: elf_notes.h:39
std::size_t secSegLength
Definition: elf_notes.h:38
std::size_t secSegOffset
Definition: elf_notes.h:37
void setSecSegLength(const std::size_t &length)
Definition: elf_notes.cpp:64
bool isMalformed() const
Definition: elf_notes.cpp:49
void addNoteEntry(const ElfNoteEntry &noteEntry)
Definition: elf_notes.cpp:74
std::size_t getNumberOfNotes() const
Definition: elf_notes.cpp:29
void setErrorMessage(const std::string &message)
Definition: elf_notes.cpp:69
std::size_t getSecSegOffset() const
Definition: elf_notes.cpp:19
std::string sectionName
Definition: elf_notes.h:36
void setSectionName(const std::string &name)
Definition: elf_notes.cpp:54
Class for ELF note section (segment).
Definition: archive_wrapper.h:19