ROSE 0.11.145.192
BinaryLoaderPe.h
1#ifndef ROSE_BinaryAnalysis_BinaryLoaderPe_H
2#define ROSE_BinaryAnalysis_BinaryLoaderPe_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/BinaryLoader.h>
6
7namespace Rose {
8namespace BinaryAnalysis {
9
12public:
15
16protected:
20 performingRemap(true);
21 }
22
23 BinaryLoaderPe(const BinaryLoaderPe &other)
24 : BinaryLoader(other){
27 performingRemap(true);
28 }
29
30public:
32 static Ptr instance() {
33 return Ptr(new BinaryLoaderPe);
34 }
35
36 virtual BinaryLoaderPtr clone() const override {
37 return BinaryLoaderPtr(new BinaryLoaderPe(*this));
38 }
39
40 virtual ~BinaryLoaderPe() {}
41
42 /* Override virtual methods from BinaryLoader */
43public:
44
45 virtual bool canLoad(SgAsmGenericHeader*) const override;
46
47 // documented in superclass
48 virtual void link(SgAsmInterpretation *interp) override;
49
51 virtual rose_addr_t rebase(const MemoryMap::Ptr&, SgAsmGenericHeader*, const SgAsmGenericSectionPtrList&) override;
52
53 // Resolve import section to DLL files.
54 virtual void fixup(SgAsmInterpretation *interp, FixupErrors *errors=NULL) override;
55
56 // Returns sections in order of their definition in the PE Section Table.
57 virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader*) override;
58
61 rose_addr_t *malign_lo, rose_addr_t *malign_hi,
62 rose_addr_t *va, rose_addr_t *mem_size,
63 rose_addr_t *offset, rose_addr_t *file_size, bool *map_private,
64 rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi,
65 ConflictResolution *resolve) override;
66
70 virtual bool isLinked(SgBinaryComposite *composite, const std::string &filename) override;
71 virtual bool isLinked(SgAsmInterpretation *interp, const std::string &filename) override;
77
82 virtual std::string findSoFile(const std::string &libname) const override;
83
84};
85
86} // namespace
87} // namespace
88
89#endif
90#endif
Loader for Windows PE files.
virtual bool isLinked(SgAsmInterpretation *interp, const std::string &filename) override
Returns true if the specified file name is already linked into the AST.
static Ptr instance()
Allocating constructor.
BinaryLoaderPePtr Ptr
Reference counting pointer to BinaryLoaderPe.
virtual void link(SgAsmInterpretation *interp) override
Finds and parses all shared objects needed by an interpretation.
virtual BinaryLoaderPtr clone() const override
Creates a new copy of a loader.
virtual rose_addr_t rebase(const MemoryMap::Ptr &, SgAsmGenericHeader *, const SgAsmGenericSectionPtrList &) override
Returns a new, temporary base address which is greater than everything that's been mapped already.
virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader *) override
Selects those sections of a header that should be mapped.
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) override
Windows-specific PE section alignment.
virtual bool canLoad(SgAsmGenericHeader *) const override
Predicate determining the suitability of a loader for a specific file header.
virtual bool isLinked(SgBinaryComposite *composite, const std::string &filename) override
Returns true if the specified file name is already linked into the AST.
virtual std::string findSoFile(const std::string &libname) const override
Convert name to fully qualified name.
virtual void fixup(SgAsmInterpretation *interp, FixupErrors *errors=NULL) override
Performs relocation fixups on the specified interpretation.
void addLibDefaults(SgAsmGenericHeader *header=NULL)
Sets up library search paths and preloads from the environment.
Base class for loading a static or dynamic object.
MappingContribution
Describes how a section contributes to the overall memory map.
bool performingRemap() const
Property: Whether this loader will perform the mapping step.
ConflictResolution
Describes how conflicts are resolved when mapping a section.
bool performingRelocations() const
Property: Whether this loader will perform the relocation step.
bool performingDynamicLinking() const
Property: Whether this loader will perform the linking step.
Reference-counting intrusive smart pointer.
Base class for container file headers.
Contiguous region of a file.
Represents an interpretation of a binary container.
Sawyer::SharedPointer< BinaryLoaderPe > BinaryLoaderPePtr
Refernce counting pointer.
Sawyer::SharedPointer< BinaryLoader > BinaryLoaderPtr
Reference counting pointer.
The ROSE library.