-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
MemorySegment.hpp
44 lines (38 loc) · 874 Bytes
/
MemorySegment.hpp
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
#ifndef PROCMAP_MEMORY_SEGMENT
#define PROCMAP_MEMORY_SEGMENT
#include <stdlib.h>
#include <string>
#include <vector>
namespace procmap {
class MemorySegment {
void* _startAddress;
void* _endAddress;
unsigned long _offset;
unsigned int _deviceMajor;
unsigned int _deviceMinor;
ino_t _inode;
unsigned char _permissions;
std::string _name;
public:
MemorySegment(char *unparsed_line);
// getters
void* startAddress();
void* endAddress();
std::string name();
size_t length();
dev_t device();
// getters for the permissions bitmask
bool isReadable();
bool isWriteable();
bool isExecutable();
bool isShared();
bool isPrivate();
// other functions
bool isBindable();
bool isAnonymous();
bool isHeap();
bool isStack();
void print();
};
} // namespace procmap
#endif // PROCMAP_MEMORY_SEGMENT