ROSE  0.9.9.109
BinaryMagic.h
1 #ifndef ROSE_BinaryAnalysis_MagicNumber_H
2 #define ROSE_BinaryAnalysis_MagicNumber_H
3 
4 #include <MemoryMap.h>
5 
6 namespace Rose {
7 namespace BinaryAnalysis {
8 
12 class MagicNumberDetails;
13 
14 class MagicNumber {
15 public:
16  enum Mechanism { FAST, SLOW, NONE };
17 
18 private:
19  MagicNumberDetails *details_;
20  Mechanism mechanism_;
21  size_t maxBytes_;
22 
23 public:
25  MagicNumber(): details_(NULL), maxBytes_(256) {
26  init();
27  }
28 
29  ~MagicNumber();
30 
44  Mechanism mechanism() const { return mechanism_; }
45 
53  size_t maxBytesToCheck() const { return maxBytes_; }
54  void maxBytesToCheck(size_t n) { maxBytes_ = n; }
58  std::string identify(const MemoryMap::Ptr&, rose_addr_t va) const;
59 
60 private:
61  void init();
62 };
63 
64 } // namespace
65 } // namespace
66 #endif
Main namespace for the ROSE library.
void maxBytesToCheck(size_t n)
Property: Max number of bytes to check at once.
Definition: BinaryMagic.h:54
MagicNumber()
Create a magic number analyzer.
Definition: BinaryMagic.h:25
std::string identify(const MemoryMap::Ptr &, rose_addr_t va) const
Identify the magic number at the specified address.
size_t maxBytesToCheck() const
Property: Max number of bytes to check at once.
Definition: BinaryMagic.h:53
Mechanism mechanism() const
Property: The mechanism being used to find magic numbers.
Definition: BinaryMagic.h:44