@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,96 +0,0 @@
1
- import { n as __require } from "./chunk-CjcI7cDX.mjs";
2
- import { t as logger } from "./logger-Dh_xb7_2.mjs";
3
- //#region src/modules/stealth/FingerprintManager.ts
4
- var FingerprintManager = class FingerprintManager {
5
- static instance = null;
6
- activeProfile = null;
7
- available = null;
8
- constructor() {}
9
- static getInstance() {
10
- if (!FingerprintManager.instance) FingerprintManager.instance = new FingerprintManager();
11
- return FingerprintManager.instance;
12
- }
13
- /**
14
- * Check if fingerprint-generator and fingerprint-injector packages are installed.
15
- */
16
- isAvailable() {
17
- if (this.available !== null) return this.available;
18
- try {
19
- __require.resolve("fingerprint-generator");
20
- __require.resolve("fingerprint-injector");
21
- this.available = true;
22
- } catch {
23
- this.available = false;
24
- }
25
- return this.available;
26
- }
27
- /**
28
- * Generate a fingerprint profile using real-world datasets.
29
- * Returns null if packages are not installed.
30
- */
31
- async generateFingerprint(options) {
32
- if (!this.isAvailable()) {
33
- logger.warn("fingerprint-generator not installed. Run: pnpm add fingerprint-generator fingerprint-injector");
34
- return null;
35
- }
36
- try {
37
- const { FingerprintGenerator } = await import("fingerprint-generator");
38
- const generator = new FingerprintGenerator();
39
- const fpOptions = {};
40
- if (options?.os) fpOptions.operatingSystems = [{
41
- windows: "windows",
42
- macos: "macos",
43
- linux: "linux"
44
- }[options.os] ?? "windows"];
45
- if (options?.browser) fpOptions.browsers = [options.browser];
46
- if (options?.locale) fpOptions.locales = [options.locale];
47
- if (options?.screen) fpOptions.screen = options.screen;
48
- const result = generator.getFingerprint(fpOptions);
49
- this.activeProfile = {
50
- fingerprint: result.fingerprint,
51
- headers: result.headers ?? {},
52
- generatedAt: Date.now(),
53
- os: options?.os ?? "windows",
54
- browser: options?.browser ?? "chrome"
55
- };
56
- logger.info(`Fingerprint generated for ${this.activeProfile.os}/${this.activeProfile.browser}`);
57
- return this.activeProfile;
58
- } catch (err) {
59
- logger.error("Failed to generate fingerprint:", err);
60
- return null;
61
- }
62
- }
63
- /**
64
- * Inject the given fingerprint profile into a page.
65
- * Must be called BEFORE StealthScripts.injectAll().
66
- */
67
- async injectFingerprint(page, profile) {
68
- if (!this.isAvailable()) throw new Error("fingerprint-injector not installed");
69
- try {
70
- const { newInjectedPage } = await import("fingerprint-injector");
71
- await newInjectedPage(page, { fingerprint: "fingerprint" in profile ? profile.fingerprint : profile });
72
- logger.info("Fingerprint injected into page");
73
- } catch (err) {
74
- logger.error("Failed to inject fingerprint:", err);
75
- throw err;
76
- }
77
- }
78
- /**
79
- * Get the currently cached fingerprint profile.
80
- */
81
- getActiveProfile() {
82
- return this.activeProfile;
83
- }
84
- /**
85
- * Clear the cached fingerprint profile.
86
- */
87
- clearProfile() {
88
- this.activeProfile = null;
89
- }
90
- /** Reset singleton for testing purposes. */
91
- static resetInstance() {
92
- FingerprintManager.instance = null;
93
- }
94
- };
95
- //#endregion
96
- export { FingerprintManager };
@@ -1,239 +0,0 @@
1
- import { _ as BREAKPOINT_TRACE_MAX_HITS, g as BREAKPOINT_HIT_TIMEOUT_MS } from "./constants-B0OANIBL.mjs";
2
- import { t as CloseHandle } from "./Win32API-CePkipZY.mjs";
3
- import { _ as openThreadForDebug, a as DebugActiveProcessStop, c as EnumerateProcessThreads, d as ResumeThread, f as SetThreadContext, g as encodeDR7, h as WaitForDebugEvent, i as DebugActiveProcess, n as ContinueDebugEvent, o as DebugSetProcessKillOnExit, p as SuspendThread, r as DBG, s as EXCEPTION_CODE, t as CONTEXT_FLAGS, u as GetThreadContext, v as parseContext, y as writeContext } from "./Win32Debug-BvKs-gxc.mjs";
4
- import { randomUUID } from "node:crypto";
5
- //#region src/native/HardwareBreakpoint.ts
6
- /**
7
- * Hardware Breakpoint Engine — x64 debug register management.
8
- *
9
- * Sets/clears hardware breakpoints using DR0–DR3, monitors for hits,
10
- * and returns access context (instruction address, thread, register state).
11
- *
12
- * @module HardwareBreakpoint
13
- */
14
- const toHex = (v) => `0x${v.toString(16).toUpperCase()}`;
15
- var HardwareBreakpointEngine = class {
16
- breakpoints = /* @__PURE__ */ new Map();
17
- attachedPids = /* @__PURE__ */ new Set();
18
- drAllocation = [
19
- false,
20
- false,
21
- false,
22
- false
23
- ];
24
- /** Attach to process as debugger (required before setting breakpoints) */
25
- async attach(pid) {
26
- if (this.attachedPids.has(pid)) return;
27
- DebugActiveProcess(pid);
28
- DebugSetProcessKillOnExit(false);
29
- this.attachedPids.add(pid);
30
- for (let i = 0; i < 100; i++) {
31
- const evt = WaitForDebugEvent(100);
32
- if (!evt) break;
33
- ContinueDebugEvent(evt.processId, evt.threadId, DBG.CONTINUE);
34
- }
35
- }
36
- /** Detach from process */
37
- async detach(pid) {
38
- for (const [id, bp] of this.breakpoints) if (bp.pid === pid) {
39
- this.clearDR(pid, bp.drIndex);
40
- this.drAllocation[bp.drIndex] = false;
41
- this.breakpoints.delete(id);
42
- }
43
- if (this.attachedPids.has(pid)) {
44
- try {
45
- DebugActiveProcessStop(pid);
46
- } catch {}
47
- this.attachedPids.delete(pid);
48
- }
49
- }
50
- /** Set a hardware breakpoint using an available DR register */
51
- async setBreakpoint(pid, address, access, size = 4) {
52
- if (!this.attachedPids.has(pid)) await this.attach(pid);
53
- const drIndex = this.allocateDR();
54
- const targetAddr = BigInt(address.startsWith("0x") ? address : `0x${address}`);
55
- this.applyDRToAllThreads(pid, drIndex, targetAddr, access, size, true);
56
- const config = {
57
- id: randomUUID(),
58
- pid,
59
- address: `0x${targetAddr.toString(16).toUpperCase()}`,
60
- access,
61
- size,
62
- enabled: true,
63
- drIndex,
64
- hitCount: 0
65
- };
66
- this.breakpoints.set(config.id, config);
67
- return config;
68
- }
69
- /** Remove a hardware breakpoint */
70
- async removeBreakpoint(id) {
71
- const bp = this.breakpoints.get(id);
72
- if (!bp) return false;
73
- this.clearDR(bp.pid, bp.drIndex);
74
- this.drAllocation[bp.drIndex] = false;
75
- this.breakpoints.delete(id);
76
- return true;
77
- }
78
- /** List all active breakpoints */
79
- listBreakpoints() {
80
- return Array.from(this.breakpoints.values()).map((bp) => ({
81
- id: bp.id,
82
- address: bp.address,
83
- access: bp.access,
84
- size: bp.size,
85
- enabled: bp.enabled,
86
- hitCount: bp.hitCount,
87
- lastHit: bp.lastHit
88
- }));
89
- }
90
- /** Wait for a breakpoint hit */
91
- async waitForHit(timeoutMs) {
92
- const timeout = timeoutMs ?? BREAKPOINT_HIT_TIMEOUT_MS;
93
- const deadline = Date.now() + timeout;
94
- while (Date.now() < deadline) {
95
- const remaining = Math.max(100, deadline - Date.now());
96
- const evt = WaitForDebugEvent(Math.min(remaining, 500));
97
- if (!evt) continue;
98
- if (evt.exceptionCode === EXCEPTION_CODE.SINGLE_STEP) {
99
- const hit = this.processHit(evt.threadId, evt.processId, evt.exceptionAddress);
100
- ContinueDebugEvent(evt.processId, evt.threadId, DBG.CONTINUE);
101
- if (hit) return hit;
102
- } else ContinueDebugEvent(evt.processId, evt.threadId, DBG.CONTINUE);
103
- }
104
- return null;
105
- }
106
- /** Trace access: collect multiple hits, answers "who reads/writes this address?" */
107
- async traceAccess(pid, address, access, maxHits, timeoutMs) {
108
- const max = maxHits ?? BREAKPOINT_TRACE_MAX_HITS;
109
- const timeout = timeoutMs ?? BREAKPOINT_HIT_TIMEOUT_MS;
110
- const bp = await this.setBreakpoint(pid, address, access);
111
- const hits = [];
112
- const deadline = Date.now() + timeout;
113
- while (hits.length < max && Date.now() < deadline) {
114
- const hit = await this.waitForHit(Math.min(1e3, deadline - Date.now()));
115
- if (hit?.breakpointId === bp.id) hits.push(hit);
116
- }
117
- await this.removeBreakpoint(bp.id);
118
- return hits;
119
- }
120
- allocateDR() {
121
- for (let i = 0; i < 4; i++) if (!this.drAllocation[i]) {
122
- this.drAllocation[i] = true;
123
- return i;
124
- }
125
- throw new Error("All 4 hardware breakpoint registers (DR0-DR3) are in use");
126
- }
127
- applyDRToAllThreads(pid, drIndex, address, access, size, enable) {
128
- const threads = EnumerateProcessThreads(pid);
129
- const drAccessMap = {
130
- execute: "execute",
131
- write: "write",
132
- readwrite: "readwrite",
133
- read: "read"
134
- };
135
- for (const tid of threads) {
136
- let hThread;
137
- try {
138
- hThread = openThreadForDebug(tid);
139
- } catch {
140
- continue;
141
- }
142
- try {
143
- SuspendThread(hThread);
144
- const ctxBuf = GetThreadContext(hThread, CONTEXT_FLAGS.ALL);
145
- const drOffsets = [
146
- 72,
147
- 80,
148
- 88,
149
- 96
150
- ];
151
- if (enable) ctxBuf.writeBigUInt64LE(address, drOffsets[drIndex]);
152
- else ctxBuf.writeBigUInt64LE(0n, drOffsets[drIndex]);
153
- const entries = Array.from(this.breakpoints.values()).filter((bp) => bp.enabled).map((bp) => ({
154
- drIndex: bp.drIndex,
155
- enabled: true,
156
- access: drAccessMap[bp.access],
157
- size: bp.size
158
- }));
159
- if (enable) entries.push({
160
- drIndex,
161
- enabled: true,
162
- access: drAccessMap[access],
163
- size
164
- });
165
- const dr7 = encodeDR7(entries);
166
- ctxBuf.writeBigUInt64LE(dr7, 112);
167
- writeContext(ctxBuf, { contextFlags: CONTEXT_FLAGS.ALL });
168
- SetThreadContext(hThread, ctxBuf);
169
- ResumeThread(hThread);
170
- } catch {
171
- try {
172
- ResumeThread(hThread);
173
- } catch {}
174
- } finally {
175
- CloseHandle(hThread);
176
- }
177
- }
178
- }
179
- clearDR(pid, drIndex) {
180
- this.applyDRToAllThreads(pid, drIndex, 0n, "write", 1, false);
181
- }
182
- processHit(threadId, processId, _exceptionAddress) {
183
- let hThread;
184
- try {
185
- hThread = openThreadForDebug(threadId);
186
- } catch {
187
- return null;
188
- }
189
- try {
190
- const ctxBuf = GetThreadContext(hThread, CONTEXT_FLAGS.ALL);
191
- const ctx = parseContext(ctxBuf);
192
- for (const [id, bp] of this.breakpoints) {
193
- if (bp.pid !== processId) continue;
194
- const drBit = 1n << BigInt(bp.drIndex);
195
- if (ctx.dr6 & drBit) {
196
- bp.hitCount++;
197
- bp.lastHit = Date.now();
198
- ctxBuf.writeBigUInt64LE(0n, 104);
199
- SetThreadContext(hThread, ctxBuf);
200
- return {
201
- breakpointId: id,
202
- address: bp.address,
203
- accessAddress: bp.address,
204
- instructionAddress: toHex(ctx.rip),
205
- threadId,
206
- accessType: bp.access,
207
- timestamp: Date.now(),
208
- registers: {
209
- rax: toHex(ctx.rax),
210
- rbx: toHex(ctx.rbx),
211
- rcx: toHex(ctx.rcx),
212
- rdx: toHex(ctx.rdx),
213
- rsi: toHex(ctx.rsi),
214
- rdi: toHex(ctx.rdi),
215
- rsp: toHex(ctx.rsp),
216
- rbp: toHex(ctx.rbp),
217
- r8: toHex(ctx.r8),
218
- r9: toHex(ctx.r9),
219
- r10: toHex(ctx.r10),
220
- r11: toHex(ctx.r11),
221
- r12: toHex(ctx.r12),
222
- r13: toHex(ctx.r13),
223
- r14: toHex(ctx.r14),
224
- r15: toHex(ctx.r15),
225
- rip: toHex(ctx.rip),
226
- rflags: `0x${ctx.eflags.toString(16).toUpperCase()}`
227
- }
228
- };
229
- }
230
- }
231
- return null;
232
- } finally {
233
- CloseHandle(hThread);
234
- }
235
- }
236
- };
237
- const hardwareBreakpointEngine = new HardwareBreakpointEngine();
238
- //#endregion
239
- export { HardwareBreakpointEngine, hardwareBreakpointEngine };
@@ -1,284 +0,0 @@
1
- import { t as logger } from "./logger-Dh_xb7_2.mjs";
2
- import { at as HEAP_ENUMERATE_MAX_BLOCKS, ct as HEAP_SUSPICIOUS_BLOCK_SIZE, ot as HEAP_SPRAY_SIZE_TOLERANCE, st as HEAP_SPRAY_THRESHOLD } from "./constants-B0OANIBL.mjs";
3
- import { b as openProcessForMemory, d as ReadProcessMemory, t as CloseHandle } from "./Win32API-CePkipZY.mjs";
4
- import { m as TH32CS } from "./Win32Debug-BvKs-gxc.mjs";
5
- import koffi from "koffi";
6
- //#region src/native/HeapAnalyzer.types.ts
7
- /** Heap block flags */
8
- const LF32 = {
9
- FIXED: 1,
10
- FREE: 2,
11
- MOVEABLE: 4
12
- };
13
- /** Heap flags */
14
- const HF32 = {
15
- DEFAULT: 1,
16
- SHARED: 2
17
- };
18
- //#endregion
19
- //#region src/native/HeapAnalyzer.ts
20
- /**
21
- * Heap Analysis Engine.
22
- *
23
- * Enumerates process heaps and blocks via Toolhelp32 Snapshot APIs,
24
- * provides statistical analysis and anomaly detection (spray, UAF heuristic).
25
- *
26
- * @module HeapAnalyzer
27
- */
28
- let _heapApis = null;
29
- function loadHeapApis() {
30
- const k32 = koffi.load("kernel32.dll");
31
- return {
32
- CreateToolhelp32Snapshot: k32.func("CreateToolhelp32Snapshot", "intptr", ["uint32", "uint32"]),
33
- Heap32ListFirst: k32.func("Heap32ListFirst", "bool", ["intptr", "_Inout_ uint8_t *"]),
34
- Heap32ListNext: k32.func("Heap32ListNext", "bool", ["intptr", "_Inout_ uint8_t *"]),
35
- Heap32First: k32.func("Heap32First", "bool", [
36
- "_Inout_ uint8_t *",
37
- "uint32",
38
- "uintptr_t"
39
- ]),
40
- Heap32Next: k32.func("Heap32Next", "bool", ["_Inout_ uint8_t *"]),
41
- CloseHandle: k32.func("int CloseHandle(intptr)"),
42
- HEAPLIST32_SIZE: 36,
43
- HEAPENTRY32_SIZE: 56
44
- };
45
- }
46
- function getHeapApis() {
47
- if (!_heapApis) _heapApis = loadHeapApis();
48
- return _heapApis;
49
- }
50
- const SIZE_RANGES = [
51
- [
52
- "0-64B",
53
- 0,
54
- 64
55
- ],
56
- [
57
- "64-256B",
58
- 64,
59
- 256
60
- ],
61
- [
62
- "256B-1KB",
63
- 256,
64
- 1024
65
- ],
66
- [
67
- "1-4KB",
68
- 1024,
69
- 4096
70
- ],
71
- [
72
- "4-16KB",
73
- 4096,
74
- 16384
75
- ],
76
- [
77
- "16-64KB",
78
- 16384,
79
- 65536
80
- ],
81
- [
82
- "64KB-1MB",
83
- 65536,
84
- 1048576
85
- ],
86
- [
87
- ">1MB",
88
- 1048576,
89
- Number.MAX_SAFE_INTEGER
90
- ]
91
- ];
92
- function classifyBlock(size) {
93
- for (let i = 0; i < SIZE_RANGES.length; i++) {
94
- const range = SIZE_RANGES[i];
95
- if (size >= range[1] && size < range[2]) return i;
96
- }
97
- return SIZE_RANGES.length - 1;
98
- }
99
- var HeapAnalyzer = class {
100
- /**
101
- * Enumerate all heaps in a process and return info + stats.
102
- */
103
- async enumerateHeaps(pid) {
104
- const apis = getHeapApis();
105
- const hSnap = apis.CreateToolhelp32Snapshot(TH32CS.SNAPHEAPLIST, pid);
106
- if (hSnap === -1n && typeof hSnap === "bigint") throw new Error(`Failed to create heap snapshot for PID ${pid}`);
107
- const heaps = [];
108
- try {
109
- const hlBuf = Buffer.alloc(apis.HEAPLIST32_SIZE);
110
- hlBuf.writeBigUInt64LE(BigInt(apis.HEAPLIST32_SIZE), 0);
111
- let hasHeap = apis.Heap32ListFirst(hSnap, hlBuf);
112
- while (hasHeap) {
113
- const processId = hlBuf.readUInt32LE(8);
114
- const heapId = hlBuf.readBigUInt64LE(12);
115
- const flags = hlBuf.readUInt32LE(20);
116
- const blocks = await this._enumerateBlocksInternal(pid, heapId, HEAP_ENUMERATE_MAX_BLOCKS);
117
- heaps.push({
118
- heapId: `0x${heapId.toString(16)}`,
119
- processId,
120
- flags,
121
- isDefault: (flags & HF32.DEFAULT) !== 0,
122
- blockCount: blocks.length,
123
- totalSize: blocks.reduce((sum, b) => sum + b.size, 0)
124
- });
125
- hlBuf.writeBigUInt64LE(BigInt(apis.HEAPLIST32_SIZE), 0);
126
- hasHeap = apis.Heap32ListNext(hSnap, hlBuf);
127
- }
128
- } finally {
129
- apis.CloseHandle(hSnap);
130
- }
131
- return {
132
- heaps,
133
- stats: this._computeStats(heaps, [])
134
- };
135
- }
136
- /**
137
- * Enumerate blocks within a specific heap.
138
- */
139
- async enumerateBlocks(pid, heapId, options) {
140
- const id = BigInt(heapId);
141
- const max = options?.maxBlocks ?? HEAP_ENUMERATE_MAX_BLOCKS;
142
- return this._enumerateBlocksInternal(pid, id, max);
143
- }
144
- /**
145
- * Get full statistical breakdown for all heaps.
146
- */
147
- async getStats(pid) {
148
- const { heaps } = await this.enumerateHeaps(pid);
149
- const allBlocks = [];
150
- for (const heap of heaps) {
151
- const blocks = await this._enumerateBlocksInternal(pid, BigInt(heap.heapId), HEAP_ENUMERATE_MAX_BLOCKS);
152
- allBlocks.push(...blocks);
153
- }
154
- return this._computeStats(heaps, allBlocks);
155
- }
156
- /**
157
- * Detect heap anomalies: spray, UAF heuristic, suspicious sizes.
158
- */
159
- async detectAnomalies(pid) {
160
- const anomalies = [];
161
- const { heaps } = await this.enumerateHeaps(pid);
162
- for (const heap of heaps) {
163
- const blocks = await this._enumerateBlocksInternal(pid, BigInt(heap.heapId), HEAP_ENUMERATE_MAX_BLOCKS);
164
- this._detectSpray(blocks, heap.heapId, anomalies);
165
- this._detectSuspiciousSizes(blocks, heap.heapId, anomalies);
166
- await this._detectPossibleUAF(pid, blocks, heap.heapId, anomalies);
167
- }
168
- return anomalies;
169
- }
170
- async _enumerateBlocksInternal(pid, heapId, maxBlocks) {
171
- const apis = getHeapApis();
172
- const blocks = [];
173
- const heBuf = Buffer.alloc(apis.HEAPENTRY32_SIZE);
174
- heBuf.writeBigUInt64LE(BigInt(apis.HEAPENTRY32_SIZE), 0);
175
- let hasBlock = apis.Heap32First(heBuf, pid, heapId);
176
- while (hasBlock && blocks.length < maxBlocks) {
177
- const address = heBuf.readBigUInt64LE(16);
178
- const blockSize = Number(heBuf.readBigUInt64LE(24));
179
- const flags = heBuf.readUInt32LE(32);
180
- blocks.push({
181
- address: `0x${address.toString(16)}`,
182
- size: blockSize,
183
- flags,
184
- heapId: `0x${heapId.toString(16)}`,
185
- isFree: (flags & LF32.FREE) !== 0
186
- });
187
- heBuf.writeBigUInt64LE(BigInt(apis.HEAPENTRY32_SIZE), 0);
188
- hasBlock = apis.Heap32Next(heBuf);
189
- }
190
- return blocks;
191
- }
192
- _computeStats(heaps, blocks) {
193
- const buckets = SIZE_RANGES.map(([range]) => ({
194
- range,
195
- count: 0,
196
- totalBytes: 0
197
- }));
198
- let totalSize = 0;
199
- let freeSize = 0;
200
- let largestBlock = 0;
201
- let smallestBlock = Number.MAX_SAFE_INTEGER;
202
- for (const block of blocks) {
203
- totalSize += block.size;
204
- if (block.isFree) freeSize += block.size;
205
- if (block.size > largestBlock) largestBlock = block.size;
206
- if (!block.isFree && block.size < smallestBlock) smallestBlock = block.size;
207
- const idx = classifyBlock(block.size);
208
- buckets[idx].count++;
209
- buckets[idx].totalBytes += block.size;
210
- }
211
- if (smallestBlock === Number.MAX_SAFE_INTEGER) smallestBlock = 0;
212
- if (totalSize === 0 && heaps.length > 0) totalSize = heaps.reduce((s, h) => s + h.totalSize, 0);
213
- return {
214
- totalHeaps: heaps.length,
215
- totalBlocks: blocks.length || heaps.reduce((s, h) => s + h.blockCount, 0),
216
- totalSize,
217
- freeSize,
218
- usedSize: totalSize - freeSize,
219
- largestBlock,
220
- smallestBlock,
221
- averageBlockSize: blocks.length > 0 ? Math.round(totalSize / blocks.length) : 0,
222
- sizeDistribution: buckets,
223
- fragmentationRatio: totalSize > 0 ? freeSize / totalSize : 0
224
- };
225
- }
226
- _detectSpray(blocks, heapId, anomalies) {
227
- const sizeGroups = /* @__PURE__ */ new Map();
228
- for (const block of blocks) {
229
- if (block.isFree) continue;
230
- const rounded = Math.round(block.size / HEAP_SPRAY_SIZE_TOLERANCE) * HEAP_SPRAY_SIZE_TOLERANCE;
231
- const group = sizeGroups.get(rounded) ?? [];
232
- group.push(block);
233
- sizeGroups.set(rounded, group);
234
- }
235
- for (const [size, group] of sizeGroups) if (group.length >= HEAP_SPRAY_THRESHOLD) anomalies.push({
236
- type: "heap_spray_pattern",
237
- severity: "high",
238
- address: group[0].address,
239
- details: `${group.length} blocks of ~${size} bytes detected — possible heap spray`,
240
- heapId
241
- });
242
- }
243
- _detectSuspiciousSizes(blocks, heapId, anomalies) {
244
- for (const block of blocks) if (block.size === 0) anomalies.push({
245
- type: "suspicious_size",
246
- severity: "medium",
247
- address: block.address,
248
- details: "Block with zero size",
249
- heapId
250
- });
251
- else if (block.size > HEAP_SUSPICIOUS_BLOCK_SIZE) anomalies.push({
252
- type: "suspicious_size",
253
- severity: "medium",
254
- address: block.address,
255
- details: `Unusually large block: ${(block.size / (1024 * 1024)).toFixed(1)} MB`,
256
- heapId
257
- });
258
- }
259
- async _detectPossibleUAF(pid, blocks, heapId, anomalies) {
260
- const sampled = blocks.filter((b) => b.isFree && b.size >= 8).slice(0, 100);
261
- let hProcess = null;
262
- try {
263
- hProcess = openProcessForMemory(pid);
264
- for (const block of sampled) {
265
- const addr = BigInt(block.address);
266
- const data = ReadProcessMemory(hProcess, addr, 8);
267
- if (data && data.readBigUInt64LE(0) !== 0n) anomalies.push({
268
- type: "possible_uaf",
269
- severity: "low",
270
- address: block.address,
271
- details: `Free block has non-zero data: 0x${data.readBigUInt64LE(0).toString(16)}`,
272
- heapId
273
- });
274
- }
275
- } catch (e) {
276
- logger.debug(`UAF check failed for PID ${pid}: ${e}`);
277
- } finally {
278
- if (hProcess) CloseHandle(hProcess);
279
- }
280
- }
281
- };
282
- const heapAnalyzer = new HeapAnalyzer();
283
- //#endregion
284
- export { HeapAnalyzer, heapAnalyzer };