frida 17.15.4 → 17.16.0

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.
@@ -0,0 +1,40 @@
1
+ def to_snake_case(name: str) -> str:
2
+ result = []
3
+ i = 0
4
+ n = len(name)
5
+ while i < n:
6
+ if name[i].isupper():
7
+ if i > 0:
8
+ result.append("_")
9
+ start = i
10
+ if i + 1 < n and name[i + 1].islower():
11
+ while i + 1 < n and name[i + 1].islower():
12
+ i += 1
13
+ else:
14
+ while i + 1 < n and name[i + 1].isupper():
15
+ i += 1
16
+ if i + 1 < n:
17
+ i -= 1
18
+ result.append(name[start : i + 1].lower())
19
+ else:
20
+ result.append(name[i])
21
+ i += 1
22
+ return "".join(result)
23
+
24
+
25
+ def to_pascal_case(name: str) -> str:
26
+ return "".join(word.capitalize() for word in name.split("_"))
27
+
28
+
29
+ def to_camel_case(name: str) -> str:
30
+ words = name.split("_")
31
+ return words[0] + "".join(word.capitalize() for word in words[1:])
32
+
33
+
34
+ def to_macro_case(identifier: str) -> str:
35
+ result = []
36
+ for i, char in enumerate(identifier):
37
+ if char.isupper() and i != 0:
38
+ result.append("_")
39
+ result.append(char)
40
+ return "".join(result).upper()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida",
3
- "version": "17.15.4",
3
+ "version": "17.16.0",
4
4
  "authors": [
5
5
  "Frida Developers"
6
6
  ],
@@ -35,6 +35,7 @@
35
35
  "build/src/*.js",
36
36
  "configure",
37
37
  "configure.bat",
38
+ "frida-bindgen/frida_bindgen_core/",
38
39
  "make.bat",
39
40
  "meson.build",
40
41
  "meson.options",
package/releng/deps.toml CHANGED
@@ -1,5 +1,5 @@
1
1
  [dependencies]
2
- version = "20260611"
2
+ version = "20260717"
3
3
  bootstrap_version = "20250801"
4
4
 
5
5
  [ninja]
@@ -143,8 +143,18 @@ def init_machine_config(machine: MachineSpec,
143
143
  outenv["VSINSTALLDIR"] = str(vs_dir) + "\\"
144
144
  outenv["VCINSTALLDIR"] = str(vs_dir / "VC") + "\\"
145
145
  outenv["Platform"] = machine.msvc_platform
146
- outenv["INCLUDE"] = ";".join([str(path) for path in winenv.detect_msvs_include_path(toolchain_prefix)])
147
- outenv["LIB"] = ";".join([str(path) for path in winenv.detect_msvs_library_path(machine, toolchain_prefix)])
146
+ include_paths = winenv.detect_msvs_include_path(toolchain_prefix)
147
+ library_paths = winenv.detect_msvs_library_path(machine, toolchain_prefix)
148
+ # The flags scope the paths per-machine, which cross builds need as
149
+ # the build and host toolchains differ. The environment additionally
150
+ # reaches the build-machine compiler in a native build, whose native
151
+ # targets don't pick up the host machine's compiler flags.
152
+ for path in include_paths:
153
+ c_like_flags += [f"/I{path}"]
154
+ for path in library_paths:
155
+ linker_flags += [f"/LIBPATH:{path}"]
156
+ outenv["INCLUDE"] = ";".join([str(path) for path in include_paths])
157
+ outenv["LIB"] = ";".join([str(path) for path in library_paths])
148
158
  elif machine != build_machine \
149
159
  and "CC" not in environ \
150
160
  and "CFLAGS" not in environ \
@@ -113,13 +113,16 @@ class MachineSpec:
113
113
  def maybe_adapt_to_host(self, host_machine: MachineSpec) -> MachineSpec:
114
114
  if self.identifier == host_machine.identifier and host_machine.triplet is not None:
115
115
  return host_machine
116
- if self.os == "windows" and host_machine.os == "windows":
117
- if host_machine.arch in {"x86_64", "x86"}:
118
- return host_machine
119
- if self.arch == host_machine.arch:
120
- return host_machine
116
+ if self.os == "windows" and host_machine.os == "windows" and self.can_run(host_machine):
117
+ return host_machine
121
118
  return self
122
119
 
120
+ def can_run(self, other: MachineSpec) -> bool:
121
+ if self.arch == other.arch:
122
+ return True
123
+ intel = {"x86", "x86_64"}
124
+ return self.arch in intel and other.arch in intel
125
+
123
126
  @property
124
127
  def identifier(self) -> str:
125
128
  parts = [self.os, self.arch]
@@ -1,9 +1,10 @@
1
1
  from __future__ import annotations
2
2
 
3
- from collections import OrderedDict
4
3
  from pathlib import Path
5
4
 
6
- from .model import Customizations, Model, parse_gir
5
+ import frida_bindgen_core as core
6
+
7
+ from .model import FACTORY, Customizations, Model
7
8
 
8
9
  INCLUDED_GIO_OBJECT_TYPES = [
9
10
  "Cancellable",
@@ -31,30 +32,14 @@ def compute_model(
31
32
  gio_gir: Path,
32
33
  customizations: Customizations,
33
34
  ) -> Model:
34
- glib = parse_gir(glib_gir, [])
35
- gobject = parse_gir(gobject_gir, [glib])
36
- gio = parse_gir(gio_gir, [glib, gobject])
37
- frida = parse_gir(frida_gir, [glib, gobject, gio])
38
-
39
- object_types = OrderedDict(frida.object_types)
40
- object_types["Object"] = gobject.object_types["Object"]
41
- for t in INCLUDED_GIO_OBJECT_TYPES:
42
- object_types[t] = gio.object_types[t]
43
-
44
- enumerations = OrderedDict(frida.enumerations)
45
- for t in INCLUDED_GIO_ENUMERATIONS:
46
- enumerations[t] = gio.enumerations[t]
47
-
48
- model = Model(
49
- frida.namespace,
50
- object_types,
51
- enumerations,
35
+ return core.compute_model(
36
+ frida_gir,
37
+ glib_gir,
38
+ gobject_gir,
39
+ gio_gir,
52
40
  customizations,
41
+ FACTORY,
42
+ INCLUDED_GIO_OBJECT_TYPES,
43
+ INCLUDED_GIO_ENUMERATIONS,
44
+ seed_object_first=False,
53
45
  )
54
-
55
- for t in object_types.values():
56
- t.model = model
57
- for t in enumerations.values():
58
- t.model = model
59
-
60
- return model