@efffrida/rpc 0.0.27 → 0.0.29
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/dist/frida/FridaRpcClient.d.ts +5 -29
- package/dist/frida/FridaRpcClient.d.ts.map +1 -1
- package/dist/frida/FridaRpcClient.js +48 -83
- package/dist/frida/FridaRpcClient.js.map +1 -1
- package/dist/frida/FridaRpcServer.d.ts +7 -7
- package/dist/frida/FridaRpcServer.d.ts.map +1 -1
- package/dist/frida/FridaRpcServer.js +37 -49
- package/dist/frida/FridaRpcServer.js.map +1 -1
- package/dist/node/FridaRpcClient.d.ts +6 -10
- package/dist/node/FridaRpcClient.d.ts.map +1 -1
- package/dist/node/FridaRpcClient.js +67 -46
- package/dist/node/FridaRpcClient.js.map +1 -1
- package/dist/node/FridaRpcServer.d.ts +10 -3
- package/dist/node/FridaRpcServer.d.ts.map +1 -1
- package/dist/node/FridaRpcServer.js +63 -64
- package/dist/node/FridaRpcServer.js.map +1 -1
- package/dist/shared/{constants.d.ts → Constants.d.ts} +7 -3
- package/dist/shared/Constants.d.ts.map +1 -0
- package/dist/shared/Constants.js +10 -0
- package/dist/shared/Constants.js.map +1 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +10 -0
- package/dist/shared/index.js.map +1 -0
- package/package.json +12 -20
- package/src/frida/FridaRpcClient.ts +65 -141
- package/src/frida/FridaRpcServer.ts +47 -54
- package/src/node/FridaRpcClient.ts +84 -71
- package/src/node/FridaRpcServer.ts +92 -80
- package/src/shared/Constants.ts +13 -0
- package/src/shared/index.ts +10 -0
- package/dist/shared/constants.d.ts.map +0 -1
- package/dist/shared/constants.js +0 -7
- package/dist/shared/constants.js.map +0 -1
- package/dist/shared/predicates.d.ts +0 -10
- package/dist/shared/predicates.d.ts.map +0 -1
- package/dist/shared/predicates.js +0 -12
- package/dist/shared/predicates.js.map +0 -1
- package/src/shared/constants.ts +0 -11
- package/src/shared/predicates.ts +0 -19
|
@@ -5,44 +5,20 @@
|
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
7
|
import "@efffrida/polyfills";
|
|
8
|
-
import type * as Duration from "effect/Duration";
|
|
9
8
|
import type * as Scope from "effect/Scope";
|
|
10
|
-
import * as
|
|
11
|
-
import * as RpcSerialization from "@effect/rpc/RpcSerialization";
|
|
9
|
+
import * as Crypto from "effect/Crypto";
|
|
12
10
|
import * as Effect from "effect/Effect";
|
|
13
11
|
import * as Layer from "effect/Layer";
|
|
12
|
+
import * as RpcClient from "effect/unstable/rpc/RpcClient";
|
|
13
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
14
14
|
/**
|
|
15
15
|
* @since 1.0.0
|
|
16
16
|
* @category Protocol
|
|
17
17
|
*/
|
|
18
|
-
export declare const makeProtocolFrida: (
|
|
19
|
-
readonly generateExportName?: (() => string) | undefined;
|
|
20
|
-
readonly receivingStreamShareOptions?: {
|
|
21
|
-
readonly capacity: "unbounded";
|
|
22
|
-
readonly replay?: number | undefined;
|
|
23
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
24
|
-
} | {
|
|
25
|
-
readonly capacity: number;
|
|
26
|
-
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
27
|
-
readonly replay?: number | undefined;
|
|
28
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
} | undefined) => Effect.Effect<RpcClient.Protocol["Type"], never, RpcSerialization.RpcSerialization | Scope.Scope>;
|
|
18
|
+
export declare const makeProtocolFrida: () => Effect.Effect<RpcClient.Protocol["Service"], never, Crypto.Crypto | RpcSerialization.RpcSerialization | Scope.Scope>;
|
|
31
19
|
/**
|
|
32
20
|
* @since 1.0.0
|
|
33
21
|
* @category Layers
|
|
34
22
|
*/
|
|
35
|
-
export declare const layerProtocolFrida:
|
|
36
|
-
readonly generateExportName?: (() => string) | undefined;
|
|
37
|
-
readonly receivingStreamShareOptions?: {
|
|
38
|
-
readonly capacity: "unbounded";
|
|
39
|
-
readonly replay?: number | undefined;
|
|
40
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
41
|
-
} | {
|
|
42
|
-
readonly capacity: number;
|
|
43
|
-
readonly strategy?: "sliding" | "dropping" | "suspend" | undefined;
|
|
44
|
-
readonly replay?: number | undefined;
|
|
45
|
-
readonly idleTimeToLive?: Duration.DurationInput | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
} | undefined) => Layer.Layer<RpcClient.Protocol, never, RpcSerialization.RpcSerialization>;
|
|
23
|
+
export declare const layerProtocolFrida: Layer.Layer<RpcClient.Protocol, never, Crypto.Crypto | RpcSerialization.RpcSerialization>;
|
|
48
24
|
//# sourceMappingURL=FridaRpcClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FridaRpcClient.d.ts","sourceRoot":"","sources":["../../src/frida/FridaRpcClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"FridaRpcClient.d.ts","sourceRoot":"","sources":["../../src/frida/FridaRpcClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,gBAAgB,MAAM,sCAAsC,CAAC;AAIzE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAAM,CAAC,MAAM,CAC9C,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC7B,KAAK,EACL,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,KAAK,CAiE9D,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CACxC,SAAS,CAAC,QAAQ,EAClB,KAAK,EACL,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CACI,CAAC"}
|
|
@@ -5,112 +5,77 @@
|
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
7
|
import "@efffrida/polyfills";
|
|
8
|
-
import * as
|
|
9
|
-
import * as RpcSerialization from "@effect/rpc/RpcSerialization";
|
|
10
|
-
import * as FridaStream from "@efffrida/platform/Stream";
|
|
11
|
-
import * as Cause from "effect/Cause";
|
|
12
|
-
import * as Deferred from "effect/Deferred";
|
|
8
|
+
import * as Crypto from "effect/Crypto";
|
|
13
9
|
import * as Effect from "effect/Effect";
|
|
14
10
|
import * as Function from "effect/Function";
|
|
15
11
|
import * as Layer from "effect/Layer";
|
|
16
|
-
import * as
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import * as Stream from "effect/Stream";
|
|
21
|
-
import * as constants from "../shared/constants.js";
|
|
22
|
-
import * as sharedPredicates from "../shared/predicates.js";
|
|
12
|
+
import * as RpcClient from "effect/unstable/rpc/RpcClient";
|
|
13
|
+
import * as RpcClientError from "effect/unstable/rpc/RpcClientError";
|
|
14
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
15
|
+
import * as constants from "../shared/Constants.js";
|
|
23
16
|
/**
|
|
24
17
|
* @since 1.0.0
|
|
25
18
|
* @category Protocol
|
|
26
19
|
*/
|
|
27
|
-
export const makeProtocolFrida =
|
|
20
|
+
export const makeProtocolFrida = () => RpcClient.Protocol.make(Effect.fnUntraced(function* (writeResponse, clientIds) {
|
|
28
21
|
const serialization = yield* RpcSerialization.RpcSerialization;
|
|
22
|
+
const crypto = yield* Crypto.Crypto;
|
|
29
23
|
const encoder = new TextEncoder();
|
|
30
|
-
const parser = serialization.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* use a client id to identify ourselves, this deferred will
|
|
34
|
-
* complete.
|
|
35
|
-
*/
|
|
36
|
-
const clientIdDeferred = yield* Deferred.make();
|
|
37
|
-
/**
|
|
38
|
-
* Setup the receiving handler for the client id. We receive the
|
|
39
|
-
* client id over a script export instead of over the receiving
|
|
40
|
-
* stream since there could be multiple clients in this frida script
|
|
41
|
-
* and multiple could request client ids at the same time. This
|
|
42
|
-
* could be mitigated with a nonce of some kind in the request
|
|
43
|
-
* message, but receiving over a script export is full-proof so long
|
|
44
|
-
* as the exports are unique.
|
|
45
|
-
*/
|
|
46
|
-
const exportName = options?.generateExportName?.() ?? constants.generateClientCallbackExportNameForServer();
|
|
47
|
-
yield* Effect.addFinalizer(() => Effect.sync(() => delete rpc.exports[exportName]));
|
|
48
|
-
rpc.exports[exportName] = maybeIncomingClientId => {
|
|
49
|
-
const parsedClientId = Schema.decodeUnknown(Schema.Number)(maybeIncomingClientId);
|
|
50
|
-
Deferred.unsafeDone(clientIdDeferred, parsedClientId);
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Request a client id from the node side and wait for the response,
|
|
54
|
-
* handling any transient errors that might occur by retrying with
|
|
55
|
-
* the retry policy.
|
|
56
|
-
*/
|
|
24
|
+
const parser = serialization.makeUnsafe();
|
|
25
|
+
const requestClientMap = new Map();
|
|
26
|
+
const exportName = yield* crypto.randomUUIDv4.pipe(Effect.orDie);
|
|
57
27
|
const connectionRequest = constants.nodeRpcClientMakeConnectionRequestForServer(exportName);
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Attach to the receiving stream, where all future messages will
|
|
62
|
-
* come in at, and filter for only our messages.
|
|
63
|
-
*/
|
|
64
|
-
const receivingPredicate = sharedPredicates.isTaggedForClient(clientId);
|
|
65
|
-
const receiveStream = yield* FridaStream.receiveStream(options?.receivingStreamShareOptions ?? {
|
|
66
|
-
replay: 100,
|
|
67
|
-
capacity: "unbounded"
|
|
28
|
+
const broadcast = response => Effect.forEach(clientIds, id => writeResponse(id, response), {
|
|
29
|
+
discard: true
|
|
68
30
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* response back to the implementation.
|
|
72
|
-
*/
|
|
73
|
-
yield* receiveStream.pipe(Stream.filterMap(unfiltered => {
|
|
74
|
-
if (receivingPredicate(unfiltered.message)) return Option.fromNullable(unfiltered.data);else return Option.none();
|
|
75
|
-
}), Stream.runForEach(filtered => {
|
|
31
|
+
yield* Effect.addFinalizer(() => Effect.sync(() => delete rpc.exports[exportName]));
|
|
32
|
+
rpc.exports[exportName] = data => {
|
|
76
33
|
try {
|
|
77
|
-
const responses = parser.decode(
|
|
78
|
-
if (responses.length === 0) return
|
|
34
|
+
const responses = parser.decode(data);
|
|
35
|
+
if (responses.length === 0) return Promise.resolve();
|
|
79
36
|
let i = 0;
|
|
80
37
|
return Effect.whileLoop({
|
|
38
|
+
step: Function.constVoid,
|
|
81
39
|
while: () => i < responses.length,
|
|
82
|
-
body: () =>
|
|
83
|
-
|
|
84
|
-
|
|
40
|
+
body: () => {
|
|
41
|
+
const response = responses[i++];
|
|
42
|
+
if ("requestId" in response) {
|
|
43
|
+
const clientId = requestClientMap.get(response.requestId);
|
|
44
|
+
if (response._tag === "Exit") requestClientMap.delete(response.requestId);
|
|
45
|
+
return writeResponse(clientId, response);
|
|
46
|
+
} else return broadcast(response);
|
|
47
|
+
}
|
|
48
|
+
}).pipe(Effect.runPromise);
|
|
85
49
|
} catch (defect) {
|
|
86
|
-
return
|
|
87
|
-
_tag: "
|
|
88
|
-
|
|
89
|
-
|
|
50
|
+
return broadcast({
|
|
51
|
+
_tag: "ClientProtocolError",
|
|
52
|
+
error: new RpcClientError.RpcClientError({
|
|
53
|
+
reason: new RpcClientError.RpcClientDefect({
|
|
54
|
+
message: "Error decoding message",
|
|
55
|
+
cause: defect
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}).pipe(Effect.runPromise);
|
|
90
59
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
* Sending messages is as simple as encoding them, then sending them
|
|
94
|
-
* to the node side tagged with our client id so it knows where to
|
|
95
|
-
* send them back to.
|
|
96
|
-
*/
|
|
97
|
-
const sendHelper = Effect.fnUntraced(function* (message) {
|
|
98
|
-
const encoded = parser.encode(message);
|
|
99
|
-
if (Predicate.isUndefined(encoded)) return;
|
|
100
|
-
const transformed = typeof encoded === "string" ? encoder.encode(encoded) : encoded;
|
|
101
|
-
send({
|
|
102
|
-
clientId
|
|
103
|
-
}, transformed.buffer);
|
|
104
|
-
});
|
|
60
|
+
};
|
|
61
|
+
send(connectionRequest);
|
|
105
62
|
return {
|
|
106
|
-
send: sendHelper,
|
|
107
63
|
supportsAck: true,
|
|
108
|
-
supportsTransferables: false
|
|
64
|
+
supportsTransferables: false,
|
|
65
|
+
send(clientId, request) {
|
|
66
|
+
if (request._tag === "Request") {
|
|
67
|
+
requestClientMap.set(request.id, clientId);
|
|
68
|
+
}
|
|
69
|
+
const encoded = parser.encode(request);
|
|
70
|
+
if (encoded === undefined) return Effect.void;
|
|
71
|
+
const transformed = typeof encoded === "string" ? encoder.encode(encoded) : encoded;
|
|
72
|
+
return Effect.sync(() => send(exportName, transformed.buffer));
|
|
73
|
+
}
|
|
109
74
|
};
|
|
110
75
|
}));
|
|
111
76
|
/**
|
|
112
77
|
* @since 1.0.0
|
|
113
78
|
* @category Layers
|
|
114
79
|
*/
|
|
115
|
-
export const layerProtocolFrida =
|
|
80
|
+
export const layerProtocolFrida = /*#__PURE__*/Layer.effect(RpcClient.Protocol, /*#__PURE__*/makeProtocolFrida());
|
|
116
81
|
//# sourceMappingURL=FridaRpcClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FridaRpcClient.js","names":["
|
|
1
|
+
{"version":3,"file":"FridaRpcClient.js","names":["Crypto","Effect","Function","Layer","RpcClient","RpcClientError","RpcSerialization","constants","makeProtocolFrida","Protocol","make","fnUntraced","writeResponse","clientIds","serialization","crypto","encoder","TextEncoder","parser","makeUnsafe","requestClientMap","Map","exportName","randomUUIDv4","pipe","orDie","connectionRequest","nodeRpcClientMakeConnectionRequestForServer","broadcast","response","forEach","id","discard","addFinalizer","sync","rpc","exports","data","responses","decode","length","Promise","resolve","i","whileLoop","step","constVoid","while","body","clientId","get","requestId","_tag","delete","runPromise","defect","error","reason","RpcClientDefect","message","cause","send","supportsAck","supportsTransferables","request","set","encoded","encode","undefined","void","transformed","buffer","layerProtocolFrida","effect"],"sources":["../../src/frida/FridaRpcClient.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;AAOA,OAAO,qBAAqB;AAK5B,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,SAAS,MAAM,+BAA+B;AAC1D,OAAO,KAAKC,cAAc,MAAM,oCAAoC;AACpE,OAAO,KAAKC,gBAAgB,MAAM,sCAAsC;AAExE,OAAO,KAAKC,SAAS,MAAM,wBAAwB;AAEnD;;;;AAIA,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAK7BJ,SAAS,CAACK,QAAQ,CAACC,IAAI,CACnBT,MAAM,CAACU,UAAU,CAAC,WAAWC,aAAa,EAAEC,SAAS;EACjD,MAAMC,aAAa,GAAG,OAAOR,gBAAgB,CAACA,gBAAgB;EAC9D,MAAMS,MAAM,GAAG,OAAOf,MAAM,CAACA,MAAM;EAEnC,MAAMgB,OAAO,GAAG,IAAIC,WAAW,EAAE;EACjC,MAAMC,MAAM,GAAGJ,aAAa,CAACK,UAAU,EAAE;EACzC,MAAMC,gBAAgB,GAAG,IAAIC,GAAG,EAAkB;E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,CAACK,QAAQ,eAAED,iBAAiB,EAAE,CAAC","ignoreList":[]}
|
|
@@ -5,26 +5,26 @@
|
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
7
|
import "@efffrida/polyfills";
|
|
8
|
-
import * as RpcSerialization from "@effect/rpc/RpcSerialization";
|
|
9
|
-
import * as RpcServer from "@effect/rpc/RpcServer";
|
|
10
8
|
import * as Effect from "effect/Effect";
|
|
11
9
|
import * as Layer from "effect/Layer";
|
|
10
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
11
|
+
import * as RpcServer from "effect/unstable/rpc/RpcServer";
|
|
12
12
|
/**
|
|
13
13
|
* @since 1.0.0
|
|
14
14
|
* @category Protocol
|
|
15
15
|
*/
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const makeProtocolFridaNoSendRecv: (options?: {
|
|
17
17
|
/** Generates server listener rpc exports for individual clients. */
|
|
18
18
|
readonly generateExportName?: ((clientId: number) => string) | undefined;
|
|
19
19
|
} | undefined) => Effect.Effect<{
|
|
20
|
-
readonly protocol: RpcServer.Protocol["
|
|
21
|
-
readonly rpcExport: () => Promise<
|
|
20
|
+
readonly protocol: RpcServer.Protocol["Service"];
|
|
21
|
+
readonly rpcExport: () => Promise<string>;
|
|
22
22
|
}, never, RpcSerialization.RpcSerialization>;
|
|
23
23
|
/**
|
|
24
24
|
* @since 1.0.0
|
|
25
25
|
* @category Protocol
|
|
26
26
|
*/
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const makeProtocolFrida: (options?: {
|
|
28
28
|
/**
|
|
29
29
|
* Name for the main rpc export that all clients start by
|
|
30
30
|
* connecting to.
|
|
@@ -32,7 +32,7 @@ export declare const makeProtocolFridaWithExport: (options?: {
|
|
|
32
32
|
readonly exportName?: string | undefined;
|
|
33
33
|
/** Generates server listener rpc exports for individual clients. */
|
|
34
34
|
readonly generateExportName?: ((clientId: number) => string) | undefined;
|
|
35
|
-
} | undefined) => Effect.Effect<RpcServer.Protocol["
|
|
35
|
+
} | undefined) => Effect.Effect<RpcServer.Protocol["Service"], never, RpcSerialization.RpcSerialization>;
|
|
36
36
|
/**
|
|
37
37
|
* @since 1.0.0
|
|
38
38
|
* @category Layer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FridaRpcServer.d.ts","sourceRoot":"","sources":["../../src/frida/FridaRpcServer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"FridaRpcServer.d.ts","sourceRoot":"","sources":["../../src/frida/FridaRpcServer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,KAAK,gBAAgB,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAI3D;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACpC,UACM;IACI,oEAAoE;IACpE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;CAC5E,GACD,SAAS,KAChB,MAAM,CAAC,MAAM,CACZ;IACI,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C,EACD,KAAK,EACL,gBAAgB,CAAC,gBAAgB,CA6F/B,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC1B,UACM;IACI;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzC,oEAAoE;IACpE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;CAC5E,GACD,SAAS,KAChB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAMlF,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC3B,UACM;IACI;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzC,oEAAoE;IACpE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;CAC5E,GACD,SAAS,KAChB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CACX,CAAC"}
|
|
@@ -5,80 +5,70 @@
|
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
7
|
import "@efffrida/polyfills";
|
|
8
|
-
import * as RpcMessage from "@effect/rpc/RpcMessage";
|
|
9
|
-
import * as RpcSerialization from "@effect/rpc/RpcSerialization";
|
|
10
|
-
import * as RpcServer from "@effect/rpc/RpcServer";
|
|
11
8
|
import * as Effect from "effect/Effect";
|
|
12
9
|
import * as Function from "effect/Function";
|
|
13
10
|
import * as Layer from "effect/Layer";
|
|
14
|
-
import * as
|
|
15
|
-
import * as
|
|
16
|
-
import * as
|
|
11
|
+
import * as Queue from "effect/Queue";
|
|
12
|
+
import * as RpcMessage from "effect/unstable/rpc/RpcMessage";
|
|
13
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
14
|
+
import * as RpcServer from "effect/unstable/rpc/RpcServer";
|
|
15
|
+
import * as constants from "../shared/Constants.js";
|
|
17
16
|
/**
|
|
18
17
|
* @since 1.0.0
|
|
19
18
|
* @category Protocol
|
|
20
19
|
*/
|
|
21
|
-
export const
|
|
22
|
-
const encoder = new TextEncoder();
|
|
23
|
-
const disconnects = yield* Mailbox.make();
|
|
20
|
+
export const makeProtocolFridaNoSendRecv = options => Effect.gen(function* () {
|
|
24
21
|
const serialization = yield* RpcSerialization.RpcSerialization;
|
|
22
|
+
const disconnects = yield* Queue.unbounded();
|
|
23
|
+
const parser = serialization.makeUnsafe();
|
|
24
|
+
const encoder = new TextEncoder();
|
|
25
25
|
let clientId = 0;
|
|
26
26
|
const clientIds = new Set();
|
|
27
27
|
const clients = new Map();
|
|
28
28
|
let writeRequest;
|
|
29
29
|
const makeExportName = options?.generateExportName ?? constants.generateServerExportNameForClient;
|
|
30
|
-
|
|
30
|
+
const writeRaw = data => {
|
|
31
|
+
const transformed = typeof data === "string" ? encoder.encode(data) : data;
|
|
32
|
+
return send(void 0, transformed.buffer);
|
|
33
|
+
};
|
|
34
|
+
const write = response => {
|
|
35
|
+
try {
|
|
36
|
+
const encoded = parser.encode(response);
|
|
37
|
+
if (encoded === undefined) return;
|
|
38
|
+
return writeRaw(encoded);
|
|
39
|
+
} catch (cause) {
|
|
40
|
+
const encoded = parser.encode(RpcMessage.ResponseDefectEncoded(cause));
|
|
41
|
+
return writeRaw(encoded);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// @effect-diagnostics-next-line runEffectInsideEffect:off
|
|
31
45
|
const rpcExport = Effect.gen(function* () {
|
|
32
46
|
const id = ++clientId;
|
|
33
|
-
const parser = serialization.unsafeMake();
|
|
34
|
-
const writeRaw = data => {
|
|
35
|
-
const transformed = typeof data === "string" ? encoder.encode(data) : data;
|
|
36
|
-
return send({
|
|
37
|
-
clientId: id
|
|
38
|
-
}, transformed.buffer);
|
|
39
|
-
};
|
|
40
|
-
const write = response => {
|
|
41
|
-
try {
|
|
42
|
-
const encoded = parser.encode(
|
|
43
|
-
// TODO: handle defects on the node client better
|
|
44
|
-
response._tag === "Defect" && response.defect instanceof Error ? RpcMessage.ResponseDefectEncoded({
|
|
45
|
-
stack: response.defect.stack,
|
|
46
|
-
cause: response.defect.cause,
|
|
47
|
-
...response.defect
|
|
48
|
-
}) : response);
|
|
49
|
-
if (Predicate.isNotUndefined(encoded)) {
|
|
50
|
-
return writeRaw(encoded);
|
|
51
|
-
}
|
|
52
|
-
} catch (cause) {
|
|
53
|
-
const encoded = parser.encode(RpcMessage.ResponseDefectEncoded(cause));
|
|
54
|
-
return writeRaw(encoded);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
clientIds.add(id);
|
|
58
47
|
clients.set(id, {
|
|
59
48
|
write
|
|
60
49
|
});
|
|
50
|
+
clientIds.add(id);
|
|
61
51
|
const onMessage = input => {
|
|
62
|
-
const data = typeof input === "string" ? input : Uint8Array.from(Object.values(input));
|
|
63
52
|
try {
|
|
53
|
+
const data = typeof input === "string" ? input : Uint8Array.from(Object.values(input));
|
|
64
54
|
const decoded = parser.decode(data);
|
|
65
55
|
if (decoded.length === 0) return Effect.void;
|
|
66
56
|
let i = 0;
|
|
67
57
|
return Effect.whileLoop({
|
|
68
58
|
while: () => i < decoded.length,
|
|
59
|
+
step: Function.constVoid,
|
|
69
60
|
body() {
|
|
70
61
|
const message = decoded[i++];
|
|
71
62
|
return writeRequest(id, message);
|
|
72
|
-
}
|
|
73
|
-
step: Function.constVoid
|
|
63
|
+
}
|
|
74
64
|
});
|
|
75
65
|
} catch (cause) {
|
|
76
66
|
return Effect.sync(() => writeRaw(parser.encode(RpcMessage.ResponseDefectEncoded(cause))));
|
|
77
67
|
}
|
|
78
68
|
};
|
|
79
69
|
rpc.exports[makeExportName(id)] = data => Effect.runPromise(onMessage(data));
|
|
80
|
-
return id;
|
|
81
|
-
});
|
|
70
|
+
return makeExportName(id);
|
|
71
|
+
}).pipe(export_ => () => Effect.runPromise(export_));
|
|
82
72
|
const protocol = yield* RpcServer.Protocol.make(writeRequest_ => {
|
|
83
73
|
writeRequest = writeRequest_;
|
|
84
74
|
return Effect.succeed({
|
|
@@ -89,9 +79,6 @@ export const makeProtocolFrida = options => Effect.gen(function* () {
|
|
|
89
79
|
return Effect.sync(() => client.write(response));
|
|
90
80
|
},
|
|
91
81
|
end(clientId) {
|
|
92
|
-
clientIds.delete(clientId); // TODO: Is this required?
|
|
93
|
-
clients.delete(clientId); // TODO: Is this required?
|
|
94
|
-
const makeExportName = options?.generateExportName ?? constants.generateServerExportNameForClient;
|
|
95
82
|
delete rpc.exports[makeExportName(clientId)];
|
|
96
83
|
return Effect.void;
|
|
97
84
|
},
|
|
@@ -104,20 +91,21 @@ export const makeProtocolFrida = options => Effect.gen(function* () {
|
|
|
104
91
|
});
|
|
105
92
|
return {
|
|
106
93
|
protocol,
|
|
107
|
-
rpcExport
|
|
94
|
+
rpcExport
|
|
108
95
|
};
|
|
109
96
|
});
|
|
110
97
|
/**
|
|
111
98
|
* @since 1.0.0
|
|
112
99
|
* @category Protocol
|
|
113
100
|
*/
|
|
114
|
-
export const
|
|
101
|
+
export const makeProtocolFrida = options => Effect.gen(function* () {
|
|
102
|
+
const protocolOptions = {
|
|
103
|
+
generateExportName: options?.generateExportName
|
|
104
|
+
};
|
|
115
105
|
const {
|
|
116
106
|
protocol,
|
|
117
107
|
rpcExport
|
|
118
|
-
} = yield*
|
|
119
|
-
generateExportName: options?.generateExportName
|
|
120
|
-
});
|
|
108
|
+
} = yield* makeProtocolFridaNoSendRecv(protocolOptions);
|
|
121
109
|
rpc.exports[options?.exportName ?? constants.defaultServerMainExportName] = rpcExport;
|
|
122
110
|
return protocol;
|
|
123
111
|
});
|
|
@@ -125,5 +113,5 @@ export const makeProtocolFridaWithExport = options => Effect.gen(function* () {
|
|
|
125
113
|
* @since 1.0.0
|
|
126
114
|
* @category Layer
|
|
127
115
|
*/
|
|
128
|
-
export const layerProtocolFrida = options => Layer.effect(RpcServer.Protocol,
|
|
116
|
+
export const layerProtocolFrida = options => Layer.effect(RpcServer.Protocol, makeProtocolFrida(options));
|
|
129
117
|
//# sourceMappingURL=FridaRpcServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FridaRpcServer.js","names":["
|
|
1
|
+
{"version":3,"file":"FridaRpcServer.js","names":["Effect","Function","Layer","Queue","RpcMessage","RpcSerialization","RpcServer","constants","makeProtocolFridaNoSendRecv","options","gen","serialization","disconnects","unbounded","parser","makeUnsafe","encoder","TextEncoder","clientId","clientIds","Set","clients","Map","writeRequest","makeExportName","generateExportName","generateServerExportNameForClient","writeRaw","data","transformed","encode","send","buffer","write","response","encoded","undefined","cause","ResponseDefectEncoded","rpcExport","id","set","add","onMessage","input","Uint8Array","from","Object","values","decoded","decode","length","void","i","whileLoop","while","step","constVoid","body","message","sync","rpc","exports","runPromise","pipe","export_","protocol","Protocol","make","writeRequest_","succeed","client","get","end","initialMessage","succeedNone","supportsAck","supportsTransferables","supportsSpanPropagation","makeProtocolFrida","protocolOptions","exportName","defaultServerMainExportName","layerProtocolFrida","effect"],"sources":["../../src/frida/FridaRpcServer.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;AAOA,OAAO,qBAAqB;AAE5B,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,UAAU,MAAM,gCAAgC;AAC5D,OAAO,KAAKC,gBAAgB,MAAM,sCAAsC;AACxE,OAAO,KAAKC,SAAS,MAAM,+BAA+B;AAE1D,OAAO,KAAKC,SAAS,MAAM,wBAAwB;AAEnD;;;;AAIA,OAAO,MAAMC,2BAA2B,GACpCC,OAKe,IASfT,MAAM,CAACU,GAAG,CAAC,aAAS;EAChB,MAAMC,aAAa,GAAG,OAAON,gBAAgB,CAACA,gBAAgB;EAE9D,MAAMO,WAAW,GAAG,OAAOT,KAAK,CAACU,SAAS,EAAU;EACpD,MAAMC,MAAM,GAAGH,aAAa,CAACI,UAAU,EAAE;E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iB,CAACtE,OAAO,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @since 1.0.0
|
|
6
6
|
*/
|
|
7
|
-
import type * as FridaSessionError from "@efffrida/frida-tools/FridaSessionError";
|
|
8
7
|
import type * as Scope from "effect/Scope";
|
|
9
|
-
import * as RpcClient from "@effect/rpc/RpcClient";
|
|
10
|
-
import * as RpcSerialization from "@effect/rpc/RpcSerialization";
|
|
11
|
-
import * as FridaScript from "@efffrida/frida-tools/FridaScript";
|
|
12
8
|
import * as Effect from "effect/Effect";
|
|
13
9
|
import * as Layer from "effect/Layer";
|
|
10
|
+
import * as RpcClient from "effect/unstable/rpc/RpcClient";
|
|
11
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
12
|
+
import type * as FridaSessionError from "@efffrida/frida-tools/FridaSessionError";
|
|
13
|
+
import * as FridaScript from "@efffrida/frida-tools/FridaScript";
|
|
14
14
|
/**
|
|
15
15
|
* @since 1.0.0
|
|
16
16
|
* @category Protocol
|
|
@@ -21,9 +21,7 @@ export declare const makeProtocolFrida: (options?: {
|
|
|
21
21
|
* connecting to.
|
|
22
22
|
*/
|
|
23
23
|
readonly exportName?: string | undefined;
|
|
24
|
-
|
|
25
|
-
readonly generateExportName?: ((clientId: number) => string) | undefined;
|
|
26
|
-
} | undefined) => Effect.Effect<RpcClient.Protocol["Type"], FridaSessionError.FridaSessionError, RpcSerialization.RpcSerialization | FridaScript.FridaScript | Scope.Scope>;
|
|
24
|
+
} | undefined) => Effect.Effect<RpcClient.Protocol["Service"], FridaSessionError.FridaSessionError, RpcSerialization.RpcSerialization | FridaScript.FridaScript | Scope.Scope>;
|
|
27
25
|
/**
|
|
28
26
|
* @since 1.0.0
|
|
29
27
|
* @category Layers
|
|
@@ -31,10 +29,8 @@ export declare const makeProtocolFrida: (options?: {
|
|
|
31
29
|
export declare const layerProtocolFrida: (options?: {
|
|
32
30
|
/**
|
|
33
31
|
* Name for the main rpc export that all clients start by
|
|
34
|
-
* connecting to.
|
|
32
|
+
* connecting to to inform the script of their client id.
|
|
35
33
|
*/
|
|
36
34
|
readonly exportName?: string | undefined;
|
|
37
|
-
/** Generates server listener rpc exports for individual clients. */
|
|
38
|
-
readonly generateExportName?: ((clientId: number) => string) | undefined;
|
|
39
35
|
} | undefined) => Layer.Layer<RpcClient.Protocol, FridaSessionError.FridaSessionError, RpcSerialization.RpcSerialization | FridaScript.FridaScript>;
|
|
40
36
|
//# sourceMappingURL=FridaRpcClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FridaRpcClient.d.ts","sourceRoot":"","sources":["../../src/node/FridaRpcClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"FridaRpcClient.d.ts","sourceRoot":"","sources":["../../src/node/FridaRpcClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAKtC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,gBAAgB,MAAM,sCAAsC,CAAC;AAEzE,OAAO,KAAK,KAAK,iBAAiB,MAAM,yCAAyC,CAAC;AAElF,OAAO,KAAK,WAAW,MAAM,mCAAmC,CAAC;AAIjE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC1B,UACM;IACI;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C,GACD,SAAS,KAChB,MAAM,CAAC,MAAM,CACZ,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC7B,iBAAiB,CAAC,iBAAiB,EACnC,gBAAgB,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAwFxE,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC3B,UACM;IACI;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C,GACD,SAAS,KAChB,KAAK,CAAC,KAAK,CACV,SAAS,CAAC,QAAQ,EAClB,iBAAiB,CAAC,iBAAiB,EACnC,gBAAgB,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,CACE,CAAC"}
|