frida 16.7.13 → 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.
Files changed (172) hide show
  1. package/README.md +1 -10
  2. package/build/BSDmakefile +6 -0
  3. package/build/Makefile +10 -0
  4. package/build/src/frida.d.ts +364 -0
  5. package/build/src/frida.js +962 -0
  6. package/build/src/frida_binding.d.ts +938 -0
  7. package/meson.build +34 -67
  8. package/package.json +30 -20
  9. package/scripts/fetch-abi-bits.py +15 -65
  10. package/scripts/install.js +5 -4
  11. package/src/addon.def +3 -0
  12. package/src/addon.symbols +2 -1
  13. package/src/addon.version +4 -0
  14. package/src/frida_bindgen/__init__.py +0 -0
  15. package/src/frida_bindgen/__main__.py +4 -0
  16. package/src/frida_bindgen/__pycache__/__init__.cpython-312.pyc +0 -0
  17. package/src/frida_bindgen/__pycache__/__main__.cpython-312.pyc +0 -0
  18. package/src/frida_bindgen/__pycache__/cli.cpython-312.pyc +0 -0
  19. package/src/frida_bindgen/__pycache__/codegen.cpython-312.pyc +0 -0
  20. package/src/frida_bindgen/__pycache__/customization.cpython-312.pyc +0 -0
  21. package/src/frida_bindgen/__pycache__/loader.cpython-312.pyc +0 -0
  22. package/src/frida_bindgen/__pycache__/model.cpython-312.pyc +0 -0
  23. package/src/frida_bindgen/assets/codegen_helpers.c +1970 -0
  24. package/src/frida_bindgen/assets/codegen_helpers.ts +100 -0
  25. package/src/frida_bindgen/assets/codegen_prototypes.h +78 -0
  26. package/src/frida_bindgen/assets/codegen_types.h +57 -0
  27. package/src/frida_bindgen/assets/customization_facade.exports +13 -0
  28. package/src/frida_bindgen/assets/customization_facade.ts +157 -0
  29. package/src/frida_bindgen/assets/customization_helpers.imports +2 -0
  30. package/src/frida_bindgen/assets/customization_helpers.ts +396 -0
  31. package/src/frida_bindgen/cli.py +96 -0
  32. package/src/frida_bindgen/codegen.py +2233 -0
  33. package/src/frida_bindgen/customization.py +924 -0
  34. package/src/frida_bindgen/loader.py +60 -0
  35. package/src/frida_bindgen/model.py +1357 -0
  36. package/src/meson.build +92 -27
  37. package/{lib/build.py → src/tsc.py} +12 -12
  38. package/src/win_delay_load_hook.c +56 -0
  39. package/subprojects/frida-core.wrap +1 -1
  40. package/test/data/index.ts +2 -2
  41. package/test/device.ts +1 -2
  42. package/test/device_manager.ts +1 -2
  43. package/test/labrat.ts +2 -2
  44. package/test/script.ts +12 -12
  45. package/test/session.ts +3 -3
  46. package/tsconfig.json +6 -11
  47. package/dist/application.d.ts +0 -81
  48. package/dist/application.js +0 -2
  49. package/dist/authentication.d.ts +0 -3
  50. package/dist/authentication.js +0 -2
  51. package/dist/bus.d.ts +0 -16
  52. package/dist/bus.js +0 -23
  53. package/dist/cancellable.d.ts +0 -15
  54. package/dist/cancellable.js +0 -41
  55. package/dist/child.d.ts +0 -16
  56. package/dist/child.js +0 -9
  57. package/dist/crash.d.ts +0 -10
  58. package/dist/crash.js +0 -2
  59. package/dist/device.d.ts +0 -156
  60. package/dist/device.js +0 -188
  61. package/dist/device_manager.d.ts +0 -25
  62. package/dist/device_manager.js +0 -42
  63. package/dist/endpoint_parameters.d.ts +0 -26
  64. package/dist/endpoint_parameters.js +0 -24
  65. package/dist/icon.d.ts +0 -14
  66. package/dist/icon.js +0 -2
  67. package/dist/index.d.ts +0 -161
  68. package/dist/index.js +0 -170
  69. package/dist/iostream.d.ts +0 -13
  70. package/dist/iostream.js +0 -73
  71. package/dist/native.d.ts +0 -1
  72. package/dist/native.js +0 -11
  73. package/dist/portal_membership.d.ts +0 -6
  74. package/dist/portal_membership.js +0 -12
  75. package/dist/portal_service.d.ts +0 -48
  76. package/dist/portal_service.js +0 -52
  77. package/dist/process.d.ts +0 -47
  78. package/dist/process.js +0 -2
  79. package/dist/relay.d.ts +0 -22
  80. package/dist/relay.js +0 -32
  81. package/dist/script.d.ts +0 -70
  82. package/dist/script.js +0 -266
  83. package/dist/service.d.ts +0 -16
  84. package/dist/service.js +0 -26
  85. package/dist/session.d.ts +0 -45
  86. package/dist/session.js +0 -73
  87. package/dist/signals.d.ts +0 -20
  88. package/dist/signals.js +0 -40
  89. package/dist/socket_address.d.ts +0 -25
  90. package/dist/socket_address.js +0 -2
  91. package/dist/spawn.d.ts +0 -4
  92. package/dist/spawn.js +0 -2
  93. package/dist/system_parameters.d.ts +0 -84
  94. package/dist/system_parameters.js +0 -2
  95. package/lib/application.ts +0 -98
  96. package/lib/authentication.ts +0 -3
  97. package/lib/bus.ts +0 -30
  98. package/lib/cancellable.ts +0 -48
  99. package/lib/child.ts +0 -15
  100. package/lib/crash.ts +0 -11
  101. package/lib/device.ts +0 -331
  102. package/lib/device_manager.ts +0 -69
  103. package/lib/endpoint_parameters.ts +0 -56
  104. package/lib/icon.ts +0 -15
  105. package/lib/index.ts +0 -316
  106. package/lib/iostream.ts +0 -78
  107. package/lib/meson.build +0 -53
  108. package/lib/native.ts +0 -9
  109. package/lib/portal_membership.ts +0 -10
  110. package/lib/portal_service.ts +0 -105
  111. package/lib/process.ts +0 -57
  112. package/lib/relay.ts +0 -44
  113. package/lib/script.ts +0 -361
  114. package/lib/service.ts +0 -34
  115. package/lib/session.ts +0 -113
  116. package/lib/signals.ts +0 -45
  117. package/lib/socket_address.ts +0 -35
  118. package/lib/spawn.ts +0 -4
  119. package/lib/system_parameters.ts +0 -103
  120. package/meson.options +0 -11
  121. package/src/addon.cc +0 -78
  122. package/src/application.cc +0 -148
  123. package/src/application.h +0 -31
  124. package/src/authentication.cc +0 -174
  125. package/src/authentication.h +0 -24
  126. package/src/bus.cc +0 -167
  127. package/src/bus.h +0 -33
  128. package/src/cancellable.cc +0 -117
  129. package/src/cancellable.h +0 -31
  130. package/src/child.cc +0 -150
  131. package/src/child.h +0 -32
  132. package/src/crash.cc +0 -122
  133. package/src/crash.h +0 -30
  134. package/src/device.cc +0 -1350
  135. package/src/device.h +0 -56
  136. package/src/device_manager.cc +0 -362
  137. package/src/device_manager.h +0 -35
  138. package/src/endpoint_parameters.cc +0 -171
  139. package/src/endpoint_parameters.h +0 -28
  140. package/src/glib_context.cc +0 -62
  141. package/src/glib_context.h +0 -29
  142. package/src/glib_object.cc +0 -25
  143. package/src/glib_object.h +0 -37
  144. package/src/iostream.cc +0 -243
  145. package/src/iostream.h +0 -30
  146. package/src/operation.h +0 -94
  147. package/src/portal_membership.cc +0 -100
  148. package/src/portal_membership.h +0 -26
  149. package/src/portal_service.cc +0 -401
  150. package/src/portal_service.h +0 -40
  151. package/src/process.cc +0 -135
  152. package/src/process.h +0 -30
  153. package/src/relay.cc +0 -139
  154. package/src/relay.h +0 -31
  155. package/src/runtime.cc +0 -568
  156. package/src/runtime.h +0 -69
  157. package/src/script.cc +0 -301
  158. package/src/script.h +0 -36
  159. package/src/service.cc +0 -224
  160. package/src/service.h +0 -36
  161. package/src/session.cc +0 -860
  162. package/src/session.h +0 -42
  163. package/src/signals.cc +0 -334
  164. package/src/signals.h +0 -47
  165. package/src/spawn.cc +0 -95
  166. package/src/spawn.h +0 -27
  167. package/src/usage_monitor.h +0 -117
  168. package/src/uv_context.cc +0 -118
  169. package/src/uv_context.h +0 -40
  170. package/src/win_delay_load_hook.cc +0 -63
  171. package/subprojects/nan.wrap +0 -9
  172. 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
@@ -1,9 +0,0 @@
1
- [wrap-git]
2
- url = https://github.com/nodejs/nan.git
3
- revision = 4d1d74e0a9ea8fa8091b88e45dc57e4c7eb9cdf7
4
- depth = 1
5
- diff_files = nan.patch
6
-
7
- [provide]
8
- dependency_names = nan
9
-
@@ -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)