@jshookmcp/jshook 0.3.0 → 0.3.2

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 (346) hide show
  1. package/LICENSE +661 -661
  2. package/README.md +32 -49
  3. package/README.zh.md +32 -47
  4. package/dist/AntiCheatDetector-B6d4Qe9D.mjs +1 -0
  5. package/dist/BrowserSessionCoordinator-BJ-HOxo0.mjs +1 -0
  6. package/dist/CacheAdapters-CsNtQIR8.mjs +1 -0
  7. package/dist/CodeInjector-Cll_7bLJ.mjs +1 -0
  8. package/dist/ConsoleMonitor-CxDJV15E.mjs +306 -0
  9. package/dist/DOMInspector-C19J4zeq.mjs +95 -0
  10. package/dist/DarwinAPI-ZfQdpLNI.mjs +1 -0
  11. package/dist/DetailedDataManager-DmQ1LT-W.mjs +1 -0
  12. package/dist/EventBus-DL8iLA09.mjs +1 -0
  13. package/dist/EvidenceGraphBridge-BtbwXsLC.mjs +1 -0
  14. package/dist/ExtensionManager-BD724zkO.mjs +1 -0
  15. package/dist/ExtensionManager.tools-oVMJgPcN.mjs +1 -0
  16. package/dist/FingerprintManager-DT0EAUEo.mjs +1 -0
  17. package/dist/HardwareBreakpoint-BUfPdp0f.mjs +1 -0
  18. package/dist/HeapAnalyzer-B_aqY8oj.mjs +1 -0
  19. package/dist/{HookGeneratorBuilders.core.generators.storage-CTbB4Lcx.mjs → HookGeneratorBuilders.core.generators.storage-DzD6dIJd.mjs} +66 -101
  20. package/dist/InstrumentationSession-D_G1ZPyd.mjs +1 -0
  21. package/dist/MCPServer.search.handlers.domain-BbS-6LnX.mjs +1 -0
  22. package/dist/MemoryController-X1XNSn1n.mjs +2 -0
  23. package/dist/MemoryScanSession-DG_F-PjE.mjs +1 -0
  24. package/dist/MemoryScanner-g1_L1ub5.mjs +1 -0
  25. package/dist/NativeMemoryManager.impl-DniBe2wf.mjs +1 -0
  26. package/dist/NativeMemoryManager.utils-BHy1P_jM.mjs +1 -0
  27. package/dist/NetworkMonitor-B_-au6aV.mjs +185 -0
  28. package/dist/PEAnalyzer-yWQaGrcx.mjs +1 -0
  29. package/dist/PageController-Dfsm1_o7.mjs +1 -0
  30. package/dist/PointerChainEngine-BhCUkmxY.mjs +1 -0
  31. package/dist/PrerequisiteError-BjCQA-gK.mjs +1 -0
  32. package/dist/ProcessRegistry-C-bN48oR.mjs +1 -0
  33. package/dist/ResponseBuilder-BfWP-uaT.mjs +1 -0
  34. package/dist/ReverseEvidenceGraph-BhSYYdiI.mjs +2 -0
  35. package/dist/RingBuffer-Dm54ELKT.mjs +1 -0
  36. package/dist/ScriptManager-LWGPTdvD.mjs +7 -0
  37. package/dist/ServerRuntimeState-D2bWHqEE.mjs +1 -0
  38. package/dist/Speedhack-yseDPSZ9.mjs +1 -0
  39. package/dist/StealthVerifier-BmcxfwSF.mjs +1 -0
  40. package/dist/StructureAnalyzer-C5lpuZkg.mjs +2 -0
  41. package/dist/ToolCatalog-CYdD9F5f.mjs +1 -0
  42. package/dist/ToolError-DWU_z7gp.mjs +1 -0
  43. package/dist/ToolProbe-C7ZU2x7M.mjs +1 -0
  44. package/dist/ToolRegistry-C5oB8KP8.mjs +1 -0
  45. package/dist/ToolRouter.policy-CfhJczkt.mjs +4 -0
  46. package/dist/TraceRecorder-BiJWBXHX.mjs +272 -0
  47. package/dist/VersionDetector-CHT36Az0.mjs +9 -0
  48. package/dist/Win32API-eUCF57l_.mjs +1 -0
  49. package/dist/Win32Debug-CYrIQBvr.mjs +1 -0
  50. package/dist/WorkflowEngine-D876meOO.mjs +1 -0
  51. package/dist/analysis-D4swdMvq.mjs +6 -0
  52. package/dist/{antidebug-BRKeyt27.mjs → antidebug-7L3ygj_9.mjs} +8 -259
  53. package/dist/apk-packer-BqXcInnX.mjs +1 -0
  54. package/dist/artifactRetention-BCPQASm7.mjs +1 -0
  55. package/dist/artifacts-CkodUM4j.mjs +1 -0
  56. package/dist/authorization-schema-BOFwSXUN.mjs +1 -0
  57. package/dist/betterSqlite3-Brtq-SIQ.mjs +1 -0
  58. package/dist/binary-instrument-DU7V6TUM.mjs +7 -0
  59. package/dist/binary-secrets-PdMVoyt0.mjs +1 -0
  60. package/dist/bind-helpers-m2U8glkF.mjs +1 -0
  61. package/dist/boringssl-inspector-BBaJwwkU.mjs +2 -0
  62. package/dist/browser-Qqco2rOT.mjs +11 -0
  63. package/dist/capabilities-CyXuKUl1.mjs +1 -0
  64. package/dist/chunk-C_pMuVsO.mjs +1 -0
  65. package/dist/collector-Bpl6qy2L.mjs +1 -0
  66. package/dist/concurrency-DCr8WQ2M.mjs +1 -0
  67. package/dist/constants-BYj8Xek8.mjs +1 -0
  68. package/dist/coordination-CWXW1o8K.mjs +1 -0
  69. package/dist/dart-inspector-7AkPeZ_Q.mjs +0 -0
  70. package/dist/debugger-DyALjYMk.mjs +1 -0
  71. package/dist/definitions-BWxBke3r.mjs +1 -0
  72. package/dist/definitions-BYwATKc-.mjs +1 -0
  73. package/dist/definitions-B_83XfNQ.mjs +1 -0
  74. package/dist/definitions-Bf3H1EwV.mjs +1 -0
  75. package/dist/definitions-BftdXgXI.mjs +1 -0
  76. package/dist/definitions-Bio5XJYy.mjs +1 -0
  77. package/dist/definitions-C3qNgSn1.mjs +1 -0
  78. package/dist/definitions-CB6vmOer.mjs +1 -0
  79. package/dist/definitions-CMZRSy3k.mjs +1 -0
  80. package/dist/definitions-CQd7yCQH.mjs +1 -0
  81. package/dist/definitions-CT8ln6GQ.mjs +1 -0
  82. package/dist/definitions-Cenu6mxo.mjs +1 -0
  83. package/dist/definitions-D4g-MS10.mjs +1 -0
  84. package/dist/definitions-D5wl_8HN.mjs +1 -0
  85. package/dist/definitions-DAQm1Xar.mjs +1 -0
  86. package/dist/definitions-DP1vgxEY.mjs +1 -0
  87. package/dist/definitions-DxFNRQNK2.mjs +1 -0
  88. package/dist/definitions-Ibci7e_L.mjs +1 -0
  89. package/dist/definitions-OeLvmlQy.mjs +1 -0
  90. package/dist/definitions-RZYGD_Ey.mjs +1 -0
  91. package/dist/definitions-Tls8c0A0.mjs +1 -0
  92. package/dist/definitions-bybDvnG0.mjs +26 -0
  93. package/dist/definitions-l7TjdE6V.mjs +1 -0
  94. package/dist/encoding-ycOaz8Vr.mjs +2 -0
  95. package/dist/ensure-browser-core-DxWC-NTp.mjs +1 -0
  96. package/dist/evidence-graph-bridge-CV_UdYqj.mjs +1 -0
  97. package/dist/factory-CKr4fAE1.mjs +1 -0
  98. package/dist/flat-target-session-DvcQX7J5.mjs +1 -0
  99. package/dist/formatAddress-vLA_hOJt.mjs +1 -0
  100. package/dist/graphql-B2TiPEow.mjs +62 -0
  101. package/dist/handlers-0yKLRIfo.mjs +2 -0
  102. package/dist/handlers-8zN_vBIz.mjs +1 -0
  103. package/dist/handlers-B62K4FTc.mjs +1 -0
  104. package/dist/handlers-BpDlVVVU.mjs +1 -0
  105. package/dist/handlers-CMJK7m1c.mjs +31 -0
  106. package/dist/handlers-D2ZOul9p.mjs +54 -0
  107. package/dist/handlers-D5E40ssn.mjs +5 -0
  108. package/dist/handlers-DGbdQAgD.mjs +4 -0
  109. package/dist/handlers-DHO3rjsW.mjs +1 -0
  110. package/dist/handlers-FJ80VzUI.mjs +2 -0
  111. package/dist/handlers-VHWrxbM_.mjs +1 -0
  112. package/dist/handlers-l8QIKqBj.mjs +2 -0
  113. package/dist/handlers-mPFiNPe8.mjs +302 -0
  114. package/dist/{handlers-Dz9PYsCa.mjs → handlers-yo_xYzT8.mjs} +118 -904
  115. package/dist/handlers.impl-D9Hh8Bgl.mjs +1 -0
  116. package/dist/hooks-D4XLfgtV.mjs +600 -0
  117. package/dist/index.mjs +13 -5240
  118. package/dist/jadx-search-B_Yse0Zh.mjs +5 -0
  119. package/dist/logger-sBC6IdRT.mjs +1 -0
  120. package/dist/maintenance-BUpIukhg.mjs +1 -0
  121. package/dist/manifest-0Jpt_AQa.mjs +1 -0
  122. package/dist/manifest-B3fZbSWR.mjs +1 -0
  123. package/dist/manifest-B7NB2rh2.mjs +1 -0
  124. package/dist/manifest-BDi4nbH1.mjs +1 -0
  125. package/dist/manifest-BLDfkE7n.mjs +1 -0
  126. package/dist/manifest-BcXbB4gf.mjs +1 -0
  127. package/dist/manifest-Bdnc_vrc.mjs +1 -0
  128. package/dist/manifest-BuYKgCnp.mjs +1 -0
  129. package/dist/manifest-CBfNnGPV.mjs +1 -0
  130. package/dist/manifest-CPS1Xv69.mjs +1 -0
  131. package/dist/manifest-CQH9FhwI.mjs +1 -0
  132. package/dist/manifest-CRryuZF4.mjs +1 -0
  133. package/dist/manifest-CctIumog.mjs +1 -0
  134. package/dist/manifest-CvTe5ZGV2.mjs +1 -0
  135. package/dist/manifest-D-5GH0DV.mjs +1 -0
  136. package/dist/manifest-D3Ssf3IC.mjs +1 -0
  137. package/dist/manifest-D5ck3NvC.mjs +1 -0
  138. package/dist/manifest-D9jUUJAu.mjs +1 -0
  139. package/dist/manifest-DCx6w2XV.mjs +1 -0
  140. package/dist/manifest-DG19q-Ld.mjs +1 -0
  141. package/dist/manifest-DLMlD0Zc.mjs +1 -0
  142. package/dist/manifest-DYpn8w_h.mjs +1 -0
  143. package/dist/manifest-DYzWI8Xs.mjs +1 -0
  144. package/dist/manifest-D_obs5F4.mjs +1 -0
  145. package/dist/manifest-DujQqEQR.mjs +2 -0
  146. package/dist/manifest-DwL2ik8P.mjs +1 -0
  147. package/dist/manifest-ItF5P8A12.mjs +1 -0
  148. package/dist/manifest-KZphqIyX.mjs +1 -0
  149. package/dist/manifest-LG42zPLY2.mjs +1 -0
  150. package/dist/manifest-LLdI5m4T.mjs +1 -0
  151. package/dist/manifest-QYbQXJn0.mjs +1 -0
  152. package/dist/manifest-RcpX_MyZ.mjs +123 -0
  153. package/dist/manifest-YgVd8Sgz.mjs +1 -0
  154. package/dist/manifest-Zy7Odg5J.mjs +1 -0
  155. package/dist/manifest-ff1H7Pdp.mjs +1 -0
  156. package/dist/manifest-iuhF6pTL2.mjs +1 -0
  157. package/dist/manifest-nXHmtMSp2.mjs +1 -0
  158. package/dist/manifest-xWfu6iLo.mjs +1 -0
  159. package/dist/manifest-yC16OhL2.mjs +1 -0
  160. package/dist/manifest-ztWJoXy4.mjs +1 -0
  161. package/dist/matchesWildcardPattern-BAG6LvX5.mjs +1 -0
  162. package/dist/modules-BPBcSaM-.mjs +333 -0
  163. package/dist/mojo-ipc-BhwsdVUW.mjs +9 -0
  164. package/dist/native/scripts/linux/enum-windows.sh +12 -12
  165. package/dist/native/scripts/macos/enum-windows.applescript +22 -22
  166. package/dist/native-j8l473zn.mjs +961 -0
  167. package/dist/network-T0VRwNPd.mjs +7 -0
  168. package/dist/outputPaths-B4Ic4RZh.mjs +2 -0
  169. package/dist/parse-args-Bw413PlW.mjs +1 -0
  170. package/dist/platform-CzaQtISh.mjs +93 -0
  171. package/dist/playwright-cdp-fallback-DqFdx9-s.mjs +1 -0
  172. package/dist/process-CWhsCWrf.mjs +2 -0
  173. package/dist/proxy-DZFlDsG3.mjs +2 -0
  174. package/dist/registry-DH4sc1dt.mjs +1 -0
  175. package/dist/renderer-pid-9tJnZ_9N.mjs +1 -0
  176. package/dist/response-C7rKQst4.mjs +1 -0
  177. package/dist/search-defaults-lYBVn_3L.mjs +1 -0
  178. package/dist/server/plugin-api.d.mts +19 -36
  179. package/dist/server/plugin-api.mjs +1 -293
  180. package/dist/shared-state-board-BSjXLUV1.mjs +1 -0
  181. package/dist/sourcemap-Dh3Ai_ur.mjs +1 -0
  182. package/dist/ssrf-policy-CsIJGkpd.mjs +1 -0
  183. package/dist/streaming-BcJ0B6ao.mjs +1 -0
  184. package/dist/tool-builder-qif8M9-K.mjs +1 -0
  185. package/dist/transform-DOxzeWPB.mjs +103 -0
  186. package/dist/types-D9EiE5o9.mjs +1 -0
  187. package/dist/types-Fz69RzbZ.mjs +1 -0
  188. package/dist/wasm-CZ_HTfKR.mjs +174 -0
  189. package/dist/webcrack-C1iYG_EX.mjs +46 -0
  190. package/dist/workflow-BdwQmARn.mjs +101 -0
  191. package/package.json +55 -82
  192. package/src/native/scripts/linux/enum-windows.sh +12 -12
  193. package/src/native/scripts/macos/enum-windows.applescript +22 -22
  194. package/dist/AntiCheatDetector-CqGDXmfc.mjs +0 -350
  195. package/dist/CacheAdapters-jJFy20G-.mjs +0 -80
  196. package/dist/CodeInjector-BdjRfNx7.mjs +0 -150
  197. package/dist/ConsoleMonitor-DykL3IAw.mjs +0 -2269
  198. package/dist/DarwinAPI-ETyy0xyo.mjs +0 -363
  199. package/dist/DetailedDataManager-HT49OrvF.mjs +0 -217
  200. package/dist/EventBus-DFKvADm3.mjs +0 -141
  201. package/dist/EvidenceGraphBridge-318Oi0Lf.mjs +0 -153
  202. package/dist/ExtensionManager-BDMsY2Dz.mjs +0 -721
  203. package/dist/FingerprintManager-BN4UQWnX.mjs +0 -96
  204. package/dist/HardwareBreakpoint-Cc2AFq1Y.mjs +0 -239
  205. package/dist/HeapAnalyzer-DruMgsgj.mjs +0 -284
  206. package/dist/InstrumentationSession-DLH0vd-z.mjs +0 -244
  207. package/dist/MemoryController-CMtviNW_.mjs +0 -167
  208. package/dist/MemoryScanSession-ITgb_NMi.mjs +0 -278
  209. package/dist/MemoryScanner-CiL7Z3ey.mjs +0 -428
  210. package/dist/NativeMemoryManager.impl-D9Lkovvn.mjs +0 -485
  211. package/dist/NativeMemoryManager.utils-BBlAixF5.mjs +0 -165
  212. package/dist/PEAnalyzer-DMQ44gen.mjs +0 -385
  213. package/dist/PageController-BPJNqqBN.mjs +0 -431
  214. package/dist/PointerChainEngine-K7wN8Z-w.mjs +0 -325
  215. package/dist/PrerequisiteError-TuyZIs6n.mjs +0 -20
  216. package/dist/ProcessRegistry-zGg12QbE.mjs +0 -74
  217. package/dist/ResponseBuilder-CJXWmWNw.mjs +0 -143
  218. package/dist/ReverseEvidenceGraph-C02-gXOh.mjs +0 -269
  219. package/dist/ScriptManager-ZuWD-0Jg.mjs +0 -3003
  220. package/dist/Speedhack-D-z0umeT.mjs +0 -156
  221. package/dist/StealthVerifier-BWmPgQsv.mjs +0 -135
  222. package/dist/StructureAnalyzer-Cav5AVSL.mjs +0 -429
  223. package/dist/ToolCatalog-5OJdMiF0.mjs +0 -582
  224. package/dist/ToolError-jh9whhMd.mjs +0 -15
  225. package/dist/ToolProbe-DbCFGyrg.mjs +0 -45
  226. package/dist/ToolRegistry-B9krbTtI.mjs +0 -180
  227. package/dist/ToolRouter.policy-BGDAGyeH.mjs +0 -344
  228. package/dist/TraceRecorder-B41Z5XBj.mjs +0 -1286
  229. package/dist/VersionDetector-K3V4vGsw.mjs +0 -104
  230. package/dist/Win32API-C2kjj0ze.mjs +0 -346
  231. package/dist/Win32Debug-CKrGOTpo.mjs +0 -274
  232. package/dist/WorkflowEngine-DJ6M4opp.mjs +0 -569
  233. package/dist/analysis-BHeJW2Nb.mjs +0 -1234
  234. package/dist/artifactRetention-CPXkUJXp.mjs +0 -598
  235. package/dist/artifacts-DkfosXH3.mjs +0 -59
  236. package/dist/authorization-schema-DRqyJMSk.mjs +0 -31
  237. package/dist/betterSqlite3-DLSBZodi.mjs +0 -74
  238. package/dist/binary-instrument--V3MAhJ4.mjs +0 -971
  239. package/dist/bind-helpers-ClV34xdn.mjs +0 -42
  240. package/dist/boringssl-inspector-Bo_LOLaS.mjs +0 -180
  241. package/dist/browser-Dx3_S2cG.mjs +0 -4369
  242. package/dist/capabilities-CcHlvWgK.mjs +0 -33
  243. package/dist/chunk-CjcI7cDX.mjs +0 -15
  244. package/dist/concurrency-Drev_Vz9.mjs +0 -41
  245. package/dist/constants-CDZLOoVv.mjs +0 -534
  246. package/dist/coordination-DgItD9DL.mjs +0 -259
  247. package/dist/debugger-RS3RSAqs.mjs +0 -1288
  248. package/dist/definitions-BEoYofW5.mjs +0 -47
  249. package/dist/definitions-BRaefg3u.mjs +0 -365
  250. package/dist/definitions-BbkvZkiv.mjs +0 -96
  251. package/dist/definitions-BtWSHJ3o.mjs +0 -17
  252. package/dist/definitions-C1gCHO0i.mjs +0 -43
  253. package/dist/definitions-CDOg_b-l.mjs +0 -138
  254. package/dist/definitions-CVPD9hzZ.mjs +0 -54
  255. package/dist/definitions-Cea8Lgl7.mjs +0 -94
  256. package/dist/definitions-DAgIyjxM.mjs +0 -10
  257. package/dist/definitions-DJA27nsL.mjs +0 -66
  258. package/dist/definitions-DKPFU3LW.mjs +0 -25
  259. package/dist/definitions-DPRpZQ96.mjs +0 -47
  260. package/dist/definitions-DUE5gmdn.mjs +0 -18
  261. package/dist/definitions-DYVjOtxa.mjs +0 -26
  262. package/dist/definitions-DcYLVLCo.mjs +0 -37
  263. package/dist/definitions-Pp5LI2H4.mjs +0 -27
  264. package/dist/definitions-j9KdHVNR.mjs +0 -14
  265. package/dist/definitions-uzkjBwa7.mjs +0 -258
  266. package/dist/definitions-va-AnLuQ.mjs +0 -28
  267. package/dist/encoding-DJeqHmpd.mjs +0 -1079
  268. package/dist/evidence-graph-bridge-DcYizFk2.mjs +0 -136
  269. package/dist/factory-C90tBff6.mjs +0 -575
  270. package/dist/flat-target-session-Dgax2Cy3.mjs +0 -29
  271. package/dist/formatAddress-nnMvEohD.mjs +0 -17
  272. package/dist/graphql-CoHrhweh.mjs +0 -1197
  273. package/dist/handlers-4jmR0nMs.mjs +0 -898
  274. package/dist/handlers-BAHPxcch.mjs +0 -789
  275. package/dist/handlers-BOs9b907.mjs +0 -2600
  276. package/dist/handlers-BWXEy6ef.mjs +0 -917
  277. package/dist/handlers-Bndn6QvE.mjs +0 -111
  278. package/dist/handlers-BqC4bD4s.mjs +0 -681
  279. package/dist/handlers-BtYq60bM2.mjs +0 -276
  280. package/dist/handlers-BzgcB4iv.mjs +0 -799
  281. package/dist/handlers-CRyRWj2b.mjs +0 -859
  282. package/dist/handlers-CVv2H1uq.mjs +0 -592
  283. package/dist/handlers-Dl5a7JS4.mjs +0 -572
  284. package/dist/handlers-Dx2d7jt7.mjs +0 -2537
  285. package/dist/handlers-HujRKC3b.mjs +0 -661
  286. package/dist/handlers.impl-XWXkQfyi.mjs +0 -807
  287. package/dist/hooks-B1B8NRHL.mjs +0 -898
  288. package/dist/logger-Dh_xb7_2.mjs +0 -93
  289. package/dist/maintenance-PRMkLVRW.mjs +0 -835
  290. package/dist/manifest-67Bok-Si.mjs +0 -58
  291. package/dist/manifest-6lNTMZAB2.mjs +0 -87
  292. package/dist/manifest-B2duEHiH.mjs +0 -90
  293. package/dist/manifest-B6EY9Vm8.mjs +0 -57
  294. package/dist/manifest-B6nKSbyY.mjs +0 -95
  295. package/dist/manifest-BL8AQNPF.mjs +0 -106
  296. package/dist/manifest-BSZvJJmV.mjs +0 -47
  297. package/dist/manifest-BU7qzUyX.mjs +0 -418
  298. package/dist/manifest-Bl62e8WK.mjs +0 -49
  299. package/dist/manifest-Bo5cXjdt.mjs +0 -82
  300. package/dist/manifest-BpS4gtUK.mjs +0 -1347
  301. package/dist/manifest-Bv65_e2W.mjs +0 -101
  302. package/dist/manifest-BytNIF4Z.mjs +0 -117
  303. package/dist/manifest-C-xtsjS3.mjs +0 -81
  304. package/dist/manifest-CDYl7OhA.mjs +0 -66
  305. package/dist/manifest-CRZ3xmkD.mjs +0 -61
  306. package/dist/manifest-CoW6u4Tp.mjs +0 -132
  307. package/dist/manifest-Cq5zN_8A.mjs +0 -50
  308. package/dist/manifest-D7YZM_2e.mjs +0 -194
  309. package/dist/manifest-DE_VrAeQ.mjs +0 -314
  310. package/dist/manifest-DGsXSCpT.mjs +0 -39
  311. package/dist/manifest-DJ2vfEuW.mjs +0 -156
  312. package/dist/manifest-DPXDYhEu.mjs +0 -80
  313. package/dist/manifest-Dd4fQb0a.mjs +0 -322
  314. package/dist/manifest-Deq6opGg.mjs +0 -223
  315. package/dist/manifest-DfJTafJK.mjs +0 -37
  316. package/dist/manifest-DgOdgN_j.mjs +0 -50
  317. package/dist/manifest-DlbMW4v4.mjs +0 -47
  318. package/dist/manifest-DmVfbH0w.mjs +0 -374
  319. package/dist/manifest-Dog6Ddjr.mjs +0 -109
  320. package/dist/manifest-DvgU5FWb.mjs +0 -58
  321. package/dist/manifest-HsfDBs7j.mjs +0 -50
  322. package/dist/manifest-I8oQHvCG.mjs +0 -186
  323. package/dist/manifest-NvH_a-av.mjs +0 -786
  324. package/dist/manifest-cEJU1v0Z.mjs +0 -129
  325. package/dist/manifest-wOl5XLB12.mjs +0 -112
  326. package/dist/modules-tZozf0LQ.mjs +0 -10635
  327. package/dist/mojo-ipc-DXNEXEqb.mjs +0 -640
  328. package/dist/network-CPVvwvFg.mjs +0 -3852
  329. package/dist/outputPaths-um7lCRY3.mjs +0 -1141
  330. package/dist/parse-args-B4cY5Vx5.mjs +0 -39
  331. package/dist/platform-CYeFoTWp.mjs +0 -2161
  332. package/dist/process-BTbgcVc6.mjs +0 -1306
  333. package/dist/proxy-r8YN6nP1.mjs +0 -192
  334. package/dist/registry-Bl8ZQW61.mjs +0 -34
  335. package/dist/response-CWhh2aLo.mjs +0 -34
  336. package/dist/shared-state-board-BoZnSoj-.mjs +0 -586
  337. package/dist/sourcemap-BIDHUVXy.mjs +0 -934
  338. package/dist/ssrf-policy-Dsqd-DTX.mjs +0 -166
  339. package/dist/streaming-Dal6utPp.mjs +0 -725
  340. package/dist/tool-builder-BHJp32mV.mjs +0 -186
  341. package/dist/transform-DRVgGG90.mjs +0 -1011
  342. package/dist/types-Bx92KJfT.mjs +0 -4
  343. package/dist/types-DDBWs9UP.mjs +0 -37
  344. package/dist/wasm-BYx5UOeG.mjs +0 -1044
  345. package/dist/webcrack-Be0_FccV.mjs +0 -747
  346. package/dist/workflow-BpuKEtvn.mjs +0 -725
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jshookmcp/jshook",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "MCP server with built-in tools across multiple domains for AI-assisted JavaScript analysis and security analysis — browser automation, CDP debugging, network monitoring, JS hooks, code analysis, and workflow orchestration",
5
5
  "keywords": [
6
6
  "ai",
@@ -66,10 +66,60 @@
66
66
  "access": "public",
67
67
  "registry": "https://registry.npmjs.org"
68
68
  },
69
+ "dependencies": {
70
+ "@babel/generator": "^7.29.1",
71
+ "@babel/parser": "^7.29.2",
72
+ "@babel/traverse": "^7.29.0",
73
+ "@babel/types": "^7.29.0",
74
+ "@modelcontextprotocol/sdk": "^1.29.0",
75
+ "dotenv": "^17.4.1",
76
+ "jsdom": "^29.0.2",
77
+ "koffi": "^3.0.1",
78
+ "mockttp": "^4.4.2",
79
+ "quickjs-emscripten": "^0.32.0",
80
+ "rebrowser-puppeteer-core": "^24.8.1",
81
+ "yauzl": "^3.3.1",
82
+ "zod": "^4.3.6"
83
+ },
84
+ "devDependencies": {
85
+ "@types/babel__generator": "^7.27.0",
86
+ "@types/babel__traverse": "^7.28.0",
87
+ "@types/better-sqlite3": "^7.6.13",
88
+ "@types/jsdom": "^28.0.3",
89
+ "@types/node": "^25.9.1",
90
+ "@vitest/coverage-v8": "^4.1.7",
91
+ "cross-env": "^10.1.0",
92
+ "lefthook": "^2.1.8",
93
+ "medium-zoom": "^1.1.0",
94
+ "oxfmt": "^0.51.0",
95
+ "oxlint": "^1.66.0",
96
+ "rollup-plugin-visualizer": "^7.0.1",
97
+ "tinyglobby": "^0.2.16",
98
+ "tsdown": "^0.22.0",
99
+ "tsx": "^4.22.3",
100
+ "typescript": "^6.0.2",
101
+ "vite": "^8.0.14",
102
+ "vitepress": "1.6.4",
103
+ "vitest": "^4.1.7",
104
+ "vue": "^3.5.32"
105
+ },
106
+ "optionalDependencies": {
107
+ "@devicefarmer/adbkit": "^3.3.8",
108
+ "@huggingface/transformers": "^4.0.1",
109
+ "better-sqlite3": "12.10.0",
110
+ "camoufox-js": "^0.10.2",
111
+ "playwright-core": "^1.60.0",
112
+ "webcrack": "2.16.0"
113
+ },
114
+ "engines": {
115
+ "node": "^22.12.0 || ^24.0.0"
116
+ },
117
+ "mcpName": "io.github.vmoranv/jshookmcp",
69
118
  "scripts": {
70
- "build": "node scripts/clean-dist.mjs && node scripts/generate-domains-index.mjs && tsdown",
119
+ "build": "node scripts/build.mjs",
120
+ "build:dts": "node scripts/build.mjs --dts",
71
121
  "build:sdk": "corepack pnpm -C packages/extension-sdk build",
72
- "build:all": "corepack pnpm run build && corepack pnpm run build:sdk",
122
+ "build:all": "corepack pnpm run build:dts && corepack pnpm run build:sdk",
73
123
  "build:analyze": "cross-env BUNDLE_ANALYZE=1 corepack pnpm run build && echo 'Open stats.html in browser to view bundle analysis'",
74
124
  "typecheck": "tsc --noEmit -p tsconfig.json && corepack pnpm -C packages/extension-sdk typecheck",
75
125
  "deps:update": "corepack pnpm update -r",
@@ -92,7 +142,6 @@
92
142
  "test:e2e:protocol-runtime": "vitest run --config tests/e2e/vitest.e2e.config.ts tests/e2e/protocol-runtime-assisted.e2e.test.ts",
93
143
  "test:e2e:perf": "cross-env E2E_TARGET_URL=https://vmoranv.github.io/jshookmcp/ E2E_COLLECT_PERFORMANCE=1 vitest run --config tests/e2e/vitest.e2e.config.ts",
94
144
  "test:coverage": "node -e \"require('fs').mkdirSync('coverage/.tmp', { recursive: true })\" && cross-env ENABLE_INJECTION_TOOLS=true COVERAGE_FULL=true node scripts/run-vitest-smart.mjs run --coverage",
95
- "prepack": "corepack pnpm run metadata:check && corepack pnpm run build:all",
96
145
  "package:verify-bin": "node scripts/verify-packed-bin.mjs",
97
146
  "package:verify-install": "node scripts/verify-packed-install.mjs",
98
147
  "package:verify-release": "node scripts/verify-release-artifact.mjs",
@@ -101,7 +150,6 @@
101
150
  "git:refresh-noise": "node scripts/refresh-git-noise.mjs",
102
151
  "check": "corepack pnpm run metadata:check && corepack pnpm run lint && corepack pnpm run format:check && corepack pnpm run typecheck && corepack pnpm run test",
103
152
  "package": "corepack pnpm pack",
104
- "prepublishOnly": "corepack pnpm run check",
105
153
  "postinstall": "node scripts/postinstall.cjs",
106
154
  "install:full": "corepack pnpm install && corepack pnpm exec camoufox-js fetch",
107
155
  "metadata:sync": "node scripts/generate-metadata.mjs --write",
@@ -109,80 +157,5 @@
109
157
  "check:docs-format": "corepack pnpm run lint:md",
110
158
  "search:tune": "tsx scripts/search-tune/optimize.ts",
111
159
  "search:tune:report": "tsx scripts/search-tune/report.ts"
112
- },
113
- "dependencies": {
114
- "@babel/generator": "^7.29.1",
115
- "@babel/parser": "^7.29.2",
116
- "@babel/traverse": "^7.29.0",
117
- "@babel/types": "^7.29.0",
118
- "@modelcontextprotocol/sdk": "^1.29.0",
119
- "dotenv": "^17.4.1",
120
- "jsdom": "^29.0.2",
121
- "koffi": "^2.15.6",
122
- "mockttp": "^4.3.1",
123
- "quickjs-emscripten": "^0.32.0",
124
- "rebrowser-puppeteer-core": "^24.8.1",
125
- "tinyglobby": "^0.2.16",
126
- "zod": "^4.3.6"
127
- },
128
- "devDependencies": {
129
- "@types/babel__generator": "^7.27.0",
130
- "@types/babel__traverse": "^7.28.0",
131
- "@types/better-sqlite3": "^7.6.13",
132
- "@types/jsdom": "^28.0.1",
133
- "@types/node": "^25.5.2",
134
- "@vitest/coverage-v8": "^4.1.4",
135
- "cross-env": "^10.1.0",
136
- "lefthook": "^2.1.5",
137
- "medium-zoom": "^1.1.0",
138
- "oxfmt": "^0.47.0",
139
- "oxlint": "^1.59.0",
140
- "rollup-plugin-visualizer": "^7.0.1",
141
- "tsdown": "^0.21.7",
142
- "tsx": "^4.21.0",
143
- "typescript": "^6.0.2",
144
- "vite": "^8.0.8",
145
- "vitepress": "1.6.4",
146
- "vitest": "^4.1.4",
147
- "vue": "^3.5.32"
148
- },
149
- "optionalDependencies": {
150
- "@devicefarmer/adbkit": "^3.3.8",
151
- "@huggingface/transformers": "^4.0.1",
152
- "better-sqlite3": "12.9.0",
153
- "camoufox-js": "^0.10.2",
154
- "playwright-core": "^1.59.1",
155
- "webcrack": "2.15.1"
156
- },
157
- "engines": {
158
- "node": "^20.19.0 || >=22.12.0"
159
- },
160
- "packageManager": "pnpm@10.33.0",
161
- "pnpm": {
162
- "overrides": {
163
- "hono": ">=4.12.14",
164
- "@hono/node-server": "1.19.13",
165
- "express-rate-limit": "8.3.0",
166
- "basic-ftp": ">=5.3.0",
167
- "brace-expansion": "5.0.5",
168
- "minimatch": "10.2.4",
169
- "esbuild": "0.27.3",
170
- "isolated-vm": "6.1.2",
171
- "flatted": ">=3.4.2",
172
- "path-to-regexp": "8.4.0",
173
- "protobufjs": ">=7.5.5",
174
- "picomatch@^2.0.0": "2.3.2",
175
- "picomatch@^4.0.0": "4.0.4"
176
- },
177
- "onlyBuiltDependencies": [
178
- "better-sqlite3",
179
- "esbuild",
180
- "isolated-vm",
181
- "koffi",
182
- "lefthook",
183
- "onnxruntime-node",
184
- "protobufjs"
185
- ]
186
- },
187
- "mcpName": "io.github.vmoranv/jshookmcp"
188
- }
160
+ }
161
+ }
@@ -1,12 +1,12 @@
1
- #!/bin/bash
2
- # enum-windows.sh
3
- # Linux window enumeration script (placeholder)
4
-
5
- TARGET_PID=$1
6
-
7
- # Use xdotool or wmctrl for window enumeration
8
- # This is a placeholder for future implementation
9
-
10
- if command -v xdotool &> /dev/null; then
11
- xdotool search --pid "$TARGET_PID" --name "" get-window-name
12
- fi
1
+ #!/bin/bash
2
+ # enum-windows.sh
3
+ # Linux window enumeration script (placeholder)
4
+
5
+ TARGET_PID=$1
6
+
7
+ # Use xdotool or wmctrl for window enumeration
8
+ # This is a placeholder for future implementation
9
+
10
+ if command -v xdotool &> /dev/null; then
11
+ xdotool search --pid "$TARGET_PID" --name "" get-window-name
12
+ fi
@@ -1,22 +1,22 @@
1
- -- enum-windows.applescript
2
- -- macOS window enumeration script (placeholder)
3
-
4
- param TargetPid
5
-
6
- -- AppleScript implementation for window enumeration
7
- -- This is a placeholder for future implementation
8
-
9
- tell application "System Events"
10
- set windowList to {}
11
- repeat with proc in (every process whose unix id is TargetPid)
12
- repeat with win in windows of proc
13
- set end of windowList to {¬
14
- title: name of win, ¬
15
- position: position of win, ¬
16
- size: size of win ¬
17
- }
18
- end repeat
19
- end repeat
20
- end tell
21
-
22
- return windowList
1
+ -- enum-windows.applescript
2
+ -- macOS window enumeration script (placeholder)
3
+
4
+ param TargetPid
5
+
6
+ -- AppleScript implementation for window enumeration
7
+ -- This is a placeholder for future implementation
8
+
9
+ tell application "System Events"
10
+ set windowList to {}
11
+ repeat with proc in (every process whose unix id is TargetPid)
12
+ repeat with win in windows of proc
13
+ set end of windowList to {¬
14
+ title: name of win, ¬
15
+ position: position of win, ¬
16
+ size: size of win ¬
17
+ }
18
+ end repeat
19
+ end repeat
20
+ end tell
21
+
22
+ return windowList
@@ -1,350 +0,0 @@
1
- import { t as logger } from "./logger-Dh_xb7_2.mjs";
2
- import { a as GetModuleFileNameEx, b as openProcessForMemory, d as ReadProcessMemory, h as VirtualQueryEx, i as GetModuleBaseName, n as EnumProcessModules, s as GetModuleInformation, t as CloseHandle, u as PAGE } from "./Win32API-C2kjj0ze.mjs";
3
- import { PEAnalyzer } from "./PEAnalyzer-DMQ44gen.mjs";
4
- import { createHash } from "node:crypto";
5
- import { promises } from "node:fs";
6
- //#region src/native/AntiCheatDetector.ts
7
- /**
8
- * Anti-Cheat / Anti-Debug Detection Engine.
9
- *
10
- * Scans processes for anti-debug mechanisms, guard pages, and code integrity
11
- * checks by analyzing imports, memory regions, and section hashes.
12
- *
13
- * @module AntiCheatDetector
14
- */
15
- const ANTI_DEBUG_IMPORTS = [{
16
- dll: "kernel32.dll",
17
- funcs: [
18
- {
19
- name: "IsDebuggerPresent",
20
- mechanism: "anti_debug_api",
21
- confidence: "high",
22
- bypass: "Hook IsDebuggerPresent to return 0, or patch PEB.BeingDebugged field"
23
- },
24
- {
25
- name: "CheckRemoteDebuggerPresent",
26
- mechanism: "anti_debug_api",
27
- confidence: "high",
28
- bypass: "Hook CheckRemoteDebuggerPresent to set output to FALSE and return TRUE"
29
- },
30
- {
31
- name: "OutputDebugStringA",
32
- mechanism: "exception_based",
33
- confidence: "low",
34
- bypass: "May be used for anti-debug timing — monitor for exception handler abuse"
35
- },
36
- {
37
- name: "GetTickCount",
38
- mechanism: "timing_check",
39
- confidence: "low",
40
- bypass: "Hook GetTickCount to return consistent delta values"
41
- },
42
- {
43
- name: "GetTickCount64",
44
- mechanism: "timing_check",
45
- confidence: "low",
46
- bypass: "Hook GetTickCount64 to return consistent delta values"
47
- },
48
- {
49
- name: "QueryPerformanceCounter",
50
- mechanism: "timing_check",
51
- confidence: "medium",
52
- bypass: "Hook QPC to filter out debugging time deltas"
53
- }
54
- ]
55
- }, {
56
- dll: "ntdll.dll",
57
- funcs: [
58
- {
59
- name: "NtQueryInformationProcess",
60
- mechanism: "ntquery_debug",
61
- confidence: "high",
62
- bypass: "Hook NtQueryInformationProcess: return 0 for ProcessDebugPort (7), ProcessDebugObjectHandle (30), ProcessDebugFlags (31)"
63
- },
64
- {
65
- name: "NtSetInformationThread",
66
- mechanism: "thread_hiding",
67
- confidence: "medium",
68
- bypass: "Hook NtSetInformationThread: intercept ThreadHideFromDebugger (0x11) calls"
69
- },
70
- {
71
- name: "NtClose",
72
- mechanism: "exception_based",
73
- confidence: "low",
74
- bypass: "NtClose with invalid handle detects debugger via exception — hook to suppress"
75
- },
76
- {
77
- name: "RtlGetNtGlobalFlags",
78
- mechanism: "heap_flags",
79
- confidence: "medium",
80
- bypass: "Clear NtGlobalFlag (FLG_HEAP_*) in PEB at offset 0xBC (x64)"
81
- }
82
- ]
83
- }];
84
- const DR_CHECK_IMPORTS = ["GetThreadContext", "SetThreadContext"];
85
- const DEFAULT_LIMITS = {
86
- guardPageMaxRegions: 2e4,
87
- guardPageTimeoutMs: 2e3,
88
- integrityMaxModules: 32,
89
- integrityMaxSections: 128,
90
- integrityMaxBytes: 16 * 1024 * 1024,
91
- integrityMaxSectionBytes: 2 * 1024 * 1024,
92
- integrityTimeoutMs: 3e3
93
- };
94
- var AntiCheatDetector = class {
95
- peAnalyzer = new PEAnalyzer();
96
- options;
97
- constructor(options = {}) {
98
- this.options = {
99
- ...DEFAULT_LIMITS,
100
- ...options
101
- };
102
- }
103
- /**
104
- * Scan process for anti-debug / anti-cheat mechanisms by analyzing imports.
105
- */
106
- async detect(pid) {
107
- const detections = [];
108
- const hProcess = openProcessForMemory(pid);
109
- try {
110
- const modules = this.enumerateModules(hProcess);
111
- for (const mod of modules) try {
112
- const imports = await this.peAnalyzer.parseImports(pid, mod.base);
113
- for (const imp of imports) {
114
- const dllLower = imp.dllName.toLowerCase();
115
- for (const knownDll of ANTI_DEBUG_IMPORTS) if (dllLower.includes(knownDll.dll.toLowerCase().replace(".dll", ""))) {
116
- for (const func of knownDll.funcs) if (imp.functions.some((f) => f.name === func.name)) detections.push({
117
- mechanism: func.mechanism,
118
- confidence: func.confidence,
119
- location: `import:${func.name}`,
120
- moduleName: mod.name,
121
- details: `${mod.name} imports ${func.name} from ${imp.dllName}`,
122
- bypassSuggestion: func.bypass
123
- });
124
- }
125
- for (const func of imp.functions) if (DR_CHECK_IMPORTS.includes(func.name)) detections.push({
126
- mechanism: "hardware_breakpoint",
127
- confidence: "medium",
128
- location: `import:${func.name}`,
129
- moduleName: mod.name,
130
- details: `${mod.name} imports ${func.name} — may check debug registers for hardware breakpoints`,
131
- bypassSuggestion: "Hook GetThreadContext to zero out DR0-DR3 and DR6/DR7 before returning"
132
- });
133
- }
134
- } catch (e) {
135
- logger.debug(`Import scan skipped for ${mod.name}: ${e}`);
136
- }
137
- } finally {
138
- CloseHandle(hProcess);
139
- }
140
- return detections;
141
- }
142
- /**
143
- * Find all guard page regions in the process.
144
- */
145
- async findGuardPages(pid) {
146
- return (await this.scanGuardPages(pid)).guardPages;
147
- }
148
- async scanGuardPages(pid) {
149
- const guardPages = [];
150
- const hProcess = openProcessForMemory(pid);
151
- const startedAt = Date.now();
152
- const stats = {
153
- scannedRegions: 0,
154
- queryFailures: 0,
155
- durationMs: 0,
156
- timedOut: false,
157
- truncated: false,
158
- maxRegions: this.options.guardPageMaxRegions,
159
- timeoutMs: this.options.guardPageTimeoutMs
160
- };
161
- try {
162
- const modules = this.enumerateModules(hProcess);
163
- let address = 0n;
164
- const maxAddress = 140737488355327n;
165
- while (address < maxAddress) {
166
- if (this.isTimedOut(startedAt, stats.timeoutMs)) {
167
- stats.timedOut = true;
168
- stats.truncated = true;
169
- break;
170
- }
171
- if (stats.scannedRegions >= stats.maxRegions) {
172
- stats.truncated = true;
173
- break;
174
- }
175
- try {
176
- const result = VirtualQueryEx(hProcess, address);
177
- if (!result.success) break;
178
- const mbi = result.info;
179
- const nextAddress = mbi.BaseAddress + mbi.RegionSize;
180
- stats.scannedRegions += 1;
181
- if ((mbi.Protect & PAGE.GUARD) !== 0) {
182
- let moduleName = null;
183
- for (const mod of modules) {
184
- const modBase = BigInt(mod.base);
185
- if (mbi.BaseAddress >= modBase && mbi.BaseAddress < modBase + BigInt(mod.size)) {
186
- moduleName = mod.name;
187
- break;
188
- }
189
- }
190
- guardPages.push({
191
- address: `0x${mbi.BaseAddress.toString(16)}`,
192
- size: Number(mbi.RegionSize),
193
- moduleName,
194
- nearbySymbol: null
195
- });
196
- }
197
- if (mbi.RegionSize <= 0n || nextAddress <= address || nextAddress <= mbi.BaseAddress) {
198
- stats.truncated = true;
199
- break;
200
- }
201
- address = nextAddress;
202
- } catch {
203
- stats.queryFailures += 1;
204
- address += 4096n;
205
- }
206
- }
207
- } finally {
208
- stats.durationMs = Date.now() - startedAt;
209
- CloseHandle(hProcess);
210
- }
211
- return {
212
- guardPages,
213
- stats
214
- };
215
- }
216
- /**
217
- * Check code section integrity by comparing disk vs memory hashes.
218
- */
219
- async checkIntegrity(pid, moduleName) {
220
- return (await this.scanIntegrity(pid, moduleName)).sections;
221
- }
222
- async scanIntegrity(pid, moduleName) {
223
- const results = [];
224
- const hProcess = openProcessForMemory(pid);
225
- const startedAt = Date.now();
226
- const stats = {
227
- scannedModules: 0,
228
- scannedSections: 0,
229
- hashedBytes: 0,
230
- skippedModules: 0,
231
- skippedSections: 0,
232
- durationMs: 0,
233
- timedOut: false,
234
- truncated: false,
235
- maxModules: this.options.integrityMaxModules,
236
- maxSections: this.options.integrityMaxSections,
237
- maxBytes: this.options.integrityMaxBytes,
238
- timeoutMs: this.options.integrityTimeoutMs
239
- };
240
- let stopScan = false;
241
- try {
242
- const modules = this.enumerateModules(hProcess);
243
- const targets = moduleName ? modules.filter((m) => m.name.toLowerCase().includes(moduleName.toLowerCase())) : modules;
244
- for (const mod of targets) {
245
- if (this.shouldStopIntegrityScan(stats, startedAt)) {
246
- if (this.isTimedOut(startedAt, stats.timeoutMs)) stats.timedOut = true;
247
- stats.truncated = true;
248
- break;
249
- }
250
- stats.scannedModules += 1;
251
- try {
252
- const diskData = await promises.readFile(mod.path);
253
- const sections = await this.peAnalyzer.listSections(pid, mod.base);
254
- for (const sec of sections) {
255
- if (this.shouldStopIntegrityScan(stats, startedAt)) {
256
- if (this.isTimedOut(startedAt, stats.timeoutMs)) stats.timedOut = true;
257
- stats.truncated = true;
258
- stopScan = true;
259
- break;
260
- }
261
- if (!sec.isExecutable) continue;
262
- const secRva = parseInt(sec.virtualAddress, 16);
263
- const secSize = Math.min(sec.virtualSize, sec.rawSize);
264
- if (secSize <= 0) continue;
265
- if (secSize > this.options.integrityMaxSectionBytes) {
266
- stats.skippedSections += 1;
267
- continue;
268
- }
269
- if (stats.hashedBytes + secSize > stats.maxBytes) {
270
- stats.truncated = true;
271
- stopScan = true;
272
- break;
273
- }
274
- const memBytes = ReadProcessMemory(hProcess, BigInt(mod.base) + BigInt(secRva), secSize);
275
- const diskOffset = this.rvaToFileOffset(diskData, secRva);
276
- if (diskOffset < 0 || diskOffset + secSize > diskData.length) continue;
277
- const diskBytes = diskData.subarray(diskOffset, diskOffset + secSize);
278
- const memoryHash = createHash("sha256").update(memBytes).digest("hex");
279
- const diskHash = createHash("sha256").update(diskBytes).digest("hex");
280
- results.push({
281
- sectionName: sec.name,
282
- moduleName: mod.name,
283
- diskHash,
284
- memoryHash,
285
- isModified: memoryHash !== diskHash
286
- });
287
- stats.scannedSections += 1;
288
- stats.hashedBytes += secSize;
289
- }
290
- } catch (e) {
291
- stats.skippedModules += 1;
292
- logger.debug(`Integrity check skipped for ${mod.name}: ${e}`);
293
- }
294
- if (stopScan) break;
295
- }
296
- } finally {
297
- stats.durationMs = Date.now() - startedAt;
298
- CloseHandle(hProcess);
299
- }
300
- return {
301
- sections: results,
302
- stats
303
- };
304
- }
305
- enumerateModules(hProcess) {
306
- const modules = [];
307
- try {
308
- const { modules: modHandles, count } = EnumProcessModules(hProcess);
309
- for (let i = 0; i < count; i++) {
310
- const hMod = modHandles[i];
311
- const name = GetModuleBaseName(hProcess, hMod);
312
- const info = GetModuleInformation(hProcess, hMod);
313
- const modulePath = GetModuleFileNameEx(hProcess, hMod) ?? name;
314
- if (info.success) modules.push({
315
- name,
316
- base: `0x${info.info.lpBaseOfDll.toString(16)}`,
317
- path: modulePath,
318
- size: info.info.SizeOfImage
319
- });
320
- }
321
- } catch (e) {
322
- logger.debug(`Module enumeration failed: ${e}`);
323
- }
324
- return modules;
325
- }
326
- rvaToFileOffset(peData, rva) {
327
- const e_lfanew = peData.readUInt32LE(60);
328
- const numSections = peData.readUInt16LE(e_lfanew + 6);
329
- const sizeOfOptionalHeader = peData.readUInt16LE(e_lfanew + 20);
330
- const secStart = e_lfanew + 24 + sizeOfOptionalHeader;
331
- for (let i = 0; i < numSections; i++) {
332
- const off = secStart + i * 40;
333
- if (off + 40 > peData.length) break;
334
- const virtualAddr = peData.readUInt32LE(off + 12);
335
- const virtualSize = peData.readUInt32LE(off + 8);
336
- const rawOffset = peData.readUInt32LE(off + 20);
337
- if (rva >= virtualAddr && rva < virtualAddr + virtualSize) return rawOffset + (rva - virtualAddr);
338
- }
339
- return -1;
340
- }
341
- isTimedOut(startedAt, timeoutMs) {
342
- return Date.now() - startedAt >= timeoutMs;
343
- }
344
- shouldStopIntegrityScan(stats, startedAt) {
345
- return this.isTimedOut(startedAt, stats.timeoutMs) || stats.scannedModules >= stats.maxModules || stats.scannedSections >= stats.maxSections || stats.hashedBytes >= stats.maxBytes;
346
- }
347
- };
348
- const antiCheatDetector = new AntiCheatDetector();
349
- //#endregion
350
- export { AntiCheatDetector, antiCheatDetector };
@@ -1,80 +0,0 @@
1
- //#region src/utils/CacheAdapters.ts
2
- var DetailedDataManagerAdapter = class {
3
- name = "DetailedDataManager";
4
- constructor(manager) {
5
- this.manager = manager;
6
- }
7
- getStats() {
8
- const stats = this.manager.getStats();
9
- return {
10
- entries: stats.cacheSize,
11
- size: this.estimateSize(stats.cacheSize),
12
- hits: 0,
13
- misses: 0,
14
- ttl: stats.defaultTTLSeconds * 1e3,
15
- maxSize: stats.maxCacheSize
16
- };
17
- }
18
- clear() {
19
- this.manager.clear();
20
- }
21
- estimateSize(entries) {
22
- return entries * 50 * 1024;
23
- }
24
- };
25
- var CodeCacheAdapter = class {
26
- name = "CodeCache";
27
- constructor(cache) {
28
- this.cache = cache;
29
- }
30
- async getStats() {
31
- const stats = await this.cache.getStats();
32
- return {
33
- entries: stats.memoryEntries + stats.diskEntries,
34
- size: stats.totalSize,
35
- hits: 0,
36
- misses: 0
37
- };
38
- }
39
- async cleanup() {
40
- await this.cache.cleanup();
41
- }
42
- async clear() {
43
- await this.cache.clear();
44
- }
45
- };
46
- var CodeCompressorAdapter = class {
47
- name = "CodeCompressor";
48
- constructor(compressor) {
49
- this.compressor = compressor;
50
- }
51
- getStats() {
52
- const stats = this.compressor.getStats();
53
- const cacheSize = this.compressor.getCacheSize();
54
- const total = stats.cacheHits + stats.cacheMisses;
55
- const hitRate = total > 0 ? stats.cacheHits / total : 0;
56
- return {
57
- entries: cacheSize,
58
- size: this.estimateSize(cacheSize, stats.totalCompressedSize),
59
- hits: stats.cacheHits,
60
- misses: stats.cacheMisses,
61
- hitRate
62
- };
63
- }
64
- clear() {
65
- this.compressor.clearCache();
66
- }
67
- estimateSize(entries, totalCompressed) {
68
- if (entries === 0) return 0;
69
- return entries * (totalCompressed / Math.max(1, entries));
70
- }
71
- };
72
- function createCacheAdapters(detailedDataManager, codeCache, codeCompressor) {
73
- return [
74
- new DetailedDataManagerAdapter(detailedDataManager),
75
- new CodeCacheAdapter(codeCache),
76
- new CodeCompressorAdapter(codeCompressor)
77
- ];
78
- }
79
- //#endregion
80
- export { createCacheAdapters };