ROSE  0.11.22.0
BinaryLoaderPe.h
1 #ifndef ROSE_BinaryAnalysis_BinaryLoaderPe_H
2 #define ROSE_BinaryAnalysis_BinaryLoaderPe_H
3 
4 #include <featureTests.h>
5 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
6 #include "BinaryLoader.h"
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 
13 
16 public:
19 
20 protected:
21  BinaryLoaderPe() {}
22 
23  BinaryLoaderPe(const BinaryLoaderPe &other)
24  : BinaryLoader(other)
25  {}
26 
27 public:
29  static Ptr instance() {
30  return Ptr(new BinaryLoaderPe);
31  }
32 
33  virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE {
34  return BinaryLoaderPtr(new BinaryLoaderPe(*this));
35  }
36 
37  virtual ~BinaryLoaderPe() {}
38 
39  /* Override virtual methods from BinaryLoader */
40 public:
41 
42  virtual bool canLoad(SgAsmGenericHeader*) const ROSE_OVERRIDE;
43 
44  // Returns sections in order of their definition in the PE Section Table.
45  virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader*) ROSE_OVERRIDE;
46 
48  virtual MappingContribution alignValues(SgAsmGenericSection*, const MemoryMap::Ptr&,
49  rose_addr_t *malign_lo, rose_addr_t *malign_hi,
50  rose_addr_t *va, rose_addr_t *mem_size,
51  rose_addr_t *offset, rose_addr_t *file_size, bool *map_private,
52  rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi,
53  ConflictResolution *resolve) ROSE_OVERRIDE;
54 };
55 
56 } // namespace
57 } // namespace
58 
59 #endif
60 #endif
Contiguous region of a file.
Loader for Windows PE files.
Sawyer::SharedPointer< class BinaryLoaderPe > BinaryLoaderPePtr
Reference counting pointer to BinaryLoaderPe.
Main namespace for the ROSE library.
virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader *) ROSE_OVERRIDE
Selects those sections of a header that should be mapped.
virtual bool canLoad(SgAsmGenericHeader *) const ROSE_OVERRIDE
Predicate determining the suitability of a loader for a specific file header.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
Base class for container file headers.
static Ptr instance()
Allocating constructor.
Sawyer::SharedPointer< class BinaryLoader > BinaryLoaderPtr
Reference counting pointer to BinaryLoader.
Definition: BinaryLoader.h:16
MappingContribution
Describes how a section contributes to the overall memory map.
Definition: BinaryLoader.h:66
virtual MappingContribution alignValues(SgAsmGenericSection *, const MemoryMap::Ptr &, rose_addr_t *malign_lo, rose_addr_t *malign_hi, rose_addr_t *va, rose_addr_t *mem_size, rose_addr_t *offset, rose_addr_t *file_size, bool *map_private, rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi, ConflictResolution *resolve) ROSE_OVERRIDE
Windows-specific PE section alignment.
ConflictResolution
Describes how conflicts are resolved when mapping a section.
Definition: BinaryLoader.h:74
Base class for loading a static or dynamic object.
Definition: BinaryLoader.h:57
Sawyer::SharedPointer< BinaryLoaderPe > Ptr
Reference counting pointer to BinaryLoaderPe.
virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE
Creates a new copy of a loader.