@eyeauras/insight-cli 0.2.0 → 0.2.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 (384) hide show
  1. package/.cli-package-build.json +1 -1
  2. package/README.md +25 -0
  3. package/SKILL.md +38 -54
  4. package/dist/src/binary.d.ts +3 -0
  5. package/dist/src/binary.js +74 -0
  6. package/dist/src/capture.d.ts +3 -0
  7. package/dist/src/capture.js +220 -0
  8. package/dist/src/cli.js +57 -12
  9. package/dist/src/contexts.d.ts +5 -0
  10. package/dist/src/contexts.js +42 -16
  11. package/dist/src/debugger-caller.d.ts +17 -0
  12. package/dist/src/debugger-caller.js +129 -0
  13. package/dist/src/debugger-launch.d.ts +2 -0
  14. package/dist/src/debugger-launch.js +17 -0
  15. package/dist/src/debugger-results.d.ts +1 -0
  16. package/dist/src/debugger-results.js +8 -0
  17. package/dist/src/debugger-supervisor.js +56 -13
  18. package/dist/src/debugger.js +16 -7
  19. package/dist/src/die.d.ts +12 -0
  20. package/dist/src/die.js +127 -0
  21. package/dist/src/dnspy-runtime.d.ts +8 -0
  22. package/dist/src/dnspy-runtime.js +46 -0
  23. package/dist/src/dnspy.d.ts +22 -0
  24. package/dist/src/dnspy.js +160 -0
  25. package/dist/src/dotnet-diagnostics.d.ts +13 -0
  26. package/dist/src/dotnet-diagnostics.js +101 -0
  27. package/dist/src/frida-worker.d.ts +1 -0
  28. package/dist/src/frida-worker.js +125 -0
  29. package/dist/src/frida.d.ts +16 -0
  30. package/dist/src/frida.js +125 -0
  31. package/dist/src/ghidra-debugger-runtime.d.ts +7 -0
  32. package/dist/src/ghidra-debugger-runtime.js +31 -0
  33. package/dist/src/ghidra-processes.d.ts +6 -0
  34. package/dist/src/ghidra-processes.js +121 -0
  35. package/dist/src/ghidra.js +6 -6
  36. package/dist/src/ilspy.d.ts +7 -0
  37. package/dist/src/ilspy.js +122 -0
  38. package/dist/src/lldb.d.ts +10 -0
  39. package/dist/src/lldb.js +99 -0
  40. package/dist/src/llvm.d.ts +6 -0
  41. package/dist/src/llvm.js +133 -0
  42. package/dist/src/managed-heap.d.ts +4 -0
  43. package/dist/src/managed-heap.js +73 -0
  44. package/dist/src/managed-metadata.d.ts +11 -0
  45. package/dist/src/managed-metadata.js +66 -0
  46. package/dist/src/mitmproxy.d.ts +55 -0
  47. package/dist/src/mitmproxy.js +172 -0
  48. package/dist/src/native-inputs.d.ts +3 -2
  49. package/dist/src/native-inputs.js +9 -4
  50. package/dist/src/package-version.d.ts +1 -0
  51. package/dist/src/package-version.js +3 -0
  52. package/dist/src/procmon-config.d.ts +2 -0
  53. package/dist/src/procmon-config.js +15 -0
  54. package/dist/src/procmon-events.d.ts +13 -0
  55. package/dist/src/procmon-events.js +82 -0
  56. package/dist/src/procmon.d.ts +4 -0
  57. package/dist/src/procmon.js +107 -0
  58. package/dist/src/research.d.ts +11 -2
  59. package/dist/src/research.js +5 -3
  60. package/dist/src/runtime-catalog.d.ts +5 -10
  61. package/dist/src/runtime-catalog.js +4 -5
  62. package/dist/src/runtime-manager.d.ts +27 -3
  63. package/dist/src/runtime-manager.js +100 -159
  64. package/dist/src/runtime-selection.js +21 -4
  65. package/dist/src/server.d.ts +13 -0
  66. package/dist/src/server.js +21 -45
  67. package/dist/src/sevenzip.d.ts +15 -0
  68. package/dist/src/sevenzip.js +119 -0
  69. package/dist/src/strace.d.ts +10 -0
  70. package/dist/src/strace.js +71 -0
  71. package/dist/src/text-window.d.ts +11 -0
  72. package/dist/src/text-window.js +6 -0
  73. package/dist/src/tool-runtime/archives.d.ts +10 -0
  74. package/dist/src/{runtime-archives.js → tool-runtime/archives.js} +91 -24
  75. package/dist/src/tool-runtime/catalog.d.ts +3 -0
  76. package/dist/src/tool-runtime/catalog.js +13 -0
  77. package/dist/src/tool-runtime/commands.d.ts +9 -0
  78. package/dist/src/tool-runtime/commands.js +39 -0
  79. package/dist/src/tool-runtime/deadline.d.ts +11 -0
  80. package/dist/src/tool-runtime/deadline.js +32 -0
  81. package/dist/src/tool-runtime/definition.d.ts +73 -0
  82. package/dist/src/tool-runtime/definition.js +49 -0
  83. package/dist/src/tool-runtime/dotnet.d.ts +4 -0
  84. package/dist/src/tool-runtime/dotnet.js +22 -0
  85. package/dist/src/tool-runtime/identity.d.ts +6 -0
  86. package/dist/src/tool-runtime/identity.js +50 -0
  87. package/dist/src/tool-runtime/installer.d.ts +101 -0
  88. package/dist/src/tool-runtime/installer.js +180 -0
  89. package/dist/src/tool-runtime/launch-worker.d.ts +1 -0
  90. package/dist/src/tool-runtime/launch-worker.js +58 -0
  91. package/dist/src/tool-runtime/run.d.ts +51 -0
  92. package/dist/src/tool-runtime/run.js +159 -0
  93. package/dist/src/tool-runtime/store.d.ts +15 -0
  94. package/dist/src/tool-runtime/store.js +219 -0
  95. package/dist/src/tool-runtime/supervisor.d.ts +57 -0
  96. package/dist/src/tool-runtime/supervisor.js +266 -0
  97. package/dist/src/tool-runtime/windows-job.d.ts +22 -0
  98. package/dist/src/tool-runtime/windows-job.js +43 -0
  99. package/dist/src/toolbox.d.ts +84 -0
  100. package/dist/src/toolbox.js +35 -0
  101. package/dist/src/tshark.d.ts +23 -0
  102. package/dist/src/tshark.js +174 -0
  103. package/dist/src/windbg.d.ts +14 -0
  104. package/dist/src/windbg.js +119 -0
  105. package/dist/src/workspace.d.ts +1 -0
  106. package/dist/src/workspace.js +6 -0
  107. package/package.json +5 -4
  108. package/references/agent-execution.md +36 -0
  109. package/references/agent-setup.md +61 -0
  110. package/references/artifacts.md +5 -0
  111. package/references/debugger.md +22 -0
  112. package/references/ilspy.md +33 -0
  113. package/references/managed-runtime.md +48 -7
  114. package/references/native/InsightPythonWheels.java +283 -2
  115. package/references/native/InsightTraceState.java +28 -13
  116. package/references/setup.md +2 -1
  117. package/runtime/managed/insight-heap/Azure.Core.dll +0 -0
  118. package/runtime/managed/insight-heap/Azure.Identity.dll +0 -0
  119. package/runtime/managed/insight-heap/Insight.Heap.csproj +1 -0
  120. package/runtime/managed/insight-heap/Insight.Heap.deps.json +391 -0
  121. package/runtime/managed/insight-heap/Insight.Heap.dll +0 -0
  122. package/runtime/managed/insight-heap/Insight.Heap.runtimeconfig.json +13 -0
  123. package/runtime/managed/insight-heap/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  124. package/runtime/managed/insight-heap/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
  125. package/runtime/managed/insight-heap/Microsoft.Diagnostics.Runtime.dll +0 -0
  126. package/runtime/managed/insight-heap/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
  127. package/runtime/managed/insight-heap/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  128. package/runtime/managed/insight-heap/Microsoft.Extensions.Diagnostics.Abstractions.dll +0 -0
  129. package/runtime/managed/insight-heap/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
  130. package/runtime/managed/insight-heap/Microsoft.Extensions.Hosting.Abstractions.dll +0 -0
  131. package/runtime/managed/insight-heap/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  132. package/runtime/managed/insight-heap/Microsoft.Extensions.Options.dll +0 -0
  133. package/runtime/managed/insight-heap/Microsoft.Extensions.Primitives.dll +0 -0
  134. package/runtime/managed/insight-heap/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
  135. package/runtime/managed/insight-heap/Microsoft.Identity.Client.dll +0 -0
  136. package/runtime/managed/insight-heap/Microsoft.IdentityModel.Abstractions.dll +0 -0
  137. package/runtime/managed/insight-heap/Microsoft.Security.AntiSSRF.dll +0 -0
  138. package/runtime/managed/insight-heap/NuGet.Config +1 -0
  139. package/runtime/managed/insight-heap/Program.cs +20 -0
  140. package/runtime/managed/insight-heap/README.md +16 -0
  141. package/runtime/managed/insight-heap/System.ClientModel.dll +0 -0
  142. package/runtime/managed/insight-heap/System.Memory.Data.dll +0 -0
  143. package/runtime/managed/insight-heap/System.Security.Cryptography.ProtectedData.dll +0 -0
  144. package/runtime/managed/insight-heap/dependencies.json +436 -0
  145. package/runtime/managed/insight-heap/notices/Azure.Core-LICENSE.txt +21 -0
  146. package/runtime/managed/insight-heap/notices/Azure.Identity-LICENSE.txt +21 -0
  147. package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-LICENSE.txt +23 -0
  148. package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-THIRD-PARTY-NOTICES.TXT +1418 -0
  149. package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.NETCore.Client-LICENSE.txt +23 -0
  150. package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.Runtime-LICENSE.txt +23 -0
  151. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-LICENSE.txt +23 -0
  152. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  153. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.txt +23 -0
  154. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  155. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-LICENSE.txt +23 -0
  156. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  157. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-LICENSE.txt +23 -0
  158. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  159. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-LICENSE.txt +23 -0
  160. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  161. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-LICENSE.txt +23 -0
  162. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
  163. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-LICENSE.txt +23 -0
  164. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-THIRD-PARTY-NOTICES.TXT +1418 -0
  165. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-LICENSE.txt +23 -0
  166. package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-THIRD-PARTY-NOTICES.TXT +1418 -0
  167. package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client-LICENSE.txt +21 -0
  168. package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client.Extensions.Msal-LICENSE.txt +21 -0
  169. package/runtime/managed/insight-heap/notices/Microsoft.IdentityModel.Abstractions-LICENSE.txt +21 -0
  170. package/runtime/managed/insight-heap/notices/Microsoft.Security.AntiSSRF-LICENSE.txt +21 -0
  171. package/runtime/managed/insight-heap/notices/System.ClientModel-LICENSE.txt +21 -0
  172. package/runtime/managed/insight-heap/notices/System.Memory.Data-LICENSE.txt +23 -0
  173. package/runtime/managed/insight-heap/notices/System.Memory.Data-THIRD-PARTY-NOTICES.TXT +1418 -0
  174. package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-LICENSE.TXT +23 -0
  175. package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-THIRD-PARTY-NOTICES.TXT +309 -0
  176. package/runtime/managed/insight-heap/packages.lock.json +165 -0
  177. package/runtime/managed/insight-heap/provenance.json +146 -0
  178. package/runtime/managed/insight-heap/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll +0 -0
  179. package/runtime/managed/insight-managed/Insight.Managed.csproj +4 -0
  180. package/runtime/managed/insight-managed/Insight.Managed.deps.json +41 -0
  181. package/runtime/managed/insight-managed/Insight.Managed.dll +0 -0
  182. package/runtime/managed/insight-managed/Insight.Managed.runtimeconfig.json +13 -0
  183. package/runtime/managed/insight-managed/LICENSE.dnlib.txt +20 -0
  184. package/runtime/managed/insight-managed/NuGet.Config +1 -0
  185. package/runtime/managed/insight-managed/Program.cs +31 -0
  186. package/runtime/managed/insight-managed/README.md +16 -0
  187. package/runtime/managed/insight-managed/dnlib.dll +0 -0
  188. package/runtime/managed/insight-managed/packages.lock.json +13 -0
  189. package/runtime/managed/insight-managed/provenance.json +40 -0
  190. package/runtime/native/binary/README.md +22 -0
  191. package/runtime/native/binary/dependencies.json +166 -0
  192. package/runtime/native/binary/helper.cpp +44 -0
  193. package/runtime/native/binary/insight-binary-darwin-arm64 +0 -0
  194. package/runtime/native/binary/notices/Catch2-3.12.0--Catch2-3.12.0__LICENSE.txt +23 -0
  195. package/runtime/native/binary/notices/LIEF-LICENSE.txt +202 -0
  196. package/runtime/native/binary/notices/LIEF-attribution.txt +37 -0
  197. package/runtime/native/binary/notices/Melkor_ELF_Fuzzer-ac2495b--elf_fuzzer-master__LICENSE.txt +674 -0
  198. package/runtime/native/binary/notices/expected-1.3.1--expected-1.3.1__COPYING +121 -0
  199. package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__AUTHORS +3 -0
  200. package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__LICENSE +202 -0
  201. package/runtime/native/binary/notices/json-LICENSE.MIT +21 -0
  202. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--LICENSE +553 -0
  203. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--framework__LICENSE +553 -0
  204. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__LICENSE +552 -0
  205. package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__framework__LICENSE +553 -0
  206. package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--LICENSE +26 -0
  207. package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--ext__robin_map__LICENSE +21 -0
  208. package/runtime/native/binary/notices/span-LICENSE_1_0.txt +23 -0
  209. package/runtime/native/binary/notices/span-attribution.txt +11 -0
  210. package/runtime/native/binary/notices/spdlog-1.17.0--spdlog-1.17.0__LICENSE +25 -0
  211. package/runtime/native/binary/notices/utfcpp-4.0.9--utfcpp-4.0.9__LICENSE +23 -0
  212. package/runtime/native/binary/provenance.json +48 -0
  213. package/runtime/native/child-deadline-linux-x64 +0 -0
  214. package/runtime/native/child-deadline-linux.c +24 -0
  215. package/runtime/native/child-deadline-linux.provenance.json +17 -0
  216. package/runtime/native/deadline-alarm-darwin-universal.dylib +0 -0
  217. package/runtime/native/deadline-alarm.c +33 -0
  218. package/runtime/native/deadline-alarm.provenance.json +22 -0
  219. package/runtime/native/deadline-exec-darwin-arm64 +0 -0
  220. package/runtime/native/deadline-exec.c +24 -0
  221. package/runtime/native/deadline-exec.provenance.json +17 -0
  222. package/runtime/native/dnspy-extension/Bridge.cs +58 -0
  223. package/runtime/native/dnspy-extension/Insight.DnSpy.csproj +13 -0
  224. package/runtime/native/dnspy-extension/Insight.DnSpy.x.dll +0 -0
  225. package/runtime/native/dnspy-extension/NuGet.Config +1 -0
  226. package/runtime/native/dnspy-extension/UNICODE-LOADER.md +26 -0
  227. package/runtime/native/dnspy-extension/packages.lock.json +6 -0
  228. package/runtime/native/dnspy-extension/provenance.json +27 -0
  229. package/runtime/native/dnspy-extension/upstream-public-build.snk +0 -0
  230. package/runtime/native/dnspy-extension/vendor-files.json +4341 -0
  231. package/runtime/native/file-version.ps1 +7 -0
  232. package/runtime/native/insight-registry-win-x64.dll +0 -0
  233. package/runtime/native/mitmproxy/bridge.py +180 -0
  234. package/runtime/native/mitmproxy/notices.json +476 -0
  235. package/runtime/native/sources/detours-LICENSE.md +23 -0
  236. package/runtime/native/sources/detours-e4bfd6b.tar.gz +0 -0
  237. package/runtime/native/sources/detours-provenance.json +10 -0
  238. package/runtime/native/tshark-layout.json +2247 -0
  239. package/runtime/native/windows-job/DirectoryAlias.cs +24 -0
  240. package/runtime/native/windows-job/Insight.WindowsJob.csproj +1 -0
  241. package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
  242. package/runtime/native/windows-job/NuGet.Config +1 -0
  243. package/runtime/native/windows-job/OwnedJob.cs +79 -0
  244. package/runtime/native/windows-job/RegistryRedirect.cs +45 -0
  245. package/runtime/native/windows-job/packages.lock.json +21 -0
  246. package/runtime/native/windows-job/provenance.json +16 -0
  247. package/runtime/native/windows-job/windows-job.ps1 +8 -0
  248. package/runtime/native/windows-registry.c +21 -0
  249. package/runtime/native/windows-registry.def +3 -0
  250. package/runtime/native/windows-registry.provenance.json +14 -0
  251. package/runtime/notices/diagnostics-10.0.750501.txt +23 -0
  252. package/runtime/tool-catalog.json +290 -0
  253. package/runtime/toolbox.json +1401 -0
  254. package/skill-bundle/insight-artifacts/SKILL.md +30 -0
  255. package/skill-bundle/insight-artifacts/references/agent-execution.md +36 -0
  256. package/skill-bundle/insight-artifacts/references/artifacts.md +52 -0
  257. package/skill-bundle/insight-binary/SKILL.md +46 -0
  258. package/skill-bundle/insight-binary/references/agent-execution.md +36 -0
  259. package/skill-bundle/insight-capture/SKILL.md +56 -0
  260. package/skill-bundle/insight-capture/references/agent-execution.md +36 -0
  261. package/skill-bundle/insight-cli/SKILL.md +42 -0
  262. package/skill-bundle/insight-cli/references/agent-execution.md +36 -0
  263. package/skill-bundle/insight-cli/references/agent-setup.md +61 -0
  264. package/skill-bundle/insight-die/SKILL.md +49 -0
  265. package/skill-bundle/insight-die/references/agent-execution.md +36 -0
  266. package/skill-bundle/insight-dnspy/SKILL.md +65 -0
  267. package/skill-bundle/insight-dnspy/references/agent-execution.md +36 -0
  268. package/skill-bundle/insight-dotnet-dump/SKILL.md +46 -0
  269. package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +36 -0
  270. package/skill-bundle/insight-dotnet-stack/SKILL.md +39 -0
  271. package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +36 -0
  272. package/skill-bundle/insight-dotnet-trace/SKILL.md +45 -0
  273. package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +36 -0
  274. package/skill-bundle/insight-frida/SKILL.md +67 -0
  275. package/skill-bundle/insight-frida/references/agent-execution.md +36 -0
  276. package/skill-bundle/insight-ghidra/SKILL.md +91 -0
  277. package/skill-bundle/insight-ghidra/references/administration.md +34 -0
  278. package/skill-bundle/insight-ghidra/references/agent-execution.md +36 -0
  279. package/skill-bundle/insight-ghidra/references/archive.md +32 -0
  280. package/skill-bundle/insight-ghidra/references/artifacts.md +52 -0
  281. package/skill-bundle/insight-ghidra/references/debugger.md +62 -0
  282. package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +124 -0
  283. package/skill-bundle/insight-ghidra/references/managed-runtime.md +157 -0
  284. package/skill-bundle/insight-ghidra/references/native-workflows.md +112 -0
  285. package/skill-bundle/insight-ghidra/references/query-semantics.md +96 -0
  286. package/skill-bundle/insight-ghidra/references/recovery.md +53 -0
  287. package/skill-bundle/insight-ghidra/references/research.md +101 -0
  288. package/skill-bundle/insight-ghidra/references/setup.md +50 -0
  289. package/skill-bundle/insight-ilspy/SKILL.md +45 -0
  290. package/skill-bundle/insight-ilspy/references/agent-execution.md +36 -0
  291. package/skill-bundle/insight-ilspy/references/ilspy.md +33 -0
  292. package/skill-bundle/insight-interop/SKILL.md +54 -0
  293. package/skill-bundle/insight-interop/references/agent-execution.md +36 -0
  294. package/skill-bundle/insight-lldb/SKILL.md +54 -0
  295. package/skill-bundle/insight-lldb/references/agent-execution.md +36 -0
  296. package/skill-bundle/insight-llvm/SKILL.md +56 -0
  297. package/skill-bundle/insight-llvm/references/agent-execution.md +36 -0
  298. package/skill-bundle/insight-managed-heap/SKILL.md +43 -0
  299. package/skill-bundle/insight-managed-heap/references/agent-execution.md +36 -0
  300. package/skill-bundle/insight-managed-metadata/SKILL.md +52 -0
  301. package/skill-bundle/insight-managed-metadata/references/agent-execution.md +36 -0
  302. package/skill-bundle/insight-mitmproxy/SKILL.md +62 -0
  303. package/skill-bundle/insight-mitmproxy/references/agent-execution.md +36 -0
  304. package/skill-bundle/insight-overview/SKILL.md +79 -0
  305. package/skill-bundle/insight-overview/references/agent-execution.md +36 -0
  306. package/skill-bundle/insight-procmon/SKILL.md +49 -0
  307. package/skill-bundle/insight-procmon/references/agent-execution.md +36 -0
  308. package/skill-bundle/insight-re/SKILL.md +121 -0
  309. package/skill-bundle/insight-re/references/agent-execution.md +36 -0
  310. package/skill-bundle/insight-re/references/artifacts.md +52 -0
  311. package/skill-bundle/insight-re/references/recovery.md +53 -0
  312. package/skill-bundle/insight-sevenzip/SKILL.md +42 -0
  313. package/skill-bundle/insight-sevenzip/references/agent-execution.md +36 -0
  314. package/skill-bundle/insight-strace/SKILL.md +46 -0
  315. package/skill-bundle/insight-strace/references/agent-execution.md +36 -0
  316. package/skill-bundle/insight-tshark/SKILL.md +49 -0
  317. package/skill-bundle/insight-tshark/references/agent-execution.md +36 -0
  318. package/skill-bundle/insight-windbg/SKILL.md +46 -0
  319. package/skill-bundle/insight-windbg/references/agent-execution.md +36 -0
  320. package/skill-bundle/manifest.json +32 -0
  321. package/skills/insight-artifacts/SKILL.md +30 -0
  322. package/skills/insight-artifacts/references/agent-execution.md +36 -0
  323. package/skills/insight-artifacts/references/artifacts.md +52 -0
  324. package/skills/insight-binary/SKILL.md +46 -0
  325. package/skills/insight-binary/references/agent-execution.md +36 -0
  326. package/skills/insight-capture/SKILL.md +56 -0
  327. package/skills/insight-capture/references/agent-execution.md +36 -0
  328. package/skills/insight-die/SKILL.md +49 -0
  329. package/skills/insight-die/references/agent-execution.md +36 -0
  330. package/skills/insight-dnspy/SKILL.md +65 -0
  331. package/skills/insight-dnspy/references/agent-execution.md +36 -0
  332. package/skills/insight-dotnet-dump/SKILL.md +46 -0
  333. package/skills/insight-dotnet-dump/references/agent-execution.md +36 -0
  334. package/skills/insight-dotnet-stack/SKILL.md +39 -0
  335. package/skills/insight-dotnet-stack/references/agent-execution.md +36 -0
  336. package/skills/insight-dotnet-trace/SKILL.md +45 -0
  337. package/skills/insight-dotnet-trace/references/agent-execution.md +36 -0
  338. package/skills/insight-frida/SKILL.md +67 -0
  339. package/skills/insight-frida/references/agent-execution.md +36 -0
  340. package/skills/insight-ghidra/SKILL.md +91 -0
  341. package/skills/insight-ghidra/references/administration.md +34 -0
  342. package/skills/insight-ghidra/references/agent-execution.md +36 -0
  343. package/skills/insight-ghidra/references/archive.md +32 -0
  344. package/skills/insight-ghidra/references/artifacts.md +52 -0
  345. package/skills/insight-ghidra/references/debugger.md +62 -0
  346. package/skills/insight-ghidra/references/extensions-and-sync.md +124 -0
  347. package/skills/insight-ghidra/references/managed-runtime.md +157 -0
  348. package/skills/insight-ghidra/references/native-workflows.md +112 -0
  349. package/skills/insight-ghidra/references/query-semantics.md +96 -0
  350. package/skills/insight-ghidra/references/recovery.md +53 -0
  351. package/skills/insight-ghidra/references/research.md +101 -0
  352. package/skills/insight-ghidra/references/setup.md +50 -0
  353. package/skills/insight-ilspy/SKILL.md +45 -0
  354. package/skills/insight-ilspy/references/agent-execution.md +36 -0
  355. package/skills/insight-ilspy/references/ilspy.md +33 -0
  356. package/skills/insight-interop/SKILL.md +54 -0
  357. package/skills/insight-interop/references/agent-execution.md +36 -0
  358. package/skills/insight-lldb/SKILL.md +54 -0
  359. package/skills/insight-lldb/references/agent-execution.md +36 -0
  360. package/skills/insight-llvm/SKILL.md +56 -0
  361. package/skills/insight-llvm/references/agent-execution.md +36 -0
  362. package/skills/insight-managed-heap/SKILL.md +43 -0
  363. package/skills/insight-managed-heap/references/agent-execution.md +36 -0
  364. package/skills/insight-managed-metadata/SKILL.md +52 -0
  365. package/skills/insight-managed-metadata/references/agent-execution.md +36 -0
  366. package/skills/insight-mitmproxy/SKILL.md +62 -0
  367. package/skills/insight-mitmproxy/references/agent-execution.md +36 -0
  368. package/skills/insight-overview/SKILL.md +79 -0
  369. package/skills/insight-overview/references/agent-execution.md +36 -0
  370. package/skills/insight-procmon/SKILL.md +49 -0
  371. package/skills/insight-procmon/references/agent-execution.md +36 -0
  372. package/skills/insight-re/SKILL.md +22 -9
  373. package/skills/insight-re/references/agent-execution.md +36 -0
  374. package/skills/insight-re/references/artifacts.md +52 -0
  375. package/skills/insight-re/references/recovery.md +53 -0
  376. package/skills/insight-sevenzip/SKILL.md +42 -0
  377. package/skills/insight-sevenzip/references/agent-execution.md +36 -0
  378. package/skills/insight-strace/SKILL.md +46 -0
  379. package/skills/insight-strace/references/agent-execution.md +36 -0
  380. package/skills/insight-tshark/SKILL.md +49 -0
  381. package/skills/insight-tshark/references/agent-execution.md +36 -0
  382. package/skills/insight-windbg/SKILL.md +46 -0
  383. package/skills/insight-windbg/references/agent-execution.md +36 -0
  384. package/dist/src/runtime-archives.d.ts +0 -5
@@ -37,10 +37,10 @@ insight-cli --profile local ghidra download
37
37
  insight-cli --profile local ghidra install --offline
38
38
  insight-cli --profile local ghidra install --archive ./ghidra.zip
39
39
  insight-cli --profile local ghidra install --archive ./ghidra.zip \
40
- --java-archive ./jdk.tar.gz --offline
40
+ --java-archive ./jdk.tar.gz --debugger-archive ./lldb-python.tar.gz --offline
41
41
  insight-cli --profile local ghidra install --executable /tools/ghidra/ghidraRun
42
42
  insight-cli --profile local ghidra install --executable /tools/ghidra \
43
- --java /tools/jdk/bin/java --offline
43
+ --java /tools/jdk/bin/java --debugger-archive ./lldb-python.tar.gz --offline
44
44
  ```
45
45
 
46
46
  `--executable` accepts the actual Ghidra launcher (`ghidraRun[.bat]`, or
@@ -54,11 +54,13 @@ falls back to profile paths after failure or uninstall.
54
54
 
55
55
  Local archives are caller-selected inputs, consumed into owned hash-addressed copies before
56
56
  extraction so later source edits cannot change the installed bytes. Optional `--archive-sha256` and
57
- `--java-archive-sha256` check the expected bytes; the actual digests are recorded in the installation
57
+ `--java-archive-sha256` and `--debugger-archive-sha256` check the expected bytes; the actual digests are recorded in the installation
58
58
  identity. `--offline` prohibits network acquisition: provide/cache every required archive. On macOS,
59
59
  an official Ghidra zip also needs the pinned prebuilt native archive in cache. The managed macOS
60
60
  distribution already includes these natives. Executable modes are preserved; paths, links and
61
- expanded sizes are checked during portable Node extraction. Downloads use pinned SHA256 values.
61
+ expanded sizes are checked during portable Node extraction. Downloads use exact assets retained
62
+ in `iXab3r/insight-cli` GitHub Releases, with hashes and sizes pinned in the installed package.
63
+ There is no runtime upstream/latest fallback; supplied archives and verified cache support offline use.
62
64
  No external unzip, tar or Python executable is needed for extraction.
63
65
 
64
66
  ## Server, process and data ownership
@@ -95,16 +97,39 @@ insight-cli --profile local ghidra uninstall --purge-cache
95
97
 
96
98
  Uninstall removes only selected owned installation files. It preserves the selection as an
97
99
  uninstalled receipt, so later research reports a missing runtime instead of changing bindings.
98
- Archives remain reusable unless `--purge-cache` is selected. Reinstalling the same archives restores
100
+ Archives remain reusable unless `--purge-cache` is selected. It removes recorded archives for
101
+ this installation, preserving other tools' cache and unrecorded legacy entries. Reinstalling the same archives restores
99
102
  the same runtime identity. Sessions, private snapshots, unresolved publication journals, server
100
103
  repositories and artifacts survive. Uninstall does not resolve an uncertain merge or replay it.
101
104
 
105
+ ## Process inventory and recovery
106
+
107
+ ```sh
108
+ insight-cli --profile local tools processes --tool ghidra
109
+ insight-cli --profile local tools processes show <process-id>
110
+ insight-cli --profile local tools processes stop <process-id>
111
+ insight-cli --profile local tools processes kill <process-id>
112
+ ```
113
+
114
+ These IDs describe executions, not new research selectors. Context records include the existing
115
+ session/target; server, GUI, debugger and helper roles remain separate. `stop` saves a selected
116
+ Ghidra context through its ordinary close path. Stopping a server requires closed contexts.
117
+ `kill` requires Destructive and explicitly interrupts verified owned work; it does not prove a
118
+ merge/save completed. Live debugger cleanup goes through the owning GUI so inferior termination
119
+ can be verified. Research and unknown journals are retained.
120
+
121
+ After an owner crash, inventory reconnects to authenticated owned endpoints without re-executing
122
+ research. macOS process birth times alone cannot prove recovered ownership; an ambiguous process
123
+ stays `unverified` and is not signalled. Original child handles and authenticated tool identities
124
+ provide the supported stop/kill authority. This is lifecycle management, not an OS security sandbox.
125
+
102
126
  ## Sources and host boundary
103
127
 
104
128
  The catalog pins Ghidra 12.1.2 and Temurin JDK 21.0.11+10. macOS uses public Homebrew-built Ghidra
105
129
  bottles with native components (macOS 14+, ARM64 or x64); no installed Homebrew is used. Linux x64
106
- and Windows x64 use the official Ghidra zip and Temurin archive. All source URLs, hashes and license
107
- identities are in `src/runtime-catalog.ts`; downloaded distributions retain their license files.
130
+ and Windows x64 use the official Ghidra zip and Temurin archive. The installed `runtime/tool-catalog.json` pins mirror assets; repository
131
+ `scripts/tool-distributions/` recipes retain upstream provenance. Published tool releases include
132
+ original licenses/notices and required source/build companions, independent of CLI releases.
108
133
  Unsupported platforms fail explicitly and may use compatible external profile paths. Native
109
134
  acceptance for this delivery is macOS ARM64; catalog availability is not Windows/Linux native proof.
110
135
 
@@ -114,3 +139,19 @@ not downloaded third-party Python dependencies. `doctor` reports a missing host
114
139
  failure even when static analysis/server pass. No root installation, developer-tools installer,
115
140
  Gatekeeper disabling, shell-profile edit or global Java/Python selection is performed. Ghidra GUI
116
141
  agents receive private copies of the Ghidra SDK's pinned debugger Python wheels.
142
+
143
+ ## Managed debugger dependency
144
+
145
+ On macOS 15+ ARM64, download/install also prepares pinned LLDB 23.1.3 with its own
146
+ Python 3.15 and native library closure. It is a private Ghidra dependency; the separate
147
+ `insight-cli lldb` application retains its own installation. `--debugger-archive` supplies
148
+ the exact pinned debugger archive for offline installation, including an external Ghidra
149
+ selection. Status reports this dependency and doctor probes its actual Python interpreter.
150
+ GUI startup prepares it for legacy profiles as needed. The backend does not use Homebrew
151
+ or Python from Apple developer tools. OS debugger authorization is still a host prerequisite.
152
+
153
+ A GUI context pins the verified debugger receipt. Its supervisor verifies those code and
154
+ library bytes again before launching LLDB. Close contexts and stop the local server before
155
+ changing/removing the Ghidra runtime; uninstall removes this owned dependency while retaining
156
+ research and external installations. Existing running GUI contexts must be closed/reopened
157
+ to adopt a different backend. Other host debugger profiles retain their declared host requirements.
@@ -19,13 +19,294 @@ class InsightPythonWheels {
19
19
  }
20
20
  }
21
21
  }
22
+ // Never wait for remote futures while holding the batch-state mutex: completing
23
+ // a reply can require a callback which starts another batch. Also close model
24
+ // transactions/batches on exceptions; these adapters never repeat a CPU action.
25
+ Path traceClient=root.resolve("ghidratrace/client.py");String traceClientSource=Files.readString(traceClient);
26
+ String batchEndBefore="""
27
+ def end_batch(self) -> Optional[List[Any]]:
28
+ cb = None
29
+ with self._block:
30
+ cb = self.cur_batch
31
+ if cb is None:
32
+ raise ValueError("No batch to end")
33
+ if 0 == cb.dec():
34
+ self.cur_batch = None
35
+ return cb.results()
36
+ return None
37
+ """;
38
+ String batchEndAfter="""
39
+ def end_batch(self) -> Optional[List[Any]]:
40
+ with self._block:
41
+ cb = self.cur_batch
42
+ if cb is None:
43
+ raise ValueError("No batch to end")
44
+ if cb.dec() != 0:
45
+ return None
46
+ self.cur_batch = None
47
+ return cb.results()
48
+ """;
49
+ String traceTxBefore="""
50
+ tx = self.start_tx(description, undoable)
51
+ yield tx
52
+ tx.commit()
53
+ """;
54
+ String traceTxAfter="""
55
+ tx = self.start_tx(description, undoable)
56
+ try:
57
+ yield tx
58
+ except BaseException:
59
+ tx.abort()
60
+ raise
61
+ else:
62
+ tx.commit()
63
+ """;
64
+ String batchBodyBefore="""
65
+ batch = self.start_batch()
66
+ yield batch
67
+ return self.end_batch()
68
+ """;
69
+ String batchBodyAfter="""
70
+ batch = self.start_batch()
71
+ try:
72
+ yield batch
73
+ finally:
74
+ results = self.end_batch()
75
+ return results
76
+ """;
77
+ String[][] tracePatches={{batchEndBefore,batchEndAfter},{traceTxBefore.indent(4),traceTxAfter.indent(4)},{batchBodyBefore.indent(4),batchBodyAfter.indent(4)}};
78
+ for(String[] patch:tracePatches){
79
+ if(traceClientSource.indexOf(patch[0])<0||traceClientSource.indexOf(patch[0])!=traceClientSource.lastIndexOf(patch[0]))throw new IllegalArgumentException("Unexpected pinned trace transaction/batch lifecycle");
80
+ traceClientSource=traceClientSource.replace(patch[0],patch[1]);
81
+ }
82
+ Files.writeString(traceClient,traceClientSource);
22
83
  // Ghidra 12.1.2's LLDB adapter calls a nonexistent SBProcess.write_memory method.
23
84
  // Adapt only the newly extracted owned copy; refuse a different upstream implementation.
24
85
  Path methods=root.resolve("ghidralldb/methods.py");String source=Files.readString(methods);
25
86
  String original=" proc.write_memory(offset, data)";
26
87
  if(source.indexOf(original)<0||source.indexOf(original)!=source.lastIndexOf(original))throw new IllegalArgumentException("Unexpected pinned LLDB memory writer");
27
88
  String replacement=" error = lldb.SBError()\n written = proc.WriteMemory(offset, data, error)\n if error.Fail() or written != len(data):\n raise RuntimeError(\"LLDB memory write failed: \" + error.GetCString())";
28
- Files.writeString(methods,source.replace(original,replacement),StandardOpenOption.TRUNCATE_EXISTING);
29
- System.out.println("{\"state\":\"prepared\",\"lldb_memory_adapter\":\"insight-sbprocess-v1\"}");
89
+ source=source.replace(original,replacement);
90
+ String originalStep=" if thread is not None:\n t = find_thread_by_obj(thread)\n t.process.SetSelectedThread(t)\n exec_convert_errors('thread step-out')";
91
+ if(source.indexOf(originalStep)<0||source.indexOf(originalStep)!=source.lastIndexOf(originalStep))throw new IllegalArgumentException("Unexpected pinned LLDB step-out adapter");
92
+ String step = """
93
+ if thread is None:
94
+ raise RuntimeError("A concrete live thread is required")
95
+ import json, os, uuid
96
+ t = find_thread_by_obj(thread)
97
+ proc = t.GetProcess()
98
+ if proc.GetState() != lldb.eStateStopped:
99
+ raise RuntimeError("Native target is not stopped")
100
+ frames = util.insight_frames(t)
101
+ caller = frames[1] if len(frames) > 1 else lldb.SBFrame()
102
+ if not caller.IsValid():
103
+ raise RuntimeError("No native caller frame")
104
+ return_pc, return_sp = caller.GetPC(), caller.GetSP()
105
+ if return_pc in (0, lldb.LLDB_INVALID_ADDRESS) or return_sp in (0, lldb.LLDB_INVALID_ADDRESS):
106
+ raise RuntimeError("Native caller location is unavailable")
107
+ root = os.path.dirname(os.path.dirname(__file__))
108
+ path = os.path.join(root, "caller-goal.json")
109
+ if os.path.exists(path):
110
+ with open(path) as source: prior = json.load(source)
111
+ observed_path = os.path.join(root, "caller-observation.json")
112
+ observed = {}
113
+ if os.path.exists(observed_path):
114
+ with open(observed_path) as source: observed = json.load(source)
115
+ if prior.get("pid") == proc.GetProcessID() and (observed.get("goal") != prior.get("id") or observed.get("state") != "verified"):
116
+ raise RuntimeError("An unverified caller intent is retained; close and reopen the context")
117
+ target = proc.GetTarget()
118
+ with commands.INSIGHT_BREAKPOINT_LOCK:
119
+ breakpoint = target.BreakpointCreateByAddress(return_pc)
120
+ commands.INSIGHT_TRANSIENT_BREAKPOINTS.add(breakpoint.GetID())
121
+ try:
122
+ if not breakpoint.IsValid():
123
+ raise RuntimeError("Cannot establish caller breakpoint")
124
+ breakpoint.SetThreadID(t.GetThreadID())
125
+ breakpoint.SetCondition("$sp == " + hex(return_sp))
126
+ breakpoint.SetOneShot(True)
127
+ if breakpoint.GetNumLocations() != 1:
128
+ raise RuntimeError("Caller breakpoint location is ambiguous")
129
+ goal = dict(schema=1, id=str(uuid.uuid4()), pid=proc.GetProcessID(), thread=str(t.GetThreadID()), pc=hex(return_pc), sp=hex(return_sp), stop=proc.GetStopID(), executable=target.GetExecutable().fullpath, breakpoint=breakpoint.GetID())
130
+ temporary = path + ".new-" + goal["id"]
131
+ fd = os.open(temporary, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600)
132
+ try:
133
+ os.write(fd, json.dumps(goal).encode("utf-8"))
134
+ os.fsync(fd)
135
+ finally:
136
+ os.close(fd)
137
+ os.replace(temporary, path)
138
+ error = proc.Continue()
139
+ if error.Fail():
140
+ raise RuntimeError(error.GetCString())
141
+ except Exception:
142
+ target.BreakpointDelete(breakpoint.GetID())
143
+ raise
144
+ """;
145
+ boolean ownedCaller=System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("mac");
146
+ if(ownedCaller)source=source.replace(originalStep,step.stripTrailing());
147
+ Files.writeString(methods,source,StandardOpenOption.TRUNCATE_EXISTING);
148
+ Path client=root.resolve("ghidratrace/client.py");String clientSource=Files.readString(client),call=" name = request.name\n if not name in self._method_registry._methods:";
149
+ if(clientSource.indexOf(call)<0||clientSource.indexOf(call)!=clientSource.lastIndexOf(call))throw new IllegalArgumentException("Unexpected pinned TraceRmi method dispatcher");
150
+ String logPath="__import__('base64').b64decode('"+Base64.getEncoder().encodeToString(root.resolve("rpc-methods.log").toString().getBytes(java.nio.charset.StandardCharsets.UTF_8))+"').decode('utf-8')";
151
+ clientSource=clientSource.replace(call," name = request.name\n import os as _insight_os\n _insight_fd = _insight_os.open("+logPath+", _insight_os.O_CREAT | _insight_os.O_APPEND | _insight_os.O_WRONLY, 0o600)\n try:\n if _insight_os.fstat(_insight_fd).st_size < 65536:\n _insight_os.write(_insight_fd, (name[:128] + '\\n').encode('utf-8'))\n finally:\n _insight_os.close(_insight_fd)\n if not name in self._method_registry._methods:");
152
+ Path commands=root.resolve("ghidralldb/commands.py");String commandSource=Files.readString(commands);
153
+ String trackedTxBefore="""
154
+ with STATE.require_trace().open_tx(description) as tx:
155
+ STATE.tx = tx
156
+ yield tx
157
+ STATE.reset_tx()
158
+ """;
159
+ String trackedTxAfter="""
160
+ try:
161
+ with STATE.require_trace().open_tx(description) as tx:
162
+ STATE.tx = tx
163
+ yield tx
164
+ finally:
165
+ STATE.reset_tx()
166
+ """;
167
+ if(commandSource.indexOf(trackedTxBefore)<0||commandSource.indexOf(trackedTxBefore)!=commandSource.lastIndexOf(trackedTxBefore))throw new IllegalArgumentException("Unexpected pinned tracked transaction lifecycle");
168
+ commandSource=commandSource.replace(trackedTxBefore,trackedTxAfter);
169
+ int frameStart=commandSource.indexOf("def put_frames() -> None:"),frameEnd=commandSource.indexOf("@convert_errors\ndef ghidra_trace_put_frames",frameStart);
170
+ if(frameStart<0||frameEnd<frameStart)throw new IllegalArgumentException("Unexpected pinned LLDB frame exporter");
171
+ String frameBlock=commandSource.substring(frameStart,frameEnd),frameIndex="level=f.GetFrameID()";
172
+ int first=frameBlock.indexOf(frameIndex),second=frameBlock.indexOf(frameIndex,first+frameIndex.length());
173
+ if(first<0||second<0||frameBlock.indexOf(frameIndex,second+frameIndex.length())>=0)throw new IllegalArgumentException("Unexpected pinned LLDB frame identity");
174
+ if(ownedCaller){
175
+ if(!frameBlock.contains("mapper.map(proc, f.GetPC())")||!frameBlock.contains("str(f.GetFunctionName())")||!frameBlock.contains("util.get_description(f)"))throw new IllegalArgumentException("Unexpected pinned LLDB frame coordinates");
176
+ frameBlock=frameBlock.replace("for i in range(0, t.GetNumFrames()):", "frames = util.insight_frames(t)\n for i in range(len(frames)):").replace("f = t.GetFrameAtIndex(i)", "f = frames[i]").replace("mapper.map(proc, f.GetPC())","mapper.map(proc, util.insight_frame_pc(f))").replace("str(f.GetFunctionName())","util.insight_frame_function(f)").replace("util.get_description(f)","util.insight_frame_description(f)");
177
+ }
178
+ commandSource=commandSource.substring(0,frameStart)+frameBlock.replace(frameIndex,"level=i")+commandSource.substring(frameEnd);
179
+ String single="def put_single_breakpoint(b: lldb.SBBreakpoint, proc: lldb.SBProcess) -> None:\n";
180
+ String list=" b = target.GetBreakpointAtIndex(i)\n keys.append(BREAKPOINT_KEY_PATTERN.format(breaknum=b.GetID()))";
181
+ if(commandSource.indexOf(single)<0||commandSource.indexOf(single)!=commandSource.lastIndexOf(single)||commandSource.indexOf(list)<0||commandSource.indexOf(list)!=commandSource.lastIndexOf(list))throw new IllegalArgumentException("Unexpected pinned LLDB breakpoint exporter");
182
+ commandSource=commandSource.replace(single,"import threading as _insight_threading\nINSIGHT_BREAKPOINT_LOCK = _insight_threading.RLock()\nINSIGHT_TRANSIENT_BREAKPOINTS = set()\n\n"+single+" with INSIGHT_BREAKPOINT_LOCK:\n if b.GetID() in INSIGHT_TRANSIENT_BREAKPOINTS:\n return\n");
183
+ commandSource=commandSource.replace(list," b = target.GetBreakpointAtIndex(i)\n with INSIGHT_BREAKPOINT_LOCK:\n if b.GetID() in INSIGHT_TRANSIENT_BREAKPOINTS:\n continue\n keys.append(BREAKPOINT_KEY_PATTERN.format(breaknum=b.GetID()))");
184
+ String registerFrame="frame.GetFrameID()";
185
+ if(commandSource.split(java.util.regex.Pattern.quote(registerFrame),-1).length!=5)throw new IllegalArgumentException("Unexpected pinned LLDB frame register paths");
186
+ commandSource=commandSource.replace(registerFrame,"util.insight_frame_level(frame)");
187
+ String dynamicRegister="bank.GetChildAtIndex(i, lldb.eDynamicCanRunTarget, True)";
188
+ if(commandSource.split(java.util.regex.Pattern.quote(dynamicRegister),-1).length!=3)throw new IllegalArgumentException("Unexpected pinned LLDB register reader");
189
+ commandSource=commandSource.replace(dynamicRegister,"bank.GetChildAtIndex(i, lldb.eDynamicDontRunTarget, True)");
190
+ Path util=root.resolve("ghidralldb/util.py");String utilSource=Files.readString(util);
191
+ String evaluation="def parse_and_eval(expr: str, signed: bool = False) -> int:\n if signed is True:\n return get_eval(expr).GetValueAsSigned()\n return get_eval(expr).GetValueAsUnsigned()";
192
+ String readOnlyEvaluation="""
193
+ def parse_and_eval(expr: str, signed: bool = False) -> int:
194
+ if not signed and re.fullmatch(r'0[xX][0-9a-fA-F]+|0|[1-9][0-9]*', expr):
195
+ return int(expr, 16 if expr.lower().startswith('0x') else 10)
196
+ register = re.fullmatch(r'[$](pc|sp)([+-](?:0[xX][0-9a-fA-F]+|0|[1-9][0-9]*))?', expr)
197
+ if register:
198
+ frame = selected_frame()
199
+ value = frame.FindRegister(register.group(1))
200
+ if not frame.IsValid() or not value.IsValid() or value.GetError().Fail():
201
+ raise ValueError('Stopped native register is unavailable')
202
+ offset = register.group(2) or '0'
203
+ displacement = int(offset, 16 if 'x' in offset.lower() else 10)
204
+ bits = get_target().GetAddressByteSize() * 8
205
+ number = (value.GetValueAsUnsigned() + displacement) & ((1 << bits) - 1)
206
+ return number - (1 << bits) if signed and number >= (1 << (bits - 1)) else number
207
+ if signed is True:
208
+ return get_eval(expr).GetValueAsSigned()
209
+ return get_eval(expr).GetValueAsUnsigned()
210
+ """;
211
+ if(utilSource.indexOf(evaluation)<0||utilSource.indexOf(evaluation)!=utilSource.lastIndexOf(evaluation))throw new IllegalArgumentException("Unexpected pinned LLDB address evaluator");
212
+ utilSource=utilSource.replace(evaluation,readOnlyEvaluation.stripTrailing());
213
+ utilSource+="\n\nINSIGHT_NORMALIZE_PHYSICAL_STACK = "+(ownedCaller?"True":"False")+"\n";
214
+ utilSource+="""
215
+
216
+ def insight_frames(thread):
217
+ frames = [thread.GetFrameAtIndex(i) for i in range(thread.GetNumFrames())]
218
+ if not INSIGHT_NORMALIZE_PHYSICAL_STACK or not frames:
219
+ return frames
220
+ head = frames[0]
221
+ pc, sp = head.FindRegister('pc'), head.FindRegister('sp')
222
+ if not pc.IsValid() or not sp.IsValid() or pc.GetError().Fail() or sp.GetError().Fail():
223
+ return frames
224
+ live_pc, live_sp = pc.GetValueAsUnsigned(), sp.GetValueAsUnsigned()
225
+ for index in range(1, min(len(frames), 16)):
226
+ previous, candidate = frames[index - 1], frames[index]
227
+ if previous.IsInlined() or previous.IsArtificial() or previous.GetSP() != live_sp or previous.GetCFA() != live_sp:
228
+ break
229
+ if candidate.GetPC() == live_pc and candidate.GetSP() == live_sp and not candidate.IsInlined() and not candidate.IsArtificial():
230
+ return frames[index:]
231
+ return frames
232
+
233
+ def insight_frame_native_index(frame):
234
+ thread = frame.GetThread()
235
+ for index in range(thread.GetNumFrames()):
236
+ if thread.GetFrameAtIndex(index).GetFrameID() == frame.GetFrameID():
237
+ return index
238
+ raise RuntimeError('Native frame is no longer present')
239
+
240
+ def insight_frame_for_level(thread, level):
241
+ return thread.GetFrameAtIndex(0) if level == 0 else insight_frames(thread)[level]
242
+
243
+ def insight_frame_level(frame):
244
+ thread = frame.GetThread()
245
+ for index, candidate in enumerate(insight_frames(thread)):
246
+ if candidate.GetFrameID() == frame.GetFrameID():
247
+ return index
248
+ frames = insight_frames(thread)
249
+ if frames and insight_frame_native_index(frame) < insight_frame_native_index(frames[0]):
250
+ return 0
251
+ raise RuntimeError('Native frame is no longer in the current stack')
252
+ """;
253
+ utilSource+="""
254
+
255
+ def insight_frame_pc(frame):
256
+ if insight_frame_level(frame) != 0 or frame.IsInlined() or frame.IsArtificial():
257
+ return frame.GetPC()
258
+ value = frame.FindRegister('pc')
259
+ if not value.IsValid() or value.GetError().Fail():
260
+ raise RuntimeError('Native frame PC register is unavailable')
261
+ return value.GetValueAsUnsigned()
262
+
263
+ def insight_frame_function(frame):
264
+ target = frame.GetThread().GetProcess().GetTarget()
265
+ address = target.ResolveLoadAddress(insight_frame_pc(frame))
266
+ function, symbol = address.GetFunction(), address.GetSymbol()
267
+ return str(function.GetName() if function.IsValid() else symbol.GetName() if symbol.IsValid() else '<unknown>')
268
+
269
+ def insight_frame_description(frame):
270
+ return '#%d: %s %s' % (insight_frame_level(frame), hex(insight_frame_pc(frame)), insight_frame_function(frame))
271
+
272
+ def insight_thread_description(thread):
273
+ if thread.GetProcess().GetState() != lldb.eStateStopped:
274
+ return get_description(thread)
275
+ frames = insight_frames(thread)
276
+ if not frames:
277
+ return get_description(thread)
278
+ frame = frames[0]
279
+ return 'thread #%d: tid = %s, %s %s, stop reason = %s' % (thread.GetIndexID(), hex(thread.GetThreadID()), hex(insight_frame_pc(frame)), insight_frame_function(frame), thread.GetStopDescription(512))
280
+ """;
281
+ Files.writeString(util,utilSource,StandardOpenOption.TRUNCATE_EXISTING);
282
+ String selectFrame="f.thread.SetSelectedFrame(f.GetFrameID())";
283
+ if(source.split(java.util.regex.Pattern.quote(selectFrame),-1).length!=3)throw new IllegalArgumentException("Unexpected pinned LLDB frame selector");
284
+ source=source.replace(selectFrame,"f.thread.SetSelectedFrame(util.insight_frame_native_index(f))");
285
+ if(ownedCaller){
286
+ String lookup=" return thread.GetFrameAtIndex(level)";
287
+ if(source.indexOf(lookup)<0||source.indexOf(lookup)!=source.lastIndexOf(lookup))throw new IllegalArgumentException("Unexpected pinned LLDB frame lookup");
288
+ source=source.replace(lookup," return util.insight_frame_for_level(thread, level)");
289
+ String display="def compute_thread_display(t: lldb.SBThread) -> str:\n return util.get_description(t)";
290
+ if(commandSource.indexOf(display)<0||commandSource.indexOf(display)!=commandSource.lastIndexOf(display))throw new IllegalArgumentException("Unexpected pinned LLDB thread display");
291
+ commandSource=commandSource.replace(display,"def compute_thread_display(t: lldb.SBThread) -> str:\n return util.insight_thread_description(t)");
292
+ }
293
+ Files.writeString(methods,source,StandardOpenOption.TRUNCATE_EXISTING);
294
+ Files.writeString(commands,commandSource,StandardOpenOption.TRUNCATE_EXISTING);
295
+ Files.writeString(client,clientSource,StandardOpenOption.TRUNCATE_EXISTING);
296
+ Path architecture=root.resolve("ghidralldb/arch.py");String architectureSource=Files.readString(architecture);
297
+ String registerAliases="""
298
+
299
+ class InsightAarch64RegisterMapper(DefaultRegisterMapper):
300
+ def map_name(self, proc, name):
301
+ return {'fp': 'x29', 'lr': 'x30'}.get(name, super().map_name(proc, name))
302
+
303
+ def map_name_back(self, proc, name):
304
+ return {'x29': 'fp', 'x30': 'lr'}.get(name, super().map_name_back(proc, name))
305
+ """;
306
+ String mapper="def compute_register_mapper(lang: str) -> DefaultRegisterMapper:\n";
307
+ if(architectureSource.indexOf(mapper)<0||architectureSource.indexOf(mapper)!=architectureSource.lastIndexOf(mapper))throw new IllegalArgumentException("Unexpected pinned LLDB register mapper");
308
+ architectureSource=architectureSource.replace(mapper,mapper+" if lang.startswith('AARCH64:'):\n return InsightAarch64RegisterMapper('big' if ':BE:' in lang else 'little')\n")+registerAliases;
309
+ Files.writeString(architecture,architectureSource,StandardOpenOption.TRUNCATE_EXISTING);
310
+ System.out.println("{\"state\":\"prepared\",\"lldb_memory_adapter\":\"insight-sbprocess-v1\",\"lldb_step_adapter\":\"insight-caller-dispatch-v2\"}");
30
311
  }
31
312
  }
@@ -17,6 +17,15 @@ import ghidra.trace.model.memory.TraceMemoryState;
17
17
  /** Save/restore trace databases independently of the program database and live execution. */
18
18
  public class InsightTraceState extends GhidraScript {
19
19
  static String string(JsonObject p,String key){return p.get(key).getAsString();}
20
+ static void activateAndWait(DebuggerTraceManagerService manager,ghidra.debug.api.tracemgr.DebuggerCoordinates coordinates)throws Exception{
21
+ var pending=new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.CompletableFuture<Void>>();
22
+ Runnable activate=()->pending.set(manager.activateAndNotify(coordinates,DebuggerTraceManagerService.ActivationCause.USER));
23
+ if(SwingUtilities.isEventDispatchThread()){
24
+ activate.run();if(!pending.get().isDone())throw new IllegalStateException("Asynchronous trace navigation requires a background script");pending.get().join();
25
+ }else{SwingUtilities.invokeAndWait(activate);pending.get().get(30,java.util.concurrent.TimeUnit.SECONDS);}
26
+ if(manager.getCurrentTrace()!=coordinates.getTrace())throw new IllegalStateException("Trace selection did not settle");
27
+ }
28
+
20
29
  static void bind(Trace trace,JsonObject p,boolean create){
21
30
  var options=trace.getOptions("Insight");String target=options.getString("Target",null),context=options.getString("Context",null);
22
31
  if(target==null&&context==null&&create){int tx=trace.startTransaction("Bind owned trace");try{
@@ -82,31 +91,31 @@ public class InsightTraceState extends GhidraScript {
82
91
  var thread=manager.getCurrentThread();var object=thread==null?null:thread.getObject();
83
92
  if(object==null){var candidates=manager.getCurrentTrace().getObjectManager().getAllObjects().filter(item->item.getSchema().getName().toString().equals("Process")).toList();
84
93
  if(candidates.size()!=1)throw new IllegalStateException("Debugger process selection is ambiguous");object=candidates.get(0);}
85
- var m=manager;final var selectedObject=object;Runnable focus=()->m.activateObject(selectedObject);
86
- if(SwingUtilities.isEventDispatchThread())focus.run();else SwingUtilities.invokeAndWait(focus);
94
+ activateAndWait(manager,manager.resolveObject(object));
87
95
  println("INSIGHT_TRACE_STATE "+new Gson().toJson(Map.of("state","focused")));return;
88
96
  }
89
97
  if(operation.equals("restore")){
90
98
  var folder=data.getRootFolder().getFolder("__insight_traces");if(folder==null)folder=data.getRootFolder().createFolder("__insight_traces");
91
99
  for(var entry:p.getAsJsonArray("traces")){
92
100
  var saved=entry.getAsJsonObject();String id=string(saved,"id");if(!id.matches("trace_[a-f0-9-]{36}"))throw new IllegalArgumentException();
93
- boolean present=false;for(var trace:manager.getOpenTraces())if(id.equals(trace.getOptions("Insight").getString("Trace ID",null)))present=true;
94
- if(present)continue;
95
- var file=folder.getFile(id);if(file==null)file=folder.createFile(id,Path.of(string(saved,"input")).toFile(),monitor);
96
- Trace trace=manager.openTrace(file,-1);bind(trace,p,false);
97
- if(!id.equals(trace.getOptions("Insight").getString("Trace ID",null)))throw new IllegalArgumentException("Restored trace identity changed");
101
+ Trace trace=null;for(var existing:manager.getOpenTraces())if(id.equals(existing.getOptions("Insight").getString("Trace ID",null)))trace=existing;
102
+ if(trace==null){var file=folder.getFile(id);if(file==null)file=folder.createFile(id,Path.of(string(saved,"input")).toFile(),monitor);trace=manager.openTrace(file,-1);}
103
+ bind(trace,p,false);if(!id.equals(trace.getOptions("Insight").getString("Trace ID",null)))throw new IllegalArgumentException("Restored trace identity changed");
98
104
  relocateMappings(trace,selected);
99
- if(p.has("active")&&id.equals(string(p,"active"))){final var m=manager;Runnable activate=()->{
100
- m.activateTrace(trace);m.activateSnap(Long.parseLong(string(saved,"snap")));
101
- if(saved.has("thread")){var thread=trace.getThreadManager().getThread(Long.parseLong(string(saved,"thread")));if(thread!=null)m.activateThread(thread);}
102
- };if(SwingUtilities.isEventDispatchThread())activate.run();else SwingUtilities.invokeAndWait(activate);}
105
+ var coordinates=manager.resolveTrace(trace).snap(Long.parseLong(string(saved,"snap")));
106
+ if(saved.has("thread")){var thread=trace.getThreadManager().getThread(Long.parseLong(string(saved,"thread")));if(thread!=null)coordinates=coordinates.thread(thread);}
107
+ activateAndWait(manager,coordinates);
108
+ if(manager.getCurrentSnap()!=Long.parseLong(string(saved,"snap")))throw new IllegalStateException("Saved trace snap did not restore");
109
+ }
110
+ if(p.has("active"))for(var trace:manager.getOpenTraces())if(string(p,"active").equals(trace.getOptions("Insight").getString("Trace ID",null))){
111
+ activateAndWait(manager,manager.resolveTrace(trace));
103
112
  }
104
113
  println("INSIGHT_TRACE_STATE "+new Gson().toJson(Map.of("state","restored")));return;
105
114
  }
106
115
  if(operation.equals("select")){
107
116
  String id=string(p,"id");for(var trace:manager.getOpenTraces()){
108
- bind(trace,p,false);if(id.equals(trace.getOptions("Insight").getString("Trace ID",null))){final var m=manager;
109
- if(SwingUtilities.isEventDispatchThread())m.activateTrace(trace);else SwingUtilities.invokeAndWait(()->m.activateTrace(trace));
117
+ bind(trace,p,false);if(id.equals(trace.getOptions("Insight").getString("Trace ID",null))){
118
+ activateAndWait(manager,manager.resolveTrace(trace));
110
119
  println("INSIGHT_TRACE_STATE "+new Gson().toJson(Map.of("state","selected","id",id)));return;}
111
120
  }
112
121
  throw new IllegalArgumentException("Trace not found");
@@ -114,15 +123,21 @@ public class InsightTraceState extends GhidraScript {
114
123
  if(!operation.equals("checkpoint"))throw new IllegalArgumentException();
115
124
  Path root=Path.of(string(p,"output")).toRealPath();List<Object> traces=new ArrayList<>();String active=null;
116
125
  if(manager.getOpenTraces().size()>64)throw new IllegalArgumentException("Trace count exceeds 64");
126
+ long lockDeadline=System.nanoTime()+java.util.concurrent.TimeUnit.SECONDS.toNanos(10);
117
127
  for(var trace:manager.getOpenTraces()){
118
128
  bind(trace,p,false);String id=trace.getOptions("Insight").getString("Trace ID",null);if(id==null||!id.matches("trace_[a-f0-9-]{36}"))throw new IllegalArgumentException();
119
129
  Path output=root.resolve(id+".gzf");if(Files.exists(output))throw new IllegalArgumentException();
130
+ while(!trace.lock("Insight consistent trace checkpoint")){
131
+ monitor.checkCancelled();if(System.nanoTime()>=lockDeadline)throw new IllegalStateException("Trace transaction did not release for checkpoint");Thread.sleep(25);
132
+ }
133
+ try{
120
134
  var coordinates=manager.getCurrentFor(trace);trace.saveToPackedFile(output.toFile(),monitor);
121
135
  Map<String,Object> row=new LinkedHashMap<>();row.put("id",id);row.put("name",trace.getName());row.put("snap",Long.toString(coordinates.getSnap()));
122
136
  row.put("modules",trace.getModuleManager().getAllModules().size());row.put("threads",trace.getThreadManager().getAllThreads().size());
123
137
  if(coordinates.getThread()!=null)row.put("thread",Long.toString(coordinates.getThread().getKey()));
124
138
  var targets=selected.getService(DebuggerTargetService.class);var live=targets==null?null:targets.getTarget(trace);row.put("connected",live!=null&&live.isValid());
125
139
  traces.add(row);if(manager.getCurrentTrace()==trace)active=id;
140
+ }finally{trace.unlock();}
126
141
  }
127
142
  Map<String,Object> result=new LinkedHashMap<>();result.put("traces",traces);if(active!=null)result.put("active",active);
128
143
  println("INSIGHT_TRACE_STATE "+new Gson().toJson(result));
@@ -40,7 +40,8 @@ Native acceptance separates macOS GUI/LLDB workflows from selected headless Wind
40
40
  SDK, Version Tracking and FID/BSim workflows. Native Windows/Linux debugger/GUI acceptance
41
41
  remains deferred. The ordinary CI lane stays offline; disposable native CI is explicit.
42
42
 
43
- Debugger execution additionally needs a supported host debugger (local LLDB on macOS). Its
43
+ On macOS 15+ ARM64, `ghidra install` delivers an owned LLDB/Python debugger backend;
44
+ OS debugger authorization remains required. Other host profiles need their supported debugger. Its
44
45
  Ghidra Python dependencies are prepared from the installed SDK wheels into owned GUI storage.
45
46
  `debuggerPython` optionally configures a Python-backed offer; `windbgDir` configures the Windows
46
47
  debugger runtime directory when relevant. These are runtime profile settings, not research scope.
@@ -0,0 +1 @@
1
+ <Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><TargetFramework>net10.0</TargetFramework><OutputType>Exe</OutputType><UseAppHost>false</UseAppHost><AssemblyName>Insight.Heap</AssemblyName><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings><Deterministic>true</Deterministic><DebugType>none</DebugType><RestorePackagesWithLockFile>true</RestorePackagesWithLockFile></PropertyGroup><ItemGroup><PackageReference Include="Microsoft.Diagnostics.Runtime" Version="4.2.751201" /></ItemGroup></Project>