ROSE  0.9.9.109
ModulesElf.h
1 #ifndef ROSE_Partitioner2_ModulesElf_H
2 #define ROSE_Partitioner2_ModulesElf_H
3 
4 #include <Partitioner2/BasicTypes.h>
5 #include <Partitioner2/Function.h>
6 #include <Partitioner2/Modules.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis {
10 namespace Partitioner2 {
11 namespace ModulesElf {
12 
19 std::vector<Function::Ptr> findErrorHandlingFunctions(SgAsmElfFileHeader*);
20 std::vector<Function::Ptr> findErrorHandlingFunctions(SgAsmInterpretation*);
21 size_t findErrorHandlingFunctions(SgAsmElfFileHeader*, std::vector<Function::Ptr>&);
27 std::vector<Function::Ptr> findPltFunctions(const Partitioner&, SgAsmElfFileHeader*);
28 std::vector<Function::Ptr> findPltFunctions(const Partitioner&, SgAsmInterpretation*);
29 size_t findPltFunctions(const Partitioner&, SgAsmElfFileHeader*, std::vector<Function::Ptr>&);
35  rose_addr_t baseVa_; // base address for computing memAddress_
36  rose_addr_t memAddress_; // address through which an indirect branch branches
37  size_t nBytesMatched_; // number of bytes matched for PLT entry
38 public:
39  PltEntryMatcher(rose_addr_t base): baseVa_(base), memAddress_(0), nBytesMatched_(0) {}
40  static Ptr instance(rose_addr_t base) { return Ptr(new PltEntryMatcher(base)); }
41  virtual bool match(const Partitioner&, rose_addr_t anchor);
42  rose_addr_t memAddress() const { return memAddress_; }
43  size_t nBytesMatched() const { return nBytesMatched_; }
44 };
45 
47 void buildMayReturnLists(Partitioner&);
48 
49 } // namespace
50 } // namespace
51 } // namespace
52 } // namespace
53 
54 #endif
Represents the file header of an ELF binary container.
Main namespace for the ROSE library.
Base class for matching an instruction pattern.
Definition: Modules.h:77
Reference-counting smart pointer.
Definition: SharedPointer.h:34
virtual bool match(const Partitioner &, rose_addr_t anchor)
Attempt to match an instruction pattern.
Sawyer::SharedPointer< InstructionMatcher > Ptr
Shared-ownership pointer to an InstructionMatcher.
Definition: Modules.h:80
Partitions instructions into basic blocks and functions.
Definition: Partitioner.h:289
Represents an interpretation of a binary container.