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/cancellable.cc
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
#include "cancellable.h"
|
|
2
|
-
|
|
3
|
-
#include "signals.h"
|
|
4
|
-
|
|
5
|
-
#define CANCELLABLE_DATA_TEMPLATE "cancellable:tpl"
|
|
6
|
-
|
|
7
|
-
using v8::DEFAULT;
|
|
8
|
-
using v8::External;
|
|
9
|
-
using v8::Function;
|
|
10
|
-
using v8::FunctionTemplate;
|
|
11
|
-
using v8::Isolate;
|
|
12
|
-
using v8::Local;
|
|
13
|
-
using v8::Object;
|
|
14
|
-
using v8::Persistent;
|
|
15
|
-
using v8::ReadOnly;
|
|
16
|
-
using v8::Value;
|
|
17
|
-
|
|
18
|
-
namespace frida {
|
|
19
|
-
|
|
20
|
-
Cancellable::Cancellable(GCancellable* handle, Runtime* runtime)
|
|
21
|
-
: GLibObject(handle, runtime) {
|
|
22
|
-
g_object_ref(handle_);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Cancellable::~Cancellable() {
|
|
26
|
-
g_object_unref(handle_);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
void Cancellable::Init(Local<Object> exports, Runtime* runtime) {
|
|
30
|
-
auto isolate = Isolate::GetCurrent();
|
|
31
|
-
|
|
32
|
-
auto name = Nan::New("Cancellable").ToLocalChecked();
|
|
33
|
-
auto tpl = CreateTemplate(name, Cancellable::New, runtime);
|
|
34
|
-
|
|
35
|
-
auto instance_tpl = tpl->InstanceTemplate();
|
|
36
|
-
auto data = Local<Value>();
|
|
37
|
-
Nan::SetAccessor(instance_tpl, Nan::New("isCancelled").ToLocalChecked(),
|
|
38
|
-
IsCancelled, 0, data, DEFAULT, ReadOnly);
|
|
39
|
-
|
|
40
|
-
Nan::SetPrototypeMethod(tpl, "throwIfCancelled", ThrowIfCancelled);
|
|
41
|
-
Nan::SetPrototypeMethod(tpl, "cancel", Cancel);
|
|
42
|
-
|
|
43
|
-
auto ctor = Nan::GetFunction(tpl).ToLocalChecked();
|
|
44
|
-
Nan::Set(exports, name, ctor);
|
|
45
|
-
runtime->SetDataPointer(CANCELLABLE_DATA_TEMPLATE,
|
|
46
|
-
new Persistent<FunctionTemplate>(isolate, tpl));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
GCancellable* Cancellable::TryParse(Local<Value> value, Runtime* runtime) {
|
|
50
|
-
if (!value->IsObject())
|
|
51
|
-
return NULL;
|
|
52
|
-
|
|
53
|
-
auto impl = Nan::Get(value.As<Object>(), Nan::New("impl").ToLocalChecked())
|
|
54
|
-
.ToLocalChecked();
|
|
55
|
-
if (!HasInstance(impl, runtime))
|
|
56
|
-
return NULL;
|
|
57
|
-
|
|
58
|
-
return ObjectWrap::Unwrap<Cancellable>(impl.As<Object>())
|
|
59
|
-
->GetHandle<GCancellable>();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
bool Cancellable::HasInstance(Local<Value> value, Runtime* runtime) {
|
|
63
|
-
auto tpl = Nan::New<FunctionTemplate>(
|
|
64
|
-
*static_cast<Persistent<FunctionTemplate>*>(
|
|
65
|
-
runtime->GetDataPointer(CANCELLABLE_DATA_TEMPLATE)));
|
|
66
|
-
return tpl->HasInstance(value);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
NAN_METHOD(Cancellable::New) {
|
|
70
|
-
if (!info.IsConstructCall()) {
|
|
71
|
-
Nan::ThrowError("Use the `new` keyword to create a new instance");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
auto runtime = GetRuntimeFromConstructorArgs(info);
|
|
76
|
-
|
|
77
|
-
auto handle = g_cancellable_new();
|
|
78
|
-
|
|
79
|
-
auto wrapper = new Cancellable(handle, runtime);
|
|
80
|
-
auto obj = info.This();
|
|
81
|
-
wrapper->Wrap(obj);
|
|
82
|
-
|
|
83
|
-
auto signals_obj = Signals::New(handle, runtime);
|
|
84
|
-
Nan::Set(obj, Nan::New("signals").ToLocalChecked(), signals_obj);
|
|
85
|
-
|
|
86
|
-
g_object_unref(handle);
|
|
87
|
-
|
|
88
|
-
info.GetReturnValue().Set(obj);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
NAN_PROPERTY_GETTER(Cancellable::IsCancelled) {
|
|
92
|
-
auto handle = ObjectWrap::Unwrap<Cancellable>(
|
|
93
|
-
info.Holder())->GetHandle<GCancellable>();
|
|
94
|
-
|
|
95
|
-
info.GetReturnValue().Set(
|
|
96
|
-
static_cast<bool>(g_cancellable_is_cancelled(handle)));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
NAN_METHOD(Cancellable::ThrowIfCancelled) {
|
|
100
|
-
auto handle = ObjectWrap::Unwrap<Cancellable>(
|
|
101
|
-
info.Holder())->GetHandle<GCancellable>();
|
|
102
|
-
|
|
103
|
-
GError* error = NULL;
|
|
104
|
-
if (g_cancellable_set_error_if_cancelled(handle, &error)) {
|
|
105
|
-
Nan::ThrowError(Nan::Error(error->message));
|
|
106
|
-
g_error_free(error);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
NAN_METHOD(Cancellable::Cancel) {
|
|
111
|
-
auto handle = ObjectWrap::Unwrap<Cancellable>(
|
|
112
|
-
info.Holder())->GetHandle<GCancellable>();
|
|
113
|
-
|
|
114
|
-
g_cancellable_cancel(handle);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
}
|
package/src/cancellable.h
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#ifndef FRIDANODE_CANCELLABLE_H
|
|
2
|
-
#define FRIDANODE_CANCELLABLE_H
|
|
3
|
-
|
|
4
|
-
#include "glib_object.h"
|
|
5
|
-
|
|
6
|
-
#include <gio/gio.h>
|
|
7
|
-
|
|
8
|
-
namespace frida {
|
|
9
|
-
|
|
10
|
-
class Cancellable : public GLibObject {
|
|
11
|
-
public:
|
|
12
|
-
static void Init(v8::Local<v8::Object> exports, Runtime* runtime);
|
|
13
|
-
|
|
14
|
-
static GCancellable* TryParse(v8::Local<v8::Value> value, Runtime* runtime);
|
|
15
|
-
static bool HasInstance(v8::Local<v8::Value> value, Runtime* runtime);
|
|
16
|
-
|
|
17
|
-
private:
|
|
18
|
-
explicit Cancellable(GCancellable* handle, Runtime* runtime);
|
|
19
|
-
~Cancellable();
|
|
20
|
-
|
|
21
|
-
static NAN_METHOD(New);
|
|
22
|
-
|
|
23
|
-
static NAN_PROPERTY_GETTER(IsCancelled);
|
|
24
|
-
|
|
25
|
-
static NAN_METHOD(ThrowIfCancelled);
|
|
26
|
-
static NAN_METHOD(Cancel);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#endif
|
package/src/child.cc
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
#include "child.h"
|
|
2
|
-
|
|
3
|
-
#define CHILD_DATA_CONSTRUCTOR "child:ctor"
|
|
4
|
-
|
|
5
|
-
using v8::DEFAULT;
|
|
6
|
-
using v8::External;
|
|
7
|
-
using v8::Function;
|
|
8
|
-
using v8::Integer;
|
|
9
|
-
using v8::Isolate;
|
|
10
|
-
using v8::Local;
|
|
11
|
-
using v8::Object;
|
|
12
|
-
using v8::Persistent;
|
|
13
|
-
using v8::ReadOnly;
|
|
14
|
-
using v8::Value;
|
|
15
|
-
|
|
16
|
-
namespace frida {
|
|
17
|
-
|
|
18
|
-
Child::Child(FridaChild* handle, Runtime* runtime)
|
|
19
|
-
: GLibObject(handle, runtime) {
|
|
20
|
-
g_object_ref(handle_);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Child::~Child() {
|
|
24
|
-
g_object_unref(handle_);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
void Child::Init(Local<Object> exports, Runtime* runtime) {
|
|
28
|
-
auto isolate = Isolate::GetCurrent();
|
|
29
|
-
|
|
30
|
-
auto name = Nan::New("Child").ToLocalChecked();
|
|
31
|
-
auto tpl = CreateTemplate(name, Child::New, runtime);
|
|
32
|
-
|
|
33
|
-
auto instance_tpl = tpl->InstanceTemplate();
|
|
34
|
-
auto data = Local<Value>();
|
|
35
|
-
Nan::SetAccessor(instance_tpl, Nan::New("envp").ToLocalChecked(),
|
|
36
|
-
GetEnvp, 0, data, DEFAULT, ReadOnly);
|
|
37
|
-
Nan::SetAccessor(instance_tpl, Nan::New("argv").ToLocalChecked(),
|
|
38
|
-
GetArgv, 0, data, DEFAULT, ReadOnly);
|
|
39
|
-
Nan::SetAccessor(instance_tpl, Nan::New("path").ToLocalChecked(),
|
|
40
|
-
GetPath, 0, data, DEFAULT, ReadOnly);
|
|
41
|
-
Nan::SetAccessor(instance_tpl, Nan::New("identifier").ToLocalChecked(),
|
|
42
|
-
GetIdentifier, 0, data, DEFAULT, ReadOnly);
|
|
43
|
-
Nan::SetAccessor(instance_tpl, Nan::New("origin").ToLocalChecked(),
|
|
44
|
-
GetOrigin, 0, data, DEFAULT, ReadOnly);
|
|
45
|
-
Nan::SetAccessor(instance_tpl, Nan::New("parentPid").ToLocalChecked(),
|
|
46
|
-
GetParentPid, 0, data, DEFAULT, ReadOnly);
|
|
47
|
-
Nan::SetAccessor(instance_tpl, Nan::New("pid").ToLocalChecked(),
|
|
48
|
-
GetPid, 0, data, DEFAULT, ReadOnly);
|
|
49
|
-
|
|
50
|
-
auto ctor = Nan::GetFunction(tpl).ToLocalChecked();
|
|
51
|
-
Nan::Set(exports, name, ctor);
|
|
52
|
-
runtime->SetDataPointer(CHILD_DATA_CONSTRUCTOR,
|
|
53
|
-
new Persistent<Function>(isolate, ctor));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Local<Object> Child::New(gpointer handle, Runtime* runtime) {
|
|
57
|
-
auto ctor = Nan::New<Function>(
|
|
58
|
-
*static_cast<Persistent<Function>*>(
|
|
59
|
-
runtime->GetDataPointer(CHILD_DATA_CONSTRUCTOR)));
|
|
60
|
-
const int argc = 1;
|
|
61
|
-
Local<Value> argv[argc] = { Nan::New<External>(handle) };
|
|
62
|
-
return Nan::NewInstance(ctor, argc, argv).ToLocalChecked();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
NAN_METHOD(Child::New) {
|
|
66
|
-
if (!info.IsConstructCall()) {
|
|
67
|
-
Nan::ThrowError("Use the `new` keyword to create a new instance");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (info.Length() != 1 || !info[0]->IsExternal()) {
|
|
72
|
-
Nan::ThrowTypeError("Bad argument, expected raw handle");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
auto runtime = GetRuntimeFromConstructorArgs(info);
|
|
77
|
-
|
|
78
|
-
auto handle = static_cast<FridaChild*>(
|
|
79
|
-
Local<External>::Cast(info[0])->Value());
|
|
80
|
-
auto wrapper = new Child(handle, runtime);
|
|
81
|
-
auto obj = info.This();
|
|
82
|
-
wrapper->Wrap(obj);
|
|
83
|
-
|
|
84
|
-
info.GetReturnValue().Set(obj);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
NAN_PROPERTY_GETTER(Child::GetPid) {
|
|
88
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
89
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
90
|
-
|
|
91
|
-
info.GetReturnValue().Set(Nan::New<Integer>(frida_child_get_pid(handle)));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
NAN_PROPERTY_GETTER(Child::GetParentPid) {
|
|
95
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
96
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
97
|
-
|
|
98
|
-
info.GetReturnValue().Set(
|
|
99
|
-
Nan::New<Integer>(frida_child_get_parent_pid(handle)));
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
NAN_PROPERTY_GETTER(Child::GetOrigin) {
|
|
103
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
104
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
105
|
-
|
|
106
|
-
info.GetReturnValue().Set(Runtime::ValueFromEnum(
|
|
107
|
-
frida_child_get_origin(handle), FRIDA_TYPE_CHILD_ORIGIN));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
NAN_PROPERTY_GETTER(Child::GetIdentifier) {
|
|
111
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
112
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
113
|
-
|
|
114
|
-
auto identifier = frida_child_get_identifier(handle);
|
|
115
|
-
if (identifier != NULL)
|
|
116
|
-
info.GetReturnValue().Set(Nan::New(identifier).ToLocalChecked());
|
|
117
|
-
else
|
|
118
|
-
info.GetReturnValue().Set(Nan::Null());
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
NAN_PROPERTY_GETTER(Child::GetPath) {
|
|
122
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
123
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
124
|
-
|
|
125
|
-
auto path = frida_child_get_path(handle);
|
|
126
|
-
if (path != NULL)
|
|
127
|
-
info.GetReturnValue().Set(Nan::New(path).ToLocalChecked());
|
|
128
|
-
else
|
|
129
|
-
info.GetReturnValue().Set(Nan::Null());
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
NAN_PROPERTY_GETTER(Child::GetArgv) {
|
|
133
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
134
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
135
|
-
|
|
136
|
-
gint length;
|
|
137
|
-
auto argv = frida_child_get_argv(handle, &length);
|
|
138
|
-
info.GetReturnValue().Set(Runtime::ValueFromStrv(argv, length));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
NAN_PROPERTY_GETTER(Child::GetEnvp) {
|
|
142
|
-
auto handle = ObjectWrap::Unwrap<Child>(
|
|
143
|
-
info.Holder())->GetHandle<FridaChild>();
|
|
144
|
-
|
|
145
|
-
gint length;
|
|
146
|
-
auto envp = frida_child_get_envp(handle, &length);
|
|
147
|
-
info.GetReturnValue().Set(Runtime::ValueFromEnvp(envp, length));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
}
|
package/src/child.h
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#ifndef FRIDANODE_CHILD_H
|
|
2
|
-
#define FRIDANODE_CHILD_H
|
|
3
|
-
|
|
4
|
-
#include "glib_object.h"
|
|
5
|
-
|
|
6
|
-
#include <frida-core.h>
|
|
7
|
-
|
|
8
|
-
namespace frida {
|
|
9
|
-
|
|
10
|
-
class Child : public GLibObject {
|
|
11
|
-
public:
|
|
12
|
-
static void Init(v8::Local<v8::Object> exports, Runtime* runtime);
|
|
13
|
-
static v8::Local<v8::Object> New(gpointer handle, Runtime* runtime);
|
|
14
|
-
|
|
15
|
-
private:
|
|
16
|
-
explicit Child(FridaChild* handle, Runtime* runtime);
|
|
17
|
-
~Child();
|
|
18
|
-
|
|
19
|
-
static NAN_METHOD(New);
|
|
20
|
-
|
|
21
|
-
static NAN_PROPERTY_GETTER(GetPid);
|
|
22
|
-
static NAN_PROPERTY_GETTER(GetParentPid);
|
|
23
|
-
static NAN_PROPERTY_GETTER(GetOrigin);
|
|
24
|
-
static NAN_PROPERTY_GETTER(GetIdentifier);
|
|
25
|
-
static NAN_PROPERTY_GETTER(GetPath);
|
|
26
|
-
static NAN_PROPERTY_GETTER(GetArgv);
|
|
27
|
-
static NAN_PROPERTY_GETTER(GetEnvp);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
#endif
|
package/src/crash.cc
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
#include "crash.h"
|
|
2
|
-
|
|
3
|
-
#define CRASH_DATA_CONSTRUCTOR "crash:ctor"
|
|
4
|
-
|
|
5
|
-
using v8::DEFAULT;
|
|
6
|
-
using v8::External;
|
|
7
|
-
using v8::Function;
|
|
8
|
-
using v8::Integer;
|
|
9
|
-
using v8::Isolate;
|
|
10
|
-
using v8::Local;
|
|
11
|
-
using v8::Object;
|
|
12
|
-
using v8::Persistent;
|
|
13
|
-
using v8::ReadOnly;
|
|
14
|
-
using v8::Value;
|
|
15
|
-
|
|
16
|
-
namespace frida {
|
|
17
|
-
|
|
18
|
-
Crash::Crash(FridaCrash* handle, Runtime* runtime)
|
|
19
|
-
: GLibObject(handle, runtime) {
|
|
20
|
-
g_object_ref(handle_);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
Crash::~Crash() {
|
|
24
|
-
g_object_unref(handle_);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
void Crash::Init(Local<Object> exports, Runtime* runtime) {
|
|
28
|
-
auto isolate = Isolate::GetCurrent();
|
|
29
|
-
|
|
30
|
-
auto name = Nan::New("Crash").ToLocalChecked();
|
|
31
|
-
auto tpl = CreateTemplate(name, Crash::New, runtime);
|
|
32
|
-
|
|
33
|
-
auto instance_tpl = tpl->InstanceTemplate();
|
|
34
|
-
auto data = Local<Value>();
|
|
35
|
-
Nan::SetAccessor(instance_tpl, Nan::New("parameters").ToLocalChecked(),
|
|
36
|
-
GetParameters, 0, data, DEFAULT, ReadOnly);
|
|
37
|
-
Nan::SetAccessor(instance_tpl, Nan::New("report").ToLocalChecked(),
|
|
38
|
-
GetReport, 0, data, DEFAULT, ReadOnly);
|
|
39
|
-
Nan::SetAccessor(instance_tpl, Nan::New("summary").ToLocalChecked(),
|
|
40
|
-
GetSummary, 0, data, DEFAULT, ReadOnly);
|
|
41
|
-
Nan::SetAccessor(instance_tpl, Nan::New("processName").ToLocalChecked(),
|
|
42
|
-
GetProcessName, 0, data, DEFAULT, ReadOnly);
|
|
43
|
-
Nan::SetAccessor(instance_tpl, Nan::New("pid").ToLocalChecked(),
|
|
44
|
-
GetPid, 0, data, DEFAULT, ReadOnly);
|
|
45
|
-
|
|
46
|
-
auto ctor = Nan::GetFunction(tpl).ToLocalChecked();
|
|
47
|
-
Nan::Set(exports, name, ctor);
|
|
48
|
-
runtime->SetDataPointer(CRASH_DATA_CONSTRUCTOR,
|
|
49
|
-
new Persistent<Function>(isolate, ctor));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
Local<Object> Crash::New(gpointer handle, Runtime* runtime) {
|
|
53
|
-
auto ctor = Nan::New<Function>(
|
|
54
|
-
*static_cast<Persistent<Function>*>(
|
|
55
|
-
runtime->GetDataPointer(CRASH_DATA_CONSTRUCTOR)));
|
|
56
|
-
const int argc = 1;
|
|
57
|
-
Local<Value> argv[argc] = { Nan::New<External>(handle) };
|
|
58
|
-
return Nan::NewInstance(ctor, argc, argv).ToLocalChecked();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
NAN_METHOD(Crash::New) {
|
|
62
|
-
if (!info.IsConstructCall()) {
|
|
63
|
-
Nan::ThrowError("Use the `new` keyword to create a new instance");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (info.Length() != 1 || !info[0]->IsExternal()) {
|
|
68
|
-
Nan::ThrowTypeError("Bad argument, expected raw handle");
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
auto runtime = GetRuntimeFromConstructorArgs(info);
|
|
73
|
-
|
|
74
|
-
auto handle = static_cast<FridaCrash*>(
|
|
75
|
-
Local<External>::Cast(info[0])->Value());
|
|
76
|
-
auto wrapper = new Crash(handle, runtime);
|
|
77
|
-
auto obj = info.This();
|
|
78
|
-
wrapper->Wrap(obj);
|
|
79
|
-
|
|
80
|
-
info.GetReturnValue().Set(obj);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
NAN_PROPERTY_GETTER(Crash::GetPid) {
|
|
84
|
-
auto handle = ObjectWrap::Unwrap<Crash>(
|
|
85
|
-
info.Holder())->GetHandle<FridaCrash>();
|
|
86
|
-
|
|
87
|
-
info.GetReturnValue().Set(Nan::New<Integer>(frida_crash_get_pid(handle)));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
NAN_PROPERTY_GETTER(Crash::GetProcessName) {
|
|
91
|
-
auto handle = ObjectWrap::Unwrap<Crash>(
|
|
92
|
-
info.Holder())->GetHandle<FridaCrash>();
|
|
93
|
-
|
|
94
|
-
info.GetReturnValue().Set(
|
|
95
|
-
Nan::New(frida_crash_get_process_name(handle)).ToLocalChecked());
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
NAN_PROPERTY_GETTER(Crash::GetSummary) {
|
|
99
|
-
auto handle = ObjectWrap::Unwrap<Crash>(
|
|
100
|
-
info.Holder())->GetHandle<FridaCrash>();
|
|
101
|
-
|
|
102
|
-
info.GetReturnValue().Set(
|
|
103
|
-
Nan::New(frida_crash_get_summary(handle)).ToLocalChecked());
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
NAN_PROPERTY_GETTER(Crash::GetReport) {
|
|
107
|
-
auto handle = ObjectWrap::Unwrap<Crash>(
|
|
108
|
-
info.Holder())->GetHandle<FridaCrash>();
|
|
109
|
-
|
|
110
|
-
info.GetReturnValue().Set(
|
|
111
|
-
Nan::New(frida_crash_get_report(handle)).ToLocalChecked());
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
NAN_PROPERTY_GETTER(Crash::GetParameters) {
|
|
115
|
-
auto handle = ObjectWrap::Unwrap<Crash>(
|
|
116
|
-
info.Holder())->GetHandle<FridaCrash>();
|
|
117
|
-
|
|
118
|
-
GHashTable* parameters = frida_crash_get_parameters(handle);
|
|
119
|
-
info.GetReturnValue().Set(Runtime::ValueFromParametersDict(parameters));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|
package/src/crash.h
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#ifndef FRIDANODE_CRASH_H
|
|
2
|
-
#define FRIDANODE_CRASH_H
|
|
3
|
-
|
|
4
|
-
#include "glib_object.h"
|
|
5
|
-
|
|
6
|
-
#include <frida-core.h>
|
|
7
|
-
|
|
8
|
-
namespace frida {
|
|
9
|
-
|
|
10
|
-
class Crash : public GLibObject {
|
|
11
|
-
public:
|
|
12
|
-
static void Init(v8::Local<v8::Object> exports, Runtime* runtime);
|
|
13
|
-
static v8::Local<v8::Object> New(gpointer handle, Runtime* runtime);
|
|
14
|
-
|
|
15
|
-
private:
|
|
16
|
-
explicit Crash(FridaCrash* handle, Runtime* runtime);
|
|
17
|
-
~Crash();
|
|
18
|
-
|
|
19
|
-
static NAN_METHOD(New);
|
|
20
|
-
|
|
21
|
-
static NAN_PROPERTY_GETTER(GetPid);
|
|
22
|
-
static NAN_PROPERTY_GETTER(GetProcessName);
|
|
23
|
-
static NAN_PROPERTY_GETTER(GetSummary);
|
|
24
|
-
static NAN_PROPERTY_GETTER(GetReport);
|
|
25
|
-
static NAN_PROPERTY_GETTER(GetParameters);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
#endif
|