-
Notifications
You must be signed in to change notification settings - Fork 0
/
qemu.patch
executable file
·43 lines (42 loc) · 1.31 KB
/
qemu.patch
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
diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index 5f1017201f..20fa39cf16 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -590,4 +590,11 @@ void qemu_plugin_outs(const char *string);
*/
bool qemu_plugin_bool_parse(const char *name, const char *val, bool *ret);
+/**
+ * Returns the address space base of the emulated process
+ *
+ * Note that the address space base is initialized after plugins are installed.
+ */
+uintptr_t qemu_plugin_guest_base(void);
+
#endif /* QEMU_PLUGIN_API_H */
diff --git a/plugins/api.c b/plugins/api.c
index b143b09ce9..37fefbe456 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -391,3 +391,10 @@ bool qemu_plugin_bool_parse(const char *name, const char *value, bool *ret)
{
return name && value && qapi_bool_parse(name, value, ret, NULL);
}
+
+/*
+ * Returns the address space base of the emulated process
+ */
+uintptr_t qemu_plugin_guest_base(void) {
+ return guest_base;
+}
diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols
index 67b309ea2a..2a42f52e91 100644
--- a/plugins/qemu-plugins.symbols
+++ b/plugins/qemu-plugins.symbols
@@ -1,6 +1,7 @@
{
qemu_plugin_bool_parse;
qemu_plugin_get_hwaddr;
+ qemu_plugin_guest_base;
qemu_plugin_hwaddr_is_io;
qemu_plugin_insn_data;
qemu_plugin_insn_disas;