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/uv_context.cc
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
#include "uv_context.h"
|
|
2
|
-
|
|
3
|
-
#define UV_CONTEXT_LOCK() g_mutex_lock(&mutex_)
|
|
4
|
-
#define UV_CONTEXT_UNLOCK() g_mutex_unlock(&mutex_)
|
|
5
|
-
#define UV_CONTEXT_WAIT() g_cond_wait(&cond_, &mutex_)
|
|
6
|
-
#define UV_CONTEXT_SIGNAL() g_cond_signal(&cond_)
|
|
7
|
-
|
|
8
|
-
using v8::Context;
|
|
9
|
-
using v8::External;
|
|
10
|
-
using v8::Function;
|
|
11
|
-
using v8::FunctionCallbackInfo;
|
|
12
|
-
using v8::Isolate;
|
|
13
|
-
using v8::Local;
|
|
14
|
-
using v8::Object;
|
|
15
|
-
using v8::Value;
|
|
16
|
-
using Nan::HandleScope;
|
|
17
|
-
|
|
18
|
-
namespace frida {
|
|
19
|
-
|
|
20
|
-
UVContext::UVContext(uv_loop_t* loop)
|
|
21
|
-
: usage_count_(0), async_(new uv_async_t), async_resource_("frida"),
|
|
22
|
-
pending_(NULL) {
|
|
23
|
-
async_->data = this;
|
|
24
|
-
uv_async_init(loop, async_, ProcessPendingWrapper);
|
|
25
|
-
uv_unref(reinterpret_cast<uv_handle_t*>(async_));
|
|
26
|
-
|
|
27
|
-
g_mutex_init(&mutex_);
|
|
28
|
-
g_cond_init(&cond_);
|
|
29
|
-
|
|
30
|
-
auto isolate = Isolate::GetCurrent();
|
|
31
|
-
auto context = isolate->GetCurrentContext();
|
|
32
|
-
auto module = Nan::New<Object>();
|
|
33
|
-
auto process_pending = Function::New(context, ProcessPendingWrapper,
|
|
34
|
-
External::New(isolate, this)).ToLocalChecked();
|
|
35
|
-
auto process_pending_name = Nan::New("processPending").ToLocalChecked();
|
|
36
|
-
process_pending->SetName(process_pending_name);
|
|
37
|
-
Nan::Set(module, process_pending_name, process_pending);
|
|
38
|
-
module_.Reset(isolate, module);
|
|
39
|
-
process_pending_.Reset(isolate, process_pending);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
UVContext::~UVContext() {
|
|
43
|
-
process_pending_.Reset();
|
|
44
|
-
module_.Reset();
|
|
45
|
-
g_cond_clear(&cond_);
|
|
46
|
-
g_mutex_clear(&mutex_);
|
|
47
|
-
uv_close(reinterpret_cast<uv_handle_t*>(async_), DeleteAsyncHandle);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
void UVContext::DeleteAsyncHandle(uv_handle_t* handle) {
|
|
51
|
-
delete reinterpret_cast<uv_async_t*>(handle);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
void UVContext::IncreaseUsage() {
|
|
55
|
-
if (++usage_count_ == 1)
|
|
56
|
-
uv_ref(reinterpret_cast<uv_handle_t*>(async_));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
void UVContext::DecreaseUsage() {
|
|
60
|
-
if (usage_count_-- == 1)
|
|
61
|
-
uv_unref(reinterpret_cast<uv_handle_t*>(async_));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
void UVContext::Schedule(std::function<void ()> f) {
|
|
65
|
-
auto work = new std::function<void ()>(f);
|
|
66
|
-
UV_CONTEXT_LOCK();
|
|
67
|
-
pending_ = g_slist_append(pending_, work);
|
|
68
|
-
UV_CONTEXT_UNLOCK();
|
|
69
|
-
uv_async_send(async_);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
void UVContext::Perform(std::function<void ()> f) {
|
|
73
|
-
volatile bool finished = false;
|
|
74
|
-
|
|
75
|
-
Schedule([this, f, &finished]() {
|
|
76
|
-
f();
|
|
77
|
-
|
|
78
|
-
UV_CONTEXT_LOCK();
|
|
79
|
-
finished = true;
|
|
80
|
-
UV_CONTEXT_SIGNAL();
|
|
81
|
-
UV_CONTEXT_UNLOCK();
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
UV_CONTEXT_LOCK();
|
|
85
|
-
while (!finished)
|
|
86
|
-
UV_CONTEXT_WAIT();
|
|
87
|
-
UV_CONTEXT_UNLOCK();
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
void UVContext::ProcessPending() {
|
|
91
|
-
UV_CONTEXT_LOCK();
|
|
92
|
-
while (pending_ != NULL) {
|
|
93
|
-
auto work = static_cast<std::function<void ()>*>(pending_->data);
|
|
94
|
-
pending_ = g_slist_delete_link(pending_, pending_);
|
|
95
|
-
UV_CONTEXT_UNLOCK();
|
|
96
|
-
(*work)();
|
|
97
|
-
delete work;
|
|
98
|
-
UV_CONTEXT_LOCK();
|
|
99
|
-
}
|
|
100
|
-
UV_CONTEXT_UNLOCK();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
void UVContext::ProcessPendingWrapper(const FunctionCallbackInfo<Value>& info) {
|
|
104
|
-
UVContext* self = static_cast<UVContext*>(
|
|
105
|
-
info.Data().As<External>()->Value ());
|
|
106
|
-
self->ProcessPending();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
void UVContext::ProcessPendingWrapper(uv_async_t* handle) {
|
|
110
|
-
HandleScope scope;
|
|
111
|
-
|
|
112
|
-
auto self = static_cast<UVContext*>(handle->data);
|
|
113
|
-
auto module = Nan::New<Object>(self->module_);
|
|
114
|
-
auto process_pending = Nan::New<Function>(self->process_pending_);
|
|
115
|
-
self->async_resource_.runInAsyncScope(module, process_pending, 0, NULL);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}
|
package/src/uv_context.h
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#ifndef FRIDANODE_UV_CONTEXT_H
|
|
2
|
-
#define FRIDANODE_UV_CONTEXT_H
|
|
3
|
-
|
|
4
|
-
#include <glib.h>
|
|
5
|
-
#include <nan.h>
|
|
6
|
-
|
|
7
|
-
#include <functional>
|
|
8
|
-
|
|
9
|
-
namespace frida {
|
|
10
|
-
|
|
11
|
-
class UVContext {
|
|
12
|
-
public:
|
|
13
|
-
UVContext(uv_loop_t* handle);
|
|
14
|
-
~UVContext();
|
|
15
|
-
|
|
16
|
-
void IncreaseUsage();
|
|
17
|
-
void DecreaseUsage();
|
|
18
|
-
|
|
19
|
-
void Schedule(std::function<void ()> f);
|
|
20
|
-
void Perform(std::function<void ()> f);
|
|
21
|
-
|
|
22
|
-
private:
|
|
23
|
-
static void DeleteAsyncHandle(uv_handle_t* handle);
|
|
24
|
-
void ProcessPending();
|
|
25
|
-
static void ProcessPendingWrapper(const v8::FunctionCallbackInfo<v8::Value>& info);
|
|
26
|
-
static void ProcessPendingWrapper(uv_async_t* handle);
|
|
27
|
-
|
|
28
|
-
int usage_count_;
|
|
29
|
-
uv_async_t* async_;
|
|
30
|
-
Nan::AsyncResource async_resource_;
|
|
31
|
-
GMutex mutex_;
|
|
32
|
-
GCond cond_;
|
|
33
|
-
GSList* pending_;
|
|
34
|
-
v8::Persistent<v8::Object> module_;
|
|
35
|
-
v8::Persistent<v8::Function> process_pending_;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
#endif
|
|
@@ -1,63 +0,0 @@
|
|
|
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 load_exe_hook(unsigned int event, DelayLoadInfo* info) {
|
|
24
|
-
#ifdef FRIDA_NODE_WEBKIT
|
|
25
|
-
static HMODULE node_dll = NULL;
|
|
26
|
-
static HMODULE nw_dll = NULL;
|
|
27
|
-
|
|
28
|
-
switch (event) {
|
|
29
|
-
case dliStartProcessing:
|
|
30
|
-
node_dll = GetModuleHandle("node.dll");
|
|
31
|
-
nw_dll = GetModuleHandle("nw.dll");
|
|
32
|
-
return NULL;
|
|
33
|
-
case dliNotePreLoadLibrary:
|
|
34
|
-
if (_stricmp(info->szDll, "node.exe") == 0)
|
|
35
|
-
return (FARPROC) node_dll;
|
|
36
|
-
return NULL;
|
|
37
|
-
case dliNotePreGetProcAddress: {
|
|
38
|
-
FARPROC ret = GetProcAddress(node_dll, info->dlp.szProcName);
|
|
39
|
-
if (ret)
|
|
40
|
-
return ret;
|
|
41
|
-
return GetProcAddress(nw_dll, info->dlp.szProcName);
|
|
42
|
-
}
|
|
43
|
-
default:
|
|
44
|
-
return NULL;
|
|
45
|
-
}
|
|
46
|
-
#else
|
|
47
|
-
HMODULE m;
|
|
48
|
-
if (event != dliNotePreLoadLibrary)
|
|
49
|
-
return NULL;
|
|
50
|
-
|
|
51
|
-
if (_stricmp(info->szDll, HOST_BINARY) != 0)
|
|
52
|
-
return NULL;
|
|
53
|
-
|
|
54
|
-
m = GetModuleHandle(NULL);
|
|
55
|
-
return (FARPROC) m;
|
|
56
|
-
#endif
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook;
|
|
60
|
-
|
|
61
|
-
#pragma managed(pop)
|
|
62
|
-
|
|
63
|
-
#endif
|
package/subprojects/nan.wrap
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
diff -Nur nan-2.18.0-orig/meson.build nan-2.18.0/meson.build
|
|
2
|
-
--- nan-2.18.0-orig/meson.build 1970-01-01 01:00:00.000000000 +0100
|
|
3
|
-
+++ nan-2.18.0/meson.build 2024-02-27 10:43:03.643648729 +0100
|
|
4
|
-
@@ -0,0 +1,9 @@
|
|
5
|
-
+project('nan', 'cpp',
|
|
6
|
-
+ version: '2.18.0',
|
|
7
|
-
+)
|
|
8
|
-
+
|
|
9
|
-
+nan_dep = declare_dependency(
|
|
10
|
-
+ include_directories: include_directories('.'),
|
|
11
|
-
+)
|
|
12
|
-
+
|
|
13
|
-
+meson.override_dependency('nan', nan_dep)
|