frida 16.7.14 → 16.7.15
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/README.md +1 -10
- package/build/BSDmakefile +6 -0
- package/build/Makefile +10 -0
- package/build/src/frida.d.ts +364 -0
- package/build/src/frida.js +962 -0
- package/build/src/frida_binding.d.ts +938 -0
- package/meson.build +34 -67
- package/package.json +30 -20
- package/scripts/fetch-abi-bits.py +15 -65
- package/scripts/install.js +5 -4
- package/src/addon.def +3 -0
- package/src/addon.symbols +2 -1
- package/src/addon.version +4 -0
- package/src/frida_bindgen/__init__.py +0 -0
- package/src/frida_bindgen/__main__.py +4 -0
- package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
- package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
- package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
- package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
- package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
- package/src/frida_bindgen/assets/codegen_types.h +57 -0
- package/src/frida_bindgen/assets/customization_facade.exports +13 -0
- package/src/frida_bindgen/assets/customization_facade.ts +157 -0
- package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
- package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
- package/src/frida_bindgen/cli.py +96 -0
- package/src/frida_bindgen/codegen.py +2233 -0
- package/src/frida_bindgen/customization.py +924 -0
- package/src/frida_bindgen/loader.py +60 -0
- package/src/frida_bindgen/model.py +1357 -0
- package/src/meson.build +92 -27
- package/{lib/build.py → src/tsc.py} +12 -12
- package/src/win_delay_load_hook.c +56 -0
- package/subprojects/frida-core.wrap +1 -1
- package/test/data/index.ts +2 -2
- package/test/device.ts +1 -2
- package/test/device_manager.ts +1 -2
- package/test/labrat.ts +2 -2
- package/test/script.ts +12 -12
- package/test/session.ts +3 -3
- package/tsconfig.json +6 -11
- package/dist/application.d.ts +0 -81
- package/dist/application.js +0 -2
- package/dist/authentication.d.ts +0 -3
- package/dist/authentication.js +0 -2
- package/dist/bus.d.ts +0 -16
- package/dist/bus.js +0 -23
- package/dist/cancellable.d.ts +0 -15
- package/dist/cancellable.js +0 -41
- package/dist/child.d.ts +0 -16
- package/dist/child.js +0 -9
- package/dist/crash.d.ts +0 -10
- package/dist/crash.js +0 -2
- package/dist/device.d.ts +0 -156
- package/dist/device.js +0 -188
- package/dist/device_manager.d.ts +0 -25
- package/dist/device_manager.js +0 -42
- package/dist/endpoint_parameters.d.ts +0 -26
- package/dist/endpoint_parameters.js +0 -24
- package/dist/icon.d.ts +0 -14
- package/dist/icon.js +0 -2
- package/dist/index.d.ts +0 -161
- package/dist/index.js +0 -170
- package/dist/iostream.d.ts +0 -13
- package/dist/iostream.js +0 -73
- package/dist/native.d.ts +0 -1
- package/dist/native.js +0 -11
- package/dist/portal_membership.d.ts +0 -6
- package/dist/portal_membership.js +0 -12
- package/dist/portal_service.d.ts +0 -48
- package/dist/portal_service.js +0 -52
- package/dist/process.d.ts +0 -47
- package/dist/process.js +0 -2
- package/dist/relay.d.ts +0 -22
- package/dist/relay.js +0 -32
- package/dist/script.d.ts +0 -70
- package/dist/script.js +0 -266
- package/dist/service.d.ts +0 -16
- package/dist/service.js +0 -26
- package/dist/session.d.ts +0 -45
- package/dist/session.js +0 -73
- package/dist/signals.d.ts +0 -20
- package/dist/signals.js +0 -40
- package/dist/socket_address.d.ts +0 -25
- package/dist/socket_address.js +0 -2
- package/dist/spawn.d.ts +0 -4
- package/dist/spawn.js +0 -2
- package/dist/system_parameters.d.ts +0 -84
- package/dist/system_parameters.js +0 -2
- package/lib/application.ts +0 -98
- package/lib/authentication.ts +0 -3
- package/lib/bus.ts +0 -30
- package/lib/cancellable.ts +0 -48
- package/lib/child.ts +0 -15
- package/lib/crash.ts +0 -11
- package/lib/device.ts +0 -331
- package/lib/device_manager.ts +0 -69
- package/lib/endpoint_parameters.ts +0 -56
- package/lib/icon.ts +0 -15
- package/lib/index.ts +0 -316
- package/lib/iostream.ts +0 -78
- package/lib/meson.build +0 -53
- package/lib/native.ts +0 -9
- package/lib/portal_membership.ts +0 -10
- package/lib/portal_service.ts +0 -105
- package/lib/process.ts +0 -57
- package/lib/relay.ts +0 -44
- package/lib/script.ts +0 -361
- package/lib/service.ts +0 -34
- package/lib/session.ts +0 -113
- package/lib/signals.ts +0 -45
- package/lib/socket_address.ts +0 -35
- package/lib/spawn.ts +0 -4
- package/lib/system_parameters.ts +0 -103
- package/meson.options +0 -11
- package/src/addon.cc +0 -78
- package/src/application.cc +0 -148
- package/src/application.h +0 -31
- package/src/authentication.cc +0 -174
- package/src/authentication.h +0 -24
- package/src/bus.cc +0 -167
- package/src/bus.h +0 -33
- package/src/cancellable.cc +0 -117
- package/src/cancellable.h +0 -31
- package/src/child.cc +0 -150
- package/src/child.h +0 -32
- package/src/crash.cc +0 -122
- package/src/crash.h +0 -30
- package/src/device.cc +0 -1350
- package/src/device.h +0 -56
- package/src/device_manager.cc +0 -362
- package/src/device_manager.h +0 -35
- package/src/endpoint_parameters.cc +0 -171
- package/src/endpoint_parameters.h +0 -28
- package/src/glib_context.cc +0 -62
- package/src/glib_context.h +0 -29
- package/src/glib_object.cc +0 -25
- package/src/glib_object.h +0 -37
- package/src/iostream.cc +0 -243
- package/src/iostream.h +0 -30
- package/src/operation.h +0 -94
- package/src/portal_membership.cc +0 -100
- package/src/portal_membership.h +0 -26
- package/src/portal_service.cc +0 -401
- package/src/portal_service.h +0 -40
- package/src/process.cc +0 -135
- package/src/process.h +0 -30
- package/src/relay.cc +0 -139
- package/src/relay.h +0 -31
- package/src/runtime.cc +0 -568
- package/src/runtime.h +0 -69
- package/src/script.cc +0 -301
- package/src/script.h +0 -36
- package/src/service.cc +0 -224
- package/src/service.h +0 -36
- package/src/session.cc +0 -860
- package/src/session.h +0 -42
- package/src/signals.cc +0 -334
- package/src/signals.h +0 -47
- package/src/spawn.cc +0 -95
- package/src/spawn.h +0 -27
- package/src/usage_monitor.h +0 -117
- package/src/uv_context.cc +0 -118
- package/src/uv_context.h +0 -40
- package/src/win_delay_load_hook.cc +0 -63
- package/subprojects/nan.wrap +0 -9
- package/subprojects/packagefiles/nan.patch +0 -13
package/meson.build
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
project('frida-node', '
|
|
1
|
+
project('frida-node', 'c',
|
|
2
2
|
version: run_command(find_program('python3'), files('scripts' / 'detect-version.py'),
|
|
3
3
|
capture: true,
|
|
4
4
|
check: true).stdout().strip(),
|
|
5
5
|
meson_version: '>=1.1.0',
|
|
6
6
|
)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
strip = (
|
|
8
|
+
cc = meson.get_compiler('c')
|
|
9
|
+
strip = (cc.get_argument_syntax() == 'msvc') ? '' : find_program('strip')
|
|
10
10
|
|
|
11
11
|
node = find_program('node')
|
|
12
12
|
npm = find_program('npm')
|
|
13
13
|
python = import('python').find_installation()
|
|
14
14
|
|
|
15
15
|
version = meson.project_version()
|
|
16
|
-
runtime = get_option('runtime')
|
|
17
|
-
target = get_option('target')
|
|
18
16
|
|
|
19
17
|
system = host_machine.system()
|
|
20
18
|
|
|
19
|
+
napi_version = 8
|
|
20
|
+
|
|
21
21
|
node_platforms = {
|
|
22
22
|
'windows': 'win32',
|
|
23
23
|
}
|
|
@@ -38,34 +38,17 @@ gyp_archs = {
|
|
|
38
38
|
cpu_family = host_machine.cpu_family()
|
|
39
39
|
gyp_arch = gyp_archs.get(cpu_family, cpu_family)
|
|
40
40
|
|
|
41
|
-
fs = import('fs')
|
|
42
|
-
if runtime == 'node-webkit'
|
|
43
|
-
host_binary = 'node'
|
|
44
|
-
if host_machine.system() == 'windows'
|
|
45
|
-
host_binary += '.dll'
|
|
46
|
-
endif
|
|
47
|
-
else
|
|
48
|
-
host_binary = 'node'
|
|
49
|
-
if host_machine.system() == 'windows'
|
|
50
|
-
host_binary += '.exe'
|
|
51
|
-
endif
|
|
52
|
-
endif
|
|
53
|
-
|
|
54
41
|
message('Fetching ABI bits')
|
|
55
42
|
metadata = run_command(python, files('scripts' / 'fetch-abi-bits.py'),
|
|
56
|
-
|
|
57
|
-
node, npm, meson.current_build_dir(),
|
|
43
|
+
gyp_os, gyp_arch, node, npm, meson.current_build_dir(),
|
|
58
44
|
capture: true,
|
|
59
45
|
check: true,
|
|
60
46
|
).stdout().strip().split('\n')
|
|
61
|
-
abi = 0
|
|
62
47
|
node_defines = []
|
|
63
48
|
node_incdirs = []
|
|
64
49
|
node_libs = []
|
|
65
50
|
foreach item : metadata
|
|
66
|
-
if item.startswith('
|
|
67
|
-
abi = item.substring(5)
|
|
68
|
-
elif item.startswith('node_defines: ')
|
|
51
|
+
if item.startswith('node_defines: ')
|
|
69
52
|
node_defines += item.substring(14).split(' ')
|
|
70
53
|
elif item.startswith('node_incdir: ')
|
|
71
54
|
node_incdirs += item.substring(13)
|
|
@@ -76,68 +59,69 @@ foreach item : metadata
|
|
|
76
59
|
endif
|
|
77
60
|
endforeach
|
|
78
61
|
|
|
79
|
-
|
|
62
|
+
extra_c_args = []
|
|
80
63
|
extra_link_args = []
|
|
81
64
|
extra_link_depends = []
|
|
82
65
|
|
|
83
66
|
foreach d : node_defines
|
|
84
|
-
|
|
67
|
+
extra_c_args += '-D' + d
|
|
85
68
|
endforeach
|
|
86
69
|
|
|
87
70
|
if host_machine.system() == 'windows'
|
|
88
|
-
|
|
89
|
-
'/Zc:__cplusplus',
|
|
90
|
-
'/Zc:inline',
|
|
91
|
-
'/Zc:threadSafeInit-',
|
|
71
|
+
extra_c_args += [
|
|
92
72
|
'/wd4244',
|
|
93
|
-
'/wd4251',
|
|
94
|
-
'/wd4275',
|
|
95
|
-
'/wd5051',
|
|
96
|
-
'-DNOMINMAX',
|
|
97
73
|
]
|
|
98
74
|
extra_link_args += [
|
|
99
|
-
'/DELAYLOAD:'
|
|
75
|
+
'/DELAYLOAD:node.exe',
|
|
100
76
|
'-lDelayImp',
|
|
101
77
|
]
|
|
102
78
|
endif
|
|
103
79
|
|
|
104
|
-
nan_dep = dependency('nan')
|
|
105
|
-
|
|
106
80
|
frida_core_dep = dependency('frida-core-1.0', default_options: [
|
|
107
81
|
f'frida_version=@version@',
|
|
108
82
|
'compiler_backend=disabled',
|
|
109
83
|
])
|
|
110
84
|
|
|
111
|
-
subdir('src')
|
|
112
|
-
|
|
113
85
|
pkg_install_dir = get_option('libdir') / 'node_modules' / 'frida'
|
|
114
86
|
|
|
87
|
+
package_json = custom_target('package.json',
|
|
88
|
+
input: 'package.json',
|
|
89
|
+
output: 'package.json',
|
|
90
|
+
command: [
|
|
91
|
+
python,
|
|
92
|
+
files('scripts' / 'adjust-version.py'),
|
|
93
|
+
version,
|
|
94
|
+
'@INPUT@',
|
|
95
|
+
'@OUTPUT@',
|
|
96
|
+
],
|
|
97
|
+
install: true,
|
|
98
|
+
install_dir: pkg_install_dir,
|
|
99
|
+
)
|
|
100
|
+
tsconfig_json = files('tsconfig.json')
|
|
101
|
+
|
|
102
|
+
subdir('src')
|
|
103
|
+
|
|
115
104
|
binding = shared_module('frida_binding', frida_binding_sources,
|
|
116
105
|
name_prefix: '',
|
|
117
106
|
name_suffix: 'node',
|
|
118
107
|
include_directories: include_directories(node_incdirs),
|
|
119
108
|
implicit_include_directories: false,
|
|
120
|
-
|
|
121
|
-
'cpp_std=c++17',
|
|
122
|
-
'cpp_eh=none',
|
|
123
|
-
'cpp_rtti=false',
|
|
124
|
-
],
|
|
125
|
-
cpp_args: [
|
|
109
|
+
c_args: [
|
|
126
110
|
'-DBUILDING_NODE_EXTENSION',
|
|
127
111
|
'-DNODE_GYP_MODULE_NAME=frida_binding',
|
|
128
|
-
f'-
|
|
129
|
-
|
|
130
|
-
] + extra_cpp_args,
|
|
112
|
+
f'-DNAPI_VERSION=@napi_version@',
|
|
113
|
+
] + extra_c_args,
|
|
131
114
|
link_args: node_libs + extra_link_args,
|
|
132
115
|
link_depends: extra_link_depends,
|
|
133
|
-
dependencies:
|
|
116
|
+
dependencies: frida_core_dep,
|
|
134
117
|
install: true,
|
|
135
118
|
install_dir: pkg_install_dir / 'build',
|
|
119
|
+
vs_module_defs: 'src' / 'addon.def',
|
|
136
120
|
)
|
|
137
121
|
|
|
138
122
|
custom_target('prebuild',
|
|
139
123
|
input: [binding],
|
|
140
|
-
output: [f'frida-v@version
|
|
124
|
+
output: [f'frida-v@version@-napi-v@napi_version@-@node_platform@-@gyp_arch@.tar.gz'],
|
|
141
125
|
command: [
|
|
142
126
|
python,
|
|
143
127
|
files('scripts' / 'package.py'),
|
|
@@ -147,20 +131,3 @@ custom_target('prebuild',
|
|
|
147
131
|
'@OUTPUT@',
|
|
148
132
|
],
|
|
149
133
|
)
|
|
150
|
-
|
|
151
|
-
package_json = custom_target('package.json',
|
|
152
|
-
input: 'package.json',
|
|
153
|
-
output: 'package.json',
|
|
154
|
-
command: [
|
|
155
|
-
python,
|
|
156
|
-
files('scripts' / 'adjust-version.py'),
|
|
157
|
-
version,
|
|
158
|
-
'@INPUT@',
|
|
159
|
-
'@OUTPUT@',
|
|
160
|
-
],
|
|
161
|
-
install: true,
|
|
162
|
-
install_dir: pkg_install_dir,
|
|
163
|
-
)
|
|
164
|
-
tsconfig_json = files('tsconfig.json')
|
|
165
|
-
|
|
166
|
-
subdir('lib')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frida",
|
|
3
|
-
"version": "16.7.
|
|
3
|
+
"version": "16.7.15",
|
|
4
4
|
"authors": [
|
|
5
5
|
"Frida Developers"
|
|
6
6
|
],
|
|
@@ -21,20 +21,24 @@
|
|
|
21
21
|
],
|
|
22
22
|
"homepage": "https://frida.re",
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=16
|
|
24
|
+
"node": ">=16"
|
|
25
25
|
},
|
|
26
|
-
"main": "
|
|
26
|
+
"main": "build/src/frida.js",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./build/src/frida.js"
|
|
29
|
+
},
|
|
30
|
+
"type": "module",
|
|
27
31
|
"files": [
|
|
28
32
|
"BSDmakefile",
|
|
29
33
|
"Makefile",
|
|
34
|
+
"build/src/*.d.ts",
|
|
35
|
+
"build/src/*.js",
|
|
30
36
|
"configure",
|
|
31
37
|
"configure.bat",
|
|
32
|
-
"dist/",
|
|
33
38
|
"make.bat",
|
|
34
39
|
"meson.build",
|
|
35
40
|
"meson.options",
|
|
36
41
|
"tsconfig.json",
|
|
37
|
-
"lib/",
|
|
38
42
|
"releng/*.py",
|
|
39
43
|
"releng/*.toml",
|
|
40
44
|
"releng/devkit-assets/",
|
|
@@ -51,30 +55,36 @@
|
|
|
51
55
|
],
|
|
52
56
|
"dependencies": {
|
|
53
57
|
"bindings": "^1.5.0",
|
|
54
|
-
"minimatch": "^
|
|
55
|
-
"
|
|
56
|
-
"prebuild-install": "^7.1.1"
|
|
58
|
+
"minimatch": "^10.0.1",
|
|
59
|
+
"prebuild-install": "^7.1.3"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
62
|
+
"@types/bindings": "^1.5.5",
|
|
63
|
+
"@types/chai": "^5.2.1",
|
|
64
|
+
"@types/mocha": "^10.0.10",
|
|
65
|
+
"@types/node": "^22.13.16",
|
|
66
|
+
"chai": "^5.2.0",
|
|
67
|
+
"mocha": "^11.1.0",
|
|
68
|
+
"ts-node": "^10.9.2",
|
|
69
|
+
"typescript": "^5.8.2"
|
|
66
70
|
},
|
|
67
71
|
"scripts": {
|
|
68
|
-
"prepare": "npm run build",
|
|
69
|
-
"build": "tsc",
|
|
70
|
-
"watch": "tsc -w",
|
|
71
72
|
"install": "node scripts/install.js",
|
|
72
|
-
"test": "node --expose-gc node_modules/mocha/bin/_mocha
|
|
73
|
+
"test": "node --loader ts-node/esm --expose-gc node_modules/mocha/bin/_mocha --extension ts test/*.ts",
|
|
74
|
+
"examples:build": "tsc -p tsconfig.examples.json",
|
|
75
|
+
"examples:watch": "tsc -p tsconfig.examples.json -w"
|
|
73
76
|
},
|
|
74
77
|
"binary": {
|
|
75
78
|
"host": "https://github.com",
|
|
76
79
|
"remote_path": "frida/frida/releases/download/{version}",
|
|
77
|
-
"module_path": "build"
|
|
80
|
+
"module_path": "build",
|
|
81
|
+
"napi_versions": [
|
|
82
|
+
8
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"config": {
|
|
86
|
+
"runtime": "napi",
|
|
87
|
+
"target": "8"
|
|
78
88
|
},
|
|
79
89
|
"license": "LGPL-2.0 WITH WxWindows-exception-3.1",
|
|
80
90
|
"repository": {
|
|
@@ -20,9 +20,9 @@ IMPORT_OBJECT_HDR_SIG2 = 0xffff
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def main(argv: list[str]):
|
|
23
|
-
|
|
24
|
-
flavor = "|".join(argv[1:
|
|
25
|
-
node, npm, outdir = [Path(p) for p in argv[
|
|
23
|
+
gyp_os, gyp_arch = argv[1:3]
|
|
24
|
+
flavor = "|".join(argv[1:3])
|
|
25
|
+
node, npm, outdir = [Path(p) for p in argv[3:6]]
|
|
26
26
|
|
|
27
27
|
abidir = outdir / "abi-bits"
|
|
28
28
|
metadata_file = abidir / "abi-bits.json"
|
|
@@ -37,24 +37,17 @@ def main(argv: list[str]):
|
|
|
37
37
|
if abidir.exists():
|
|
38
38
|
shutil.rmtree(abidir)
|
|
39
39
|
|
|
40
|
-
(node_incdirs, node_gypdir, node_libs) = load_dev_assets(
|
|
41
|
-
node, outdir, abidir)
|
|
40
|
+
(node_incdirs, node_gypdir, node_libs) = load_dev_assets(gyp_os, gyp_arch, node, outdir, abidir)
|
|
42
41
|
|
|
43
42
|
subprocess.run([npm, "init", "-y"],
|
|
44
43
|
capture_output=True,
|
|
45
44
|
cwd=abidir,
|
|
46
45
|
check=True)
|
|
47
|
-
subprocess.run([npm, "install", "node-
|
|
46
|
+
subprocess.run([npm, "install", "node-gyp"],
|
|
48
47
|
capture_output=True,
|
|
49
48
|
cwd=abidir,
|
|
50
49
|
check=True)
|
|
51
50
|
|
|
52
|
-
abi = subprocess.run([node, "-e", f"import('node-abi').then(abi => {{ console.log(abi.getAbi('{target}', '{runtime}')); }})"],
|
|
53
|
-
capture_output=True,
|
|
54
|
-
encoding="utf-8",
|
|
55
|
-
cwd=abidir,
|
|
56
|
-
check=True).stdout.strip()
|
|
57
|
-
|
|
58
51
|
node_defines = load_node_defines(gyp_os, gyp_arch, node_gypdir,
|
|
59
52
|
abidir / "node_modules" / "node-gyp" / "gyp" / "pylib")
|
|
60
53
|
|
|
@@ -63,7 +56,6 @@ def main(argv: list[str]):
|
|
|
63
56
|
|
|
64
57
|
metadata = {
|
|
65
58
|
"flavor": flavor,
|
|
66
|
-
"abi": abi,
|
|
67
59
|
"node_defines": node_defines,
|
|
68
60
|
"node_incdirs": [str(d) for d in node_incdirs_rel],
|
|
69
61
|
"node_libs": [str(l) for l in node_libs_rel],
|
|
@@ -74,7 +66,6 @@ def main(argv: list[str]):
|
|
|
74
66
|
|
|
75
67
|
|
|
76
68
|
def print_metadata(metadata: dict[str, Union[str, list[str]]]):
|
|
77
|
-
print("abi:", metadata["abi"])
|
|
78
69
|
print("node_defines:", " ".join(metadata["node_defines"]))
|
|
79
70
|
for d in metadata["node_incdirs"]:
|
|
80
71
|
print("node_incdir:", d)
|
|
@@ -82,45 +73,18 @@ def print_metadata(metadata: dict[str, Union[str, list[str]]]):
|
|
|
82
73
|
print("node_lib:", l)
|
|
83
74
|
|
|
84
75
|
|
|
85
|
-
def load_dev_assets(
|
|
86
|
-
target: str,
|
|
87
|
-
gyp_os: str,
|
|
76
|
+
def load_dev_assets(gyp_os: str,
|
|
88
77
|
gyp_arch: str,
|
|
89
78
|
node: Path,
|
|
90
79
|
outdir: Path,
|
|
91
80
|
abidir: Path) -> tuple[list[Path], Path, list[Path]]:
|
|
92
|
-
|
|
93
|
-
node_incroot = node.parent.parent / "include"
|
|
94
|
-
node_incdir = node_incroot / "node"
|
|
95
|
-
if node_incdir.exists():
|
|
96
|
-
abidir.mkdir()
|
|
97
|
-
node_gypdir = node_incdir
|
|
98
|
-
node_libs = []
|
|
99
|
-
return ([node_incdir, node_incroot], node_gypdir, node_libs)
|
|
100
|
-
|
|
101
|
-
if target == "":
|
|
102
|
-
version = subprocess.run([node, "--version"], capture_output=True, encoding="utf-8").stdout.strip()
|
|
103
|
-
else:
|
|
104
|
-
version = f"v{target}"
|
|
105
|
-
|
|
81
|
+
version = f"v24.0.0"
|
|
106
82
|
node_arch = "x86" if gyp_arch == "ia32" else gyp_arch
|
|
107
83
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
compression_formats = ["xz", "gz"]
|
|
113
|
-
elif runtime == "electron":
|
|
114
|
-
base_url = f"https://electronjs.org/headers/{version}"
|
|
115
|
-
headers_stem = f"node-{version}-headers"
|
|
116
|
-
libs_subpath = f"/win-{node_arch}"
|
|
117
|
-
compression_formats = ["gz"]
|
|
118
|
-
else:
|
|
119
|
-
assert runtime == "node-webkit"
|
|
120
|
-
base_url = f"https://node-webkit.s3.amazonaws.com/{version}"
|
|
121
|
-
headers_stem = f"nw-headers-{version}"
|
|
122
|
-
libs_subpath = "" if node_arch == "x86" else f"/{node_arch}"
|
|
123
|
-
compression_formats = ["gz"]
|
|
84
|
+
base_url = f"https://nodejs.org/dist/{version}"
|
|
85
|
+
headers_stem = f"node-{version}-headers"
|
|
86
|
+
libs_subpath = f"/win-{node_arch}"
|
|
87
|
+
compression_formats = ["xz", "gz"]
|
|
124
88
|
|
|
125
89
|
download_error = None
|
|
126
90
|
for compression in compression_formats:
|
|
@@ -158,25 +122,11 @@ def load_dev_assets(runtime: str,
|
|
|
158
122
|
node_lib.write_bytes(redacted_lib.getvalue())
|
|
159
123
|
node_libnames.append(node_lib.name)
|
|
160
124
|
|
|
161
|
-
if runtime == "node-webkit":
|
|
162
|
-
nw_lib = libdir / "nw.lib"
|
|
163
|
-
with urllib.request.urlopen(f"{base_url}{libs_subpath}/nw.lib") as response:
|
|
164
|
-
nw_lib.write_bytes(response.read())
|
|
165
|
-
node_libnames.append(nw_lib.name)
|
|
166
|
-
|
|
167
125
|
os.rename(extracted_rootdir, abidir)
|
|
168
126
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
abidir / "deps" / "uv" / "include",
|
|
173
|
-
abidir / "deps" / "v8" / "include",
|
|
174
|
-
]
|
|
175
|
-
node_gypdir = abidir
|
|
176
|
-
else:
|
|
177
|
-
incdir = abidir / "include" / "node"
|
|
178
|
-
node_incdirs = [incdir]
|
|
179
|
-
node_gypdir = incdir
|
|
127
|
+
incdir = abidir / "include" / "node"
|
|
128
|
+
node_incdirs = [incdir]
|
|
129
|
+
node_gypdir = incdir
|
|
180
130
|
|
|
181
131
|
node_libs = [abidir / "lib" / name for name in node_libnames]
|
|
182
132
|
|
|
@@ -194,7 +144,7 @@ def load_node_defines(gyp_os: str, gyp_arch: str, node_gypdir: Path, gyp_pylib:
|
|
|
194
144
|
"target_name": "frida_binding",
|
|
195
145
|
"type": "loadable_module",
|
|
196
146
|
"sources": [
|
|
197
|
-
"src/
|
|
147
|
+
"src/frida_binding.c",
|
|
198
148
|
],
|
|
199
149
|
},
|
|
200
150
|
],
|
package/scripts/install.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
|
|
5
|
-
const pkgRoot = path.dirname(path.dirname(
|
|
6
|
+
const pkgRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
6
7
|
const binding = path.join(pkgRoot, 'build', 'frida_binding.node');
|
|
7
8
|
if (fs.existsSync(binding)) {
|
|
8
9
|
process.exit(0);
|
package/src/addon.def
ADDED
package/src/addon.symbols
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
_node_api_module_get_api_version_v1
|
|
2
|
+
_napi_register_module_v1
|
package/src/addon.version
CHANGED
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|