ROSE 0.11.145.192
MagicNumber.h
1#ifndef ROSE_BinaryAnalysis_MagicNumber_H
2#define ROSE_BinaryAnalysis_MagicNumber_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5
6#include <Rose/BinaryAnalysis/MemoryMap.h>
7
8namespace Rose {
9namespace BinaryAnalysis {
10
14class MagicNumberDetails;
15
17public:
21 enum Mechanism {
22 FAST,
23 SLOW,
24 NONE
25 };
26
27private:
28 MagicNumberDetails *details_;
29 Mechanism mechanism_;
30 size_t maxBytes_;
31
32public:
34 MagicNumber(): details_(NULL), maxBytes_(256) {
35 init();
36 }
37
39
40 MagicNumber(const MagicNumber&) = delete;
41 MagicNumber& operator=(const MagicNumber&) = delete;
42
56 Mechanism mechanism() const { return mechanism_; }
57
65 size_t maxBytesToCheck() const { return maxBytes_; }
66 void maxBytesToCheck(size_t n) { maxBytes_ = n; }
70 std::string identify(const MemoryMap::Ptr&, rose_addr_t va) const;
71
72private:
73 void init();
74};
75
76} // namespace
77} // namespace
78
79#endif
80#endif
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 MagicNumber.h:65
void maxBytesToCheck(size_t n)
Property: Max number of bytes to check at once.
Definition MagicNumber.h:66
Mechanism
How to search for magic numbers.
Definition MagicNumber.h:21
Mechanism mechanism() const
Property: The mechanism being used to find magic numbers.
Definition MagicNumber.h:56
MagicNumber()
Create a magic number analyzer.
Definition MagicNumber.h:34
The ROSE library.