-
-
Notifications
You must be signed in to change notification settings - Fork 252
/
Copy pathgumkernel.h
62 lines (52 loc) · 1.97 KB
/
gumkernel.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
/*
* Copyright (C) 2015-2024 Ole André Vadla Ravnås <oleavr@nowsecure.com>
*
* Licence: wxWindows Library Licence, Version 3.1
*/
#ifndef __GUM_KERNEL_H__
#define __GUM_KERNEL_H__
#include <gum/gumprocess.h>
G_BEGIN_DECLS
typedef struct _GumKernelModuleRangeDetails GumKernelModuleRangeDetails;
typedef struct _GumKernelModuleDetails GumKernelModuleDetails;
struct _GumKernelModuleRangeDetails
{
gchar name[48];
GumAddress address;
guint64 size;
GumPageProtection protection;
};
struct _GumKernelModuleDetails
{
const gchar * name;
const GumMemoryRange * range;
const gchar * path;
};
typedef gboolean (* GumFoundKernelModuleRangeFunc) (
const GumKernelModuleRangeDetails * details, gpointer user_data);
typedef gboolean (* GumFoundKernelModuleFunc) (
const GumKernelModuleDetails * details, gpointer user_data);
GUM_API gboolean gum_kernel_api_is_available (void);
GUM_API guint gum_kernel_query_page_size (void);
GUM_API GumAddress gum_kernel_alloc_n_pages (guint n_pages);
GUM_API void gum_kernel_free_pages (GumAddress mem);
GUM_API gboolean gum_kernel_try_mprotect (GumAddress address, gsize size,
GumPageProtection prot);
GUM_API guint8 * gum_kernel_read (GumAddress address, gsize len,
gsize * n_bytes_read);
GUM_API gboolean gum_kernel_write (GumAddress address, const guint8 * bytes,
gsize len);
GUM_API void gum_kernel_scan (const GumMemoryRange * range,
const GumMatchPattern * pattern, GumMemoryScanMatchFunc func,
gpointer user_data);
GUM_API void gum_kernel_enumerate_ranges (GumPageProtection prot,
GumFoundRangeFunc func, gpointer user_data);
GUM_API void gum_kernel_enumerate_module_ranges (const gchar * module_name,
GumPageProtection prot, GumFoundKernelModuleRangeFunc func,
gpointer user_data);
GUM_API void gum_kernel_enumerate_modules (GumFoundKernelModuleFunc func,
gpointer user_data);
GUM_API GumAddress gum_kernel_find_base_address (void);
GUM_API void gum_kernel_set_base_address (GumAddress base);
G_END_DECLS
#endif