-
-
Notifications
You must be signed in to change notification settings - Fork 250
/
gumarm64relocator.h
72 lines (53 loc) · 2.09 KB
/
gumarm64relocator.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
/*
* Copyright (C) 2014-2017 Ole André Vadla Ravnås <[email protected]>
*
* Licence: wxWindows Library Licence, Version 3.1
*/
#ifndef __GUM_ARM64_RELOCATOR_H__
#define __GUM_ARM64_RELOCATOR_H__
#include "gumarm64writer.h"
#include <capstone.h>
G_BEGIN_DECLS
typedef struct _GumArm64Relocator GumArm64Relocator;
struct _GumArm64Relocator
{
volatile gint ref_count;
csh capstone;
const guint8 * input_start;
const guint8 * input_cur;
GumAddress input_pc;
cs_insn ** input_insns;
GumArm64Writer * output;
guint inpos;
guint outpos;
gboolean eob;
gboolean eoi;
};
GUM_API GumArm64Relocator * gum_arm64_relocator_new (gconstpointer input_code,
GumArm64Writer * output);
GUM_API GumArm64Relocator * gum_arm64_relocator_ref (
GumArm64Relocator * relocator);
GUM_API void gum_arm64_relocator_unref (GumArm64Relocator * relocator);
GUM_API void gum_arm64_relocator_init (GumArm64Relocator * relocator,
gconstpointer input_code, GumArm64Writer * output);
GUM_API void gum_arm64_relocator_clear (GumArm64Relocator * relocator);
GUM_API void gum_arm64_relocator_reset (GumArm64Relocator * relocator,
gconstpointer input_code, GumArm64Writer * output);
GUM_API guint gum_arm64_relocator_read_one (GumArm64Relocator * self,
const cs_insn ** instruction);
GUM_API cs_insn * gum_arm64_relocator_peek_next_write_insn (
GumArm64Relocator * self);
GUM_API gpointer gum_arm64_relocator_peek_next_write_source (
GumArm64Relocator * self);
GUM_API void gum_arm64_relocator_skip_one (GumArm64Relocator * self);
GUM_API gboolean gum_arm64_relocator_write_one (GumArm64Relocator * self);
GUM_API void gum_arm64_relocator_write_all (GumArm64Relocator * self);
GUM_API gboolean gum_arm64_relocator_eob (GumArm64Relocator * self);
GUM_API gboolean gum_arm64_relocator_eoi (GumArm64Relocator * self);
GUM_API gboolean gum_arm64_relocator_can_relocate (gpointer address,
guint min_bytes, GumRelocationScenario scenario, guint * maximum,
arm64_reg * available_scratch_reg);
GUM_API guint gum_arm64_relocator_relocate (gpointer from, guint min_bytes,
gpointer to);
G_END_DECLS
#endif