retdec
macho_image.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LOADER_RETDEC_LOADER_MACHO_MACHO_IMAGE_H
8 #define RETDEC_LOADER_RETDEC_LOADER_MACHO_MACHO_IMAGE_H
9 
10 #include <unordered_map>
11 #include <vector>
12 
14 
15 namespace retdec {
16 namespace loader {
17 
18 class MachOImage : public Image
19 {
20  using SectionList = std::vector<const retdec::fileformat::MachOSection*>;
21  using SegmentToSectionsTable = std::unordered_map<std::string, SectionList>;
22 public:
23  MachOImage(const std::shared_ptr<retdec::fileformat::FileFormat>& fileFormat);
24 
25  virtual bool load() override;
26 
27 protected:
28  bool loadObjectFile();
29  bool loadExecutableFile();
30 
32  const Segment* addSegment(const retdec::fileformat::SecSeg* secSeg);
33 };
34 
35 } // namespace loader
36 } // namespace retdec
37 
38 #endif
Definition: sec_seg.h:24
Definition: image.h:22
Definition: macho_image.h:19
virtual bool load() override
Definition: macho_image.cpp:23
bool loadExecutableFile()
Definition: macho_image.cpp:59
std::vector< const retdec::fileformat::MachOSection * > SectionList
Definition: macho_image.h:20
bool loadObjectFile()
Definition: macho_image.cpp:41
SegmentToSectionsTable mapSegmentsToSections() const
Definition: macho_image.cpp:94
const Segment * addSegment(const retdec::fileformat::SecSeg *secSeg)
Definition: macho_image.cpp:122
std::unordered_map< std::string, SectionList > SegmentToSectionsTable
Definition: macho_image.h:21
MachOImage(const std::shared_ptr< retdec::fileformat::FileFormat > &fileFormat)
Definition: macho_image.cpp:13
Definition: segment.h:25
Declaration of loadable image class.
Generic loader.
Definition: archive_wrapper.h:19