-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathruntrace.h
93 lines (77 loc) · 1.95 KB
/
runtrace.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef RUN_TRACER_H_
#define RUN_TRACER_H_ 1
#define TRACE_RECORD_MAGIC 0x0A0BABE0
typedef struct TRACE_RECORD_FILE_HEADER {
UINT32 magic;
UINT32 filesize;
UINT32 addrsize;
UINT32 num_records;
} TRACE_RECORD_FILE_HEADER;
enum TRACE_RECORD_TYPES {
TRACE_TYPE_NONE = 0, // invalid start point... we can reuse later
TRACE_TYPE_INDIRECT_CALL, // 1
TRACE_TYPE_DIRECT_CALL, // 2
TRACE_TYPE_RETURN, // 3
TRACE_TYPE_BASIC_BLOCK, // 4
TRACE_TYPE_HEAP_ALLOC, // 5
TRACE_TYPE_HEAP_REALLOC, // 6
TRACE_TYPE_HEAP_FREE, // 7
TRACE_TYPE_MEMORY, // 8
TRACE_TYPE_LIBRARY_LOAD, // 9
};
typedef struct TRACE_RECORD_HEADER {
UINT32 type;
THREADID threadid;
} TRACE_RECORD_HEADER;
typedef struct TRACE_RECORD_CALL {
ADDRINT address;
ADDRINT target;
ADDRINT esp;
} TRACE_RECORD_CALL;
typedef struct TRACE_RECORD_RETURN {
ADDRINT address;
ADDRINT retval;
ADDRINT esp;
} TRACE_RECORD_RETURN;
typedef struct TRACE_RECORD_BASIC_BLOCK {
ADDRINT address;
} TRACE_RECORD_BASIC_BLOCK;
typedef struct TRACE_RECORD_HEAP_ALLOC {
ADDRINT heap;
UINT64 size;
ADDRINT address;
} TRACE_RECORD_HEAP_ALLOC;
typedef struct TRACE_RECORD_HEAP_REALLOC {
ADDRINT heap;
ADDRINT oldaddress;
UINT64 size;
ADDRINT address;
} TRACE_RECORD_HEAP_REALLOC;
typedef struct TRACE_RECORD_HEAP_FREE {
ADDRINT heap;
ADDRINT address;
} TRACE_RECORD_HEAP_FREE;
typedef struct TRACE_RECORD_MEMORY {
ADDRINT address;
UINT32 store;
ADDRINT target;
} TRACE_RECORD_MEMORY;
typedef struct TRACE_RECORD_LIBRARY_LOAD {
ADDRINT low;
ADDRINT high;
UINT32 namelen;
char name[255];
} TRACE_RECORD_LIBRARY_LOAD;
typedef struct TRACE_RECORD {
TRACE_RECORD_HEADER header;
union {
TRACE_RECORD_CALL call;
TRACE_RECORD_RETURN ret;
TRACE_RECORD_BASIC_BLOCK bbl;
TRACE_RECORD_HEAP_ALLOC alloc;
TRACE_RECORD_HEAP_REALLOC realloc;
TRACE_RECORD_HEAP_FREE free;
TRACE_RECORD_MEMORY memory;
};
} TRACE_RECORD;
#endif /* RUN_TRACER_H_ */