Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef SMPPROGRAM_H
#define SMPPROGRAM_H 1
// SMPProgram.h
//
// This header defines the interfaces needed for analyzing whole programs.
#include <utility>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <cstddef>
#include <pro.h>
#include <ida.hpp>
#include <ua.hpp>
#include "SMPDataFlowAnalysis.h"
#include "SMPInstr.h"
#include "SMPBasicBlock.h"
#include "SMPFunction.h"
using namespace std;
struct GlobalVar {
ea_t addr;
size_t size;
char name[MAXSTR];
bool ReadOnly; // came from read-only data segment type
flags_t flags;
};
// Class encapsulating all that the SMP static analyzer cares to know
// about a whole program.
class SMPProgram {
public:
// Constructors
SMPProgram(void); // Default constructor
~SMPProgram(void); // Destructor
// Get methods
// Set methods
// Query methods
// Printing methods
void Dump(void); // debug dump
// Analysis methods
void Analyze(void); // Analyze all functions in the program
void EmitAnnotations(FILE *AnnotFile); // Emit annotations for all functions
private:
// Data
map<ea_t, SMPFunction *> FuncMap; // all functions in the program
map<ea_t, struct GlobalVar> GlobalVarTable; // all global static variables
// Methods
void InitStaticDataTable(void); // Gather info about global static data locations
}; // end class SMPProgram
#endif