ROSE  0.9.12.19
BinaryLoaderPe.h
1 #ifndef ROSE_BinaryAnalysis_BinaryLoaderPe_H
2 #define ROSE_BinaryAnalysis_BinaryLoaderPe_H
3 
4 #include "BinaryLoader.h"
5 
6 namespace Rose {
7 namespace BinaryAnalysis {
8 
11 
14 public:
17 
18 protected:
19  BinaryLoaderPe() {}
20 
21  BinaryLoaderPe(const BinaryLoaderPe &other)
22  : BinaryLoader(other)
23  {}
24 
25 public:
27  static Ptr instance() {
28  return Ptr(new BinaryLoaderPe);
29  }
30 
31  virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE {
32  return BinaryLoaderPtr(new BinaryLoaderPe(*this));
33  }
34 
35  virtual ~BinaryLoaderPe() {}
36 
37  /* Override virtual methods from BinaryLoader */
38 public:
39 
40  virtual bool canLoad(SgAsmGenericHeader*) const ROSE_OVERRIDE;
41 
42  // Returns sections in order of their definition in the PE Section Table.
43  virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader*) ROSE_OVERRIDE;
44 
46  virtual MappingContribution alignValues(SgAsmGenericSection*, const MemoryMap::Ptr&,
47  rose_addr_t *malign_lo, rose_addr_t *malign_hi,
48  rose_addr_t *va, rose_addr_t *mem_size,
49  rose_addr_t *offset, rose_addr_t *file_size, bool *map_private,
50  rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi,
51  ConflictResolution *resolve) ROSE_OVERRIDE;
52 };
53 
54 } // namespace
55 } // namespace
56 
57 #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 smart pointer.
Definition: SharedPointer.h:67
Base class for container file headers.
static Ptr instance()
Allocating constructor.
Sawyer::SharedPointer< class BinaryLoader > BinaryLoaderPtr
Reference counting pointer to BinaryLoader.
Definition: BinaryLoader.h:13
MappingContribution
Describes how a section contributes to the overall memory map.
Definition: BinaryLoader.h:63
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:71
Base class for loading a static or dynamic object.
Definition: BinaryLoader.h:54
Sawyer::SharedPointer< BinaryLoaderPe > Ptr
Reference counting pointer to BinaryLoaderPe.
virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE
Creates a new copy of a loader.