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/src/meson.build
CHANGED
|
@@ -1,33 +1,98 @@
|
|
|
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
|
-
|
|
1
|
+
if frida_core_dep.type_name() == 'internal'
|
|
2
|
+
frida_core_subprj = subproject('frida-core')
|
|
3
|
+
frida_gir = frida_core_subprj.get_variable('core_public_gir')
|
|
4
|
+
glib_gir = frida_core_subprj.get_variable('glib_gir')
|
|
5
|
+
gobject_gir = frida_core_subprj.get_variable('gobject_gir')
|
|
6
|
+
gio_gir = frida_core_subprj.get_variable('gio_gir')
|
|
7
|
+
else
|
|
8
|
+
girdir = frida_core_dep.get_variable('frida_girdir')
|
|
9
|
+
frida_gir = girdir / 'Frida-1.0.gir'
|
|
10
|
+
glib_gir = girdir / 'GLib-2.0.gir'
|
|
11
|
+
gobject_gir = girdir / 'GObject-2.0.gir'
|
|
12
|
+
gio_gir = girdir / 'Gio-2.0.gir'
|
|
13
|
+
endif
|
|
14
|
+
|
|
15
|
+
env = environment()
|
|
16
|
+
env.set('PYTHONPATH', meson.current_source_dir())
|
|
17
|
+
|
|
18
|
+
code = custom_target('binding-code',
|
|
19
|
+
output: [
|
|
20
|
+
'frida.ts',
|
|
21
|
+
'frida_binding.d.ts',
|
|
22
|
+
'frida_binding.c',
|
|
23
|
+
],
|
|
24
|
+
input: [
|
|
25
|
+
frida_gir,
|
|
26
|
+
glib_gir,
|
|
27
|
+
gobject_gir,
|
|
28
|
+
gio_gir,
|
|
29
|
+
files(
|
|
30
|
+
'frida_bindgen' / '__init__.py',
|
|
31
|
+
'frida_bindgen' / '__main__.py',
|
|
32
|
+
'frida_bindgen' / 'cli.py',
|
|
33
|
+
'frida_bindgen' / 'codegen.py',
|
|
34
|
+
'frida_bindgen' / 'customization.py',
|
|
35
|
+
'frida_bindgen' / 'loader.py',
|
|
36
|
+
'frida_bindgen' / 'model.py',
|
|
37
|
+
'frida_bindgen' / 'assets' / 'codegen_helpers.c',
|
|
38
|
+
'frida_bindgen' / 'assets' / 'codegen_helpers.ts',
|
|
39
|
+
'frida_bindgen' / 'assets' / 'codegen_prototypes.h',
|
|
40
|
+
'frida_bindgen' / 'assets' / 'codegen_types.h',
|
|
41
|
+
'frida_bindgen' / 'assets' / 'customization_facade.exports',
|
|
42
|
+
'frida_bindgen' / 'assets' / 'customization_facade.ts',
|
|
43
|
+
'frida_bindgen' / 'assets' / 'customization_helpers.imports',
|
|
44
|
+
'frida_bindgen' / 'assets' / 'customization_helpers.ts',
|
|
45
|
+
)
|
|
46
|
+
],
|
|
47
|
+
command: [
|
|
48
|
+
python, '-m', 'frida_bindgen',
|
|
49
|
+
'--frida-gir=@INPUT0@',
|
|
50
|
+
'--glib-gir=@INPUT1@',
|
|
51
|
+
'--gobject-gir=@INPUT2@',
|
|
52
|
+
'--gio-gir=@INPUT3@',
|
|
53
|
+
'--output-ts=@OUTPUT0@',
|
|
54
|
+
'--output-dts=@OUTPUT1@',
|
|
55
|
+
'--output-c=@OUTPUT2@',
|
|
56
|
+
],
|
|
57
|
+
env: env,
|
|
58
|
+
install: true,
|
|
59
|
+
install_dir: [
|
|
60
|
+
false,
|
|
61
|
+
pkg_install_dir / 'build' / 'src',
|
|
62
|
+
false,
|
|
63
|
+
],
|
|
27
64
|
)
|
|
28
65
|
|
|
66
|
+
custom_target('js',
|
|
67
|
+
input: [
|
|
68
|
+
code[0],
|
|
69
|
+
code[1],
|
|
70
|
+
],
|
|
71
|
+
output: [
|
|
72
|
+
'frida.js',
|
|
73
|
+
'frida.d.ts',
|
|
74
|
+
],
|
|
75
|
+
command: [
|
|
76
|
+
python,
|
|
77
|
+
files('tsc.py'),
|
|
78
|
+
'@OUTDIR@',
|
|
79
|
+
'@PRIVATE_DIR@',
|
|
80
|
+
npm,
|
|
81
|
+
package_json,
|
|
82
|
+
tsconfig_json,
|
|
83
|
+
'@INPUT@',
|
|
84
|
+
],
|
|
85
|
+
install: true,
|
|
86
|
+
install_dir: pkg_install_dir / 'build' / 'src',
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
frida_binding_sources = [
|
|
90
|
+
code[2],
|
|
91
|
+
files('win_delay_load_hook.c'),
|
|
92
|
+
]
|
|
93
|
+
|
|
29
94
|
if system == 'windows'
|
|
30
|
-
if
|
|
95
|
+
if cc.get_argument_syntax() != 'msvc'
|
|
31
96
|
symfile = 'addon.symbols'
|
|
32
97
|
extra_link_args += '-Wl,--retain-symbols-file,' + meson.current_source_dir() / symfile
|
|
33
98
|
extra_link_depends += files(symfile)
|
|
@@ -12,16 +12,16 @@ def main(argv: list[str]):
|
|
|
12
12
|
for asset in [package_json, tsconfig]:
|
|
13
13
|
shutil.copy(asset, privdir)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
if
|
|
17
|
-
shutil.rmtree(
|
|
18
|
-
|
|
15
|
+
srcdir = privdir / "src"
|
|
16
|
+
if srcdir.exists():
|
|
17
|
+
shutil.rmtree(srcdir)
|
|
18
|
+
srcdir.mkdir()
|
|
19
19
|
for asset in sources:
|
|
20
|
-
shutil.copy(asset,
|
|
20
|
+
shutil.copy(asset, srcdir)
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
if
|
|
24
|
-
shutil.rmtree(
|
|
22
|
+
srcoutdir = privdir / "build" / "src"
|
|
23
|
+
if srcoutdir.exists():
|
|
24
|
+
shutil.rmtree(srcoutdir)
|
|
25
25
|
|
|
26
26
|
run_kwargs = {
|
|
27
27
|
"stdout": subprocess.PIPE,
|
|
@@ -32,13 +32,13 @@ def main(argv: list[str]):
|
|
|
32
32
|
subprocess.run([npm, "install", "--ignore-scripts"],
|
|
33
33
|
cwd=privdir,
|
|
34
34
|
**run_kwargs)
|
|
35
|
-
subprocess.run([npm, "
|
|
35
|
+
subprocess.run([npm, "exec", "tsc"],
|
|
36
36
|
cwd=privdir,
|
|
37
37
|
**run_kwargs)
|
|
38
38
|
|
|
39
|
-
for asset in sources:
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
for asset in (s for s in sources if not s.name.endswith(".d.ts")):
|
|
40
|
+
shutil.copy(srcoutdir / (asset.stem + ".js"), outdir)
|
|
41
|
+
shutil.copy(srcoutdir / (asset.stem + ".d.ts"), outdir)
|
|
42
42
|
except subprocess.CalledProcessError as e:
|
|
43
43
|
print(e, file=sys.stderr)
|
|
44
44
|
print("Output:\n\t| " + "\n\t| ".join(e.output.strip().split("\n")), file=sys.stderr)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* When this file is linked to a DLL, it sets up a delay-load hook that
|
|
3
|
+
* intervenes when the DLL is trying to load the host executable
|
|
4
|
+
* dynamically. Instead of trying to locate the .exe file it'll just
|
|
5
|
+
* return a handle to the process image.
|
|
6
|
+
*
|
|
7
|
+
* This allows compiled addons to work when the host executable is renamed.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#ifdef _MSC_VER
|
|
11
|
+
|
|
12
|
+
#pragma managed(push, off)
|
|
13
|
+
|
|
14
|
+
#ifndef WIN32_LEAN_AND_MEAN
|
|
15
|
+
#define WIN32_LEAN_AND_MEAN
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#include <windows.h>
|
|
19
|
+
|
|
20
|
+
#include <delayimp.h>
|
|
21
|
+
#include <string.h>
|
|
22
|
+
|
|
23
|
+
static FARPROC WINAPI
|
|
24
|
+
load_exe_hook (unsigned int event,
|
|
25
|
+
DelayLoadInfo * info)
|
|
26
|
+
{
|
|
27
|
+
static HMODULE node_dll = NULL;
|
|
28
|
+
|
|
29
|
+
switch (event)
|
|
30
|
+
{
|
|
31
|
+
case dliNoteStartProcessing:
|
|
32
|
+
if (node_dll == NULL)
|
|
33
|
+
{
|
|
34
|
+
HMODULE m = GetModuleHandle (NULL);
|
|
35
|
+
if (GetProcAddress (m, "napi_define_class") != NULL)
|
|
36
|
+
node_dll = m;
|
|
37
|
+
else
|
|
38
|
+
node_dll = GetModuleHandle ("node.dll");
|
|
39
|
+
}
|
|
40
|
+
return NULL;
|
|
41
|
+
case dliNotePreLoadLibrary:
|
|
42
|
+
if (_stricmp (info->szDll, "node.exe") == 0)
|
|
43
|
+
return (FARPROC) node_dll;
|
|
44
|
+
return NULL;
|
|
45
|
+
case dliNotePreGetProcAddress:
|
|
46
|
+
return GetProcAddress (node_dll, info->dlp.szProcName);
|
|
47
|
+
default:
|
|
48
|
+
return NULL;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;
|
|
53
|
+
|
|
54
|
+
#pragma managed(pop)
|
|
55
|
+
|
|
56
|
+
#endif
|
package/test/data/index.ts
CHANGED
|
@@ -3,10 +3,10 @@ export function targetProgram() {
|
|
|
3
3
|
if (platform === "win32") {
|
|
4
4
|
return "C:\\Windows\\notepad.exe";
|
|
5
5
|
} else if (platform === "darwin") {
|
|
6
|
-
return
|
|
6
|
+
return new URL("./unixvictim-macos", import.meta.url).pathname;
|
|
7
7
|
} else if (platform === "linux" && ["ia32", "x64"].includes(process.arch)) {
|
|
8
8
|
const fridaArch = (process.arch === "x64") ? "x86_64" : "x86";
|
|
9
|
-
return
|
|
9
|
+
return new URL("./unixvictim-linux-" + fridaArch, import.meta.url).pathname;
|
|
10
10
|
} else {
|
|
11
11
|
return "/bin/cat";
|
|
12
12
|
}
|
package/test/device.ts
CHANGED
package/test/device_manager.ts
CHANGED
package/test/labrat.ts
CHANGED
package/test/script.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LabRat } from "./labrat";
|
|
1
|
+
import { LabRat } from "./labrat.js";
|
|
3
2
|
|
|
4
3
|
import { expect } from "chai";
|
|
4
|
+
import frida from "frida";
|
|
5
5
|
import "mocha";
|
|
6
6
|
|
|
7
7
|
declare function gc(): void;
|
|
@@ -56,10 +56,10 @@ describe("Script", function () {
|
|
|
56
56
|
try {
|
|
57
57
|
await agent.add(1, -2);
|
|
58
58
|
} catch (e) {
|
|
59
|
-
thrownException = e;
|
|
59
|
+
thrownException = e as Error;
|
|
60
60
|
}
|
|
61
61
|
expect(thrownException).to.not.be.equal(null);
|
|
62
|
-
expect(thrownException
|
|
62
|
+
expect(thrownException!.message).to.equal("no");
|
|
63
63
|
|
|
64
64
|
const buf = await agent.speak();
|
|
65
65
|
expect(buf.toJSON().data).to.deep.equal([0x59, 0x6f]);
|
|
@@ -88,10 +88,10 @@ describe("Script", function () {
|
|
|
88
88
|
try {
|
|
89
89
|
await script.exports.init();
|
|
90
90
|
} catch (e) {
|
|
91
|
-
thrownException = e;
|
|
91
|
+
thrownException = e as Error;
|
|
92
92
|
}
|
|
93
93
|
expect(thrownException).to.not.equal(null);
|
|
94
|
-
expect(thrownException
|
|
94
|
+
expect(thrownException!.message).to.equal("Script is destroyed");
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
it("should fail rpc request if script is unloaded mid-request", async () => {
|
|
@@ -110,10 +110,10 @@ describe("Script", function () {
|
|
|
110
110
|
try {
|
|
111
111
|
await script.exports.waitForever();
|
|
112
112
|
} catch (e) {
|
|
113
|
-
thrownException = e;
|
|
113
|
+
thrownException = e as Error;
|
|
114
114
|
}
|
|
115
115
|
expect(thrownException).to.not.equal(null);
|
|
116
|
-
expect(thrownException
|
|
116
|
+
expect(thrownException!.message).to.equal("Script is destroyed");
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
it("should fail rpc request if session gets detached mid-request", async () => {
|
|
@@ -132,10 +132,10 @@ describe("Script", function () {
|
|
|
132
132
|
try {
|
|
133
133
|
await script.exports.waitForever();
|
|
134
134
|
} catch (e) {
|
|
135
|
-
thrownException = e;
|
|
135
|
+
thrownException = e as Error;
|
|
136
136
|
}
|
|
137
137
|
expect(thrownException).to.not.equal(null);
|
|
138
|
-
expect(thrownException
|
|
138
|
+
expect(thrownException!.message).to.equal("Script is destroyed");
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
it("should fail rpc request if cancelled mid-request", async () => {
|
|
@@ -156,10 +156,10 @@ describe("Script", function () {
|
|
|
156
156
|
try {
|
|
157
157
|
await script.exports.waitForever(cancellable);
|
|
158
158
|
} catch (e) {
|
|
159
|
-
thrownException = e;
|
|
159
|
+
thrownException = e as Error;
|
|
160
160
|
}
|
|
161
161
|
expect(thrownException).to.not.equal(null);
|
|
162
|
-
expect(thrownException
|
|
162
|
+
expect(thrownException!.message).to.equal("Operation was cancelled");
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
it("should support returning rpc exports object from async method", async () => {
|
package/test/session.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { LabRat } from "./labrat";
|
|
1
|
+
import { LabRat } from "./labrat.js";
|
|
3
2
|
|
|
4
3
|
import { expect } from "chai";
|
|
4
|
+
import frida from "frida";
|
|
5
5
|
import "mocha";
|
|
6
6
|
|
|
7
7
|
declare function gc(): void;
|
|
@@ -32,7 +32,7 @@ describe("Session", () => {
|
|
|
32
32
|
try {
|
|
33
33
|
await evaluteScript("Script.runtime", { runtime: frida.ScriptRuntime.V8 });
|
|
34
34
|
} catch (e) {
|
|
35
|
-
if (/V8 runtime not available due to build configuration/.test(e.message)) {
|
|
35
|
+
if (/V8 runtime not available due to build configuration/.test((e as Error).message)) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
throw e;
|
package/tsconfig.json
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"lib": ["
|
|
4
|
-
"target": "
|
|
5
|
-
"module": "
|
|
3
|
+
"lib": ["ES2022"],
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"module": "Node16",
|
|
6
6
|
"declaration": true,
|
|
7
|
-
"outDir": "./
|
|
8
|
-
"
|
|
9
|
-
"node_modules/@types"
|
|
10
|
-
],
|
|
11
|
-
"types": [
|
|
12
|
-
"node"
|
|
13
|
-
]
|
|
7
|
+
"outDir": "./build/src",
|
|
8
|
+
"strict": true
|
|
14
9
|
},
|
|
15
10
|
"include": [
|
|
16
|
-
"
|
|
11
|
+
"src/**/*.ts"
|
|
17
12
|
]
|
|
18
13
|
}
|
package/dist/application.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Icon } from "./icon";
|
|
2
|
-
import { SystemParameters } from "./system_parameters";
|
|
3
|
-
export interface Application {
|
|
4
|
-
identifier: string;
|
|
5
|
-
name: string;
|
|
6
|
-
pid: number;
|
|
7
|
-
parameters: ApplicationParameters;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Application parameters typically obtained through `enumerateApplications({ scope })`,
|
|
11
|
-
* where `scope` is either `Scope.Metadata` or `Scope.Full`. The default of `Scope.Minimal`
|
|
12
|
-
* means no parameters will be included.
|
|
13
|
-
*/
|
|
14
|
-
export interface ApplicationParameters {
|
|
15
|
-
/**
|
|
16
|
-
* Version. Exposes `CFBundleShortVersionString` on Apple OSes, `versionName` on Android.
|
|
17
|
-
*/
|
|
18
|
-
version?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Build stamp. Exposes `CFBundleVersion` on Apple OSes, `versionCode` on Android.
|
|
21
|
-
*/
|
|
22
|
-
build?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Filesystem path of application. On Apple OSes this is where the bundle is.
|
|
25
|
-
*/
|
|
26
|
-
path?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Apple storage container locations.
|
|
29
|
-
*/
|
|
30
|
-
containers?: {
|
|
31
|
-
/**
|
|
32
|
-
* Data container location.
|
|
33
|
-
*/
|
|
34
|
-
data?: string;
|
|
35
|
-
/**
|
|
36
|
-
* App group container locations.
|
|
37
|
-
*/
|
|
38
|
-
[name: string]: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Android source APKs. Exposes `publicSourceDir` followed by `splitPublicSourceDirs`.
|
|
42
|
-
*/
|
|
43
|
-
sources?: string[];
|
|
44
|
-
/**
|
|
45
|
-
* Android data directory location.
|
|
46
|
-
*/
|
|
47
|
-
dataDir?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Android target SDK.
|
|
50
|
-
*/
|
|
51
|
-
targetSdk?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Whether the application is debuggable. Applicable on e.g. iOS and Android.
|
|
54
|
-
*/
|
|
55
|
-
debuggable?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* If application is running, whether it is currently frontmost.
|
|
58
|
-
*/
|
|
59
|
-
frontmost?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* If application is running, name of user that it is running as.
|
|
62
|
-
*/
|
|
63
|
-
user?: string;
|
|
64
|
-
/**
|
|
65
|
-
* If application is running, PID of its parent process.
|
|
66
|
-
*/
|
|
67
|
-
ppid?: number;
|
|
68
|
-
/**
|
|
69
|
-
* If application is running, when it was started.
|
|
70
|
-
*/
|
|
71
|
-
started?: Date;
|
|
72
|
-
/**
|
|
73
|
-
* One or more icons. Only included when `scope` is set to `Scope.Full`.
|
|
74
|
-
*/
|
|
75
|
-
icons?: Icon[];
|
|
76
|
-
/**
|
|
77
|
-
* System parameters, available for applications accessed through a portal.
|
|
78
|
-
*/
|
|
79
|
-
system?: SystemParameters;
|
|
80
|
-
[name: string]: any;
|
|
81
|
-
}
|
package/dist/application.js
DELETED
package/dist/authentication.d.ts
DELETED
package/dist/authentication.js
DELETED
package/dist/bus.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { Cancellable } from "./cancellable";
|
|
4
|
-
import { Signal } from "./signals";
|
|
5
|
-
import { inspect } from "util";
|
|
6
|
-
export declare class Bus {
|
|
7
|
-
private impl;
|
|
8
|
-
detached: Signal<BusDetachedHandler>;
|
|
9
|
-
message: Signal<BusMessageHandler>;
|
|
10
|
-
constructor(impl: any);
|
|
11
|
-
attach(cancellable?: Cancellable): Promise<void>;
|
|
12
|
-
post(message: any, data?: Buffer | null): void;
|
|
13
|
-
[inspect.custom](depth: any, options: any): string;
|
|
14
|
-
}
|
|
15
|
-
export type BusDetachedHandler = () => void;
|
|
16
|
-
export type BusMessageHandler = (message: any, data: Buffer | null) => void;
|
package/dist/bus.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Bus = void 0;
|
|
4
|
-
const signals_1 = require("./signals");
|
|
5
|
-
const util_1 = require("util");
|
|
6
|
-
class Bus {
|
|
7
|
-
constructor(impl) {
|
|
8
|
-
this.impl = impl;
|
|
9
|
-
const signals = impl.signals;
|
|
10
|
-
this.detached = new signals_1.Signal(signals, "detached");
|
|
11
|
-
this.message = new signals_1.Signal(signals, "message");
|
|
12
|
-
}
|
|
13
|
-
attach(cancellable) {
|
|
14
|
-
return this.impl.attach(cancellable);
|
|
15
|
-
}
|
|
16
|
-
post(message, data = null) {
|
|
17
|
-
this.impl.post(message, data);
|
|
18
|
-
}
|
|
19
|
-
[util_1.inspect.custom](depth, options) {
|
|
20
|
-
return "Bus {}";
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.Bus = Bus;
|
package/dist/cancellable.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Signal } from "./signals";
|
|
3
|
-
import { inspect } from "util";
|
|
4
|
-
export declare class Cancellable {
|
|
5
|
-
private impl;
|
|
6
|
-
cancelled: Signal<CancelledHandler>;
|
|
7
|
-
constructor();
|
|
8
|
-
get isCancelled(): boolean;
|
|
9
|
-
throwIfCancelled(): void;
|
|
10
|
-
cancel(): void;
|
|
11
|
-
[inspect.custom](): string;
|
|
12
|
-
combine(other: Cancellable): Cancellable;
|
|
13
|
-
static withTimeout(ms: any): Cancellable;
|
|
14
|
-
}
|
|
15
|
-
export type CancelledHandler = () => void;
|
package/dist/cancellable.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Cancellable = void 0;
|
|
4
|
-
const native_1 = require("./native");
|
|
5
|
-
const signals_1 = require("./signals");
|
|
6
|
-
const util_1 = require("util");
|
|
7
|
-
class Cancellable {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.impl = new native_1.binding.Cancellable();
|
|
10
|
-
const { signals } = this.impl;
|
|
11
|
-
this.cancelled = new signals_1.Signal(signals, "cancelled");
|
|
12
|
-
}
|
|
13
|
-
get isCancelled() {
|
|
14
|
-
return this.impl.isCancelled;
|
|
15
|
-
}
|
|
16
|
-
throwIfCancelled() {
|
|
17
|
-
this.impl.throwIfCancelled();
|
|
18
|
-
}
|
|
19
|
-
cancel() {
|
|
20
|
-
return this.impl.cancel();
|
|
21
|
-
}
|
|
22
|
-
[util_1.inspect.custom]() {
|
|
23
|
-
return "Cancellable {}";
|
|
24
|
-
}
|
|
25
|
-
combine(other) {
|
|
26
|
-
const cancel = new Cancellable();
|
|
27
|
-
this.cancelled.connect(() => cancel.cancel());
|
|
28
|
-
other.cancelled.connect(() => cancel.cancel());
|
|
29
|
-
if (this.isCancelled)
|
|
30
|
-
cancel.cancel();
|
|
31
|
-
if (other.isCancelled)
|
|
32
|
-
cancel.cancel();
|
|
33
|
-
return cancel;
|
|
34
|
-
}
|
|
35
|
-
static withTimeout(ms) {
|
|
36
|
-
const cancel = new Cancellable();
|
|
37
|
-
setTimeout(() => cancel.cancel(), ms).unref();
|
|
38
|
-
return cancel;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.Cancellable = Cancellable;
|
package/dist/child.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Child {
|
|
2
|
-
pid: number;
|
|
3
|
-
parentPid: number;
|
|
4
|
-
origin: ChildOrigin;
|
|
5
|
-
identifier: string | null;
|
|
6
|
-
path: string | null;
|
|
7
|
-
argv: string[] | null;
|
|
8
|
-
envp: {
|
|
9
|
-
[name: string]: string;
|
|
10
|
-
} | null;
|
|
11
|
-
}
|
|
12
|
-
export declare enum ChildOrigin {
|
|
13
|
-
Fork = "fork",
|
|
14
|
-
Exec = "exec",
|
|
15
|
-
Spawn = "spawn"
|
|
16
|
-
}
|
package/dist/child.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChildOrigin = void 0;
|
|
4
|
-
var ChildOrigin;
|
|
5
|
-
(function (ChildOrigin) {
|
|
6
|
-
ChildOrigin["Fork"] = "fork";
|
|
7
|
-
ChildOrigin["Exec"] = "exec";
|
|
8
|
-
ChildOrigin["Spawn"] = "spawn";
|
|
9
|
-
})(ChildOrigin || (exports.ChildOrigin = ChildOrigin = {}));
|
package/dist/crash.d.ts
DELETED
package/dist/crash.js
DELETED