forked from tortoisedoc/miep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memory.h
31 lines (24 loc) · 760 Bytes
/
memory.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
#ifndef __MEMORY__H__
#define __MEMORY__H__
#include <stdint.h>
class memory
{
protected:
unsigned char *pm;
uint64_t len;
memory();
public:
memory(uint64_t size, bool init);
memory(unsigned char *p, uint64_t len);
virtual ~memory();
virtual uint64_t get_size() const { return len; }
virtual void read_64b(uint64_t offset, uint64_t *data);
virtual void read_32b(uint64_t offset, uint32_t *data);
virtual void read_16b(uint64_t offset, uint16_t *data);
virtual void read_8b(uint64_t offset, uint8_t *data);
virtual void write_64b(uint64_t offset, uint64_t data);
virtual void write_32b(uint64_t offset, uint32_t data);
virtual void write_16b(uint64_t offset, uint16_t data);
virtual void write_8b(uint64_t offset, uint8_t data);
};
#endif