forked from wargio/libvle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvle.h
48 lines (39 loc) · 776 Bytes
/
vle.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
#ifndef LIB_PPCVLE
#define LIB_PPCVLE
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint8_t ut8;
typedef uint16_t ut16;
typedef uint32_t ut32;
typedef uint64_t ut64;
#define TYPE_NONE 0
#define TYPE_REG 1
#define TYPE_IMM 2
#define TYPE_MEM 3
#define TYPE_JMP 4
#define TYPE_CR 5
typedef struct {
const ut8* end;
const ut8* pos;
ut16 inc;
} vle_handle;
typedef struct {
ut32 value;
ut16 type;
} vle_field_t;
typedef struct {
const char* name;
vle_field_t fields[10];
ut16 n;
ut16 size;
} vle_t;
int vle_init(vle_handle* handle, const ut8* buffer, const ut32 size);
vle_t* vle_next(vle_handle* handle);
void vle_free(vle_t* instr);
void vle_snprint(char* str, int size, ut64 addr, vle_t* instr);
#ifdef __cplusplus
}
#endif
#endif