retdec
pe_image.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LOADER_RETDEC_LOADER_PE_PE_IMAGE_H
8 #define RETDEC_LOADER_RETDEC_LOADER_PE_PE_IMAGE_H
9 
10 #include <string>
11 
13 
14 namespace retdec {
15 namespace loader {
16 
17 class PeImage : public Image
18 {
19 public:
20  PeImage(const std::shared_ptr<retdec::fileformat::FileFormat>& fileFormat);
21 
22  virtual bool load() override;
23 
24 protected:
25  Segment* addSegment(const retdec::fileformat::Section* section, std::uint64_t address, std::uint64_t memSize);
26  Segment* addSingleSegment(std::uint64_t address, std::vector<std::uint8_t>& content);
27 
28  bool canAddSegment(std::uint64_t address, std::uint64_t memSize) const;
29 
31 
32 private:
33  std::unique_ptr<std::vector<std::uint8_t>> _singleSegment;
34 };
35 
36 } // namespace loader
37 } // namespace retdec
38 
39 #endif
Definition: section.h:19
Definition: image.h:22
Definition: pe_image.h:18
void loadNonDecodableAddressRanges()
Definition: pe_image.cpp:123
Segment * addSingleSegment(std::uint64_t address, std::vector< std::uint8_t > &content)
Definition: pe_image.cpp:96
PeImage(const std::shared_ptr< retdec::fileformat::FileFormat > &fileFormat)
Definition: pe_image.cpp:22
Segment * addSegment(const retdec::fileformat::Section *section, std::uint64_t address, std::uint64_t memSize)
Definition: pe_image.cpp:80
bool canAddSegment(std::uint64_t address, std::uint64_t memSize) const
Definition: pe_image.cpp:110
std::unique_ptr< std::vector< std::uint8_t > > _singleSegment
Used when there is no section present in the file.
Definition: pe_image.h:33
virtual bool load() override
Definition: pe_image.cpp:32
Definition: segment.h:25
Declaration of loadable image class.
Generic loader.
Definition: archive_wrapper.h:19