@jshookmcp/jshook 0.3.0 → 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 (321) 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-CTbB4Lcx.mjs → HookGeneratorBuilders.core.generators.storage-Bf1fbrNK.mjs} +66 -101
  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-BRKeyt27.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-Dz9PYsCa.mjs → handlers-pVNpaw4A.mjs} +118 -904
  102. package/dist/handlers.impl-CD2_kOcC.mjs +1 -0
  103. package/dist/hooks-DDKppogd.mjs +600 -0
  104. package/dist/index.mjs +12 -5235
  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 +50 -78
  169. package/dist/AntiCheatDetector-CqGDXmfc.mjs +0 -350
  170. package/dist/CacheAdapters-jJFy20G-.mjs +0 -80
  171. package/dist/CodeInjector-BdjRfNx7.mjs +0 -150
  172. package/dist/ConsoleMonitor-DykL3IAw.mjs +0 -2269
  173. package/dist/DarwinAPI-ETyy0xyo.mjs +0 -363
  174. package/dist/DetailedDataManager-HT49OrvF.mjs +0 -217
  175. package/dist/EventBus-DFKvADm3.mjs +0 -141
  176. package/dist/EvidenceGraphBridge-318Oi0Lf.mjs +0 -153
  177. package/dist/ExtensionManager-BDMsY2Dz.mjs +0 -721
  178. package/dist/FingerprintManager-BN4UQWnX.mjs +0 -96
  179. package/dist/HardwareBreakpoint-Cc2AFq1Y.mjs +0 -239
  180. package/dist/HeapAnalyzer-DruMgsgj.mjs +0 -284
  181. package/dist/InstrumentationSession-DLH0vd-z.mjs +0 -244
  182. package/dist/MemoryController-CMtviNW_.mjs +0 -167
  183. package/dist/MemoryScanSession-ITgb_NMi.mjs +0 -278
  184. package/dist/MemoryScanner-CiL7Z3ey.mjs +0 -428
  185. package/dist/NativeMemoryManager.impl-D9Lkovvn.mjs +0 -485
  186. package/dist/NativeMemoryManager.utils-BBlAixF5.mjs +0 -165
  187. package/dist/PEAnalyzer-DMQ44gen.mjs +0 -385
  188. package/dist/PageController-BPJNqqBN.mjs +0 -431
  189. package/dist/PointerChainEngine-K7wN8Z-w.mjs +0 -325
  190. package/dist/PrerequisiteError-TuyZIs6n.mjs +0 -20
  191. package/dist/ProcessRegistry-zGg12QbE.mjs +0 -74
  192. package/dist/ResponseBuilder-CJXWmWNw.mjs +0 -143
  193. package/dist/ReverseEvidenceGraph-C02-gXOh.mjs +0 -269
  194. package/dist/ScriptManager-ZuWD-0Jg.mjs +0 -3003
  195. package/dist/Speedhack-D-z0umeT.mjs +0 -156
  196. package/dist/StealthVerifier-BWmPgQsv.mjs +0 -135
  197. package/dist/StructureAnalyzer-Cav5AVSL.mjs +0 -429
  198. package/dist/ToolCatalog-5OJdMiF0.mjs +0 -582
  199. package/dist/ToolError-jh9whhMd.mjs +0 -15
  200. package/dist/ToolProbe-DbCFGyrg.mjs +0 -45
  201. package/dist/ToolRegistry-B9krbTtI.mjs +0 -180
  202. package/dist/ToolRouter.policy-BGDAGyeH.mjs +0 -344
  203. package/dist/TraceRecorder-B41Z5XBj.mjs +0 -1286
  204. package/dist/VersionDetector-K3V4vGsw.mjs +0 -104
  205. package/dist/Win32API-C2kjj0ze.mjs +0 -346
  206. package/dist/Win32Debug-CKrGOTpo.mjs +0 -274
  207. package/dist/WorkflowEngine-DJ6M4opp.mjs +0 -569
  208. package/dist/analysis-BHeJW2Nb.mjs +0 -1234
  209. package/dist/artifactRetention-CPXkUJXp.mjs +0 -598
  210. package/dist/artifacts-DkfosXH3.mjs +0 -59
  211. package/dist/authorization-schema-DRqyJMSk.mjs +0 -31
  212. package/dist/betterSqlite3-DLSBZodi.mjs +0 -74
  213. package/dist/binary-instrument--V3MAhJ4.mjs +0 -971
  214. package/dist/bind-helpers-ClV34xdn.mjs +0 -42
  215. package/dist/boringssl-inspector-Bo_LOLaS.mjs +0 -180
  216. package/dist/browser-Dx3_S2cG.mjs +0 -4369
  217. package/dist/capabilities-CcHlvWgK.mjs +0 -33
  218. package/dist/chunk-CjcI7cDX.mjs +0 -15
  219. package/dist/concurrency-Drev_Vz9.mjs +0 -41
  220. package/dist/constants-CDZLOoVv.mjs +0 -534
  221. package/dist/coordination-DgItD9DL.mjs +0 -259
  222. package/dist/debugger-RS3RSAqs.mjs +0 -1288
  223. package/dist/definitions-BEoYofW5.mjs +0 -47
  224. package/dist/definitions-BRaefg3u.mjs +0 -365
  225. package/dist/definitions-BbkvZkiv.mjs +0 -96
  226. package/dist/definitions-BtWSHJ3o.mjs +0 -17
  227. package/dist/definitions-C1gCHO0i.mjs +0 -43
  228. package/dist/definitions-CDOg_b-l.mjs +0 -138
  229. package/dist/definitions-CVPD9hzZ.mjs +0 -54
  230. package/dist/definitions-Cea8Lgl7.mjs +0 -94
  231. package/dist/definitions-DAgIyjxM.mjs +0 -10
  232. package/dist/definitions-DJA27nsL.mjs +0 -66
  233. package/dist/definitions-DKPFU3LW.mjs +0 -25
  234. package/dist/definitions-DPRpZQ96.mjs +0 -47
  235. package/dist/definitions-DUE5gmdn.mjs +0 -18
  236. package/dist/definitions-DYVjOtxa.mjs +0 -26
  237. package/dist/definitions-DcYLVLCo.mjs +0 -37
  238. package/dist/definitions-Pp5LI2H4.mjs +0 -27
  239. package/dist/definitions-j9KdHVNR.mjs +0 -14
  240. package/dist/definitions-uzkjBwa7.mjs +0 -258
  241. package/dist/definitions-va-AnLuQ.mjs +0 -28
  242. package/dist/encoding-DJeqHmpd.mjs +0 -1079
  243. package/dist/evidence-graph-bridge-DcYizFk2.mjs +0 -136
  244. package/dist/factory-C90tBff6.mjs +0 -575
  245. package/dist/flat-target-session-Dgax2Cy3.mjs +0 -29
  246. package/dist/formatAddress-nnMvEohD.mjs +0 -17
  247. package/dist/graphql-CoHrhweh.mjs +0 -1197
  248. package/dist/handlers-4jmR0nMs.mjs +0 -898
  249. package/dist/handlers-BAHPxcch.mjs +0 -789
  250. package/dist/handlers-BOs9b907.mjs +0 -2600
  251. package/dist/handlers-BWXEy6ef.mjs +0 -917
  252. package/dist/handlers-Bndn6QvE.mjs +0 -111
  253. package/dist/handlers-BqC4bD4s.mjs +0 -681
  254. package/dist/handlers-BtYq60bM2.mjs +0 -276
  255. package/dist/handlers-BzgcB4iv.mjs +0 -799
  256. package/dist/handlers-CRyRWj2b.mjs +0 -859
  257. package/dist/handlers-CVv2H1uq.mjs +0 -592
  258. package/dist/handlers-Dl5a7JS4.mjs +0 -572
  259. package/dist/handlers-Dx2d7jt7.mjs +0 -2537
  260. package/dist/handlers-HujRKC3b.mjs +0 -661
  261. package/dist/handlers.impl-XWXkQfyi.mjs +0 -807
  262. package/dist/hooks-B1B8NRHL.mjs +0 -898
  263. package/dist/logger-Dh_xb7_2.mjs +0 -93
  264. package/dist/maintenance-PRMkLVRW.mjs +0 -835
  265. package/dist/manifest-67Bok-Si.mjs +0 -58
  266. package/dist/manifest-6lNTMZAB2.mjs +0 -87
  267. package/dist/manifest-B2duEHiH.mjs +0 -90
  268. package/dist/manifest-B6EY9Vm8.mjs +0 -57
  269. package/dist/manifest-B6nKSbyY.mjs +0 -95
  270. package/dist/manifest-BL8AQNPF.mjs +0 -106
  271. package/dist/manifest-BSZvJJmV.mjs +0 -47
  272. package/dist/manifest-BU7qzUyX.mjs +0 -418
  273. package/dist/manifest-Bl62e8WK.mjs +0 -49
  274. package/dist/manifest-Bo5cXjdt.mjs +0 -82
  275. package/dist/manifest-BpS4gtUK.mjs +0 -1347
  276. package/dist/manifest-Bv65_e2W.mjs +0 -101
  277. package/dist/manifest-BytNIF4Z.mjs +0 -117
  278. package/dist/manifest-C-xtsjS3.mjs +0 -81
  279. package/dist/manifest-CDYl7OhA.mjs +0 -66
  280. package/dist/manifest-CRZ3xmkD.mjs +0 -61
  281. package/dist/manifest-CoW6u4Tp.mjs +0 -132
  282. package/dist/manifest-Cq5zN_8A.mjs +0 -50
  283. package/dist/manifest-D7YZM_2e.mjs +0 -194
  284. package/dist/manifest-DE_VrAeQ.mjs +0 -314
  285. package/dist/manifest-DGsXSCpT.mjs +0 -39
  286. package/dist/manifest-DJ2vfEuW.mjs +0 -156
  287. package/dist/manifest-DPXDYhEu.mjs +0 -80
  288. package/dist/manifest-Dd4fQb0a.mjs +0 -322
  289. package/dist/manifest-Deq6opGg.mjs +0 -223
  290. package/dist/manifest-DfJTafJK.mjs +0 -37
  291. package/dist/manifest-DgOdgN_j.mjs +0 -50
  292. package/dist/manifest-DlbMW4v4.mjs +0 -47
  293. package/dist/manifest-DmVfbH0w.mjs +0 -374
  294. package/dist/manifest-Dog6Ddjr.mjs +0 -109
  295. package/dist/manifest-DvgU5FWb.mjs +0 -58
  296. package/dist/manifest-HsfDBs7j.mjs +0 -50
  297. package/dist/manifest-I8oQHvCG.mjs +0 -186
  298. package/dist/manifest-NvH_a-av.mjs +0 -786
  299. package/dist/manifest-cEJU1v0Z.mjs +0 -129
  300. package/dist/manifest-wOl5XLB12.mjs +0 -112
  301. package/dist/modules-tZozf0LQ.mjs +0 -10635
  302. package/dist/mojo-ipc-DXNEXEqb.mjs +0 -640
  303. package/dist/network-CPVvwvFg.mjs +0 -3852
  304. package/dist/outputPaths-um7lCRY3.mjs +0 -1141
  305. package/dist/parse-args-B4cY5Vx5.mjs +0 -39
  306. package/dist/platform-CYeFoTWp.mjs +0 -2161
  307. package/dist/process-BTbgcVc6.mjs +0 -1306
  308. package/dist/proxy-r8YN6nP1.mjs +0 -192
  309. package/dist/registry-Bl8ZQW61.mjs +0 -34
  310. package/dist/response-CWhh2aLo.mjs +0 -34
  311. package/dist/shared-state-board-BoZnSoj-.mjs +0 -586
  312. package/dist/sourcemap-BIDHUVXy.mjs +0 -934
  313. package/dist/ssrf-policy-Dsqd-DTX.mjs +0 -166
  314. package/dist/streaming-Dal6utPp.mjs +0 -725
  315. package/dist/tool-builder-BHJp32mV.mjs +0 -186
  316. package/dist/transform-DRVgGG90.mjs +0 -1011
  317. package/dist/types-Bx92KJfT.mjs +0 -4
  318. package/dist/types-DDBWs9UP.mjs +0 -37
  319. package/dist/wasm-BYx5UOeG.mjs +0 -1044
  320. package/dist/webcrack-Be0_FccV.mjs +0 -747
  321. package/dist/workflow-BpuKEtvn.mjs +0 -725
@@ -1,807 +0,0 @@
1
- import { Rt as MEMORY_SCAN_MAX_RESULTS } from "./constants-CDZLOoVv.mjs";
2
- //#region src/server/domains/memory/handlers/session.ts
3
- function toTextResponse$6(payload) {
4
- return { content: [{
5
- type: "text",
6
- text: JSON.stringify(payload, null, 2)
7
- }] };
8
- }
9
- function toErrorResponse$6(tool, error) {
10
- return toTextResponse$6({
11
- success: false,
12
- tool,
13
- error: error instanceof Error ? error.message : String(error)
14
- });
15
- }
16
- var SessionHandlers = class {
17
- constructor(sessionManager) {
18
- this.sessionManager = sessionManager;
19
- }
20
- async handleScanList(_args) {
21
- try {
22
- const sessions = this.sessionManager.listSessions();
23
- return toTextResponse$6({
24
- success: true,
25
- sessions,
26
- count: sessions.length
27
- });
28
- } catch (error) {
29
- return toErrorResponse$6("memory_scan_session", error);
30
- }
31
- }
32
- async handleScanDelete(args) {
33
- try {
34
- return toTextResponse$6({
35
- success: true,
36
- deleted: this.sessionManager.deleteSession(args.sessionId)
37
- });
38
- } catch (error) {
39
- return toErrorResponse$6("memory_scan_session", error);
40
- }
41
- }
42
- async handleScanExport(args) {
43
- try {
44
- return toTextResponse$6({
45
- success: true,
46
- exportedData: this.sessionManager.exportSession(args.sessionId)
47
- });
48
- } catch (error) {
49
- return toErrorResponse$6("memory_scan_session", error);
50
- }
51
- }
52
- };
53
- //#endregion
54
- //#region src/server/domains/memory/handlers/scan.ts
55
- /** SECURITY: Cap user-supplied maxResults to prevent OOM */
56
- function capMaxResults(value) {
57
- if (value === void 0 || !Number.isFinite(value) || value <= 0) return MEMORY_SCAN_MAX_RESULTS;
58
- return Math.min(value, MEMORY_SCAN_MAX_RESULTS);
59
- }
60
- function toTextResponse$5(payload) {
61
- return { content: [{
62
- type: "text",
63
- text: JSON.stringify(payload, null, 2)
64
- }] };
65
- }
66
- function toErrorResponse$5(tool, error) {
67
- return toTextResponse$5({
68
- success: false,
69
- tool,
70
- error: error instanceof Error ? error.message : String(error)
71
- });
72
- }
73
- var ScanHandlers = class {
74
- constructor(scanner, eventBus) {
75
- this.scanner = scanner;
76
- this.eventBus = eventBus;
77
- }
78
- async handleFirstScan(args) {
79
- try {
80
- const options = {
81
- valueType: args.valueType,
82
- alignment: args.alignment,
83
- maxResults: capMaxResults(args.maxResults),
84
- regionFilter: args.regionFilter,
85
- onProgress: args.onProgress
86
- };
87
- const result = await this.scanner.firstScan(args.pid, args.value, options);
88
- this.eventBus?.emit("memory:scan_completed", {
89
- scanType: "first",
90
- resultCount: result.totalMatches ?? 0,
91
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
92
- });
93
- return toTextResponse$5({
94
- success: true,
95
- ...result,
96
- hint: result.totalMatches > 0 ? `Found ${result.totalMatches} matches. Use memory_next_scan with sessionId "${result.sessionId}" to narrow down.` : "No matches found. Try a different value or type."
97
- });
98
- } catch (error) {
99
- return toErrorResponse$5("memory_first_scan", error);
100
- }
101
- }
102
- async handleNextScan(args) {
103
- try {
104
- const result = await this.scanner.nextScan(args.sessionId, args.mode, args.value, args.value2);
105
- return toTextResponse$5({
106
- success: true,
107
- ...result,
108
- hint: result.totalMatches <= 10 ? "Few matches remaining — inspect these addresses." : `${result.totalMatches} matches remain. Continue narrowing with memory_next_scan.`
109
- });
110
- } catch (error) {
111
- return toErrorResponse$5("memory_next_scan", error);
112
- }
113
- }
114
- async handleUnknownScan(args) {
115
- try {
116
- const options = {
117
- valueType: args.valueType,
118
- alignment: args.alignment,
119
- maxResults: capMaxResults(args.maxResults),
120
- regionFilter: args.regionFilter,
121
- onProgress: args.onProgress
122
- };
123
- const result = await this.scanner.unknownInitialScan(args.pid, options);
124
- return toTextResponse$5({
125
- success: true,
126
- ...result,
127
- hint: `Captured ${result.totalMatches} addresses. Use memory_next_scan with changed/unchanged/increased/decreased to narrow.`
128
- });
129
- } catch (error) {
130
- return toErrorResponse$5("memory_unknown_scan", error);
131
- }
132
- }
133
- async handlePointerScan(args) {
134
- try {
135
- return toTextResponse$5({
136
- success: true,
137
- ...await this.scanner.pointerScan(args.pid, args.targetAddress, {
138
- maxResults: capMaxResults(args.maxResults),
139
- moduleOnly: args.moduleOnly
140
- })
141
- });
142
- } catch (error) {
143
- return toErrorResponse$5("memory_pointer_scan", error);
144
- }
145
- }
146
- async handleGroupScan(args) {
147
- try {
148
- return toTextResponse$5({
149
- success: true,
150
- ...await this.scanner.groupScan(args.pid, args.pattern, {
151
- alignment: args.alignment,
152
- maxResults: capMaxResults(args.maxResults)
153
- })
154
- });
155
- } catch (error) {
156
- return toErrorResponse$5("memory_group_scan", error);
157
- }
158
- }
159
- };
160
- //#endregion
161
- //#region src/server/domains/memory/handlers/pointer-chain.ts
162
- function toTextResponse$4(payload) {
163
- return { content: [{
164
- type: "text",
165
- text: JSON.stringify(payload, null, 2)
166
- }] };
167
- }
168
- function toErrorResponse$4(tool, error) {
169
- return toTextResponse$4({
170
- success: false,
171
- tool,
172
- error: error instanceof Error ? error.message : String(error)
173
- });
174
- }
175
- var PointerChainHandlers = class {
176
- constructor(ptrEngine) {
177
- this.ptrEngine = ptrEngine;
178
- }
179
- async handlePointerChainScan(args) {
180
- try {
181
- const result = await this.ptrEngine.scan(args.pid, args.targetAddress, {
182
- maxDepth: args.maxDepth,
183
- maxOffset: args.maxOffset,
184
- staticOnly: args.staticOnly,
185
- modules: args.modules,
186
- maxResults: args.maxResults
187
- });
188
- return toTextResponse$4({
189
- success: true,
190
- ...result,
191
- hint: result.totalFound > 0 ? `Found ${result.totalFound} pointer chains. Static chains survive process restarts.` : "No pointer chains found. Try increasing maxDepth or maxOffset."
192
- });
193
- } catch (error) {
194
- return toErrorResponse$4("memory_pointer_chain_scan", error);
195
- }
196
- }
197
- async handlePointerChainValidate(args) {
198
- try {
199
- const chains = JSON.parse(args.chains);
200
- const results = await this.ptrEngine.validateChains(args.pid, chains);
201
- return toTextResponse$4({
202
- success: true,
203
- results,
204
- validCount: results.filter((r) => r.isValid).length,
205
- totalChecked: chains.length
206
- });
207
- } catch (error) {
208
- return toErrorResponse$4("memory_pointer_chain_validate", error);
209
- }
210
- }
211
- async handlePointerChainResolve(args) {
212
- try {
213
- const chain = JSON.parse(args.chain);
214
- const resolved = await this.ptrEngine.resolveChain(args.pid, chain);
215
- return toTextResponse$4({
216
- success: true,
217
- chainId: chain.id,
218
- resolvedAddress: resolved,
219
- isResolvable: resolved !== null
220
- });
221
- } catch (error) {
222
- return toErrorResponse$4("memory_pointer_chain_resolve", error);
223
- }
224
- }
225
- async handlePointerChainExport(args) {
226
- try {
227
- const chains = JSON.parse(args.chains);
228
- return toTextResponse$4({
229
- success: true,
230
- exportedData: this.ptrEngine.exportChains(chains),
231
- chainCount: chains.length
232
- });
233
- } catch (error) {
234
- return toErrorResponse$4("memory_pointer_chain_export", error);
235
- }
236
- }
237
- };
238
- //#endregion
239
- //#region src/server/domains/memory/handlers/structure.ts
240
- function toTextResponse$3(payload) {
241
- return { content: [{
242
- type: "text",
243
- text: JSON.stringify(payload, null, 2)
244
- }] };
245
- }
246
- function toErrorResponse$3(tool, error) {
247
- return toTextResponse$3({
248
- success: false,
249
- tool,
250
- error: error instanceof Error ? error.message : String(error)
251
- });
252
- }
253
- const FIELD_TYPE_ALIASES = {
254
- int8_t: "int8",
255
- uint8_t: "uint8",
256
- int16_t: "int16",
257
- uint16_t: "uint16",
258
- int32_t: "int32",
259
- uint32_t: "uint32",
260
- int64_t: "int64",
261
- uint64_t: "uint64",
262
- void_ptr: "pointer",
263
- char_ptr: "string_ptr"
264
- };
265
- function normalizeFieldType(value) {
266
- if (typeof value !== "string" || value.length === 0) return "unknown";
267
- const normalized = value.toLowerCase().replace(/\s+/g, "_").replace(/\*/g, "_ptr");
268
- return FIELD_TYPE_ALIASES[normalized] ?? normalized;
269
- }
270
- function normalizeStructureForExport(raw) {
271
- if (!raw || typeof raw !== "object") throw new Error("structure must be a JSON object");
272
- const source = raw;
273
- const fields = (Array.isArray(source.fields) ? source.fields : []).map((entry, index) => {
274
- const field = entry;
275
- return {
276
- offset: typeof field.offset === "number" ? field.offset : 0,
277
- size: typeof field.size === "number" ? field.size : 1,
278
- type: normalizeFieldType(field.type),
279
- name: typeof field.name === "string" && field.name.length > 0 ? field.name : `field_${index}`,
280
- value: typeof field.value === "string" ? field.value : "",
281
- confidence: typeof field.confidence === "number" ? field.confidence : 1,
282
- notes: typeof field.notes === "string" ? field.notes : void 0
283
- };
284
- });
285
- const inferredSize = fields.reduce((max, field) => Math.max(max, field.offset + field.size), 0);
286
- const totalSize = typeof source.totalSize === "number" ? source.totalSize : typeof source.size === "number" ? source.size : inferredSize;
287
- return {
288
- baseAddress: typeof source.baseAddress === "string" ? source.baseAddress : "0x0",
289
- totalSize,
290
- fields,
291
- vtableAddress: typeof source.vtableAddress === "string" ? source.vtableAddress : void 0,
292
- className: typeof source.className === "string" ? source.className : void 0,
293
- baseClasses: Array.isArray(source.baseClasses) ? source.baseClasses.filter((entry) => typeof entry === "string") : void 0,
294
- timestamp: typeof source.timestamp === "number" ? source.timestamp : Date.now()
295
- };
296
- }
297
- var StructureHandlers = class {
298
- constructor(structAnalyzer) {
299
- this.structAnalyzer = structAnalyzer;
300
- }
301
- async handleStructureAnalyze(args) {
302
- try {
303
- const result = await this.structAnalyzer.analyzeStructure(args.pid, args.address, {
304
- size: args.size,
305
- otherInstances: args.otherInstances,
306
- parseRtti: args.parseRtti
307
- });
308
- return toTextResponse$3({
309
- success: true,
310
- ...result,
311
- hint: result.className ? `Detected class: ${result.className}${result.baseClasses?.length ? ` (inherits: ${result.baseClasses.join(" → ")})` : ""}` : `Inferred ${result.fields.length} fields. Use memory_structure_export_c to export as C struct.`
312
- });
313
- } catch (error) {
314
- return toErrorResponse$3("memory_structure_analyze", error);
315
- }
316
- }
317
- async handleVtableParse(args) {
318
- try {
319
- return toTextResponse$3({
320
- success: true,
321
- ...await this.structAnalyzer.parseVtable(args.pid, args.vtableAddress)
322
- });
323
- } catch (error) {
324
- return toErrorResponse$3("memory_vtable_parse", error);
325
- }
326
- }
327
- async handleStructureExportC(args) {
328
- try {
329
- const structure = normalizeStructureForExport(JSON.parse(args.structure));
330
- return toTextResponse$3({
331
- success: true,
332
- ...this.structAnalyzer.exportToCStruct(structure, args.name)
333
- });
334
- } catch (error) {
335
- return toErrorResponse$3("memory_structure_export_c", error);
336
- }
337
- }
338
- async handleStructureCompare(args) {
339
- try {
340
- const result = await this.structAnalyzer.compareInstances(args.pid, args.address1, args.address2, args.size);
341
- return toTextResponse$3({
342
- success: true,
343
- matchingFieldCount: result.matching.length,
344
- differingFieldCount: result.differing.length,
345
- ...result
346
- });
347
- } catch (error) {
348
- return toErrorResponse$3("memory_structure_compare", error);
349
- }
350
- }
351
- };
352
- //#endregion
353
- //#region src/server/domains/memory/handlers/hooks.ts
354
- function toTextResponse$2(payload) {
355
- return { content: [{
356
- type: "text",
357
- text: JSON.stringify(payload, null, 2)
358
- }] };
359
- }
360
- function toErrorResponse$2(tool, error) {
361
- return toTextResponse$2({
362
- success: false,
363
- tool,
364
- error: error instanceof Error ? error.message : String(error)
365
- });
366
- }
367
- var HookHandlers = class {
368
- constructor(bpEngine, injector) {
369
- this.bpEngine = bpEngine;
370
- this.injector = injector;
371
- }
372
- async handleBreakpointSet(args) {
373
- try {
374
- return toTextResponse$2({
375
- success: true,
376
- ...await this.bpEngine.setBreakpoint(args.pid, args.address, args.access, args.size ?? 4),
377
- hint: "Hardware breakpoint set on DR register. Use memory_breakpoint with action='trace' to collect hits."
378
- });
379
- } catch (error) {
380
- return toErrorResponse$2("memory_breakpoint", error);
381
- }
382
- }
383
- async handleBreakpointRemove(args) {
384
- try {
385
- return toTextResponse$2({
386
- success: true,
387
- removed: await this.bpEngine.removeBreakpoint(args.breakpointId)
388
- });
389
- } catch (error) {
390
- return toErrorResponse$2("memory_breakpoint", error);
391
- }
392
- }
393
- async handleBreakpointList(_args) {
394
- try {
395
- const bps = this.bpEngine.listBreakpoints();
396
- return toTextResponse$2({
397
- success: true,
398
- breakpoints: bps,
399
- count: bps.length
400
- });
401
- } catch (error) {
402
- return toErrorResponse$2("memory_breakpoint", error);
403
- }
404
- }
405
- async handleBreakpointTrace(args) {
406
- try {
407
- const hits = await this.bpEngine.traceAccess(args.pid, args.address, args.access, args.maxHits, args.timeoutMs);
408
- return toTextResponse$2({
409
- success: true,
410
- hits,
411
- hitCount: hits.length,
412
- hint: hits.length > 0 ? `${hits.length} accesses captured. Check instructionAddress to find the code accessing this address.` : "No hits captured within timeout."
413
- });
414
- } catch (error) {
415
- return toErrorResponse$2("memory_breakpoint", error);
416
- }
417
- }
418
- async handlePatchBytes(args) {
419
- try {
420
- const patch = await this.injector.patchBytes(args.pid, args.address, args.bytes);
421
- return toTextResponse$2({
422
- success: true,
423
- ...patch,
424
- hint: `Patch applied. Use memory_patch_undo with patchId "${patch.id}" to restore.`
425
- });
426
- } catch (error) {
427
- return toErrorResponse$2("memory_patch_bytes", error);
428
- }
429
- }
430
- async handlePatchNop(args) {
431
- try {
432
- return toTextResponse$2({
433
- success: true,
434
- ...await this.injector.nopBytes(args.pid, args.address, args.count),
435
- hint: `${args.count} bytes NOP'd. Use memory_patch_undo to restore.`
436
- });
437
- } catch (error) {
438
- return toErrorResponse$2("memory_patch_nop", error);
439
- }
440
- }
441
- async handlePatchUndo(args) {
442
- try {
443
- return toTextResponse$2({
444
- success: true,
445
- restored: await this.injector.unpatch(args.patchId)
446
- });
447
- } catch (error) {
448
- return toErrorResponse$2("memory_patch_undo", error);
449
- }
450
- }
451
- async handleCodeCaves(args) {
452
- try {
453
- const caves = await this.injector.findCodeCaves(args.pid, args.minSize);
454
- return toTextResponse$2({
455
- success: true,
456
- caves,
457
- count: caves.length
458
- });
459
- } catch (error) {
460
- return toErrorResponse$2("memory_code_caves", error);
461
- }
462
- }
463
- };
464
- //#endregion
465
- //#region src/server/domains/memory/handlers/readwrite.ts
466
- function toTextResponse$1(payload) {
467
- return { content: [{
468
- type: "text",
469
- text: JSON.stringify(payload, null, 2)
470
- }] };
471
- }
472
- function toErrorResponse$1(tool, error) {
473
- return toTextResponse$1({
474
- success: false,
475
- tool,
476
- error: error instanceof Error ? error.message : String(error)
477
- });
478
- }
479
- var ReadWriteHandlers = class {
480
- constructor(memCtrl) {
481
- this.memCtrl = memCtrl;
482
- }
483
- async handleWriteValue(args) {
484
- try {
485
- return toTextResponse$1({
486
- success: true,
487
- ...await this.memCtrl.writeValue(args.pid, args.address, args.value, args.valueType),
488
- hint: "Use memory_write_history with action='undo' to revert."
489
- });
490
- } catch (error) {
491
- return toErrorResponse$1("memory_write_value", error);
492
- }
493
- }
494
- async handleFreeze(args) {
495
- try {
496
- const entry = await this.memCtrl.freeze(args.pid, args.address, args.value, args.valueType, args.intervalMs);
497
- return toTextResponse$1({
498
- success: true,
499
- ...entry,
500
- hint: `Frozen. Use memory_freeze with action="unfreeze" and freezeId "${entry.id}" to stop.`
501
- });
502
- } catch (error) {
503
- return toErrorResponse$1("memory_freeze", error);
504
- }
505
- }
506
- async handleUnfreeze(args) {
507
- try {
508
- return toTextResponse$1({
509
- success: true,
510
- unfrozen: await this.memCtrl.unfreeze(args.freezeId)
511
- });
512
- } catch (error) {
513
- return toErrorResponse$1("memory_freeze", error);
514
- }
515
- }
516
- async handleDump(args) {
517
- try {
518
- return toTextResponse$1({
519
- success: true,
520
- dump: await this.memCtrl.dumpMemoryHex(args.pid, args.address, args.size ?? 256)
521
- });
522
- } catch (error) {
523
- return toErrorResponse$1("memory_dump", error);
524
- }
525
- }
526
- async handleWriteUndo(_args) {
527
- try {
528
- const entry = await this.memCtrl.undo();
529
- return toTextResponse$1({
530
- success: true,
531
- undone: entry !== null,
532
- entry
533
- });
534
- } catch (error) {
535
- return toErrorResponse$1("memory_write_history", error);
536
- }
537
- }
538
- async handleWriteRedo(_args) {
539
- try {
540
- const entry = await this.memCtrl.redo();
541
- return toTextResponse$1({
542
- success: true,
543
- redone: entry !== null,
544
- entry
545
- });
546
- } catch (error) {
547
- return toErrorResponse$1("memory_write_history", error);
548
- }
549
- }
550
- };
551
- //#endregion
552
- //#region src/server/domains/memory/handlers/integrity.ts
553
- function toTextResponse(payload) {
554
- return { content: [{
555
- type: "text",
556
- text: JSON.stringify(payload, null, 2)
557
- }] };
558
- }
559
- function toErrorResponse(tool, error) {
560
- return toTextResponse({
561
- success: false,
562
- tool,
563
- error: error instanceof Error ? error.message : String(error)
564
- });
565
- }
566
- var IntegrityHandlers = class {
567
- constructor(speedhackEngine, heapAnalyzer, peAnalyzer, antiCheatDetector) {
568
- this.speedhackEngine = speedhackEngine;
569
- this.heapAnalyzer = heapAnalyzer;
570
- this.peAnalyzer = peAnalyzer;
571
- this.antiCheatDetector = antiCheatDetector;
572
- }
573
- async handleSpeedhackApply(args) {
574
- try {
575
- return toTextResponse({
576
- ...await this.speedhackEngine.apply(args.pid, args.speed),
577
- success: true,
578
- hint: `Speedhack active (${args.speed}x). Use memory_speedhack({ action: 'set' }) to adjust.`
579
- });
580
- } catch (error) {
581
- return toErrorResponse("memory_speedhack", error);
582
- }
583
- }
584
- async handleSpeedhackSet(args) {
585
- try {
586
- return toTextResponse({
587
- success: true,
588
- updated: await this.speedhackEngine.setSpeed(args.pid, args.speed),
589
- newSpeed: args.speed
590
- });
591
- } catch (error) {
592
- return toErrorResponse("memory_speedhack", error);
593
- }
594
- }
595
- async handleHeapEnumerate(args) {
596
- try {
597
- const result = await this.heapAnalyzer.enumerateHeaps(args.pid);
598
- return toTextResponse({
599
- success: true,
600
- ...result,
601
- hint: `Enumerated ${result.heaps.length} heaps. Use memory_heap_stats for statistics or memory_heap_anomalies to check for issues.`
602
- });
603
- } catch (error) {
604
- return toErrorResponse("memory_heap_enumerate", error);
605
- }
606
- }
607
- async handleHeapStats(args) {
608
- try {
609
- return toTextResponse({
610
- success: true,
611
- ...await this.heapAnalyzer.getStats(args.pid)
612
- });
613
- } catch (error) {
614
- return toErrorResponse("memory_heap_stats", error);
615
- }
616
- }
617
- async handleHeapAnomalies(args) {
618
- try {
619
- const anomalies = await this.heapAnalyzer.detectAnomalies(args.pid);
620
- return toTextResponse({
621
- success: true,
622
- anomalies,
623
- count: anomalies.length,
624
- hint: anomalies.length > 0 ? `Found ${anomalies.length} anomalies — inspect types for spray, UAF, or suspicious patterns.` : "No heap anomalies detected."
625
- });
626
- } catch (error) {
627
- return toErrorResponse("memory_heap_anomalies", error);
628
- }
629
- }
630
- async handlePEHeaders(args) {
631
- try {
632
- return toTextResponse({
633
- success: true,
634
- ...await this.peAnalyzer.parseHeaders(args.pid, args.moduleBase)
635
- });
636
- } catch (error) {
637
- return toErrorResponse("memory_pe_headers", error);
638
- }
639
- }
640
- async handlePEImportsExports(args) {
641
- try {
642
- const table = args.table || "both";
643
- const base = args.moduleBase;
644
- const pid = args.pid;
645
- const result = { success: true };
646
- if (table === "imports" || table === "both") result.imports = await this.peAnalyzer.parseImports(pid, base);
647
- if (table === "exports" || table === "both") result.exports = await this.peAnalyzer.parseExports(pid, base);
648
- return toTextResponse(result);
649
- } catch (error) {
650
- return toErrorResponse("memory_pe_imports_exports", error);
651
- }
652
- }
653
- async handleInlineHookDetect(args) {
654
- try {
655
- const hooks = await this.peAnalyzer.detectInlineHooks(args.pid, args.moduleName);
656
- return toTextResponse({
657
- success: true,
658
- hooks,
659
- count: hooks.length,
660
- hint: hooks.length > 0 ? `Detected ${hooks.length} inline hooks — check hookType and jumpTarget for each.` : "No inline hooks detected — exports match disk bytes."
661
- });
662
- } catch (error) {
663
- return toErrorResponse("memory_inline_hook_detect", error);
664
- }
665
- }
666
- async handleAntiCheatDetect(args) {
667
- try {
668
- const detections = await this.antiCheatDetector.detect(args.pid);
669
- return toTextResponse({
670
- success: true,
671
- detections,
672
- count: detections.length,
673
- hint: detections.length > 0 ? `Found ${detections.length} anti-debug mechanisms. Each includes a bypassSuggestion.` : "No anti-debug mechanisms detected in imports."
674
- });
675
- } catch (error) {
676
- return toErrorResponse("memory_anticheat_detect", error);
677
- }
678
- }
679
- async handleGuardPages(args) {
680
- try {
681
- const { guardPages, stats } = await this.antiCheatDetector.scanGuardPages(args.pid);
682
- return toTextResponse({
683
- success: true,
684
- guardPages,
685
- count: guardPages.length,
686
- scan: stats,
687
- hint: stats.truncated ? `Scan stopped after ${stats.scannedRegions} regions in ${stats.durationMs}ms to avoid hanging. Results may be partial.` : guardPages.length > 0 ? `Found ${guardPages.length} guard page regions — these may indicate anti-tampering.` : "No guard pages found."
688
- });
689
- } catch (error) {
690
- return toErrorResponse("memory_guard_pages", error);
691
- }
692
- }
693
- async handleIntegrityCheck(args) {
694
- try {
695
- const { sections, stats } = await this.antiCheatDetector.scanIntegrity(args.pid, args.moduleName);
696
- const modified = sections.filter((r) => r.isModified);
697
- return toTextResponse({
698
- success: true,
699
- sections,
700
- totalChecked: sections.length,
701
- modifiedCount: modified.length,
702
- scan: stats,
703
- hint: stats.truncated ? `Checked ${stats.scannedSections} executable section(s) across ${stats.scannedModules} module(s) before hitting safety limits. Results may be partial.` : modified.length > 0 ? `${modified.length} section(s) modified — code may have been patched or hooked.` : "All checked sections match disk — no runtime modifications detected."
704
- });
705
- } catch (error) {
706
- return toErrorResponse("memory_integrity_check", error);
707
- }
708
- }
709
- };
710
- //#endregion
711
- //#region src/server/domains/memory/handlers.impl.ts
712
- var MemoryScanHandlers = class {
713
- sessions;
714
- scans;
715
- ptrChains;
716
- structures;
717
- hooks;
718
- readwrite;
719
- integrity;
720
- constructor(scanner, sessionManager, ptrEngine, structAnalyzer, bpEngine, injector, memCtrl, speedhackEngine, heapAnalyzer, peAnalyzer, antiCheatDetector, eventBus) {
721
- this.sessions = new SessionHandlers(sessionManager);
722
- this.scans = new ScanHandlers(scanner, eventBus);
723
- this.ptrChains = new PointerChainHandlers(ptrEngine);
724
- this.structures = new StructureHandlers(structAnalyzer);
725
- this.hooks = new HookHandlers(bpEngine, injector);
726
- this.readwrite = new ReadWriteHandlers(memCtrl);
727
- this.integrity = new IntegrityHandlers(speedhackEngine, heapAnalyzer, peAnalyzer, antiCheatDetector);
728
- }
729
- handleScanSessionDispatch(args) {
730
- switch (String(args["action"] ?? "")) {
731
- case "delete": return this.sessions.handleScanDelete(args);
732
- case "export": return this.sessions.handleScanExport(args);
733
- default: return this.sessions.handleScanList(args);
734
- }
735
- }
736
- handleScanList = (args) => this.sessions.handleScanList(args);
737
- handleScanDelete = (args) => this.sessions.handleScanDelete(args);
738
- handleScanExport = (args) => this.sessions.handleScanExport(args);
739
- handleFirstScan = (args) => this.scans.handleFirstScan(args);
740
- handleNextScan = (args) => this.scans.handleNextScan(args);
741
- handleUnknownScan = (args) => this.scans.handleUnknownScan(args);
742
- handlePointerScan = (args) => this.scans.handlePointerScan(args);
743
- handleGroupScan = (args) => this.scans.handleGroupScan(args);
744
- handlePointerChainDispatch(args) {
745
- switch (String(args["action"] ?? "")) {
746
- case "validate": return this.ptrChains.handlePointerChainValidate(args);
747
- case "resolve": return this.ptrChains.handlePointerChainResolve(args);
748
- case "export": return this.ptrChains.handlePointerChainExport(args);
749
- default: return this.ptrChains.handlePointerChainScan(args);
750
- }
751
- }
752
- handlePointerChainScan = (args) => this.ptrChains.handlePointerChainScan(args);
753
- handlePointerChainValidate = (args) => this.ptrChains.handlePointerChainValidate(args);
754
- handlePointerChainResolve = (args) => this.ptrChains.handlePointerChainResolve(args);
755
- handlePointerChainExport = (args) => this.ptrChains.handlePointerChainExport(args);
756
- handleStructureAnalyze = (args) => this.structures.handleStructureAnalyze(args);
757
- handleVtableParse = (args) => this.structures.handleVtableParse(args);
758
- handleStructureExportC = (args) => this.structures.handleStructureExportC(args);
759
- handleStructureCompare = (args) => this.structures.handleStructureCompare(args);
760
- handleBreakpointDispatch(args) {
761
- switch (String(args["action"] ?? "")) {
762
- case "remove": return this.hooks.handleBreakpointRemove(args);
763
- case "list": return this.hooks.handleBreakpointList(args);
764
- case "trace": return this.hooks.handleBreakpointTrace(args);
765
- default: return this.hooks.handleBreakpointSet(args);
766
- }
767
- }
768
- handleBreakpointSet = (args) => this.hooks.handleBreakpointSet(args);
769
- handleBreakpointRemove = (args) => this.hooks.handleBreakpointRemove(args);
770
- handleBreakpointList = (args) => this.hooks.handleBreakpointList(args);
771
- handleBreakpointTrace = (args) => this.hooks.handleBreakpointTrace(args);
772
- handlePatchBytes = (args) => this.hooks.handlePatchBytes(args);
773
- handlePatchNop = (args) => this.hooks.handlePatchNop(args);
774
- handlePatchUndo = (args) => this.hooks.handlePatchUndo(args);
775
- handleCodeCaves = (args) => this.hooks.handleCodeCaves(args);
776
- handleFreezeDispatch(args) {
777
- if (String(args["action"] ?? "") === "unfreeze") return this.readwrite.handleUnfreeze(args);
778
- return this.readwrite.handleFreeze(args);
779
- }
780
- handleWriteHistoryDispatch(args) {
781
- if (String(args["action"] ?? "") === "redo") return this.readwrite.handleWriteRedo(args);
782
- return this.readwrite.handleWriteUndo(args);
783
- }
784
- handleWriteValue = (args) => this.readwrite.handleWriteValue(args);
785
- handleFreeze = (args) => this.readwrite.handleFreeze(args);
786
- handleUnfreeze = (args) => this.readwrite.handleUnfreeze(args);
787
- handleDump = (args) => this.readwrite.handleDump(args);
788
- handleWriteUndo = (args) => this.readwrite.handleWriteUndo(args);
789
- handleWriteRedo = (args) => this.readwrite.handleWriteRedo(args);
790
- handleSpeedhackDispatch(args) {
791
- if (String(args["action"] ?? "") === "set") return this.integrity.handleSpeedhackSet(args);
792
- return this.integrity.handleSpeedhackApply(args);
793
- }
794
- handleSpeedhackApply = (args) => this.integrity.handleSpeedhackApply(args);
795
- handleSpeedhackSet = (args) => this.integrity.handleSpeedhackSet(args);
796
- handleHeapEnumerate = (args) => this.integrity.handleHeapEnumerate(args);
797
- handleHeapStats = (args) => this.integrity.handleHeapStats(args);
798
- handleHeapAnomalies = (args) => this.integrity.handleHeapAnomalies(args);
799
- handlePEHeaders = (args) => this.integrity.handlePEHeaders(args);
800
- handlePEImportsExports = (args) => this.integrity.handlePEImportsExports(args);
801
- handleInlineHookDetect = (args) => this.integrity.handleInlineHookDetect(args);
802
- handleAntiCheatDetect = (args) => this.integrity.handleAntiCheatDetect(args);
803
- handleGuardPages = (args) => this.integrity.handleGuardPages(args);
804
- handleIntegrityCheck = (args) => this.integrity.handleIntegrityCheck(args);
805
- };
806
- //#endregion
807
- export { MemoryScanHandlers };