@jshookmcp/jshook 0.2.9 → 0.3.1
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 +25 -50
- package/README.zh.md +25 -48
- package/dist/AntiCheatDetector-CGVGNfy5.mjs +1 -0
- package/dist/CacheAdapters-CdAxBmVW.mjs +1 -0
- package/dist/CodeInjector-BlgyqTOk.mjs +1 -0
- package/dist/ConsoleMonitor-Dkqc0HNi.mjs +490 -0
- package/dist/DOMInspector-BYY_EJ0C.mjs +95 -0
- package/dist/DarwinAPI-DC4HGGLl.mjs +1 -0
- package/dist/DetailedDataManager-BniBJlVv.mjs +1 -0
- package/dist/EventBus-DgciURGg.mjs +1 -0
- package/dist/EvidenceGraphBridge-BIfgB7HP.mjs +1 -0
- package/dist/ExtensionManager-erMpqcLk.mjs +1 -0
- package/dist/FingerprintManager-N7BZqjxP.mjs +1 -0
- package/dist/HardwareBreakpoint-OcJqNFVc.mjs +1 -0
- package/dist/HeapAnalyzer-CqAxZzeS.mjs +1 -0
- package/dist/{HookGeneratorBuilders.core.generators.storage-CtcdK78Q.mjs → HookGeneratorBuilders.core.generators.storage-Bf1fbrNK.mjs} +66 -174
- package/dist/InstrumentationSession-DxXs0sCp.mjs +1 -0
- package/dist/MCPServer.search.handlers.domain-DVbWL1bT.mjs +1 -0
- package/dist/MemoryController-BaqstM5w.mjs +2 -0
- package/dist/MemoryScanSession-CaxAjZJf.mjs +1 -0
- package/dist/MemoryScanner-BLYnMJy6.mjs +1 -0
- package/dist/NativeMemoryManager.impl-CI554XbY.mjs +1 -0
- package/dist/NativeMemoryManager.utils-DM4NC3FE.mjs +1 -0
- package/dist/PEAnalyzer-DJyaJTQJ.mjs +1 -0
- package/dist/PageController-D9jVkH0i.mjs +1 -0
- package/dist/PointerChainEngine-5nF9eNlu.mjs +1 -0
- package/dist/PrerequisiteError-Bl3dK8XA.mjs +1 -0
- package/dist/ProcessRegistry-Hf12LlR9.mjs +1 -0
- package/dist/ResponseBuilder-B2lu4KEl.mjs +1 -0
- package/dist/ReverseEvidenceGraph-B931HeoW.mjs +2 -0
- package/dist/ScriptManager-fgqiALgj.mjs +7 -0
- package/dist/Speedhack-l6s8L2Qw.mjs +1 -0
- package/dist/StealthVerifier-Dhbj4B4P.mjs +1 -0
- package/dist/StructureAnalyzer-A-WamfYE.mjs +2 -0
- package/dist/ToolCatalog-D_IKl1Hu.mjs +1 -0
- package/dist/ToolError-DWU_z7gp.mjs +1 -0
- package/dist/ToolProbe-xsfALmN3.mjs +1 -0
- package/dist/ToolRegistry-B0Zs-phN.mjs +1 -0
- package/dist/ToolRouter.policy-CFHoN_Lw.mjs +4 -0
- package/dist/TraceRecorder-Dd8jLXpi.mjs +272 -0
- package/dist/VersionDetector-DMoUWyNm.mjs +9 -0
- package/dist/Win32API-Bhi5xFBe.mjs +1 -0
- package/dist/Win32Debug-CQteFL4F.mjs +1 -0
- package/dist/WorkflowEngine-CxEp2WXH.mjs +1 -0
- package/dist/analysis-BuR-NgX8.mjs +5 -0
- package/dist/{antidebug-CqDTB_uk.mjs → antidebug-BOTZH6-0.mjs} +8 -259
- package/dist/artifactRetention-NBdncOEW.mjs +1 -0
- package/dist/artifacts-B5xQuEa_.mjs +1 -0
- package/dist/authorization-schema-B40obG1A.mjs +1 -0
- package/dist/betterSqlite3-CGaxz4AX.mjs +1 -0
- package/dist/binary-instrument-Cf9qqLlM.mjs +7 -0
- package/dist/bind-helpers-BlAOQrFQ.mjs +1 -0
- package/dist/boringssl-inspector-BST5vtKx.mjs +2 -0
- package/dist/browser-C4Le3xqA.mjs +11 -0
- package/dist/capabilities-DbYCv-HF.mjs +1 -0
- package/dist/chunk-C_pMuVsO.mjs +1 -0
- package/dist/collector-CKO8RPK8.mjs +1 -0
- package/dist/concurrency-CcK46d0h.mjs +1 -0
- package/dist/constants-Cp6hBrrx.mjs +1 -0
- package/dist/coordination-BbijHEHH.mjs +1 -0
- package/dist/debugger-CRJq_krh.mjs +1 -0
- package/dist/definitions-BGobEDQa.mjs +1 -0
- package/dist/definitions-BGwNSkVm.mjs +1 -0
- package/dist/definitions-BbxOUiP-.mjs +1 -0
- package/dist/definitions-CCP9gphV.mjs +1 -0
- package/dist/definitions-CIO9O-Sw.mjs +1 -0
- package/dist/definitions-CYFbewnd.mjs +1 -0
- package/dist/definitions-CdWEuIkI.mjs +1 -0
- package/dist/definitions-CoQFbggH.mjs +1 -0
- package/dist/definitions-CuJRsJ6N.mjs +1 -0
- package/dist/definitions-DI9YXsJk.mjs +1 -0
- package/dist/definitions-DJklW2sS.mjs +1 -0
- package/dist/definitions-DZ8uKusP.mjs +1 -0
- package/dist/definitions-Dds_zrWx.mjs +1 -0
- package/dist/definitions-Dgrg7f3D.mjs +1 -0
- package/dist/definitions-DtE0XLrT.mjs +1 -0
- package/dist/definitions-LaYTuwQd.mjs +26 -0
- package/dist/definitions-NoVp_9Pm.mjs +1 -0
- package/dist/definitions-OvGsfxdt.mjs +1 -0
- package/dist/definitions-jXPaVy4P.mjs +1 -0
- package/dist/encoding-DGcr6Aj_.mjs +2 -0
- package/dist/ensure-browser-core-Buls24LQ.mjs +1 -0
- package/dist/evidence-graph-bridge-B0yhGPcs.mjs +1 -0
- package/dist/factory-Cx_1LorX.mjs +1 -0
- package/dist/flat-target-session-CO5g78k3.mjs +1 -0
- package/dist/formatAddress-C7j2fDlM.mjs +1 -0
- package/dist/graphql-HLf3MS8H.mjs +62 -0
- package/dist/handlers-BLMa4X7l.mjs +54 -0
- package/dist/handlers-BP12ZsWc.mjs +4 -0
- package/dist/handlers-BZoPla6E.mjs +1 -0
- package/dist/handlers-BggKiVx9.mjs +2 -0
- package/dist/handlers-D3iev8g1.mjs +1 -0
- package/dist/handlers-D49r1-1P.mjs +1 -0
- package/dist/handlers-DCE45Ww8.mjs +2 -0
- package/dist/handlers-DW5AbYs5.mjs +5 -0
- package/dist/handlers-De5u62Ga2.mjs +1 -0
- package/dist/handlers-DmQzIc44.mjs +31 -0
- package/dist/handlers-DnJRGp7t.mjs +302 -0
- package/dist/handlers-Dv_runVv.mjs +2 -0
- package/dist/handlers-S9Ws0IGy.mjs +2 -0
- package/dist/{handlers-Bl8zkwz1.mjs → handlers-pVNpaw4A.mjs} +144 -841
- package/dist/handlers.impl-CD2_kOcC.mjs +1 -0
- package/dist/hooks-DDKppogd.mjs +600 -0
- package/dist/index.mjs +12 -5225
- package/dist/logger-sBC6IdRT.mjs +1 -0
- package/dist/maintenance-CutEO84j.mjs +1 -0
- package/dist/manifest-BFGxlDRh.mjs +123 -0
- package/dist/manifest-BPuE6oH2.mjs +1 -0
- package/dist/manifest-BXry5N09.mjs +1 -0
- package/dist/manifest-BeP_zJGb2.mjs +1 -0
- package/dist/manifest-C0g67k6U.mjs +1 -0
- package/dist/manifest-C1nZkTkO.mjs +1 -0
- package/dist/manifest-C7qV1z7F.mjs +1 -0
- package/dist/manifest-CDeUZGUZ.mjs +1 -0
- package/dist/manifest-CDiCtaQT.mjs +1 -0
- package/dist/manifest-CFn0359q2.mjs +1 -0
- package/dist/manifest-CGq4NpqH2.mjs +1 -0
- package/dist/manifest-CJMGt7Qy.mjs +1 -0
- package/dist/manifest-CRIJq4Hs.mjs +1 -0
- package/dist/manifest-C_hEIjSx.mjs +1 -0
- package/dist/manifest-CeQmtQOY.mjs +1 -0
- package/dist/manifest-Cq0j7GZt.mjs +1 -0
- package/dist/manifest-CtPmHAdn.mjs +1 -0
- package/dist/manifest-Cx2IVMUY.mjs +1 -0
- package/dist/manifest-D16xPXro.mjs +1 -0
- package/dist/manifest-D44TaRJU.mjs +1 -0
- package/dist/manifest-D610kxZr.mjs +2 -0
- package/dist/manifest-DC-SMF6b.mjs +1 -0
- package/dist/manifest-DD3rtxvV.mjs +1 -0
- package/dist/manifest-DKUorv5M.mjs +1 -0
- package/dist/manifest-DMJlcsTR.mjs +1 -0
- package/dist/manifest-DWUUWBz0.mjs +1 -0
- package/dist/manifest-De-6Wf2R.mjs +1 -0
- package/dist/manifest-Dgh0uDW-.mjs +1 -0
- package/dist/manifest-Dm0o3i2U.mjs +1 -0
- package/dist/manifest-DsVh7Y4U.mjs +1 -0
- package/dist/manifest-DtEFSRaq.mjs +1 -0
- package/dist/manifest-H-EpAyZQ.mjs +1 -0
- package/dist/manifest-ais9Afrw.mjs +1 -0
- package/dist/manifest-tmb54wmA.mjs +1 -0
- package/dist/manifest-yu2xiQqe.mjs +1 -0
- package/dist/manifest-zrbrpKCC.mjs +1 -0
- package/dist/matchesWildcardPattern-BGqLSmEs.mjs +1 -0
- package/dist/modules-p-PUNv9r.mjs +332 -0
- package/dist/mojo-ipc-VGlv3Qyp.mjs +9 -0
- package/dist/network-BjZ1Y-GB.mjs +7 -0
- package/dist/outputPaths-BonGThuc.mjs +2 -0
- package/dist/parse-args-Cuk7-xUt.mjs +1 -0
- package/dist/platform-C446Lf97.mjs +93 -0
- package/dist/playwright-cdp-fallback-BwVR-_T3.mjs +1 -0
- package/dist/process-C9f2A5zk.mjs +962 -0
- package/dist/proxy-CvRepxgV.mjs +1 -0
- package/dist/registry-DUHIPE-v.mjs +1 -0
- package/dist/response-C7rKQst4.mjs +1 -0
- package/dist/search-defaults-D2bY-rzH.mjs +1 -0
- package/dist/server/plugin-api.mjs +1 -293
- package/dist/shared-state-board-Cyg-xh_k.mjs +1 -0
- package/dist/sourcemap-D6Q1UuAp.mjs +1 -0
- package/dist/ssrf-policy-T96MR3r6.mjs +1 -0
- package/dist/streaming-CTX58tbb.mjs +1 -0
- package/dist/tool-builder-CI9914Tf.mjs +1 -0
- package/dist/transform-Cv9P2vVD.mjs +103 -0
- package/dist/types-CuyefmGT.mjs +1 -0
- package/dist/types-DtThH00r.mjs +1 -0
- package/dist/wasm-DaJa8J0V.mjs +174 -0
- package/dist/webcrack-CsLLJIs9.mjs +46 -0
- package/dist/workflow-CYIXtrWD.mjs +101 -0
- package/package.json +12 -7
- package/dist/AntiCheatDetector-BNk-EoBt.mjs +0 -244
- package/dist/CacheAdapters-CDe5WPSV.mjs +0 -80
- package/dist/CodeInjector-Cq8q01kp.mjs +0 -150
- package/dist/ConsoleMonitor-CPVQW1Y-.mjs +0 -2201
- package/dist/DarwinAPI-BNPxu0RH.mjs +0 -363
- package/dist/DetailedDataManager-BQQcxh64.mjs +0 -217
- package/dist/EventBus-DgPmwpeu.mjs +0 -141
- package/dist/EvidenceGraphBridge-SFesNera.mjs +0 -153
- package/dist/ExtensionManager-CWYgw0YW.mjs +0 -714
- package/dist/FingerprintManager-gzWtkKuf.mjs +0 -96
- package/dist/HardwareBreakpoint-B9gZCdFP.mjs +0 -239
- package/dist/HeapAnalyzer-BLDH0dCv.mjs +0 -284
- package/dist/InstrumentationSession-CvPC7Jwy.mjs +0 -244
- package/dist/MemoryController-CbVdCIJF.mjs +0 -167
- package/dist/MemoryScanSession-BsDZbLYm.mjs +0 -278
- package/dist/MemoryScanner-Bcpml6II.mjs +0 -425
- package/dist/NativeMemoryManager.impl-dZtA1ZGn.mjs +0 -482
- package/dist/NativeMemoryManager.utils-B-FjA2mJ.mjs +0 -165
- package/dist/PEAnalyzer-D1lzJ_VG.mjs +0 -385
- package/dist/PageController-Bqm2kZ_X.mjs +0 -417
- package/dist/PointerChainEngine-BOhyVsjx.mjs +0 -322
- package/dist/PrerequisiteError-Dl33Svkz.mjs +0 -20
- package/dist/ResponseBuilder-D3iFYx2N.mjs +0 -143
- package/dist/ReverseEvidenceGraph-Dlsk94LC.mjs +0 -269
- package/dist/ScriptManager-aHHq0X7U.mjs +0 -3000
- package/dist/Speedhack-CqdIFlQl.mjs +0 -156
- package/dist/StealthVerifier-Bo4T3bz8.mjs +0 -135
- package/dist/StructureAnalyzer-DhFaPvRO.mjs +0 -426
- package/dist/ToolCatalog-C0JGZoOm.mjs +0 -582
- package/dist/ToolError-jh9whhMd.mjs +0 -15
- package/dist/ToolProbe-oC7aPrkv.mjs +0 -45
- package/dist/ToolRegistry-BjaF4oNz.mjs +0 -131
- package/dist/ToolRouter.policy-BWV67ZK-.mjs +0 -304
- package/dist/TraceRecorder-DgxyVbdQ.mjs +0 -519
- package/dist/VersionDetector-CwVLVdDM.mjs +0 -104
- package/dist/Win32API-CePkipZY.mjs +0 -340
- package/dist/Win32Debug-BvKs-gxc.mjs +0 -274
- package/dist/WorkflowEngine-CuvkZtWu.mjs +0 -598
- package/dist/analysis-CL9uACt9.mjs +0 -463
- package/dist/artifactRetention-CFEprwPw.mjs +0 -591
- package/dist/artifacts-Bk2-_uPq.mjs +0 -59
- package/dist/betterSqlite3-0pqusHHH.mjs +0 -74
- package/dist/binary-instrument-CXfpx6fT.mjs +0 -979
- package/dist/bind-helpers-xFfRF-qm.mjs +0 -22
- package/dist/boringssl-inspector-BH2D3VKc.mjs +0 -180
- package/dist/browser-BpOr5PEx.mjs +0 -4082
- package/dist/chunk-CjcI7cDX.mjs +0 -15
- package/dist/concurrency-Bt0yv1kJ.mjs +0 -41
- package/dist/constants-B0OANIBL.mjs +0 -519
- package/dist/coordination-qUbyF8KU.mjs +0 -259
- package/dist/debugger-gnKxRSN0.mjs +0 -1271
- package/dist/definitions-6M-eejaT.mjs +0 -53
- package/dist/definitions-B18eyf0B.mjs +0 -18
- package/dist/definitions-B3QdlrHv.mjs +0 -34
- package/dist/definitions-B4rAvHNZ.mjs +0 -63
- package/dist/definitions-BB_4jnmy.mjs +0 -37
- package/dist/definitions-BMfYXoNC.mjs +0 -43
- package/dist/definitions-Beid2EB3.mjs +0 -27
- package/dist/definitions-C1UvM5Iy.mjs +0 -126
- package/dist/definitions-CXEI7QC72.mjs +0 -216
- package/dist/definitions-C_4r7Fo-2.mjs +0 -14
- package/dist/definitions-CkFDALoa.mjs +0 -26
- package/dist/definitions-Cke7zEb8.mjs +0 -94
- package/dist/definitions-ClJLzsJQ.mjs +0 -25
- package/dist/definitions-Cq-zroAU.mjs +0 -28
- package/dist/definitions-Cy3Sl6gV.mjs +0 -34
- package/dist/definitions-D3VsGcvz.mjs +0 -47
- package/dist/definitions-DVGfrn7y.mjs +0 -96
- package/dist/definitions-LKpC3-nL.mjs +0 -9
- package/dist/definitions-bAhHQJq9.mjs +0 -359
- package/dist/encoding-Bvz5jLRv.mjs +0 -1065
- package/dist/evidence-graph-bridge-C_fv9PuC.mjs +0 -135
- package/dist/factory-DxlGh9Xf.mjs +0 -575
- package/dist/formatAddress-DVkj9kpI.mjs +0 -17
- package/dist/graphql-DYWzJ29s.mjs +0 -1026
- package/dist/handlers-9sAbfIg-.mjs +0 -2552
- package/dist/handlers-C67ktuRN.mjs +0 -710
- package/dist/handlers-C87g8oCe.mjs +0 -276
- package/dist/handlers-CTsDAO6p.mjs +0 -681
- package/dist/handlers-Cgyg6c0U.mjs +0 -645
- package/dist/handlers-D6j6yka7.mjs +0 -2124
- package/dist/handlers-DdFzXLvF.mjs +0 -446
- package/dist/handlers-DeLOCd5m.mjs +0 -799
- package/dist/handlers-DlCJN4Td.mjs +0 -757
- package/dist/handlers-DxGIq15_2.mjs +0 -917
- package/dist/handlers-U6L4xhuF.mjs +0 -585
- package/dist/handlers-tB9Mp9ZK.mjs +0 -84
- package/dist/handlers-tiy7EIBp.mjs +0 -572
- package/dist/handlers.impl-DS0d9fUw.mjs +0 -761
- package/dist/hooks-CzCWByww.mjs +0 -898
- package/dist/logger-Dh_xb7_2.mjs +0 -93
- package/dist/maintenance-P7ePRXQC.mjs +0 -830
- package/dist/manifest-2ToTpjv8.mjs +0 -106
- package/dist/manifest-3g71z6Bg.mjs +0 -79
- package/dist/manifest-82baTv4U.mjs +0 -45
- package/dist/manifest-B3QVVeBS.mjs +0 -82
- package/dist/manifest-BB2J8IMJ.mjs +0 -149
- package/dist/manifest-BKbgbSiY.mjs +0 -60
- package/dist/manifest-Bcf-TJzH.mjs +0 -848
- package/dist/manifest-BmtZzQiQ2.mjs +0 -45
- package/dist/manifest-Bnd7kqEY.mjs +0 -55
- package/dist/manifest-BqQX6OQC2.mjs +0 -65
- package/dist/manifest-BqrQ4Tpj.mjs +0 -81
- package/dist/manifest-Br4RPFt5.mjs +0 -370
- package/dist/manifest-C5qDjysN.mjs +0 -107
- package/dist/manifest-C9RT5nk32.mjs +0 -34
- package/dist/manifest-CAhOuvSl.mjs +0 -204
- package/dist/manifest-CBYWCUBJ.mjs +0 -51
- package/dist/manifest-CFADCRa1.mjs +0 -37
- package/dist/manifest-CQVhavRF.mjs +0 -114
- package/dist/manifest-CT7zZBV1.mjs +0 -48
- package/dist/manifest-CV12bcrF.mjs +0 -121
- package/dist/manifest-CXsRWjjI.mjs +0 -224
- package/dist/manifest-CZLUCfG02.mjs +0 -95
- package/dist/manifest-D6phHKFd.mjs +0 -131
- package/dist/manifest-DCyjf4n2.mjs +0 -294
- package/dist/manifest-DHsnKgP6.mjs +0 -60
- package/dist/manifest-Df_dliIe.mjs +0 -55
- package/dist/manifest-Dh8WBmEW.mjs +0 -129
- package/dist/manifest-DhKRAT8_.mjs +0 -92
- package/dist/manifest-DlpTj4ic2.mjs +0 -193
- package/dist/manifest-DrbmZcFl2.mjs +0 -253
- package/dist/manifest-DuwHjUa5.mjs +0 -70
- package/dist/manifest-DzwvxPJX.mjs +0 -38
- package/dist/manifest-NXctwWQq.mjs +0 -68
- package/dist/manifest-Sc_0JQ13.mjs +0 -418
- package/dist/manifest-gZ4s_UtG.mjs +0 -96
- package/dist/manifest-qSleDqdO.mjs +0 -1023
- package/dist/modules-C184v-S9.mjs +0 -11365
- package/dist/mojo-ipc-B_H61Afw.mjs +0 -525
- package/dist/network-671Cw6hV.mjs +0 -3346
- package/dist/outputPaths-B1uGmrWZ.mjs +0 -1145
- package/dist/parse-args-BlRjqlkL.mjs +0 -39
- package/dist/platform-WmNn8Sxb.mjs +0 -2070
- package/dist/process-QcbIy5Zq.mjs +0 -1401
- package/dist/proxy-DqNs0bAd.mjs +0 -170
- package/dist/registry-D-6e18lB.mjs +0 -34
- package/dist/response-BQVP-xUn.mjs +0 -28
- package/dist/shared-state-board-DV-dpHFJ.mjs +0 -586
- package/dist/sourcemap-Dq8ez8vS.mjs +0 -650
- package/dist/ssrf-policy-ZaUfvhq7.mjs +0 -166
- package/dist/streaming-BUQ0VJsg.mjs +0 -725
- package/dist/tool-builder-DCbIC5Eo.mjs +0 -186
- package/dist/transform-CiYJfNX0.mjs +0 -1007
- package/dist/types-Bx92KJfT.mjs +0 -4
- package/dist/types-CPhOReNX.mjs +0 -37
- package/dist/wasm-DQTnHDs4.mjs +0 -531
- package/dist/workflow-f3xJOcjx.mjs +0 -725
|
@@ -1,525 +0,0 @@
|
|
|
1
|
-
import { n as __require } from "./chunk-CjcI7cDX.mjs";
|
|
2
|
-
import { Ht as MOJO_MONITOR_TIMEOUT_MS } from "./constants-B0OANIBL.mjs";
|
|
3
|
-
import { a as argString, r as argNumber } from "./parse-args-BlRjqlkL.mjs";
|
|
4
|
-
import "./manifest-B3QVVeBS.mjs";
|
|
5
|
-
import { execFile, spawn } from "node:child_process";
|
|
6
|
-
//#region src/modules/mojo-ipc/MojoMonitor.ts
|
|
7
|
-
function getDefaultInterfaces() {
|
|
8
|
-
return [
|
|
9
|
-
{
|
|
10
|
-
name: "blink.mojom.WidgetHost",
|
|
11
|
-
version: 1,
|
|
12
|
-
pendingMessages: 0
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "content.mojom.FrameHost",
|
|
16
|
-
version: 2,
|
|
17
|
-
pendingMessages: 0
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "network.mojom.URLLoaderFactory",
|
|
21
|
-
version: 3,
|
|
22
|
-
pendingMessages: 0
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
function detectFridaNpmPackage() {
|
|
27
|
-
try {
|
|
28
|
-
__require.resolve("frida");
|
|
29
|
-
return true;
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async function probeFridaCli() {
|
|
35
|
-
return new Promise((resolve) => {
|
|
36
|
-
const child = spawn("frida", ["--version"], {
|
|
37
|
-
timeout: MOJO_MONITOR_TIMEOUT_MS,
|
|
38
|
-
windowsHide: true
|
|
39
|
-
});
|
|
40
|
-
let stdout = "";
|
|
41
|
-
child.stdout?.on("data", (chunk) => {
|
|
42
|
-
stdout += chunk.toString();
|
|
43
|
-
});
|
|
44
|
-
child.on("close", (code) => {
|
|
45
|
-
if (code === 0 && stdout.trim().length > 0) {
|
|
46
|
-
resolve("frida");
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
resolve(null);
|
|
50
|
-
});
|
|
51
|
-
child.on("error", () => {
|
|
52
|
-
resolve(null);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
async function detectAvailability() {
|
|
57
|
-
const flag = process.env["JSHOOK_ENABLE_MOJO_IPC"];
|
|
58
|
-
const fridaNpm = detectFridaNpmPackage();
|
|
59
|
-
const fridaCli = await probeFridaCli();
|
|
60
|
-
const fridaAvailable = fridaNpm || fridaCli !== null;
|
|
61
|
-
if (flag === "0" || flag === "false") return {
|
|
62
|
-
available: false,
|
|
63
|
-
fridaAvailable,
|
|
64
|
-
fridaCliAvailable: fridaCli !== null,
|
|
65
|
-
reason: "Mojo IPC disabled by JSHOOK_ENABLE_MOJO_IPC=0."
|
|
66
|
-
};
|
|
67
|
-
return {
|
|
68
|
-
available: fridaAvailable,
|
|
69
|
-
fridaAvailable,
|
|
70
|
-
fridaCliAvailable: fridaCli !== null,
|
|
71
|
-
reason: fridaAvailable ? void 0 : "Mojo IPC backend is not connected. Install Frida for real IPC monitoring: https://frida.re/docs/installation/"
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function matchesFilter(message, filter) {
|
|
75
|
-
if (filter.interfaceName && message.interfaceName !== filter.interfaceName) return false;
|
|
76
|
-
if (filter.messageType && message.messageType !== filter.messageType) return false;
|
|
77
|
-
if (typeof filter.pid === "number" && message.sourcePid !== filter.pid && message.targetPid !== filter.pid) return false;
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
function buildFridaScript() {
|
|
81
|
-
return `
|
|
82
|
-
const messages = [];
|
|
83
|
-
recv('message', () => {});
|
|
84
|
-
rpc.exports = {
|
|
85
|
-
flush() {
|
|
86
|
-
return messages;
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
`;
|
|
90
|
-
}
|
|
91
|
-
var MojoMonitor = class {
|
|
92
|
-
active = false;
|
|
93
|
-
simulationMode = false;
|
|
94
|
-
deviceId;
|
|
95
|
-
messages = [];
|
|
96
|
-
interfaces = /* @__PURE__ */ new Map();
|
|
97
|
-
availability = {
|
|
98
|
-
available: false,
|
|
99
|
-
fridaAvailable: false,
|
|
100
|
-
fridaCliAvailable: false,
|
|
101
|
-
reason: "Not yet initialized. Call start() to probe availability."
|
|
102
|
-
};
|
|
103
|
-
constructor() {
|
|
104
|
-
for (const item of getDefaultInterfaces()) this.interfaces.set(item.name, { ...item });
|
|
105
|
-
}
|
|
106
|
-
isAvailable() {
|
|
107
|
-
return this.availability.available;
|
|
108
|
-
}
|
|
109
|
-
getUnavailableReason() {
|
|
110
|
-
return this.availability.reason;
|
|
111
|
-
}
|
|
112
|
-
isSimulationMode() {
|
|
113
|
-
return this.simulationMode;
|
|
114
|
-
}
|
|
115
|
-
setSimulationMode(enabled) {
|
|
116
|
-
this.simulationMode = enabled;
|
|
117
|
-
}
|
|
118
|
-
isActive() {
|
|
119
|
-
return this.active;
|
|
120
|
-
}
|
|
121
|
-
getDeviceId() {
|
|
122
|
-
return this.deviceId;
|
|
123
|
-
}
|
|
124
|
-
async start(deviceId) {
|
|
125
|
-
this.deviceId = deviceId;
|
|
126
|
-
this.availability = await detectAvailability();
|
|
127
|
-
if (!this.availability.available) {
|
|
128
|
-
this.active = false;
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.active = true;
|
|
132
|
-
this.resetPendingCounts();
|
|
133
|
-
if (this.availability.fridaCliAvailable) await this.captureWithFrida(deviceId);
|
|
134
|
-
else this.simulationMode = true;
|
|
135
|
-
}
|
|
136
|
-
async stop() {
|
|
137
|
-
this.active = false;
|
|
138
|
-
this.deviceId = void 0;
|
|
139
|
-
this.messages.length = 0;
|
|
140
|
-
this.resetPendingCounts();
|
|
141
|
-
}
|
|
142
|
-
async captureMessages(filter = {}) {
|
|
143
|
-
if (!this.active) return [];
|
|
144
|
-
const captured = [];
|
|
145
|
-
const remaining = [];
|
|
146
|
-
for (const message of this.messages) if (matchesFilter(message, filter)) captured.push({ ...message });
|
|
147
|
-
else remaining.push(message);
|
|
148
|
-
this.messages.length = 0;
|
|
149
|
-
this.messages.push(...remaining);
|
|
150
|
-
this.recomputePendingCounts();
|
|
151
|
-
return captured;
|
|
152
|
-
}
|
|
153
|
-
async listInterfaces() {
|
|
154
|
-
return [...this.interfaces.values()].map((item) => ({
|
|
155
|
-
name: item.name,
|
|
156
|
-
version: item.version,
|
|
157
|
-
pendingMessages: item.pendingMessages
|
|
158
|
-
})).toSorted((left, right) => left.name.localeCompare(right.name));
|
|
159
|
-
}
|
|
160
|
-
async getMessages(options) {
|
|
161
|
-
if (!this.active) return {
|
|
162
|
-
messages: [],
|
|
163
|
-
totalAvailable: 0,
|
|
164
|
-
filtered: false,
|
|
165
|
-
_simulation: this.simulationMode
|
|
166
|
-
};
|
|
167
|
-
const filter = {};
|
|
168
|
-
if (options?.interfaceName) filter.interfaceName = options.interfaceName;
|
|
169
|
-
const allMessages = await this.captureMessages(filter);
|
|
170
|
-
const limit = options?.limit ?? 100;
|
|
171
|
-
return {
|
|
172
|
-
messages: allMessages.slice(0, limit),
|
|
173
|
-
totalAvailable: allMessages.length,
|
|
174
|
-
filtered: !!options?.interfaceName,
|
|
175
|
-
_simulation: this.simulationMode
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
recordMessage(message, version = 1) {
|
|
179
|
-
if (!this.active) return;
|
|
180
|
-
this.messages.push({ ...message });
|
|
181
|
-
const existing = this.interfaces.get(message.interfaceName);
|
|
182
|
-
if (existing) {
|
|
183
|
-
existing.pendingMessages += 1;
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
this.interfaces.set(message.interfaceName, {
|
|
187
|
-
name: message.interfaceName,
|
|
188
|
-
version,
|
|
189
|
-
pendingMessages: 1
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
async captureWithFrida(deviceId) {
|
|
193
|
-
const targetProcess = deviceId ?? "chrome";
|
|
194
|
-
const script = buildFridaScript();
|
|
195
|
-
await new Promise((resolve, reject) => {
|
|
196
|
-
execFile("frida", [
|
|
197
|
-
"-q",
|
|
198
|
-
"-n",
|
|
199
|
-
targetProcess,
|
|
200
|
-
"-l",
|
|
201
|
-
"-",
|
|
202
|
-
"--runtime=v8"
|
|
203
|
-
], {
|
|
204
|
-
timeout: MOJO_MONITOR_TIMEOUT_MS,
|
|
205
|
-
windowsHide: true
|
|
206
|
-
}, (error) => {
|
|
207
|
-
if (error) {
|
|
208
|
-
this.simulationMode = true;
|
|
209
|
-
reject(error);
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
this.simulationMode = false;
|
|
213
|
-
resolve();
|
|
214
|
-
}).stdin?.end(script);
|
|
215
|
-
}).catch(() => {
|
|
216
|
-
this.simulationMode = true;
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
recomputePendingCounts() {
|
|
220
|
-
this.resetPendingCounts();
|
|
221
|
-
for (const message of this.messages) {
|
|
222
|
-
const item = this.interfaces.get(message.interfaceName);
|
|
223
|
-
if (item) item.pendingMessages += 1;
|
|
224
|
-
else this.interfaces.set(message.interfaceName, {
|
|
225
|
-
name: message.interfaceName,
|
|
226
|
-
version: 1,
|
|
227
|
-
pendingMessages: 1
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
resetPendingCounts() {
|
|
232
|
-
for (const item of this.interfaces.values()) item.pendingMessages = 0;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/modules/mojo-ipc/MojoDecoder.ts
|
|
237
|
-
function isRecord(value) {
|
|
238
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
239
|
-
}
|
|
240
|
-
const FIELD_TYPE_BOOL = 1;
|
|
241
|
-
const FIELD_TYPE_INT32 = 6;
|
|
242
|
-
const FIELD_TYPE_UINT32 = 8;
|
|
243
|
-
const FIELD_TYPE_STRING = 12;
|
|
244
|
-
const FIELD_TYPE_HANDLE = 16;
|
|
245
|
-
function isHandleField(value) {
|
|
246
|
-
if (!isRecord(value)) return false;
|
|
247
|
-
return typeof value["handle"] === "number";
|
|
248
|
-
}
|
|
249
|
-
function normalizeHexInput(hex) {
|
|
250
|
-
const cleaned = hex.replace(/\s+/g, "");
|
|
251
|
-
if (cleaned.length % 2 === 0) return cleaned.toLowerCase();
|
|
252
|
-
return `0${cleaned.toLowerCase()}`;
|
|
253
|
-
}
|
|
254
|
-
var MojoDecoder = class {
|
|
255
|
-
decodePayload(hex, context) {
|
|
256
|
-
const raw = this.cleanHex(hex);
|
|
257
|
-
const bytes = Buffer.from(raw, "hex");
|
|
258
|
-
const version = this.readUInt8(bytes, 0);
|
|
259
|
-
const flags = this.readUInt8(bytes, 1);
|
|
260
|
-
const messageType = this.readUInt8(bytes, 2);
|
|
261
|
-
const numFields = this.readUInt8(bytes, 3);
|
|
262
|
-
const declaredHandles = this.readUInt16LE(bytes, 4);
|
|
263
|
-
const fields = {};
|
|
264
|
-
const summaryParts = [];
|
|
265
|
-
let cursor = 6;
|
|
266
|
-
let actualHandles = 0;
|
|
267
|
-
for (let index = 0; index < numFields; index += 1) {
|
|
268
|
-
if (cursor >= bytes.length) {
|
|
269
|
-
summaryParts.push("payload ended before all fields were decoded");
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
const typeCode = this.readUInt8(bytes, cursor);
|
|
273
|
-
cursor += 1;
|
|
274
|
-
const fieldName = `field${index}`;
|
|
275
|
-
if (typeCode === FIELD_TYPE_BOOL) {
|
|
276
|
-
if (!this.hasBytes(bytes, cursor, 1)) {
|
|
277
|
-
summaryParts.push(`${fieldName} truncated`);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
fields[fieldName] = this.readUInt8(bytes, cursor) !== 0;
|
|
281
|
-
cursor += 1;
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
if (typeCode === FIELD_TYPE_INT32) {
|
|
285
|
-
if (!this.hasBytes(bytes, cursor, 4)) {
|
|
286
|
-
summaryParts.push(`${fieldName} truncated`);
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
fields[fieldName] = bytes.readInt32LE(cursor);
|
|
290
|
-
cursor += 4;
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
if (typeCode === FIELD_TYPE_UINT32) {
|
|
294
|
-
if (!this.hasBytes(bytes, cursor, 4)) {
|
|
295
|
-
summaryParts.push(`${fieldName} truncated`);
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
fields[fieldName] = bytes.readUInt32LE(cursor);
|
|
299
|
-
cursor += 4;
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
if (typeCode === FIELD_TYPE_STRING) {
|
|
303
|
-
if (!this.hasBytes(bytes, cursor, 2)) {
|
|
304
|
-
summaryParts.push(`${fieldName} length prefix truncated`);
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
const length = this.readUInt16LE(bytes, cursor);
|
|
308
|
-
cursor += 2;
|
|
309
|
-
if (!this.hasBytes(bytes, cursor, length)) {
|
|
310
|
-
summaryParts.push(`${fieldName} string data truncated`);
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
313
|
-
fields[fieldName] = bytes.subarray(cursor, cursor + length).toString("utf8");
|
|
314
|
-
cursor += length;
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
if (typeCode === FIELD_TYPE_HANDLE) {
|
|
318
|
-
if (!this.hasBytes(bytes, cursor, 4)) {
|
|
319
|
-
summaryParts.push(`${fieldName} handle truncated`);
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
fields[fieldName] = { handle: bytes.readUInt32LE(cursor) };
|
|
323
|
-
actualHandles += 1;
|
|
324
|
-
cursor += 4;
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
summaryParts.push(`unknown field type 0x${typeCode.toString(16).padStart(2, "0")}`);
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
const summary = summaryParts.length > 0 ? summaryParts.join("; ") : this.buildSummary(context, Object.keys(fields).length, numFields, actualHandles);
|
|
331
|
-
return {
|
|
332
|
-
header: {
|
|
333
|
-
version,
|
|
334
|
-
flags,
|
|
335
|
-
messageType,
|
|
336
|
-
numFields,
|
|
337
|
-
handles: declaredHandles
|
|
338
|
-
},
|
|
339
|
-
fields,
|
|
340
|
-
handles: actualHandles,
|
|
341
|
-
raw,
|
|
342
|
-
_raw_summary: summary
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
encodeMessage(interfaceName, messageType, fields) {
|
|
346
|
-
const encodedParts = [];
|
|
347
|
-
let handles = 0;
|
|
348
|
-
for (const field of fields) {
|
|
349
|
-
if (typeof field === "boolean") {
|
|
350
|
-
encodedParts.push(Buffer.from([FIELD_TYPE_BOOL, field ? 1 : 0]));
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
if (typeof field === "number" && Number.isInteger(field) && field >= 0) {
|
|
354
|
-
const chunk = Buffer.alloc(5);
|
|
355
|
-
chunk.writeUInt8(FIELD_TYPE_UINT32, 0);
|
|
356
|
-
chunk.writeUInt32LE(field, 1);
|
|
357
|
-
encodedParts.push(chunk);
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
if (typeof field === "number" && Number.isInteger(field)) {
|
|
361
|
-
const chunk = Buffer.alloc(5);
|
|
362
|
-
chunk.writeUInt8(FIELD_TYPE_INT32, 0);
|
|
363
|
-
chunk.writeInt32LE(field, 1);
|
|
364
|
-
encodedParts.push(chunk);
|
|
365
|
-
continue;
|
|
366
|
-
}
|
|
367
|
-
if (isHandleField(field)) {
|
|
368
|
-
const chunk = Buffer.alloc(5);
|
|
369
|
-
chunk.writeUInt8(FIELD_TYPE_HANDLE, 0);
|
|
370
|
-
chunk.writeUInt32LE(field.handle, 1);
|
|
371
|
-
encodedParts.push(chunk);
|
|
372
|
-
handles += 1;
|
|
373
|
-
continue;
|
|
374
|
-
}
|
|
375
|
-
const text = typeof field === "string" ? field : JSON.stringify(field);
|
|
376
|
-
const textBuffer = Buffer.from(text, "utf8");
|
|
377
|
-
const header = Buffer.alloc(3);
|
|
378
|
-
header.writeUInt8(FIELD_TYPE_STRING, 0);
|
|
379
|
-
header.writeUInt16LE(textBuffer.length, 1);
|
|
380
|
-
encodedParts.push(header, textBuffer);
|
|
381
|
-
}
|
|
382
|
-
const messageTypeCode = this.resolveMessageType(interfaceName, messageType);
|
|
383
|
-
const fieldCount = Math.min(fields.length, 255);
|
|
384
|
-
const header = Buffer.alloc(6);
|
|
385
|
-
header.writeUInt8(1, 0);
|
|
386
|
-
header.writeUInt8(0, 1);
|
|
387
|
-
header.writeUInt8(messageTypeCode, 2);
|
|
388
|
-
header.writeUInt8(fieldCount, 3);
|
|
389
|
-
header.writeUInt16LE(handles, 4);
|
|
390
|
-
return Buffer.concat([header, ...encodedParts]).toString("hex");
|
|
391
|
-
}
|
|
392
|
-
cleanHex(hex) {
|
|
393
|
-
return normalizeHexInput(hex);
|
|
394
|
-
}
|
|
395
|
-
resolveMessageType(interfaceName, messageType) {
|
|
396
|
-
if (/^[0-9]+$/.test(messageType)) return Number.parseInt(messageType, 10) & 255;
|
|
397
|
-
if (/^0x[0-9a-f]+$/i.test(messageType)) return Number.parseInt(messageType.slice(2), 16) & 255;
|
|
398
|
-
let hash = 0;
|
|
399
|
-
const seed = `${interfaceName}:${messageType}`;
|
|
400
|
-
for (const char of seed) hash = hash * 31 + char.charCodeAt(0) & 255;
|
|
401
|
-
return hash;
|
|
402
|
-
}
|
|
403
|
-
buildSummary(context, decodedFields, declaredFields, handles) {
|
|
404
|
-
return `${context ? `${context}: ` : ""}decoded ${decodedFields}/${declaredFields} fields, ${handles} handle(s)`;
|
|
405
|
-
}
|
|
406
|
-
readUInt8(bytes, offset) {
|
|
407
|
-
if (!this.hasBytes(bytes, offset, 1)) return 0;
|
|
408
|
-
return bytes.readUInt8(offset);
|
|
409
|
-
}
|
|
410
|
-
readUInt16LE(bytes, offset) {
|
|
411
|
-
if (!this.hasBytes(bytes, offset, 2)) return 0;
|
|
412
|
-
return bytes.readUInt16LE(offset);
|
|
413
|
-
}
|
|
414
|
-
hasBytes(bytes, offset, length) {
|
|
415
|
-
return offset >= 0 && length >= 0 && offset + length <= bytes.length;
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
//#endregion
|
|
419
|
-
//#region src/server/domains/mojo-ipc/handlers.impl.ts
|
|
420
|
-
function unavailablePayload(reason, action) {
|
|
421
|
-
return {
|
|
422
|
-
success: false,
|
|
423
|
-
available: false,
|
|
424
|
-
action,
|
|
425
|
-
error: reason
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
var MojoIPCHandlers = class {
|
|
429
|
-
constructor(monitor, decoder, eventBus) {
|
|
430
|
-
this.monitor = monitor;
|
|
431
|
-
this.decoder = decoder;
|
|
432
|
-
this.eventBus = eventBus;
|
|
433
|
-
}
|
|
434
|
-
async handleMojoMonitorDispatch(args) {
|
|
435
|
-
return String(args["action"] ?? "") === "stop" ? this.handleMojoMonitorStop() : this.handleMojoMonitorStart(args);
|
|
436
|
-
}
|
|
437
|
-
async handleMojoMonitorStart(args) {
|
|
438
|
-
const monitor = this.getMonitor();
|
|
439
|
-
if (!monitor.isAvailable()) return unavailablePayload(monitor.getUnavailableReason() ?? "Mojo IPC monitoring is not available", "mojo_monitor");
|
|
440
|
-
const deviceId = argString(args, "deviceId");
|
|
441
|
-
await monitor.start(deviceId);
|
|
442
|
-
return {
|
|
443
|
-
success: true,
|
|
444
|
-
available: true,
|
|
445
|
-
started: monitor.isActive(),
|
|
446
|
-
deviceId: monitor.getDeviceId() ?? null
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
async handleMojoMonitorStop() {
|
|
450
|
-
const monitor = this.getMonitor();
|
|
451
|
-
if (!monitor.isAvailable()) return unavailablePayload(monitor.getUnavailableReason() ?? "Mojo IPC monitoring is not available", "mojo_monitor");
|
|
452
|
-
await monitor.stop();
|
|
453
|
-
return {
|
|
454
|
-
success: true,
|
|
455
|
-
available: true,
|
|
456
|
-
started: false
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
async handleMojoDecodeMessage(args) {
|
|
460
|
-
const hexPayload = argString(args, "hexPayload", "");
|
|
461
|
-
if (hexPayload.length === 0) return {
|
|
462
|
-
success: false,
|
|
463
|
-
error: "hexPayload is required"
|
|
464
|
-
};
|
|
465
|
-
return {
|
|
466
|
-
success: true,
|
|
467
|
-
decoded: this.getDecoder().decodePayload(hexPayload)
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
async handleMojoListInterfaces() {
|
|
471
|
-
const monitor = this.getMonitor();
|
|
472
|
-
if (!monitor.isAvailable()) return {
|
|
473
|
-
...unavailablePayload(monitor.getUnavailableReason() ?? "Mojo IPC monitoring is not available", "mojo_list_interfaces"),
|
|
474
|
-
interfaces: []
|
|
475
|
-
};
|
|
476
|
-
const interfaces = await monitor.listInterfaces();
|
|
477
|
-
return {
|
|
478
|
-
success: true,
|
|
479
|
-
available: true,
|
|
480
|
-
active: monitor.isActive(),
|
|
481
|
-
interfaces
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
async handleMojoMessagesGet(args) {
|
|
485
|
-
const monitor = this.getMonitor();
|
|
486
|
-
if (!monitor.isAvailable()) return {
|
|
487
|
-
...unavailablePayload(monitor.getUnavailableReason() ?? "Mojo IPC monitoring is not available", "mojo_messages_get"),
|
|
488
|
-
messages: [],
|
|
489
|
-
totalAvailable: 0,
|
|
490
|
-
filtered: false,
|
|
491
|
-
_simulation: true
|
|
492
|
-
};
|
|
493
|
-
const limit = argNumber(args, "limit");
|
|
494
|
-
const interfaceName = argString(args, "interface");
|
|
495
|
-
const result = await monitor.getMessages({
|
|
496
|
-
limit: limit !== void 0 ? Math.min(limit, 1e4) : 100,
|
|
497
|
-
interfaceName
|
|
498
|
-
});
|
|
499
|
-
const response = {
|
|
500
|
-
success: true,
|
|
501
|
-
available: true,
|
|
502
|
-
active: monitor.isActive(),
|
|
503
|
-
messages: result.messages,
|
|
504
|
-
totalAvailable: result.totalAvailable,
|
|
505
|
-
filtered: result.filtered,
|
|
506
|
-
_simulation: result._simulation
|
|
507
|
-
};
|
|
508
|
-
if (result.messages && Array.isArray(result.messages) && result.messages.length > 0) this.eventBus?.emit("mojo:message_captured", {
|
|
509
|
-
messageCount: result.messages.length,
|
|
510
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
511
|
-
});
|
|
512
|
-
if (monitor.isSimulationMode()) response._warning = "Mojo IPC is operating in simulation mode. Messages are not captured from real Frida hooks. Install Frida for live IPC monitoring.";
|
|
513
|
-
return response;
|
|
514
|
-
}
|
|
515
|
-
getMonitor() {
|
|
516
|
-
if (!this.monitor) this.monitor = new MojoMonitor();
|
|
517
|
-
return this.monitor;
|
|
518
|
-
}
|
|
519
|
-
getDecoder() {
|
|
520
|
-
if (!this.decoder) this.decoder = new MojoDecoder();
|
|
521
|
-
return this.decoder;
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
//#endregion
|
|
525
|
-
export { MojoIPCHandlers };
|