@efffrida/il2cpp-bridge 0.0.15 → 0.0.17
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/package.json +7 -7
- package/src/Assembly.ts +37 -0
- package/src/Class.ts +101 -0
- package/src/index.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@efffrida/il2cpp-bridge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "effect-ts frida-il2cpp-bridge",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frida.re",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@effect/vitest": "0.27.0",
|
|
38
38
|
"@types/frida-gum": "19.0.1",
|
|
39
|
-
"@types/node": "
|
|
40
|
-
"effect": "3.19.
|
|
41
|
-
"vitest": "4.0.
|
|
42
|
-
"@efffrida/polyfills": "0.0.
|
|
43
|
-
"@efffrida/vitest-pool": "0.0.
|
|
39
|
+
"@types/node": "25.0.3",
|
|
40
|
+
"effect": "3.19.13",
|
|
41
|
+
"vitest": "4.0.16",
|
|
42
|
+
"@efffrida/polyfills": "0.0.2",
|
|
43
|
+
"@efffrida/vitest-pool": "0.0.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"effect": "3.19.
|
|
46
|
+
"effect": "3.19.13"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/src/Assembly.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Assembly
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import "frida-il2cpp-bridge";
|
|
7
|
+
|
|
8
|
+
import type * as Scope from "effect/Scope";
|
|
9
|
+
|
|
10
|
+
import * as Cause from "effect/Cause";
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @since 1.0.0
|
|
15
|
+
* @category Assembly
|
|
16
|
+
*/
|
|
17
|
+
export const assembly = (name: string): Effect.Effect<Il2Cpp.Assembly, never, never> =>
|
|
18
|
+
Effect.sync(() => Il2Cpp.domain.assembly(name));
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category Assembly
|
|
23
|
+
*/
|
|
24
|
+
export const tryAssembly = (name: string): Effect.Effect<Il2Cpp.Assembly, Cause.NoSuchElementException, never> =>
|
|
25
|
+
Effect.try({
|
|
26
|
+
try: () => Il2Cpp.domain.tryAssembly(name),
|
|
27
|
+
catch: () => new Cause.NoSuchElementException(`No assembly with name ${name}`),
|
|
28
|
+
}).pipe(Effect.flatMap(Effect.fromNullable));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
* @category Assembly
|
|
33
|
+
*/
|
|
34
|
+
export const attach: Effect.Effect<Il2Cpp.Thread, never, Scope.Scope> = Effect.acquireRelease(
|
|
35
|
+
Effect.sync(() => Il2Cpp.domain.attach()),
|
|
36
|
+
(thread) => Effect.sync(() => thread.detach())
|
|
37
|
+
);
|
package/src/Class.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Class
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import "frida-il2cpp-bridge";
|
|
7
|
+
|
|
8
|
+
import * as Cause from "effect/Cause";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category Class
|
|
14
|
+
*/
|
|
15
|
+
const class_ = (image: Il2Cpp.Image, name: string): Effect.Effect<Il2Cpp.Class, never, never> =>
|
|
16
|
+
Effect.sync(() => image.class(name));
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
/**
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
* @category Class
|
|
22
|
+
*/
|
|
23
|
+
class_ as class,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @since 1.0.0
|
|
28
|
+
* @category Class
|
|
29
|
+
*/
|
|
30
|
+
export const tryClass = (
|
|
31
|
+
image: Il2Cpp.Image,
|
|
32
|
+
name: string
|
|
33
|
+
): Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never> =>
|
|
34
|
+
Effect.try({
|
|
35
|
+
try: () => image.tryClass(name),
|
|
36
|
+
catch: () => new Cause.NoSuchElementException(`No class with name ${name}`),
|
|
37
|
+
}).pipe(Effect.flatMap(Effect.fromNullable));
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @since 1.0.0
|
|
41
|
+
* @category Class
|
|
42
|
+
*/
|
|
43
|
+
export const field = (klass: Il2Cpp.Class, name: string): Effect.Effect<Il2Cpp.Field, never, never> =>
|
|
44
|
+
Effect.sync(() => klass.field(name));
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @since 1.0.0
|
|
48
|
+
* @category Class
|
|
49
|
+
*/
|
|
50
|
+
export const tryField = (
|
|
51
|
+
klass: Il2Cpp.Class,
|
|
52
|
+
name: string
|
|
53
|
+
): Effect.Effect<Il2Cpp.Field, Cause.NoSuchElementException, never> =>
|
|
54
|
+
Effect.try({
|
|
55
|
+
try: () => klass.tryField(name),
|
|
56
|
+
catch: () => new Cause.NoSuchElementException(`No field with name ${name}`),
|
|
57
|
+
}).pipe(Effect.flatMap(Effect.fromNullable));
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
* @category Class
|
|
62
|
+
*/
|
|
63
|
+
export const method = (
|
|
64
|
+
klass: Il2Cpp.Class,
|
|
65
|
+
name: string,
|
|
66
|
+
parameterCount?: number | undefined
|
|
67
|
+
): Effect.Effect<Il2Cpp.Method, never, never> => Effect.sync(() => klass.method(name, parameterCount));
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
* @category Class
|
|
72
|
+
*/
|
|
73
|
+
export const tryMethod = (
|
|
74
|
+
klass: Il2Cpp.Class,
|
|
75
|
+
name: string,
|
|
76
|
+
parameterCount?: number | undefined
|
|
77
|
+
): Effect.Effect<Il2Cpp.Method, Cause.NoSuchElementException, never> =>
|
|
78
|
+
Effect.try({
|
|
79
|
+
try: () => klass.tryMethod(name, parameterCount),
|
|
80
|
+
catch: () => new Cause.NoSuchElementException(`No method with name ${name}`),
|
|
81
|
+
}).pipe(Effect.flatMap(Effect.fromNullable));
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @since 1.0.0
|
|
85
|
+
* @category Class
|
|
86
|
+
*/
|
|
87
|
+
export const nested = (klass: Il2Cpp.Class, name: string): Effect.Effect<Il2Cpp.Class, never, never> =>
|
|
88
|
+
Effect.sync(() => klass.nested(name));
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @since 1.0.0
|
|
92
|
+
* @category Class
|
|
93
|
+
*/
|
|
94
|
+
export const tryNested = (
|
|
95
|
+
klass: Il2Cpp.Class,
|
|
96
|
+
name: string
|
|
97
|
+
): Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never> =>
|
|
98
|
+
Effect.try({
|
|
99
|
+
try: () => klass.tryNested(name),
|
|
100
|
+
catch: () => new Cause.NoSuchElementException(`No nested class with name ${name}`),
|
|
101
|
+
}).pipe(Effect.flatMap(Effect.fromNullable));
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @since 1.0.0
|
|
7
|
+
* @category Assembly
|
|
8
|
+
*/
|
|
9
|
+
export * as Assembly from "./Assembly.ts"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category Class
|
|
14
|
+
*/
|
|
15
|
+
export * as Class from "./Class.ts"
|
|
16
|
+
|
|
5
17
|
/**
|
|
6
18
|
* FridaIl2cppBridge.ts
|
|
7
19
|
*
|