@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.
Files changed (316) hide show
  1. package/README.md +25 -50
  2. package/README.zh.md +25 -48
  3. package/dist/AntiCheatDetector-CGVGNfy5.mjs +1 -0
  4. package/dist/CacheAdapters-CdAxBmVW.mjs +1 -0
  5. package/dist/CodeInjector-BlgyqTOk.mjs +1 -0
  6. package/dist/ConsoleMonitor-Dkqc0HNi.mjs +490 -0
  7. package/dist/DOMInspector-BYY_EJ0C.mjs +95 -0
  8. package/dist/DarwinAPI-DC4HGGLl.mjs +1 -0
  9. package/dist/DetailedDataManager-BniBJlVv.mjs +1 -0
  10. package/dist/EventBus-DgciURGg.mjs +1 -0
  11. package/dist/EvidenceGraphBridge-BIfgB7HP.mjs +1 -0
  12. package/dist/ExtensionManager-erMpqcLk.mjs +1 -0
  13. package/dist/FingerprintManager-N7BZqjxP.mjs +1 -0
  14. package/dist/HardwareBreakpoint-OcJqNFVc.mjs +1 -0
  15. package/dist/HeapAnalyzer-CqAxZzeS.mjs +1 -0
  16. package/dist/{HookGeneratorBuilders.core.generators.storage-CtcdK78Q.mjs → HookGeneratorBuilders.core.generators.storage-Bf1fbrNK.mjs} +66 -174
  17. package/dist/InstrumentationSession-DxXs0sCp.mjs +1 -0
  18. package/dist/MCPServer.search.handlers.domain-DVbWL1bT.mjs +1 -0
  19. package/dist/MemoryController-BaqstM5w.mjs +2 -0
  20. package/dist/MemoryScanSession-CaxAjZJf.mjs +1 -0
  21. package/dist/MemoryScanner-BLYnMJy6.mjs +1 -0
  22. package/dist/NativeMemoryManager.impl-CI554XbY.mjs +1 -0
  23. package/dist/NativeMemoryManager.utils-DM4NC3FE.mjs +1 -0
  24. package/dist/PEAnalyzer-DJyaJTQJ.mjs +1 -0
  25. package/dist/PageController-D9jVkH0i.mjs +1 -0
  26. package/dist/PointerChainEngine-5nF9eNlu.mjs +1 -0
  27. package/dist/PrerequisiteError-Bl3dK8XA.mjs +1 -0
  28. package/dist/ProcessRegistry-Hf12LlR9.mjs +1 -0
  29. package/dist/ResponseBuilder-B2lu4KEl.mjs +1 -0
  30. package/dist/ReverseEvidenceGraph-B931HeoW.mjs +2 -0
  31. package/dist/ScriptManager-fgqiALgj.mjs +7 -0
  32. package/dist/Speedhack-l6s8L2Qw.mjs +1 -0
  33. package/dist/StealthVerifier-Dhbj4B4P.mjs +1 -0
  34. package/dist/StructureAnalyzer-A-WamfYE.mjs +2 -0
  35. package/dist/ToolCatalog-D_IKl1Hu.mjs +1 -0
  36. package/dist/ToolError-DWU_z7gp.mjs +1 -0
  37. package/dist/ToolProbe-xsfALmN3.mjs +1 -0
  38. package/dist/ToolRegistry-B0Zs-phN.mjs +1 -0
  39. package/dist/ToolRouter.policy-CFHoN_Lw.mjs +4 -0
  40. package/dist/TraceRecorder-Dd8jLXpi.mjs +272 -0
  41. package/dist/VersionDetector-DMoUWyNm.mjs +9 -0
  42. package/dist/Win32API-Bhi5xFBe.mjs +1 -0
  43. package/dist/Win32Debug-CQteFL4F.mjs +1 -0
  44. package/dist/WorkflowEngine-CxEp2WXH.mjs +1 -0
  45. package/dist/analysis-BuR-NgX8.mjs +5 -0
  46. package/dist/{antidebug-CqDTB_uk.mjs → antidebug-BOTZH6-0.mjs} +8 -259
  47. package/dist/artifactRetention-NBdncOEW.mjs +1 -0
  48. package/dist/artifacts-B5xQuEa_.mjs +1 -0
  49. package/dist/authorization-schema-B40obG1A.mjs +1 -0
  50. package/dist/betterSqlite3-CGaxz4AX.mjs +1 -0
  51. package/dist/binary-instrument-Cf9qqLlM.mjs +7 -0
  52. package/dist/bind-helpers-BlAOQrFQ.mjs +1 -0
  53. package/dist/boringssl-inspector-BST5vtKx.mjs +2 -0
  54. package/dist/browser-C4Le3xqA.mjs +11 -0
  55. package/dist/capabilities-DbYCv-HF.mjs +1 -0
  56. package/dist/chunk-C_pMuVsO.mjs +1 -0
  57. package/dist/collector-CKO8RPK8.mjs +1 -0
  58. package/dist/concurrency-CcK46d0h.mjs +1 -0
  59. package/dist/constants-Cp6hBrrx.mjs +1 -0
  60. package/dist/coordination-BbijHEHH.mjs +1 -0
  61. package/dist/debugger-CRJq_krh.mjs +1 -0
  62. package/dist/definitions-BGobEDQa.mjs +1 -0
  63. package/dist/definitions-BGwNSkVm.mjs +1 -0
  64. package/dist/definitions-BbxOUiP-.mjs +1 -0
  65. package/dist/definitions-CCP9gphV.mjs +1 -0
  66. package/dist/definitions-CIO9O-Sw.mjs +1 -0
  67. package/dist/definitions-CYFbewnd.mjs +1 -0
  68. package/dist/definitions-CdWEuIkI.mjs +1 -0
  69. package/dist/definitions-CoQFbggH.mjs +1 -0
  70. package/dist/definitions-CuJRsJ6N.mjs +1 -0
  71. package/dist/definitions-DI9YXsJk.mjs +1 -0
  72. package/dist/definitions-DJklW2sS.mjs +1 -0
  73. package/dist/definitions-DZ8uKusP.mjs +1 -0
  74. package/dist/definitions-Dds_zrWx.mjs +1 -0
  75. package/dist/definitions-Dgrg7f3D.mjs +1 -0
  76. package/dist/definitions-DtE0XLrT.mjs +1 -0
  77. package/dist/definitions-LaYTuwQd.mjs +26 -0
  78. package/dist/definitions-NoVp_9Pm.mjs +1 -0
  79. package/dist/definitions-OvGsfxdt.mjs +1 -0
  80. package/dist/definitions-jXPaVy4P.mjs +1 -0
  81. package/dist/encoding-DGcr6Aj_.mjs +2 -0
  82. package/dist/ensure-browser-core-Buls24LQ.mjs +1 -0
  83. package/dist/evidence-graph-bridge-B0yhGPcs.mjs +1 -0
  84. package/dist/factory-Cx_1LorX.mjs +1 -0
  85. package/dist/flat-target-session-CO5g78k3.mjs +1 -0
  86. package/dist/formatAddress-C7j2fDlM.mjs +1 -0
  87. package/dist/graphql-HLf3MS8H.mjs +62 -0
  88. package/dist/handlers-BLMa4X7l.mjs +54 -0
  89. package/dist/handlers-BP12ZsWc.mjs +4 -0
  90. package/dist/handlers-BZoPla6E.mjs +1 -0
  91. package/dist/handlers-BggKiVx9.mjs +2 -0
  92. package/dist/handlers-D3iev8g1.mjs +1 -0
  93. package/dist/handlers-D49r1-1P.mjs +1 -0
  94. package/dist/handlers-DCE45Ww8.mjs +2 -0
  95. package/dist/handlers-DW5AbYs5.mjs +5 -0
  96. package/dist/handlers-De5u62Ga2.mjs +1 -0
  97. package/dist/handlers-DmQzIc44.mjs +31 -0
  98. package/dist/handlers-DnJRGp7t.mjs +302 -0
  99. package/dist/handlers-Dv_runVv.mjs +2 -0
  100. package/dist/handlers-S9Ws0IGy.mjs +2 -0
  101. package/dist/{handlers-Bl8zkwz1.mjs → handlers-pVNpaw4A.mjs} +144 -841
  102. package/dist/handlers.impl-CD2_kOcC.mjs +1 -0
  103. package/dist/hooks-DDKppogd.mjs +600 -0
  104. package/dist/index.mjs +12 -5225
  105. package/dist/logger-sBC6IdRT.mjs +1 -0
  106. package/dist/maintenance-CutEO84j.mjs +1 -0
  107. package/dist/manifest-BFGxlDRh.mjs +123 -0
  108. package/dist/manifest-BPuE6oH2.mjs +1 -0
  109. package/dist/manifest-BXry5N09.mjs +1 -0
  110. package/dist/manifest-BeP_zJGb2.mjs +1 -0
  111. package/dist/manifest-C0g67k6U.mjs +1 -0
  112. package/dist/manifest-C1nZkTkO.mjs +1 -0
  113. package/dist/manifest-C7qV1z7F.mjs +1 -0
  114. package/dist/manifest-CDeUZGUZ.mjs +1 -0
  115. package/dist/manifest-CDiCtaQT.mjs +1 -0
  116. package/dist/manifest-CFn0359q2.mjs +1 -0
  117. package/dist/manifest-CGq4NpqH2.mjs +1 -0
  118. package/dist/manifest-CJMGt7Qy.mjs +1 -0
  119. package/dist/manifest-CRIJq4Hs.mjs +1 -0
  120. package/dist/manifest-C_hEIjSx.mjs +1 -0
  121. package/dist/manifest-CeQmtQOY.mjs +1 -0
  122. package/dist/manifest-Cq0j7GZt.mjs +1 -0
  123. package/dist/manifest-CtPmHAdn.mjs +1 -0
  124. package/dist/manifest-Cx2IVMUY.mjs +1 -0
  125. package/dist/manifest-D16xPXro.mjs +1 -0
  126. package/dist/manifest-D44TaRJU.mjs +1 -0
  127. package/dist/manifest-D610kxZr.mjs +2 -0
  128. package/dist/manifest-DC-SMF6b.mjs +1 -0
  129. package/dist/manifest-DD3rtxvV.mjs +1 -0
  130. package/dist/manifest-DKUorv5M.mjs +1 -0
  131. package/dist/manifest-DMJlcsTR.mjs +1 -0
  132. package/dist/manifest-DWUUWBz0.mjs +1 -0
  133. package/dist/manifest-De-6Wf2R.mjs +1 -0
  134. package/dist/manifest-Dgh0uDW-.mjs +1 -0
  135. package/dist/manifest-Dm0o3i2U.mjs +1 -0
  136. package/dist/manifest-DsVh7Y4U.mjs +1 -0
  137. package/dist/manifest-DtEFSRaq.mjs +1 -0
  138. package/dist/manifest-H-EpAyZQ.mjs +1 -0
  139. package/dist/manifest-ais9Afrw.mjs +1 -0
  140. package/dist/manifest-tmb54wmA.mjs +1 -0
  141. package/dist/manifest-yu2xiQqe.mjs +1 -0
  142. package/dist/manifest-zrbrpKCC.mjs +1 -0
  143. package/dist/matchesWildcardPattern-BGqLSmEs.mjs +1 -0
  144. package/dist/modules-p-PUNv9r.mjs +332 -0
  145. package/dist/mojo-ipc-VGlv3Qyp.mjs +9 -0
  146. package/dist/network-BjZ1Y-GB.mjs +7 -0
  147. package/dist/outputPaths-BonGThuc.mjs +2 -0
  148. package/dist/parse-args-Cuk7-xUt.mjs +1 -0
  149. package/dist/platform-C446Lf97.mjs +93 -0
  150. package/dist/playwright-cdp-fallback-BwVR-_T3.mjs +1 -0
  151. package/dist/process-C9f2A5zk.mjs +962 -0
  152. package/dist/proxy-CvRepxgV.mjs +1 -0
  153. package/dist/registry-DUHIPE-v.mjs +1 -0
  154. package/dist/response-C7rKQst4.mjs +1 -0
  155. package/dist/search-defaults-D2bY-rzH.mjs +1 -0
  156. package/dist/server/plugin-api.mjs +1 -293
  157. package/dist/shared-state-board-Cyg-xh_k.mjs +1 -0
  158. package/dist/sourcemap-D6Q1UuAp.mjs +1 -0
  159. package/dist/ssrf-policy-T96MR3r6.mjs +1 -0
  160. package/dist/streaming-CTX58tbb.mjs +1 -0
  161. package/dist/tool-builder-CI9914Tf.mjs +1 -0
  162. package/dist/transform-Cv9P2vVD.mjs +103 -0
  163. package/dist/types-CuyefmGT.mjs +1 -0
  164. package/dist/types-DtThH00r.mjs +1 -0
  165. package/dist/wasm-DaJa8J0V.mjs +174 -0
  166. package/dist/webcrack-CsLLJIs9.mjs +46 -0
  167. package/dist/workflow-CYIXtrWD.mjs +101 -0
  168. package/package.json +12 -7
  169. package/dist/AntiCheatDetector-BNk-EoBt.mjs +0 -244
  170. package/dist/CacheAdapters-CDe5WPSV.mjs +0 -80
  171. package/dist/CodeInjector-Cq8q01kp.mjs +0 -150
  172. package/dist/ConsoleMonitor-CPVQW1Y-.mjs +0 -2201
  173. package/dist/DarwinAPI-BNPxu0RH.mjs +0 -363
  174. package/dist/DetailedDataManager-BQQcxh64.mjs +0 -217
  175. package/dist/EventBus-DgPmwpeu.mjs +0 -141
  176. package/dist/EvidenceGraphBridge-SFesNera.mjs +0 -153
  177. package/dist/ExtensionManager-CWYgw0YW.mjs +0 -714
  178. package/dist/FingerprintManager-gzWtkKuf.mjs +0 -96
  179. package/dist/HardwareBreakpoint-B9gZCdFP.mjs +0 -239
  180. package/dist/HeapAnalyzer-BLDH0dCv.mjs +0 -284
  181. package/dist/InstrumentationSession-CvPC7Jwy.mjs +0 -244
  182. package/dist/MemoryController-CbVdCIJF.mjs +0 -167
  183. package/dist/MemoryScanSession-BsDZbLYm.mjs +0 -278
  184. package/dist/MemoryScanner-Bcpml6II.mjs +0 -425
  185. package/dist/NativeMemoryManager.impl-dZtA1ZGn.mjs +0 -482
  186. package/dist/NativeMemoryManager.utils-B-FjA2mJ.mjs +0 -165
  187. package/dist/PEAnalyzer-D1lzJ_VG.mjs +0 -385
  188. package/dist/PageController-Bqm2kZ_X.mjs +0 -417
  189. package/dist/PointerChainEngine-BOhyVsjx.mjs +0 -322
  190. package/dist/PrerequisiteError-Dl33Svkz.mjs +0 -20
  191. package/dist/ResponseBuilder-D3iFYx2N.mjs +0 -143
  192. package/dist/ReverseEvidenceGraph-Dlsk94LC.mjs +0 -269
  193. package/dist/ScriptManager-aHHq0X7U.mjs +0 -3000
  194. package/dist/Speedhack-CqdIFlQl.mjs +0 -156
  195. package/dist/StealthVerifier-Bo4T3bz8.mjs +0 -135
  196. package/dist/StructureAnalyzer-DhFaPvRO.mjs +0 -426
  197. package/dist/ToolCatalog-C0JGZoOm.mjs +0 -582
  198. package/dist/ToolError-jh9whhMd.mjs +0 -15
  199. package/dist/ToolProbe-oC7aPrkv.mjs +0 -45
  200. package/dist/ToolRegistry-BjaF4oNz.mjs +0 -131
  201. package/dist/ToolRouter.policy-BWV67ZK-.mjs +0 -304
  202. package/dist/TraceRecorder-DgxyVbdQ.mjs +0 -519
  203. package/dist/VersionDetector-CwVLVdDM.mjs +0 -104
  204. package/dist/Win32API-CePkipZY.mjs +0 -340
  205. package/dist/Win32Debug-BvKs-gxc.mjs +0 -274
  206. package/dist/WorkflowEngine-CuvkZtWu.mjs +0 -598
  207. package/dist/analysis-CL9uACt9.mjs +0 -463
  208. package/dist/artifactRetention-CFEprwPw.mjs +0 -591
  209. package/dist/artifacts-Bk2-_uPq.mjs +0 -59
  210. package/dist/betterSqlite3-0pqusHHH.mjs +0 -74
  211. package/dist/binary-instrument-CXfpx6fT.mjs +0 -979
  212. package/dist/bind-helpers-xFfRF-qm.mjs +0 -22
  213. package/dist/boringssl-inspector-BH2D3VKc.mjs +0 -180
  214. package/dist/browser-BpOr5PEx.mjs +0 -4082
  215. package/dist/chunk-CjcI7cDX.mjs +0 -15
  216. package/dist/concurrency-Bt0yv1kJ.mjs +0 -41
  217. package/dist/constants-B0OANIBL.mjs +0 -519
  218. package/dist/coordination-qUbyF8KU.mjs +0 -259
  219. package/dist/debugger-gnKxRSN0.mjs +0 -1271
  220. package/dist/definitions-6M-eejaT.mjs +0 -53
  221. package/dist/definitions-B18eyf0B.mjs +0 -18
  222. package/dist/definitions-B3QdlrHv.mjs +0 -34
  223. package/dist/definitions-B4rAvHNZ.mjs +0 -63
  224. package/dist/definitions-BB_4jnmy.mjs +0 -37
  225. package/dist/definitions-BMfYXoNC.mjs +0 -43
  226. package/dist/definitions-Beid2EB3.mjs +0 -27
  227. package/dist/definitions-C1UvM5Iy.mjs +0 -126
  228. package/dist/definitions-CXEI7QC72.mjs +0 -216
  229. package/dist/definitions-C_4r7Fo-2.mjs +0 -14
  230. package/dist/definitions-CkFDALoa.mjs +0 -26
  231. package/dist/definitions-Cke7zEb8.mjs +0 -94
  232. package/dist/definitions-ClJLzsJQ.mjs +0 -25
  233. package/dist/definitions-Cq-zroAU.mjs +0 -28
  234. package/dist/definitions-Cy3Sl6gV.mjs +0 -34
  235. package/dist/definitions-D3VsGcvz.mjs +0 -47
  236. package/dist/definitions-DVGfrn7y.mjs +0 -96
  237. package/dist/definitions-LKpC3-nL.mjs +0 -9
  238. package/dist/definitions-bAhHQJq9.mjs +0 -359
  239. package/dist/encoding-Bvz5jLRv.mjs +0 -1065
  240. package/dist/evidence-graph-bridge-C_fv9PuC.mjs +0 -135
  241. package/dist/factory-DxlGh9Xf.mjs +0 -575
  242. package/dist/formatAddress-DVkj9kpI.mjs +0 -17
  243. package/dist/graphql-DYWzJ29s.mjs +0 -1026
  244. package/dist/handlers-9sAbfIg-.mjs +0 -2552
  245. package/dist/handlers-C67ktuRN.mjs +0 -710
  246. package/dist/handlers-C87g8oCe.mjs +0 -276
  247. package/dist/handlers-CTsDAO6p.mjs +0 -681
  248. package/dist/handlers-Cgyg6c0U.mjs +0 -645
  249. package/dist/handlers-D6j6yka7.mjs +0 -2124
  250. package/dist/handlers-DdFzXLvF.mjs +0 -446
  251. package/dist/handlers-DeLOCd5m.mjs +0 -799
  252. package/dist/handlers-DlCJN4Td.mjs +0 -757
  253. package/dist/handlers-DxGIq15_2.mjs +0 -917
  254. package/dist/handlers-U6L4xhuF.mjs +0 -585
  255. package/dist/handlers-tB9Mp9ZK.mjs +0 -84
  256. package/dist/handlers-tiy7EIBp.mjs +0 -572
  257. package/dist/handlers.impl-DS0d9fUw.mjs +0 -761
  258. package/dist/hooks-CzCWByww.mjs +0 -898
  259. package/dist/logger-Dh_xb7_2.mjs +0 -93
  260. package/dist/maintenance-P7ePRXQC.mjs +0 -830
  261. package/dist/manifest-2ToTpjv8.mjs +0 -106
  262. package/dist/manifest-3g71z6Bg.mjs +0 -79
  263. package/dist/manifest-82baTv4U.mjs +0 -45
  264. package/dist/manifest-B3QVVeBS.mjs +0 -82
  265. package/dist/manifest-BB2J8IMJ.mjs +0 -149
  266. package/dist/manifest-BKbgbSiY.mjs +0 -60
  267. package/dist/manifest-Bcf-TJzH.mjs +0 -848
  268. package/dist/manifest-BmtZzQiQ2.mjs +0 -45
  269. package/dist/manifest-Bnd7kqEY.mjs +0 -55
  270. package/dist/manifest-BqQX6OQC2.mjs +0 -65
  271. package/dist/manifest-BqrQ4Tpj.mjs +0 -81
  272. package/dist/manifest-Br4RPFt5.mjs +0 -370
  273. package/dist/manifest-C5qDjysN.mjs +0 -107
  274. package/dist/manifest-C9RT5nk32.mjs +0 -34
  275. package/dist/manifest-CAhOuvSl.mjs +0 -204
  276. package/dist/manifest-CBYWCUBJ.mjs +0 -51
  277. package/dist/manifest-CFADCRa1.mjs +0 -37
  278. package/dist/manifest-CQVhavRF.mjs +0 -114
  279. package/dist/manifest-CT7zZBV1.mjs +0 -48
  280. package/dist/manifest-CV12bcrF.mjs +0 -121
  281. package/dist/manifest-CXsRWjjI.mjs +0 -224
  282. package/dist/manifest-CZLUCfG02.mjs +0 -95
  283. package/dist/manifest-D6phHKFd.mjs +0 -131
  284. package/dist/manifest-DCyjf4n2.mjs +0 -294
  285. package/dist/manifest-DHsnKgP6.mjs +0 -60
  286. package/dist/manifest-Df_dliIe.mjs +0 -55
  287. package/dist/manifest-Dh8WBmEW.mjs +0 -129
  288. package/dist/manifest-DhKRAT8_.mjs +0 -92
  289. package/dist/manifest-DlpTj4ic2.mjs +0 -193
  290. package/dist/manifest-DrbmZcFl2.mjs +0 -253
  291. package/dist/manifest-DuwHjUa5.mjs +0 -70
  292. package/dist/manifest-DzwvxPJX.mjs +0 -38
  293. package/dist/manifest-NXctwWQq.mjs +0 -68
  294. package/dist/manifest-Sc_0JQ13.mjs +0 -418
  295. package/dist/manifest-gZ4s_UtG.mjs +0 -96
  296. package/dist/manifest-qSleDqdO.mjs +0 -1023
  297. package/dist/modules-C184v-S9.mjs +0 -11365
  298. package/dist/mojo-ipc-B_H61Afw.mjs +0 -525
  299. package/dist/network-671Cw6hV.mjs +0 -3346
  300. package/dist/outputPaths-B1uGmrWZ.mjs +0 -1145
  301. package/dist/parse-args-BlRjqlkL.mjs +0 -39
  302. package/dist/platform-WmNn8Sxb.mjs +0 -2070
  303. package/dist/process-QcbIy5Zq.mjs +0 -1401
  304. package/dist/proxy-DqNs0bAd.mjs +0 -170
  305. package/dist/registry-D-6e18lB.mjs +0 -34
  306. package/dist/response-BQVP-xUn.mjs +0 -28
  307. package/dist/shared-state-board-DV-dpHFJ.mjs +0 -586
  308. package/dist/sourcemap-Dq8ez8vS.mjs +0 -650
  309. package/dist/ssrf-policy-ZaUfvhq7.mjs +0 -166
  310. package/dist/streaming-BUQ0VJsg.mjs +0 -725
  311. package/dist/tool-builder-DCbIC5Eo.mjs +0 -186
  312. package/dist/transform-CiYJfNX0.mjs +0 -1007
  313. package/dist/types-Bx92KJfT.mjs +0 -4
  314. package/dist/types-CPhOReNX.mjs +0 -37
  315. package/dist/wasm-DQTnHDs4.mjs +0 -531
  316. package/dist/workflow-f3xJOcjx.mjs +0 -725
@@ -1,757 +0,0 @@
1
- import { n as asJsonResponse } from "./response-BQVP-xUn.mjs";
2
- import { a as argString, t as argBool } from "./parse-args-BlRjqlkL.mjs";
3
- //#region src/server/domains/cross-domain/handlers/skia-correlator.ts
4
- function normalizeSkiaToken(value) {
5
- return value.toLowerCase().replace(/[^a-z0-9]/g, "");
6
- }
7
- function computeTokenSimilarity(a, b) {
8
- const na = normalizeSkiaToken(a);
9
- const nb = normalizeSkiaToken(b);
10
- if (na === nb && na.length > 0) return 1;
11
- if (na.length === 0 || nb.length === 0) return 0;
12
- if (na.includes(nb) || nb.includes(na)) return .8;
13
- return 0;
14
- }
15
- function findBestJSMatch(label, jsObjects) {
16
- let bestScore = 0;
17
- let bestMatch;
18
- for (const obj of jsObjects) {
19
- const nameScore = computeTokenSimilarity(label, obj.name);
20
- if (nameScore > bestScore) {
21
- bestScore = nameScore;
22
- bestMatch = {
23
- objectId: obj.objectId,
24
- name: obj.name,
25
- score: nameScore
26
- };
27
- }
28
- for (const prop of obj.stringProps) {
29
- const propScore = computeTokenSimilarity(label, prop);
30
- if (propScore > bestScore) {
31
- bestScore = propScore;
32
- bestMatch = {
33
- objectId: obj.objectId,
34
- name: obj.name,
35
- score: propScore
36
- };
37
- }
38
- }
39
- }
40
- if (bestMatch && bestScore >= .5) return bestMatch;
41
- }
42
- function correlateSkiaToJS(bridge, input) {
43
- const graphNodeIds = [];
44
- const correlations = [];
45
- const unmatchedSkiaNodes = [];
46
- const matchedIds = /* @__PURE__ */ new Set();
47
- const allSkiaItems = [];
48
- for (const layer of input.sceneTree.layers) allSkiaItems.push({
49
- id: layer.id,
50
- label: layer.label,
51
- heapObjectId: layer.heapObjectId
52
- });
53
- for (const cmd of input.sceneTree.drawCommands) allSkiaItems.push({
54
- id: cmd.id,
55
- label: cmd.label
56
- });
57
- const totalSkiaNodes = allSkiaItems.length;
58
- for (const item of allSkiaItems) {
59
- const canvasNode = bridge.addCanvasNode({
60
- nodeId: item.id,
61
- label: item.label
62
- });
63
- graphNodeIds.push(canvasNode.id);
64
- if (item.heapObjectId) {
65
- const jsObj = input.jsObjects.find((o) => o.objectId === item.heapObjectId);
66
- if (jsObj) {
67
- const heapNode = bridge.addV8Object({
68
- address: item.heapObjectId,
69
- name: jsObj.name
70
- });
71
- graphNodeIds.push(heapNode.id);
72
- bridge.getGraph().addEdge(heapNode.id, canvasNode.id, "canvas-rendered-by", {
73
- domain: "cross-domain",
74
- matchScore: 1
75
- });
76
- correlations.push({
77
- skiaNodeId: item.id,
78
- matchedObjectId: jsObj.objectId,
79
- matchedObjectName: jsObj.name,
80
- matchScore: 1
81
- });
82
- matchedIds.add(item.id);
83
- continue;
84
- }
85
- }
86
- const match = findBestJSMatch(item.label, input.jsObjects);
87
- if (match) {
88
- const heapNode = bridge.addV8Object({
89
- address: match.objectId,
90
- name: match.name
91
- });
92
- graphNodeIds.push(heapNode.id);
93
- bridge.getGraph().addEdge(heapNode.id, canvasNode.id, "canvas-rendered-by", {
94
- domain: "cross-domain",
95
- matchScore: match.score
96
- });
97
- correlations.push({
98
- skiaNodeId: item.id,
99
- matchedObjectId: match.objectId,
100
- matchedObjectName: match.name,
101
- matchScore: match.score
102
- });
103
- matchedIds.add(item.id);
104
- } else unmatchedSkiaNodes.push(item.id);
105
- }
106
- return {
107
- skiaNodes: totalSkiaNodes,
108
- correlations,
109
- unmatchedSkiaNodes,
110
- confidence: totalSkiaNodes === 0 ? 0 : correlations.length / totalSkiaNodes,
111
- graphNodeIds
112
- };
113
- }
114
- //#endregion
115
- //#region src/server/domains/cross-domain/handlers/mojo-cdp-correlator.ts
116
- /** Mapping of Mojo interface patterns to CDP event patterns. */
117
- const INTERFACE_TO_CDP_PATTERNS = [
118
- {
119
- mojoPattern: /URLLoader/i,
120
- cdpPattern: /Network\./i
121
- },
122
- {
123
- mojoPattern: /WebSocket/i,
124
- cdpPattern: /Network\.webSocket/i
125
- },
126
- {
127
- mojoPattern: /Fetch/i,
128
- cdpPattern: /Fetch\./i
129
- }
130
- ];
131
- const TIMESTAMP_PROXIMITY_MS = 50;
132
- function correlateMojoToCDP(bridge, mojoMessages, cdpEvents, networkRequests) {
133
- const graphNodeIds = [];
134
- const matchedPairs = [];
135
- const matchedMojoIds = /* @__PURE__ */ new Set();
136
- if (mojoMessages.length === 0) return {
137
- mojoMessages: 0,
138
- matchedPairs: [],
139
- unmatchedMojo: [],
140
- confidence: 0,
141
- graphNodeIds: []
142
- };
143
- const mojoNodeMap = /* @__PURE__ */ new Map();
144
- for (const msg of mojoMessages) {
145
- const node = bridge.addMojoMessage({
146
- interface: msg.interface,
147
- method: msg.method,
148
- timestamp: msg.timestamp
149
- });
150
- mojoNodeMap.set(msg.messageId, node.id);
151
- graphNodeIds.push(node.id);
152
- }
153
- for (const msg of mojoMessages) {
154
- if (matchedMojoIds.has(msg.messageId)) continue;
155
- for (const pattern of INTERFACE_TO_CDP_PATTERNS) {
156
- if (!pattern.mojoPattern.test(msg.interface)) continue;
157
- const matchingCdp = cdpEvents.find((evt) => pattern.cdpPattern.test(evt.eventType) && !matchedMojoIds.has(msg.messageId));
158
- if (matchingCdp) {
159
- matchedPairs.push({
160
- mojoMessageId: msg.messageId,
161
- matchType: "interface",
162
- cdpEventType: matchingCdp.eventType
163
- });
164
- matchedMojoIds.add(msg.messageId);
165
- break;
166
- }
167
- }
168
- }
169
- for (const msg of mojoMessages) {
170
- if (matchedMojoIds.has(msg.messageId)) continue;
171
- if (/URLLoader/i.test(msg.interface)) {
172
- const matchingReq = networkRequests.find((req) => Math.abs(req.timestamp - msg.timestamp) <= TIMESTAMP_PROXIMITY_MS);
173
- if (matchingReq) {
174
- matchedPairs.push({
175
- mojoMessageId: msg.messageId,
176
- matchType: "urlloader",
177
- networkRequestId: matchingReq.requestId,
178
- timestampDelta: Math.abs(matchingReq.timestamp - msg.timestamp)
179
- });
180
- matchedMojoIds.add(msg.messageId);
181
- }
182
- }
183
- }
184
- for (const msg of mojoMessages) {
185
- if (matchedMojoIds.has(msg.messageId)) continue;
186
- let closestDelta = Infinity;
187
- let closestCdp;
188
- for (const evt of cdpEvents) {
189
- const delta = Math.abs(evt.timestamp - msg.timestamp);
190
- if (delta <= TIMESTAMP_PROXIMITY_MS && delta < closestDelta) {
191
- closestDelta = delta;
192
- closestCdp = evt;
193
- }
194
- }
195
- if (closestCdp) {
196
- matchedPairs.push({
197
- mojoMessageId: msg.messageId,
198
- matchType: "timestamp",
199
- cdpEventType: closestCdp.eventType,
200
- timestampDelta: closestDelta
201
- });
202
- matchedMojoIds.add(msg.messageId);
203
- }
204
- }
205
- const unmatchedMojo = mojoMessages.filter((msg) => !matchedMojoIds.has(msg.messageId)).map((msg) => msg.messageId);
206
- const confidence = mojoMessages.length === 0 ? 0 : matchedMojoIds.size / mojoMessages.length;
207
- return {
208
- mojoMessages: mojoMessages.length,
209
- matchedPairs,
210
- unmatchedMojo,
211
- confidence,
212
- graphNodeIds
213
- };
214
- }
215
- //#endregion
216
- //#region src/server/domains/cross-domain/handlers/syscall-js-correlator.ts
217
- /**
218
- * Patterns mapping syscall names to JS API patterns for confidence scoring.
219
- * If the JS function name matches a pattern associated with a syscall, confidence is higher.
220
- */
221
- const SYSCALL_JS_PATTERNS = {
222
- NtReadFile: /read|fs[_.]read/i,
223
- NtWriteFile: /write|fs[_.]write/i,
224
- NtOpenFile: /open|fs[_.]open/i,
225
- NtCreateFile: /create|fs[_.]create/i,
226
- NtClose: /close|fs[_.]close/i,
227
- NtDeviceIoControlFile: /ioctl|device/i,
228
- NtQueryInformationFile: /stat|info|query/i,
229
- NtSetInformationFile: /set|chmod|chown/i
230
- };
231
- function scoreConfidence(syscallName, functionName) {
232
- const pattern = SYSCALL_JS_PATTERNS[syscallName];
233
- if (pattern && pattern.test(functionName)) return "high";
234
- if (/file|fs|read|write|open|close/i.test(functionName)) return "medium";
235
- return "low";
236
- }
237
- function correlateSyscallToJS(bridge, syscallEvents, jsStacks) {
238
- const graphNodeIds = [];
239
- const correlations = [];
240
- const unmatchedSyscalls = [];
241
- if (syscallEvents.length === 0) return {
242
- syscalls: 0,
243
- correlations: [],
244
- unmatchedSyscalls: [],
245
- correlationConfidence: 0,
246
- graphNodeIds: []
247
- };
248
- for (const event of syscallEvents) {
249
- const syscallNode = bridge.addSyscallEvent({
250
- pid: event.pid,
251
- tid: event.tid,
252
- syscallName: event.syscallName,
253
- timestamp: event.timestamp
254
- });
255
- graphNodeIds.push(syscallNode.id);
256
- const matchingStack = jsStacks.find((stack) => stack.threadId === event.tid && stack.timestamp === event.timestamp);
257
- if (matchingStack && matchingStack.frames.length > 0) {
258
- const topFrame = matchingStack.frames[0];
259
- if (topFrame) {
260
- const functionName = topFrame.functionName;
261
- const confidence = scoreConfidence(event.syscallName, functionName);
262
- const funcNode = bridge.addNode("function", functionName, {
263
- domain: "v8-inspector",
264
- functionName,
265
- threadId: event.tid
266
- });
267
- graphNodeIds.push(funcNode.id);
268
- bridge.getGraph().addEdge(funcNode.id, syscallNode.id, "syscall-emitted-by", {
269
- domain: "cross-domain",
270
- confidence
271
- });
272
- correlations.push({
273
- syscallName: event.syscallName,
274
- topJsFunction: functionName,
275
- threadId: event.tid,
276
- timestamp: event.timestamp,
277
- confidence
278
- });
279
- } else unmatchedSyscalls.push({
280
- syscallName: event.syscallName,
281
- tid: event.tid
282
- });
283
- } else unmatchedSyscalls.push({
284
- syscallName: event.syscallName,
285
- tid: event.tid
286
- });
287
- }
288
- const correlationConfidence = syscallEvents.length === 0 ? 0 : correlations.length / syscallEvents.length;
289
- return {
290
- syscalls: syscallEvents.length,
291
- correlations,
292
- unmatchedSyscalls,
293
- correlationConfidence,
294
- graphNodeIds
295
- };
296
- }
297
- //#endregion
298
- //#region src/server/domains/cross-domain/handlers/binary-to-js-pipeline.ts
299
- /** Patterns that identify functions callable from JS or exported for JS use. */
300
- const JS_CALLABLE_PATTERNS = [
301
- /^native_/i,
302
- /^JS_/i,
303
- /^Java_/i
304
- ];
305
- function isJSCallable(func) {
306
- if (func.calledFrom && func.calledFrom.length > 0) return true;
307
- return JS_CALLABLE_PATTERNS.some((pattern) => pattern.test(func.name));
308
- }
309
- function generateFridaHookCode(functions, moduleName) {
310
- const lines = [];
311
- lines.push("// Binary-to-JS Hook Script");
312
- lines.push(`// Module: ${moduleName}`);
313
- lines.push(`// Generated at: ${(/* @__PURE__ */ new Date()).toISOString()}`);
314
- lines.push("");
315
- for (const func of functions) {
316
- const resolvedModule = func.moduleName || moduleName;
317
- if (func.address) {
318
- lines.push(`// Hook: ${func.name} at ${func.address} in ${resolvedModule}`);
319
- lines.push(`Interceptor.attach(Module.findBaseAddress('${resolvedModule}').add(${func.address}), {`);
320
- } else {
321
- lines.push(`// Hook: ${func.name} in ${resolvedModule}`);
322
- lines.push(`Interceptor.attach(Module.findExportByName('${resolvedModule}', '${func.name}'), {`);
323
- }
324
- lines.push(` onEnter(args) {`);
325
- lines.push(` console.log('[${func.name}] called with args:', args[0], args[1]);`);
326
- lines.push(` },`);
327
- lines.push(` onLeave(retval) {`);
328
- lines.push(` console.log('[${func.name}] returned:', retval);`);
329
- lines.push(` }`);
330
- lines.push(`});`);
331
- lines.push("");
332
- }
333
- lines.push(`console.log('Binary-to-JS hook script loaded for ${moduleName}');`);
334
- return lines.join("\n");
335
- }
336
- function buildBinaryToJSPipeline(bridge, ghidraOutput, forcedFunctions) {
337
- const evidenceGraphLinks = [];
338
- const injectedFunctions = [];
339
- let selectedFunctions;
340
- if (forcedFunctions && forcedFunctions.length > 0) {
341
- const forcedSet = new Set(forcedFunctions);
342
- selectedFunctions = ghidraOutput.functions.filter((f) => forcedSet.has(f.name));
343
- } else selectedFunctions = ghidraOutput.functions.filter(isJSCallable);
344
- const generatedHookScript = generateFridaHookCode(selectedFunctions, ghidraOutput.moduleName);
345
- for (const func of selectedFunctions) {
346
- const symbolNode = bridge.addBinarySymbol({
347
- moduleName: func.moduleName || ghidraOutput.moduleName,
348
- symbolName: func.name,
349
- address: func.address ?? "0x0"
350
- });
351
- const hookNode = bridge.addNode("breakpoint-hook", `frida:${func.name}`, {
352
- domain: "binary-instrument",
353
- hookType: "frida-interceptor",
354
- functionName: func.name,
355
- moduleName: func.moduleName || ghidraOutput.moduleName
356
- });
357
- bridge.getGraph().addEdge(symbolNode.id, hookNode.id, "binary-exports", {
358
- domain: "cross-domain",
359
- relation: "binary-to-frida-hook"
360
- });
361
- evidenceGraphLinks.push({
362
- binarySymbolNodeId: symbolNode.id,
363
- hookScriptNodeId: hookNode.id,
364
- functionName: func.name
365
- });
366
- injectedFunctions.push(func.name);
367
- }
368
- return {
369
- hookCount: selectedFunctions.length,
370
- generatedHookScript,
371
- injectedFunctions,
372
- evidenceGraphLinks
373
- };
374
- }
375
- //#endregion
376
- //#region src/server/domains/cross-domain/workflows/missions.ts
377
- const WORKFLOWS = {
378
- WORKFLOW_REVERSE_OBFUSCATED: {
379
- id: "reverse-obfuscated-api",
380
- displayName: "Reverse Obfuscated API",
381
- steps: [
382
- {
383
- tool: "deobfuscate",
384
- args: { targetUrl: "${input.targetUrl}" }
385
- },
386
- {
387
- tool: "js_heap_search",
388
- args: { query: "${previous.cryptoKeys}" }
389
- },
390
- {
391
- tool: "network_enable",
392
- args: {}
393
- },
394
- {
395
- tool: "tls_cert_pin_bypass",
396
- args: { target: "${input.target}" }
397
- },
398
- {
399
- tool: "console_inject_fetch_interceptor",
400
- args: { urls: ["${input.apiEndpoint}"] }
401
- }
402
- ]
403
- },
404
- WORKFLOW_GAME_CANVAS_SKIA: {
405
- id: "game-canvas-skia-v8",
406
- displayName: "Game Canvas + SKIA + V8 Analysis",
407
- steps: [
408
- {
409
- tool: "canvas_engine_fingerprint",
410
- args: { canvasId: "${input.canvasId}" }
411
- },
412
- {
413
- tool: "canvas_scene_dump",
414
- args: { canvasId: "${input.canvasId}" }
415
- },
416
- {
417
- tool: "skia_correlate_objects",
418
- args: { skiaNodeIds: "${previous.nodeIds}" }
419
- },
420
- {
421
- tool: "performance_take_heap_snapshot",
422
- args: {}
423
- },
424
- {
425
- tool: "js_heap_search",
426
- args: { query: "${input.searchTerm}" }
427
- }
428
- ]
429
- },
430
- WORKFLOW_BINARY_NATIVE_HOOK: {
431
- id: "binary-native-hook",
432
- displayName: "Binary Analysis + Native Hook",
433
- steps: [
434
- {
435
- tool: "ghidra_analyze",
436
- args: { binaryPath: "${input.binaryPath}" }
437
- },
438
- {
439
- tool: "generate_hooks",
440
- args: { symbols: "${previous.exportedSymbols}" }
441
- },
442
- {
443
- tool: "frida_attach",
444
- args: { target: "${input.target}" }
445
- },
446
- {
447
- tool: "frida_run_script",
448
- args: { script: "${previous.hookScript}" }
449
- }
450
- ]
451
- }
452
- };
453
- //#endregion
454
- //#region src/server/domains/cross-domain/handlers.impl.ts
455
- function isRecord(value) {
456
- return value !== null && typeof value === "object";
457
- }
458
- function extractSkiaSceneTree(value) {
459
- if (!isRecord(value)) return {
460
- layers: [],
461
- drawCommands: []
462
- };
463
- return {
464
- layers: Array.isArray(value["layers"]) ? value["layers"] : [],
465
- drawCommands: Array.isArray(value["drawCommands"]) ? value["drawCommands"] : []
466
- };
467
- }
468
- function extractJSObjectArray(value) {
469
- if (!Array.isArray(value)) return [];
470
- return value.filter(isRecord).map((item) => ({
471
- objectId: typeof item["objectId"] === "string" ? item["objectId"] : "",
472
- className: typeof item["className"] === "string" ? item["className"] : "",
473
- name: typeof item["name"] === "string" ? item["name"] : "",
474
- stringProps: Array.isArray(item["stringProps"]) ? item["stringProps"].filter((s) => typeof s === "string") : [],
475
- numericProps: isRecord(item["numericProps"]) ? Object.fromEntries(Object.entries(item["numericProps"]).filter((entry) => typeof entry[1] === "number")) : {},
476
- colorProps: Array.isArray(item["colorProps"]) ? item["colorProps"].filter((s) => typeof s === "string") : [],
477
- urlProps: Array.isArray(item["urlProps"]) ? item["urlProps"].filter((s) => typeof s === "string") : []
478
- }));
479
- }
480
- function extractMojoMessages(value) {
481
- if (!Array.isArray(value)) return [];
482
- return value.filter(isRecord).map((item) => ({
483
- interface: typeof item["interface"] === "string" ? item["interface"] : "",
484
- method: typeof item["method"] === "string" ? item["method"] : "",
485
- timestamp: typeof item["timestamp"] === "number" ? item["timestamp"] : 0,
486
- messageId: typeof item["messageId"] === "string" ? item["messageId"] : ""
487
- }));
488
- }
489
- function extractCDPEvents(value) {
490
- if (!Array.isArray(value)) return [];
491
- return value.filter(isRecord).map((item) => ({
492
- eventType: typeof item["eventType"] === "string" ? item["eventType"] : "",
493
- timestamp: typeof item["timestamp"] === "number" ? item["timestamp"] : 0,
494
- url: typeof item["url"] === "string" ? item["url"] : void 0
495
- }));
496
- }
497
- function extractNetworkRequests(value) {
498
- if (!Array.isArray(value)) return [];
499
- return value.filter(isRecord).map((item) => ({
500
- requestId: typeof item["requestId"] === "string" ? item["requestId"] : "",
501
- url: typeof item["url"] === "string" ? item["url"] : "",
502
- timestamp: typeof item["timestamp"] === "number" ? item["timestamp"] : 0
503
- }));
504
- }
505
- function extractSyscallEvents(value) {
506
- if (!Array.isArray(value)) return [];
507
- return value.filter(isRecord).map((item) => ({
508
- pid: typeof item["pid"] === "number" ? item["pid"] : 0,
509
- tid: typeof item["tid"] === "number" ? item["tid"] : 0,
510
- syscallName: typeof item["syscallName"] === "string" ? item["syscallName"] : "",
511
- timestamp: typeof item["timestamp"] === "number" ? item["timestamp"] : 0
512
- }));
513
- }
514
- function extractJSStacks(value) {
515
- if (!Array.isArray(value)) return [];
516
- return value.filter(isRecord).map((item) => {
517
- const frames = Array.isArray(item["frames"]) ? item["frames"].filter(isRecord).map((f) => ({ functionName: typeof f["functionName"] === "string" ? f["functionName"] : "" })) : [];
518
- return {
519
- threadId: typeof item["threadId"] === "number" ? item["threadId"] : 0,
520
- timestamp: typeof item["timestamp"] === "number" ? item["timestamp"] : 0,
521
- frames
522
- };
523
- });
524
- }
525
- function extractGhidraOutput(value) {
526
- if (!isRecord(value)) return null;
527
- const moduleName = typeof value["moduleName"] === "string" ? value["moduleName"] : "";
528
- if (!moduleName) return null;
529
- return {
530
- functions: (Array.isArray(value["functions"]) ? value["functions"] : []).filter(isRecord).map((item) => ({
531
- name: typeof item["name"] === "string" ? item["name"] : "",
532
- moduleName: typeof item["moduleName"] === "string" ? item["moduleName"] : "",
533
- address: typeof item["address"] === "string" ? item["address"] : void 0,
534
- calledFrom: Array.isArray(item["calledFrom"]) ? item["calledFrom"].filter((c) => typeof c === "string") : void 0
535
- })),
536
- moduleName
537
- };
538
- }
539
- const V5_DOMAIN_NAMES = [
540
- "analysis",
541
- "browser",
542
- "network",
543
- "canvas",
544
- "skia-capture",
545
- "v8-inspector",
546
- "mojo-ipc",
547
- "syscall-hook",
548
- "binary-instrument",
549
- "boringssl-inspector",
550
- "evidence"
551
- ];
552
- var CrossDomainWorkflowClassifier = class {
553
- constructor(ctx, evidenceBridgeReady) {
554
- this.ctx = ctx;
555
- this.evidenceBridgeReady = evidenceBridgeReady;
556
- }
557
- getCapabilities() {
558
- const availableDomains = this.getAvailableDomains();
559
- const missingDomains = V5_DOMAIN_NAMES.filter((d) => !availableDomains.includes(d));
560
- const workflows = Object.entries(WORKFLOWS).map(([workflowKey, workflow]) => {
561
- const evaluation = this.evaluateWorkflow(workflow);
562
- return {
563
- workflowKey,
564
- id: workflow.id,
565
- displayName: workflow.displayName,
566
- stepCount: workflow.steps.length,
567
- ...evaluation
568
- };
569
- });
570
- return {
571
- availableDomains,
572
- missingDomains,
573
- supportedDomains: [...V5_DOMAIN_NAMES],
574
- workflows
575
- };
576
- }
577
- suggestWorkflow(goal, preferAvailableOnly) {
578
- const normalizedGoal = goal.toLowerCase();
579
- const scored = Object.entries(WORKFLOWS).map(([workflowKey, workflow]) => {
580
- return {
581
- workflowKey,
582
- workflow,
583
- keywordScore: this.scoreWorkflowGoal(normalizedGoal, workflowKey, workflow),
584
- evaluation: this.evaluateWorkflow(workflow)
585
- };
586
- });
587
- const candidates = preferAvailableOnly ? scored.filter((item) => item.evaluation.missingDomains.length === 0) : scored;
588
- const rankedPool = candidates.length > 0 ? candidates : scored;
589
- rankedPool.sort((a, b) => {
590
- if (b.keywordScore !== a.keywordScore) return b.keywordScore - a.keywordScore;
591
- return b.evaluation.coverage - a.evaluation.coverage;
592
- });
593
- const selected = rankedPool[0];
594
- if (!selected) throw new Error("No workflow definitions are available for cross-domain suggestion");
595
- const reason = this.describeWorkflowReason(normalizedGoal, selected.evaluation);
596
- return {
597
- workflowKey: selected.workflowKey,
598
- id: selected.workflow.id,
599
- displayName: selected.workflow.displayName,
600
- reason,
601
- ...selected.evaluation
602
- };
603
- }
604
- getHealth() {
605
- const availableDomains = this.getAvailableDomains();
606
- return {
607
- evidenceBridgeReady: this.evidenceBridgeReady,
608
- orchestratorReady: true,
609
- availableDomains,
610
- missingDomains: V5_DOMAIN_NAMES.filter((d) => !availableDomains.includes(d))
611
- };
612
- }
613
- getAvailableDomains() {
614
- const currentEnabledDomains = this.ctx.enabledDomains.size > 0 ? this.ctx.enabledDomains : this.ctx.resolveEnabledDomains(this.ctx.selectedTools);
615
- const available = [];
616
- for (const d of V5_DOMAIN_NAMES) if (currentEnabledDomains.has(d)) available.push(d);
617
- return available;
618
- }
619
- evaluateWorkflow(workflow) {
620
- const requiredSet = /* @__PURE__ */ new Set();
621
- for (const step of workflow.steps) for (const d of this.inferDomainsForTool(step.tool)) requiredSet.add(d);
622
- const requiredDomains = [...requiredSet];
623
- const available = this.getAvailableDomains().filter((d) => requiredSet.has(d));
624
- return {
625
- requiredDomains,
626
- availableDomains: available,
627
- missingDomains: requiredDomains.filter((d) => !available.includes(d)),
628
- coverage: requiredDomains.length === 0 ? 1 : available.length / requiredDomains.length
629
- };
630
- }
631
- inferDomainsForTool(toolName) {
632
- if (toolName.startsWith("deobfuscate") || toolName.startsWith("advanced_deobfuscate")) return ["analysis"];
633
- if (toolName.startsWith("js_heap") || toolName.startsWith("performance_take_heap_snapshot")) return ["v8-inspector"];
634
- if (toolName.startsWith("network_")) return ["network"];
635
- if (toolName.startsWith("console_")) return ["browser"];
636
- if (toolName.startsWith("tls_") || toolName.startsWith("net_raw_")) return ["boringssl-inspector"];
637
- if (toolName.startsWith("canvas_")) return ["canvas"];
638
- if (toolName.startsWith("skia_")) return ["skia-capture"];
639
- if (toolName.startsWith("v8_")) return ["v8-inspector"];
640
- if (toolName.startsWith("mojo_")) return ["mojo-ipc"];
641
- if (toolName.startsWith("syscall_")) return ["syscall-hook"];
642
- if (toolName.startsWith("adb_")) return ["adb-bridge"];
643
- if (toolName.startsWith("ghidra_") || toolName.startsWith("frida_") || toolName.startsWith("generate_hooks") || toolName.startsWith("unidbg_") || toolName.startsWith("export_hook_script")) return ["binary-instrument"];
644
- if (toolName.startsWith("extension_") || toolName.startsWith("webhook_")) return ["extension-registry"];
645
- if (toolName.startsWith("cross_domain_")) return ["cross-domain"];
646
- if (toolName.startsWith("evidence_")) return ["evidence"];
647
- if (toolName.startsWith("boringssl_")) return ["boringssl-inspector"];
648
- return [];
649
- }
650
- scoreWorkflowGoal(normalizedGoal, workflowKey, workflow) {
651
- let score = 0;
652
- if (workflowKey === "WORKFLOW_REVERSE_OBFUSCATED") {
653
- if (normalizedGoal.includes("obfus") || normalizedGoal.includes("api")) score += 3;
654
- if (normalizedGoal.includes("tls") || normalizedGoal.includes("pin")) score += 2;
655
- }
656
- if (workflowKey === "WORKFLOW_GAME_CANVAS_SKIA") {
657
- if (normalizedGoal.includes("canvas") || normalizedGoal.includes("game")) score += 3;
658
- if (normalizedGoal.includes("skia") || normalizedGoal.includes("scene")) score += 2;
659
- }
660
- if (workflowKey === "WORKFLOW_BINARY_NATIVE_HOOK") {
661
- if (normalizedGoal.includes("binary") || normalizedGoal.includes("native")) score += 3;
662
- if (normalizedGoal.includes("hook") || normalizedGoal.includes("frida")) score += 2;
663
- }
664
- if (score === 0 && workflow.displayName.toLowerCase().includes(normalizedGoal)) score += 1;
665
- return score;
666
- }
667
- describeWorkflowReason(normalizedGoal, evaluation) {
668
- if (evaluation.missingDomains.length === 0) return `Matched goal "${normalizedGoal}" and all required domains are enabled.`;
669
- return `Matched goal "${normalizedGoal}" with ${Math.round(evaluation.coverage * 100)}% domain coverage. Missing: ${evaluation.missingDomains.join(", ")}.`;
670
- }
671
- };
672
- var CrossDomainHandlers = class {
673
- constructor(evidenceBridge, workflowClassifier) {
674
- this.evidenceBridge = evidenceBridge;
675
- this.workflowClassifier = workflowClassifier;
676
- }
677
- async handleCapabilities(_args) {
678
- const capabilities = {
679
- evidenceGraphAvailable: true,
680
- workflowClassifierAvailable: this.workflowClassifier !== void 0
681
- };
682
- if (this.workflowClassifier) return asJsonResponse({
683
- capabilities,
684
- ...this.workflowClassifier.getCapabilities()
685
- });
686
- return asJsonResponse({ capabilities });
687
- }
688
- async handleSuggestWorkflow(args) {
689
- const query = argString(args, "query", "") || argString(args, "goal", "");
690
- const preferAvailableOnly = argBool(args, "preferAvailableOnly", true);
691
- if (this.workflowClassifier && query) return asJsonResponse(this.workflowClassifier.suggestWorkflow(query, preferAvailableOnly));
692
- return asJsonResponse({ message: "Cross-domain workflow suggestion requires a classifier and query." });
693
- }
694
- async handleHealth() {
695
- const stats = this.evidenceBridge.getStats();
696
- if (this.workflowClassifier) return asJsonResponse({
697
- ...this.workflowClassifier.getHealth(),
698
- evidenceGraph: stats
699
- });
700
- return asJsonResponse({
701
- evidenceBridgeReady: true,
702
- orchestratorReady: false,
703
- evidenceGraph: stats
704
- });
705
- }
706
- async handleCorrelateAll(args) {
707
- const errors = [];
708
- const results = {};
709
- try {
710
- const sceneTree = extractSkiaSceneTree(args["sceneTree"]);
711
- const jsObjects = extractJSObjectArray(args["jsObjects"]);
712
- results["skia"] = correlateSkiaToJS(this.evidenceBridge, {
713
- sceneTree,
714
- jsObjects
715
- });
716
- } catch (e) {
717
- errors.push(`SKIA-03: ${e instanceof Error ? e.message : String(e)}`);
718
- }
719
- try {
720
- const mojoMessages = extractMojoMessages(args["mojoMessages"]);
721
- const cdpEvents = extractCDPEvents(args["cdpEvents"]);
722
- const networkRequests = extractNetworkRequests(args["networkRequests"]);
723
- results["mojo"] = correlateMojoToCDP(this.evidenceBridge, mojoMessages, cdpEvents, networkRequests);
724
- } catch (e) {
725
- errors.push(`MOJO-03: ${e instanceof Error ? e.message : String(e)}`);
726
- }
727
- try {
728
- const syscallEvents = extractSyscallEvents(args["syscallEvents"]);
729
- const jsStacks = extractJSStacks(args["jsStacks"]);
730
- results["syscall"] = correlateSyscallToJS(this.evidenceBridge, syscallEvents, jsStacks);
731
- } catch (e) {
732
- errors.push(`SYSCALL-02: ${e instanceof Error ? e.message : String(e)}`);
733
- }
734
- try {
735
- const ghidraOutput = extractGhidraOutput(args["ghidraOutput"]);
736
- if (ghidraOutput) results["binary"] = buildBinaryToJSPipeline(this.evidenceBridge, ghidraOutput);
737
- } catch (e) {
738
- errors.push(`BIN-04: ${e instanceof Error ? e.message : String(e)}`);
739
- }
740
- const snapshot = this.evidenceBridge.exportGraph();
741
- return asJsonResponse({
742
- correlationResults: {
743
- ...results,
744
- errors
745
- },
746
- evidenceGraph: snapshot
747
- });
748
- }
749
- async handleEvidenceExport() {
750
- return asJsonResponse(this.evidenceBridge.exportGraph());
751
- }
752
- async handleEvidenceStats() {
753
- return asJsonResponse(this.evidenceBridge.getStats());
754
- }
755
- };
756
- //#endregion
757
- export { CrossDomainHandlers, CrossDomainWorkflowClassifier };