aboutsummaryrefslogtreecommitdiffstats
path: root/src/vm.h
blob: 3f3cc097960537851dcbfd36b9960af70b15f8b9 (plain) (blame)
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
#ifndef _VM_H_
#define _VM_H_
#include <stdint.h>
#include <sys/types.h>

typedef struct VMMapping {
  void *begin;
  void *end;
  uint8_t r:1;
  uint8_t w:1;
  uint8_t x:1;
  uint8_t s:1;
  uint8_t p:1;
  const char *name;
  struct VMMapping *next;
} VMMapping;

typedef struct MemscanResult {
  VMMapping *mapping;
  off_t offset;
  struct MemscanResult *next;
} MemscanResult;

VMMapping* parse_vmmap (int pid);

MemscanResult* memscan(int pid, uint8_t *byte_seq, uint64_t byte_seq_len);

void memwrite(int pid, void *address, uint8_t *data, size_t data_len);
#endif // _VM_H_