frida 16.7.0 → 16.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/releng/deps.toml +4 -3
- package/releng/devkit-assets/frida-gum-example-unix.c +25 -50
- package/releng/devkit-assets/frida-gum-example-windows.c +31 -52
- package/releng/devkit.py +1 -1
- package/releng/env.py +4 -0
- package/releng/env_android.py +1 -0
- package/releng/env_generic.py +4 -7
- package/releng/machine_spec.py +17 -15
- package/subprojects/frida-core.wrap +1 -1
package/package.json
CHANGED
package/releng/deps.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[dependencies]
|
|
2
|
-
version = "
|
|
3
|
-
bootstrap_version = "
|
|
2
|
+
version = "20250321"
|
|
3
|
+
bootstrap_version = "20250114"
|
|
4
4
|
|
|
5
5
|
[ninja]
|
|
6
6
|
scope = "toolchain"
|
|
@@ -362,12 +362,13 @@ options = [
|
|
|
362
362
|
[v8]
|
|
363
363
|
when = """ \
|
|
364
364
|
machine.config != 'mingw' \
|
|
365
|
+
and machine.arch != 'arm64beilp32' \
|
|
365
366
|
and not machine.arch.startswith('mips') \
|
|
366
367
|
and not machine.arch.startswith('powerpc') \
|
|
367
368
|
and machine.os != 'qnx' \
|
|
368
369
|
"""
|
|
369
370
|
name = "V8"
|
|
370
|
-
version = "
|
|
371
|
+
version = "a7b09c3d8b16199ef8664c66559d2530c293b8cf"
|
|
371
372
|
url = "https://github.com/frida/v8.git"
|
|
372
373
|
options = [
|
|
373
374
|
"-Ddebug=false",
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
#include <fcntl.h>
|
|
4
4
|
#include <unistd.h>
|
|
5
5
|
|
|
6
|
-
typedef struct
|
|
6
|
+
typedef struct _ExampleListenerData ExampleListenerData;
|
|
7
7
|
typedef enum _ExampleHookId ExampleHookId;
|
|
8
8
|
|
|
9
|
-
struct
|
|
9
|
+
struct _ExampleListenerData
|
|
10
10
|
{
|
|
11
|
-
GObject parent;
|
|
12
|
-
|
|
13
11
|
guint num_calls;
|
|
14
12
|
};
|
|
15
13
|
|
|
@@ -19,51 +17,48 @@ enum _ExampleHookId
|
|
|
19
17
|
EXAMPLE_HOOK_CLOSE
|
|
20
18
|
};
|
|
21
19
|
|
|
22
|
-
static void
|
|
23
|
-
|
|
24
|
-
#define EXAMPLE_TYPE_LISTENER (example_listener_get_type ())
|
|
25
|
-
G_DECLARE_FINAL_TYPE (ExampleListener, example_listener, EXAMPLE, LISTENER, GObject)
|
|
26
|
-
G_DEFINE_TYPE_EXTENDED (ExampleListener,
|
|
27
|
-
example_listener,
|
|
28
|
-
G_TYPE_OBJECT,
|
|
29
|
-
0,
|
|
30
|
-
G_IMPLEMENT_INTERFACE (GUM_TYPE_INVOCATION_LISTENER,
|
|
31
|
-
example_listener_iface_init))
|
|
20
|
+
static void example_listener_on_enter (GumInvocationContext * ic, gpointer user_data);
|
|
21
|
+
static void example_listener_on_leave (GumInvocationContext * ic, gpointer user_data);
|
|
32
22
|
|
|
33
23
|
int
|
|
34
24
|
main (int argc,
|
|
35
25
|
char * argv[])
|
|
36
26
|
{
|
|
37
27
|
GumInterceptor * interceptor;
|
|
28
|
+
ExampleListenerData * data;
|
|
38
29
|
GumInvocationListener * listener;
|
|
39
30
|
|
|
40
31
|
gum_init_embedded ();
|
|
41
32
|
|
|
42
33
|
interceptor = gum_interceptor_obtain ();
|
|
43
|
-
|
|
34
|
+
|
|
35
|
+
data = g_new0 (ExampleListenerData, 1);
|
|
36
|
+
listener = gum_make_call_listener (example_listener_on_enter, example_listener_on_leave, data, g_free);
|
|
44
37
|
|
|
45
38
|
gum_interceptor_begin_transaction (interceptor);
|
|
46
39
|
gum_interceptor_attach (interceptor,
|
|
47
|
-
GSIZE_TO_POINTER (
|
|
40
|
+
GSIZE_TO_POINTER (gum_module_find_global_export_by_name ("open")),
|
|
48
41
|
listener,
|
|
49
|
-
GSIZE_TO_POINTER (EXAMPLE_HOOK_OPEN)
|
|
42
|
+
GSIZE_TO_POINTER (EXAMPLE_HOOK_OPEN),
|
|
43
|
+
GUM_ATTACH_FLAGS_NONE);
|
|
50
44
|
gum_interceptor_attach (interceptor,
|
|
51
|
-
GSIZE_TO_POINTER (
|
|
45
|
+
GSIZE_TO_POINTER (gum_module_find_global_export_by_name ("close")),
|
|
52
46
|
listener,
|
|
53
|
-
GSIZE_TO_POINTER (EXAMPLE_HOOK_CLOSE)
|
|
47
|
+
GSIZE_TO_POINTER (EXAMPLE_HOOK_CLOSE),
|
|
48
|
+
GUM_ATTACH_FLAGS_NONE);
|
|
54
49
|
gum_interceptor_end_transaction (interceptor);
|
|
55
50
|
|
|
56
51
|
close (open ("/etc/hosts", O_RDONLY));
|
|
57
52
|
close (open ("/etc/fstab", O_RDONLY));
|
|
58
53
|
|
|
59
|
-
g_print ("[*] listener got %u calls\n",
|
|
54
|
+
g_print ("[*] listener got %u calls\n", data->num_calls);
|
|
60
55
|
|
|
61
56
|
gum_interceptor_detach (interceptor, listener);
|
|
62
57
|
|
|
63
58
|
close (open ("/etc/hosts", O_RDONLY));
|
|
64
59
|
close (open ("/etc/fstab", O_RDONLY));
|
|
65
60
|
|
|
66
|
-
g_print ("[*] listener still has %u calls\n",
|
|
61
|
+
g_print ("[*] listener still has %u calls\n", data->num_calls);
|
|
67
62
|
|
|
68
63
|
g_object_unref (listener);
|
|
69
64
|
g_object_unref (interceptor);
|
|
@@ -74,11 +69,13 @@ main (int argc,
|
|
|
74
69
|
}
|
|
75
70
|
|
|
76
71
|
static void
|
|
77
|
-
example_listener_on_enter (
|
|
78
|
-
|
|
72
|
+
example_listener_on_enter (GumInvocationContext * ic,
|
|
73
|
+
gpointer user_data)
|
|
79
74
|
{
|
|
80
|
-
|
|
81
|
-
ExampleHookId hook_id
|
|
75
|
+
ExampleListenerData * data = user_data;
|
|
76
|
+
ExampleHookId hook_id;
|
|
77
|
+
|
|
78
|
+
hook_id = GUM_IC_GET_FUNC_DATA (ic, ExampleHookId);
|
|
82
79
|
|
|
83
80
|
switch (hook_id)
|
|
84
81
|
{
|
|
@@ -90,33 +87,11 @@ example_listener_on_enter (GumInvocationListener * listener,
|
|
|
90
87
|
break;
|
|
91
88
|
}
|
|
92
89
|
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
static void
|
|
97
|
-
example_listener_on_leave (GumInvocationListener * listener,
|
|
98
|
-
GumInvocationContext * ic)
|
|
99
|
-
{
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
static void
|
|
103
|
-
example_listener_class_init (ExampleListenerClass * klass)
|
|
104
|
-
{
|
|
105
|
-
(void) EXAMPLE_IS_LISTENER;
|
|
106
|
-
(void) glib_autoptr_cleanup_ExampleListener;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
static void
|
|
110
|
-
example_listener_iface_init (gpointer g_iface,
|
|
111
|
-
gpointer iface_data)
|
|
112
|
-
{
|
|
113
|
-
GumInvocationListenerInterface * iface = g_iface;
|
|
114
|
-
|
|
115
|
-
iface->on_enter = example_listener_on_enter;
|
|
116
|
-
iface->on_leave = example_listener_on_leave;
|
|
90
|
+
data->num_calls++;
|
|
117
91
|
}
|
|
118
92
|
|
|
119
93
|
static void
|
|
120
|
-
|
|
94
|
+
example_listener_on_leave (GumInvocationContext * ic,
|
|
95
|
+
gpointer user_data)
|
|
121
96
|
{
|
|
122
97
|
}
|
|
@@ -11,13 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
#include <windows.h>
|
|
13
13
|
|
|
14
|
-
typedef struct
|
|
14
|
+
typedef struct _ExampleListenerData ExampleListenerData;
|
|
15
15
|
typedef enum _ExampleHookId ExampleHookId;
|
|
16
16
|
|
|
17
|
-
struct
|
|
17
|
+
struct _ExampleListenerData
|
|
18
18
|
{
|
|
19
|
-
GObject parent;
|
|
20
|
-
|
|
21
19
|
guint num_calls;
|
|
22
20
|
};
|
|
23
21
|
|
|
@@ -27,52 +25,55 @@ enum _ExampleHookId
|
|
|
27
25
|
EXAMPLE_HOOK_SLEEP
|
|
28
26
|
};
|
|
29
27
|
|
|
30
|
-
static void
|
|
31
|
-
|
|
32
|
-
#define EXAMPLE_TYPE_LISTENER (example_listener_get_type ())
|
|
33
|
-
G_DECLARE_FINAL_TYPE (ExampleListener, example_listener, EXAMPLE, LISTENER, GObject)
|
|
34
|
-
G_DEFINE_TYPE_EXTENDED (ExampleListener,
|
|
35
|
-
example_listener,
|
|
36
|
-
G_TYPE_OBJECT,
|
|
37
|
-
0,
|
|
38
|
-
G_IMPLEMENT_INTERFACE (GUM_TYPE_INVOCATION_LISTENER,
|
|
39
|
-
example_listener_iface_init))
|
|
28
|
+
static void example_listener_on_enter (GumInvocationContext * ic, gpointer user_data);
|
|
29
|
+
static void example_listener_on_leave (GumInvocationContext * ic, gpointer user_data);
|
|
40
30
|
|
|
41
31
|
int
|
|
42
32
|
main (int argc,
|
|
43
33
|
char * argv[])
|
|
44
34
|
{
|
|
45
35
|
GumInterceptor * interceptor;
|
|
36
|
+
ExampleListenerData * data;
|
|
46
37
|
GumInvocationListener * listener;
|
|
38
|
+
GumModule * user32, * kernel32;
|
|
47
39
|
|
|
48
40
|
gum_init_embedded ();
|
|
49
41
|
|
|
50
42
|
interceptor = gum_interceptor_obtain ();
|
|
51
|
-
|
|
43
|
+
|
|
44
|
+
data = g_new0 (ExampleListenerData, 1);
|
|
45
|
+
listener = gum_make_call_listener (example_listener_on_enter, example_listener_on_leave, data, g_free);
|
|
46
|
+
|
|
47
|
+
user32 = gum_process_find_module_by_name ("user32.dll");
|
|
48
|
+
kernel32 = gum_process_find_module_by_name ("kernel32.dll");
|
|
52
49
|
|
|
53
50
|
gum_interceptor_begin_transaction (interceptor);
|
|
54
51
|
gum_interceptor_attach (interceptor,
|
|
55
|
-
GSIZE_TO_POINTER (gum_module_find_export_by_name (
|
|
52
|
+
GSIZE_TO_POINTER (gum_module_find_export_by_name (user32, "MessageBeep")),
|
|
56
53
|
listener,
|
|
57
|
-
GSIZE_TO_POINTER (EXAMPLE_HOOK_MESSAGE_BEEP)
|
|
54
|
+
GSIZE_TO_POINTER (EXAMPLE_HOOK_MESSAGE_BEEP),
|
|
55
|
+
GUM_ATTACH_FLAGS_NONE);
|
|
58
56
|
gum_interceptor_attach (interceptor,
|
|
59
|
-
GSIZE_TO_POINTER (gum_module_find_export_by_name (
|
|
57
|
+
GSIZE_TO_POINTER (gum_module_find_export_by_name (kernel32, "Sleep")),
|
|
60
58
|
listener,
|
|
61
|
-
GSIZE_TO_POINTER (EXAMPLE_HOOK_SLEEP)
|
|
59
|
+
GSIZE_TO_POINTER (EXAMPLE_HOOK_SLEEP),
|
|
60
|
+
GUM_ATTACH_FLAGS_NONE);
|
|
62
61
|
gum_interceptor_end_transaction (interceptor);
|
|
63
62
|
|
|
64
63
|
MessageBeep (MB_ICONINFORMATION);
|
|
65
64
|
Sleep (1);
|
|
66
65
|
|
|
67
|
-
g_print ("[*] listener got %u calls\n",
|
|
66
|
+
g_print ("[*] listener got %u calls\n", data->num_calls);
|
|
68
67
|
|
|
69
68
|
gum_interceptor_detach (interceptor, listener);
|
|
70
69
|
|
|
71
70
|
MessageBeep (MB_ICONINFORMATION);
|
|
72
71
|
Sleep (1);
|
|
73
72
|
|
|
74
|
-
g_print ("[*] listener still has %u calls\n",
|
|
73
|
+
g_print ("[*] listener still has %u calls\n", data->num_calls);
|
|
75
74
|
|
|
75
|
+
g_object_unref (kernel32);
|
|
76
|
+
g_object_unref (user32);
|
|
76
77
|
g_object_unref (listener);
|
|
77
78
|
g_object_unref (interceptor);
|
|
78
79
|
|
|
@@ -82,11 +83,13 @@ main (int argc,
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
static void
|
|
85
|
-
example_listener_on_enter (
|
|
86
|
-
|
|
86
|
+
example_listener_on_enter (GumInvocationContext * ic,
|
|
87
|
+
gpointer user_data)
|
|
87
88
|
{
|
|
88
|
-
|
|
89
|
-
ExampleHookId hook_id
|
|
89
|
+
ExampleListenerData * data = user_data;
|
|
90
|
+
ExampleHookId hook_id;
|
|
91
|
+
|
|
92
|
+
hook_id = GUM_IC_GET_FUNC_DATA (ic, ExampleHookId);
|
|
90
93
|
|
|
91
94
|
switch (hook_id)
|
|
92
95
|
{
|
|
@@ -98,35 +101,11 @@ example_listener_on_enter (GumInvocationListener * listener,
|
|
|
98
101
|
break;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
static void
|
|
105
|
-
example_listener_on_leave (GumInvocationListener * listener,
|
|
106
|
-
GumInvocationContext * ic)
|
|
107
|
-
{
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
static void
|
|
111
|
-
example_listener_class_init (ExampleListenerClass * klass)
|
|
112
|
-
{
|
|
113
|
-
(void) EXAMPLE_IS_LISTENER;
|
|
114
|
-
#ifndef _MSC_VER
|
|
115
|
-
(void) glib_autoptr_cleanup_ExampleListener;
|
|
116
|
-
#endif
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
static void
|
|
120
|
-
example_listener_iface_init (gpointer g_iface,
|
|
121
|
-
gpointer iface_data)
|
|
122
|
-
{
|
|
123
|
-
GumInvocationListenerInterface * iface = g_iface;
|
|
124
|
-
|
|
125
|
-
iface->on_enter = example_listener_on_enter;
|
|
126
|
-
iface->on_leave = example_listener_on_leave;
|
|
104
|
+
data->num_calls++;
|
|
127
105
|
}
|
|
128
106
|
|
|
129
107
|
static void
|
|
130
|
-
|
|
108
|
+
example_listener_on_leave (GumInvocationContext * ic,
|
|
109
|
+
gpointer user_data)
|
|
131
110
|
{
|
|
132
111
|
}
|
package/releng/devkit.py
CHANGED
|
@@ -139,7 +139,7 @@ class CompilerApplication:
|
|
|
139
139
|
ingest_header(selinux_header, header_files, processed_header_files, devkit_header_lines)
|
|
140
140
|
devkit_header = u"".join(devkit_header_lines)
|
|
141
141
|
|
|
142
|
-
if package.startswith("frida-
|
|
142
|
+
if package.startswith("frida-gum"):
|
|
143
143
|
config = """#ifndef GUM_STATIC
|
|
144
144
|
# define GUM_STATIC
|
|
145
145
|
#endif
|
package/releng/env.py
CHANGED
|
@@ -282,6 +282,9 @@ def can_run_host_binaries(build_machine: MachineSpec,
|
|
|
282
282
|
|
|
283
283
|
def find_exe_wrapper(machine: MachineSpec,
|
|
284
284
|
environ: dict[str, str]) -> Optional[list[str]]:
|
|
285
|
+
if machine.arch == "arm64beilp32":
|
|
286
|
+
return None
|
|
287
|
+
|
|
285
288
|
qemu_sysroot = environ.get("FRIDA_QEMU_SYSROOT")
|
|
286
289
|
if qemu_sysroot is None:
|
|
287
290
|
return None
|
|
@@ -417,4 +420,5 @@ QEMU_ARCHS = {
|
|
|
417
420
|
"armhf": "arm",
|
|
418
421
|
"armbe8": "armeb",
|
|
419
422
|
"arm64": "aarch64",
|
|
423
|
+
"arm64be": "aarch64_be",
|
|
420
424
|
}
|
package/releng/env_android.py
CHANGED
package/releng/env_generic.py
CHANGED
|
@@ -214,11 +214,6 @@ def init_machine_config(machine: MachineSpec,
|
|
|
214
214
|
if linker_flavor == "gnu-gold":
|
|
215
215
|
linker_flags += ["-Wl,--icf=all"]
|
|
216
216
|
|
|
217
|
-
if machine.arch == "arm64be":
|
|
218
|
-
common_flags += ["-Wl,-dynamic-linker,/lib64/ld-linux-aarch64_be.so.1"]
|
|
219
|
-
elif machine.arch == "arm64beilp32":
|
|
220
|
-
common_flags += ["-Wl,-dynamic-linker,/libilp32/ld-linux-aarch64_be_ilp32.so.1"]
|
|
221
|
-
|
|
222
217
|
constants = config["constants"]
|
|
223
218
|
constants["common_flags"] = strv_to_meson(common_flags)
|
|
224
219
|
constants["c_like_flags"] = strv_to_meson(c_like_flags)
|
|
@@ -298,13 +293,15 @@ ARCH_COMMON_FLAGS_UNIX = {
|
|
|
298
293
|
],
|
|
299
294
|
"arm": [
|
|
300
295
|
"-march=armv5t",
|
|
296
|
+
"-mthumb",
|
|
301
297
|
],
|
|
302
298
|
"armbe8": [
|
|
303
|
-
"-
|
|
304
|
-
"-
|
|
299
|
+
"-mcpu=cortex-a72",
|
|
300
|
+
"-mthumb",
|
|
305
301
|
],
|
|
306
302
|
"armhf": [
|
|
307
303
|
"-march=armv7-a",
|
|
304
|
+
"-mthumb",
|
|
308
305
|
],
|
|
309
306
|
"arm64": [
|
|
310
307
|
"-march=armv8-a",
|
package/releng/machine_spec.py
CHANGED
|
@@ -57,16 +57,18 @@ class MachineSpec:
|
|
|
57
57
|
if arch[0] == "i":
|
|
58
58
|
arch = "x86"
|
|
59
59
|
elif arch == "arm":
|
|
60
|
-
if system
|
|
60
|
+
if system.endswith("eabihf"):
|
|
61
61
|
arch = "armhf"
|
|
62
62
|
elif os == "qnx" and system.endswith("eabi"):
|
|
63
63
|
arch = "armeabi"
|
|
64
|
+
elif arch == "armeb":
|
|
65
|
+
arch = "armbe8"
|
|
64
66
|
elif arch == "aarch64":
|
|
65
67
|
arch = "arm64"
|
|
66
68
|
elif arch == "aarch64_be":
|
|
67
69
|
arch = "arm64be"
|
|
68
|
-
|
|
69
|
-
arch
|
|
70
|
+
if system.endswith("_ilp32"):
|
|
71
|
+
arch += "ilp32"
|
|
70
72
|
|
|
71
73
|
if system.startswith("musl"):
|
|
72
74
|
config = "musl"
|
|
@@ -204,7 +206,7 @@ class MachineSpec:
|
|
|
204
206
|
arch = self.arch
|
|
205
207
|
if arch in {"x86_64", "s390x"}:
|
|
206
208
|
return 8
|
|
207
|
-
if arch.startswith("arm64") or arch.startswith("mips64"):
|
|
209
|
+
if (arch.startswith("arm64") and not arch.endswith("ilp32")) or arch.startswith("mips64"):
|
|
208
210
|
return 8
|
|
209
211
|
return 4
|
|
210
212
|
|
|
@@ -273,16 +275,16 @@ CPU_FAMILIES = {
|
|
|
273
275
|
}
|
|
274
276
|
|
|
275
277
|
CPU_TYPES = {
|
|
276
|
-
"arm":
|
|
277
|
-
"armbe8":
|
|
278
|
-
"armhf":
|
|
279
|
-
"armeabi":
|
|
280
|
-
|
|
281
|
-
"arm64":
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"arm64e":
|
|
285
|
-
"arm64eoabi":
|
|
278
|
+
"arm": "armv7",
|
|
279
|
+
"armbe8": "armv6",
|
|
280
|
+
"armhf": "armv7hf",
|
|
281
|
+
"armeabi": "armv7eabi",
|
|
282
|
+
|
|
283
|
+
"arm64": "aarch64",
|
|
284
|
+
"arm64be": "aarch64",
|
|
285
|
+
"arm64beilp32": "aarch64",
|
|
286
|
+
"arm64e": "aarch64",
|
|
287
|
+
"arm64eoabi": "aarch64",
|
|
286
288
|
}
|
|
287
289
|
|
|
288
290
|
CPU_TYPES_PER_OS_OVERRIDES = {
|
|
@@ -317,4 +319,4 @@ BIG_ENDIAN_ARCHS = {
|
|
|
317
319
|
"s390x",
|
|
318
320
|
}
|
|
319
321
|
|
|
320
|
-
TARGET_TRIPLET_ARCH_PATTERN = re.compile(r"^(i.86|x86_64|arm\w*|aarch64(_be
|
|
322
|
+
TARGET_TRIPLET_ARCH_PATTERN = re.compile(r"^(i.86|x86_64|arm\w*|aarch64(_be)?|mips\w*|powerpc|s390x)$")
|