You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+15-1
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ The feature once implemented will solve the following isuses:
10
10
11
11
## How it works
12
12
13
+
This PoC is based on a modified version of [PLTHook Library](https://github.com/metacall/plthook) from [@kubo](https://github.com/kubo).
14
+
13
15
First of all we have the following preconditions:
14
16
-`libmetacall` which loads `libnode_loader`.
15
17
-`libnode_loader` is not linked to anything but we are going to weakly link it to `libnode`, this means that in Windows it must be linked with `/DELAYLOAD`, in Linux and MacOS it must not be linked.
@@ -38,5 +40,17 @@ There are two possible cases, this happens before loading libnode_loader:
38
40
39
41
## Outcome
40
42
41
-
With this methodology we prevent loading a library that contains a runtime. This is very dangerous because numerous runtimes rely on constructors (C++ constructors of static class delacarations or C compiler dependant constructor mechanisms like GNU or Clang `__attribute__((destructor))`) that are mutually exclusive between them. So if we only load the library but we do not call method of the library, it can still cause errors.
43
+
With this methodology we prevent loading a library that contains a runtime. This is very dangerous because numerous runtimes rely on constructors (C++ constructors of static class delacarations or C compiler dependant constructor mechanisms like GNU or Clang `__attribute__((constructor))`) that are mutually exclusive between them. So if we only load the library but we do not call method of the library, it can still cause errors.
42
44
The loaders will be redirected to the proper runtime, reusing the functions and instance of the already running runtime.
45
+
46
+
## Features
47
+
48
+
- Works for Linux, Windows and MacOS with most of the architectures of each platform: https://github.com/metacall/plthook?tab=readme-ov-file#supported-platforms
49
+
- Hooks the functions and prevents runtime instances to be initialized, so it's fully transparent and has no side effects on the runtimes.
50
+
51
+
## Limitations
52
+
53
+
- Currently it does not support `-O3` on Linux with GCC compiler, neither `/O2` and `/Ob2`. Works in MacOS with `-O3` and Clang.
54
+
- It does not work well (https://github.com/kubo/plthook/issues/51) with `aarch64` architecture under Linux with the following flags:
0 commit comments