reverseport 0.0.0-stage → 1.2.0

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 (1489) hide show
  1. package/DISCLAIMER.md +136 -0
  2. package/LICENSE +22 -0
  3. package/README.md +289 -2
  4. package/RESPONSIBLE-USE.md +22 -0
  5. package/THIRD_PARTY_NOTICES.md +130 -0
  6. package/bin/reverseport.mjs +136 -0
  7. package/bridge/android/ReaJadxBridge.java +270 -0
  8. package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
  9. package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
  10. package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
  11. package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
  12. package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
  13. package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
  14. package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
  15. package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
  16. package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
  17. package/bridge/hopper_bridge.py +1162 -0
  18. package/bridge/mitmproxy/capture.py +208 -0
  19. package/bridge/native/NativeUIChildren.swift +27 -0
  20. package/bridge/native/ReaNativeUI.swift +171 -0
  21. package/bridge/native/rea_lldb_tracer.py +839 -0
  22. package/bridge/process/ProcessRunTokenReader.swift +339 -0
  23. package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
  24. package/bridge/pwndbg/core_context.py +101 -0
  25. package/bridge/pwndbg/launch.py +39 -0
  26. package/bridge/pwndbg/launch_impl.py +34 -0
  27. package/bridge/pwntools/decoder_runtime.py +59 -0
  28. package/bridge/pwntools/layout.py +39 -0
  29. package/bridge/pwntools/layout_impl.py +314 -0
  30. package/bridge/pwntools/recorded_crash.py +39 -0
  31. package/bridge/pwntools/recorded_crash_impl.py +147 -0
  32. package/dist/adb/AdbConfiguration.js +88 -0
  33. package/dist/adb/AdbDeviceOutput.js +191 -0
  34. package/dist/adb/AdbDirectoryListing.js +80 -0
  35. package/dist/adb/AdbHostFileName.js +34 -0
  36. package/dist/adb/AdbProvider.js +1227 -0
  37. package/dist/adb/AdbShellOutput.js +267 -0
  38. package/dist/android/AndroidTargetSnapshot.js +118 -0
  39. package/dist/android/JadxAnalysis.js +201 -0
  40. package/dist/android/JadxConfiguration.js +320 -0
  41. package/dist/android/JadxMcpTransport.js +188 -0
  42. package/dist/android/JadxProtocol.js +115 -0
  43. package/dist/android/JadxProvider.js +337 -0
  44. package/dist/android/JadxRelease.js +27 -0
  45. package/dist/android/JadxSession.js +172 -0
  46. package/dist/apktool/ApktoolConfiguration.js +120 -0
  47. package/dist/apktool/ApktoolDecodeOutput.js +142 -0
  48. package/dist/apktool/ApktoolProvider.js +522 -0
  49. package/dist/application/AnalysisContextQueries.js +128 -0
  50. package/dist/application/AnalysisDocument.js +32 -0
  51. package/dist/application/AnalysisProvider.js +27 -0
  52. package/dist/application/AppBundleExecutable.js +192 -0
  53. package/dist/application/BinaryTargetResolver.js +356 -0
  54. package/dist/application/BrowserEvidence.js +127 -0
  55. package/dist/application/BrowserObservationPort.js +1 -0
  56. package/dist/application/BrowserObservationService.js +86 -0
  57. package/dist/application/BrowserScenarioCapturePort.js +1 -0
  58. package/dist/application/BrowserScenarioCaptureService.js +17 -0
  59. package/dist/application/BrowserScenarioEvidence.js +28 -0
  60. package/dist/application/CallPathTracing.js +182 -0
  61. package/dist/application/CapabilityClientRequirements.js +17 -0
  62. package/dist/application/CapabilityInventory.js +525 -0
  63. package/dist/application/ClientConfigPath.js +35 -0
  64. package/dist/application/ClientConfigurationDocument.js +1196 -0
  65. package/dist/application/ClientConfigurationFiles.js +91 -0
  66. package/dist/application/ClientRegistrationEnvironment.js +39 -0
  67. package/dist/application/ClientRegistrationIdentity.js +80 -0
  68. package/dist/application/ClientRegistrationStatus.js +233 -0
  69. package/dist/application/DirectAnalysis.js +371 -0
  70. package/dist/application/DirectAnalysisCleanup.js +71 -0
  71. package/dist/application/DirectAnalysisDependencies.js +1 -0
  72. package/dist/application/DirectAnalysisStatus.js +22 -0
  73. package/dist/application/Doctor.js +349 -0
  74. package/dist/application/DoctorDiagnostics.js +169 -0
  75. package/dist/application/DoctorProviderIds.js +2 -0
  76. package/dist/application/DoctorScope.js +113 -0
  77. package/dist/application/DshCordisPatch.js +342 -0
  78. package/dist/application/DshCordisYaml.js +155 -0
  79. package/dist/application/EnhancedLiteralTracing.js +88 -0
  80. package/dist/application/EnhancedToolTypes.js +4 -0
  81. package/dist/application/EnhancedTools.js +428 -0
  82. package/dist/application/EvidenceBundleCommands.js +70 -0
  83. package/dist/application/EvidenceBundleFiles.js +79 -0
  84. package/dist/application/EvidenceInputResolver.js +30 -0
  85. package/dist/application/FunctionAnalysisEvidence.js +34 -0
  86. package/dist/application/GeminiClientSettings.js +139 -0
  87. package/dist/application/HermesClientHome.js +115 -0
  88. package/dist/application/HopperDownload.js +39 -0
  89. package/dist/application/InventoryProjectionEvidence.js +44 -0
  90. package/dist/application/InvestigationProviders.js +130 -0
  91. package/dist/application/JsonFiles.js +225 -0
  92. package/dist/application/JsonInputFile.js +410 -0
  93. package/dist/application/LinuxHopper.js +232 -0
  94. package/dist/application/MacHopper.js +235 -0
  95. package/dist/application/MipsElfMetadata.js +175 -0
  96. package/dist/application/MipsElfSharedLoad.js +164 -0
  97. package/dist/application/OptionalObservationProviders.js +3 -0
  98. package/dist/application/ProcedureAddressResolution.js +11 -0
  99. package/dist/application/ProgressReporter.js +30 -0
  100. package/dist/application/ProviderOperationExecution.js +31 -0
  101. package/dist/application/RealHopperAssertions.js +135 -0
  102. package/dist/application/ReconstructionCoverageService.js +22 -0
  103. package/dist/application/ReconstructionObligationAuthority.js +72 -0
  104. package/dist/application/ReconstructionObligationCandidates.js +286 -0
  105. package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
  106. package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
  107. package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
  108. package/dist/application/ReconstructionObligationLedgerService.js +54 -0
  109. package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
  110. package/dist/application/ReconstructionObligationPolicies.js +132 -0
  111. package/dist/application/ReferenceSourceImport.js +200 -0
  112. package/dist/application/ReferenceSourceImportEntries.js +151 -0
  113. package/dist/application/ReferenceSourceImportPolicy.js +125 -0
  114. package/dist/application/ReferenceSourceImportTypes.js +47 -0
  115. package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
  116. package/dist/application/RegularFileRead.js +120 -0
  117. package/dist/application/Setup.js +408 -0
  118. package/dist/application/SetupClientConfiguration.js +314 -0
  119. package/dist/application/SetupClients.js +44 -0
  120. package/dist/application/SetupHost.js +203 -0
  121. package/dist/application/SetupInstallFailure.js +77 -0
  122. package/dist/application/SetupPlan.js +210 -0
  123. package/dist/application/SetupRegistrationEnvironment.js +5 -0
  124. package/dist/application/SetupSkill.js +248 -0
  125. package/dist/application/SetupTypes.js +17 -0
  126. package/dist/application/SupportedClients.js +469 -0
  127. package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
  128. package/dist/application/Uninstall.js +452 -0
  129. package/dist/application/UninstallFailure.js +14 -0
  130. package/dist/application/Update.js +137 -0
  131. package/dist/application/UpdateFailure.js +17 -0
  132. package/dist/application/UpdateMaintenance.js +111 -0
  133. package/dist/application/UpdateRuntime.js +264 -0
  134. package/dist/application/Utf8JsonInput.js +71 -0
  135. package/dist/application/ValidateSelectedWebScript.js +27 -0
  136. package/dist/application/WebModulePorts.js +1 -0
  137. package/dist/application/WebModuleTraceService.js +214 -0
  138. package/dist/application/WebNetworkCapturePort.js +1 -0
  139. package/dist/application/WebNetworkCaptureService.js +134 -0
  140. package/dist/application/WebRuntimePort.js +1 -0
  141. package/dist/application/WebRuntimeService.js +75 -0
  142. package/dist/application/WebScriptArtifactPort.js +1 -0
  143. package/dist/application/WebScriptExportService.js +214 -0
  144. package/dist/application/WebSourceLocationPorts.js +1 -0
  145. package/dist/application/WebSourceLocationService.js +177 -0
  146. package/dist/application/WindowsCapabilities.js +87 -0
  147. package/dist/application/WorkflowEvidence.js +105 -0
  148. package/dist/application/XrefsAddressResolution.js +45 -0
  149. package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
  150. package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
  151. package/dist/application/analysisView/AnalysisViewService.js +133 -0
  152. package/dist/application/android/AndroidAnalysisPort.js +1 -0
  153. package/dist/application/android/AndroidAnalysisService.js +37 -0
  154. package/dist/application/android/AndroidApplicationService.js +17 -0
  155. package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
  156. package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
  157. package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
  158. package/dist/application/apple/AppleApplicationService.js +17 -0
  159. package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
  160. package/dist/application/binary/AbortablePromise.js +28 -0
  161. package/dist/application/binary/AnalysisClientCleanup.js +15 -0
  162. package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
  163. package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
  164. package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
  165. package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
  166. package/dist/application/binary/BinarySession.js +605 -0
  167. package/dist/application/binary/BinarySessionComposition.js +9 -0
  168. package/dist/application/binary/BinarySessionExecution.js +66 -0
  169. package/dist/application/binary/BinarySessionOpen.js +66 -0
  170. package/dist/application/binary/BinarySessionPort.js +1 -0
  171. package/dist/application/binary/BinarySessionRecords.js +216 -0
  172. package/dist/application/binary/BinarySessionStatus.js +219 -0
  173. package/dist/application/binary/BinaryTargetSummary.js +9 -0
  174. package/dist/application/binary/CompositeProvider.js +103 -0
  175. package/dist/application/binary/LazyAnalysisProvider.js +105 -0
  176. package/dist/application/binary/SessionProviderRouter.js +118 -0
  177. package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
  178. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
  179. package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
  180. package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
  181. package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
  182. package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
  183. package/dist/application/evm/EvmInterfacePort.js +1 -0
  184. package/dist/application/evm/EvmInterfaceService.js +67 -0
  185. package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
  186. package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
  187. package/dist/application/go/GoBinaryPort.js +1 -0
  188. package/dist/application/go/GoBinaryService.js +77 -0
  189. package/dist/application/harmony/HarmonyApplicationService.js +17 -0
  190. package/dist/application/homebrew.js +67 -0
  191. package/dist/application/investigation/EvidenceLedger.js +338 -0
  192. package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
  193. package/dist/application/investigation/InvestigationRecordPort.js +1 -0
  194. package/dist/application/investigation/InvestigationRecords.js +65 -0
  195. package/dist/application/investigation/UnknownEvidence.js +37 -0
  196. package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
  197. package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
  198. package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
  199. package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
  200. package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
  201. package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
  202. package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
  203. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
  204. package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
  205. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
  206. package/dist/application/javascript/ElectronEvidence.js +37 -0
  207. package/dist/application/javascript/ElectronObservationPort.js +1 -0
  208. package/dist/application/javascript/ElectronObservationService.js +26 -0
  209. package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
  210. package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
  211. package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
  212. package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
  213. package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
  214. package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
  215. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
  216. package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
  217. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
  218. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
  219. package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
  220. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
  221. package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
  222. package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
  223. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
  224. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
  225. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
  226. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
  227. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
  228. package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
  229. package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
  230. package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
  231. package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
  232. package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
  233. package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
  234. package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
  235. package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
  236. package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
  237. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
  238. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
  239. package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
  240. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
  241. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
  242. package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
  243. package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
  244. package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
  245. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
  246. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
  247. package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
  248. package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
  249. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
  250. package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
  251. package/dist/application/jeb/JebAnalysisPort.js +1 -0
  252. package/dist/application/jeb/JebAnalysisService.js +13 -0
  253. package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
  254. package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
  255. package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
  256. package/dist/application/managed/ManagedReconstructionService.js +59 -0
  257. package/dist/application/native/NativeApiInspection.js +77 -0
  258. package/dist/application/native/NativeCallRoutes.js +73 -0
  259. package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
  260. package/dist/application/native/NativeUiActionTrace.js +427 -0
  261. package/dist/application/native/NativeValueTrace.js +340 -0
  262. package/dist/application/process/ProcessCli.js +190 -0
  263. package/dist/application/process/ProcessEvidence.js +30 -0
  264. package/dist/application/wasm/WasmArtifactPort.js +1 -0
  265. package/dist/application/wasm/WasmArtifactService.js +72 -0
  266. package/dist/application/workflowInputError.js +18 -0
  267. package/dist/artifacts/ArtifactHash.js +29 -0
  268. package/dist/artifacts/ArtifactPaths.js +167 -0
  269. package/dist/artifacts/ArtifactProvider.js +280 -0
  270. package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
  271. package/dist/artifacts/ArtifactReader.js +77 -0
  272. package/dist/artifacts/ArtifactResourceScope.js +103 -0
  273. package/dist/artifacts/AsarArtifactReader.js +518 -0
  274. package/dist/artifacts/AsarEntryStream.js +76 -0
  275. package/dist/artifacts/AsarHeader.js +24 -0
  276. package/dist/artifacts/DirectoryArtifactReader.js +292 -0
  277. package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
  278. package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
  279. package/dist/artifacts/NativeDmgOwnership.js +109 -0
  280. package/dist/artifacts/SafeOutputTree.js +394 -0
  281. package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
  282. package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
  283. package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
  284. package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
  285. package/dist/artifacts/StreamBytes.js +10 -0
  286. package/dist/artifacts/ZipArtifactReader.js +222 -0
  287. package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
  288. package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
  289. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
  290. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
  291. package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
  292. package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
  293. package/dist/artifacts/apple/NibArchive.js +338 -0
  294. package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
  295. package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
  296. package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
  297. package/dist/artifacts/hostExecutableMarking.js +16 -0
  298. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
  299. package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
  300. package/dist/artifacts/inventory/classify.js +94 -0
  301. package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
  302. package/dist/artifacts/inventory/reader.js +40 -0
  303. package/dist/artifacts/inventory/scanCanonical.js +213 -0
  304. package/dist/artifacts/inventory/scanReader.js +169 -0
  305. package/dist/artifacts/inventory/types.js +3 -0
  306. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
  307. package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
  308. package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
  309. package/dist/artifacts/readStableArtifact.js +68 -0
  310. package/dist/browser/BrowserProcessStartup.js +89 -0
  311. package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
  312. package/dist/browser/BrowserScenarioSecrets.js +137 -0
  313. package/dist/browser/BrowserScenarioSessionPort.js +1 -0
  314. package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
  315. package/dist/browser/CdpAuthorizedTarget.js +22 -0
  316. package/dist/browser/CdpBrowserProvider.js +276 -0
  317. package/dist/browser/CdpCaptureCompleteness.js +92 -0
  318. package/dist/browser/CdpCaptureDocuments.js +375 -0
  319. package/dist/browser/CdpCaptureDomSvg.js +210 -0
  320. package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
  321. package/dist/browser/CdpCaptureEventHandlers.js +463 -0
  322. package/dist/browser/CdpCaptureEventHelpers.js +84 -0
  323. package/dist/browser/CdpCaptureEventState.js +1 -0
  324. package/dist/browser/CdpCaptureEventTypes.js +5 -0
  325. package/dist/browser/CdpCaptureEvents.js +199 -0
  326. package/dist/browser/CdpCaptureStorage.js +86 -0
  327. package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
  328. package/dist/browser/CdpCaptureValues.js +91 -0
  329. package/dist/browser/CdpCommandRejection.js +17 -0
  330. package/dist/browser/CdpConnection.js +303 -0
  331. package/dist/browser/CdpElectronInspection.js +253 -0
  332. package/dist/browser/CdpElectronProvider.js +115 -0
  333. package/dist/browser/CdpElectronScriptEvents.js +55 -0
  334. package/dist/browser/CdpElectronScripts.js +65 -0
  335. package/dist/browser/CdpElectronWorkers.js +57 -0
  336. package/dist/browser/CdpEndpoint.js +217 -0
  337. package/dist/browser/CdpObservationSession.js +332 -0
  338. package/dist/browser/CdpOptionalCommand.js +14 -0
  339. package/dist/browser/CdpPageCapture.js +278 -0
  340. package/dist/browser/CdpPageCaptureScripts.js +79 -0
  341. package/dist/browser/CdpPageCaptureWorkers.js +46 -0
  342. package/dist/browser/CdpSafeMetadata.js +284 -0
  343. package/dist/browser/CdpScreenshot.js +110 -0
  344. package/dist/browser/CdpTargetEvents.js +8 -0
  345. package/dist/browser/CdpTargetSession.js +65 -0
  346. package/dist/browser/CdpWebMcpDiscovery.js +361 -0
  347. package/dist/browser/ElectronFileScope.js +135 -0
  348. package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
  349. package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
  350. package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
  351. package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
  352. package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
  353. package/dist/browser/PlaywrightScenarioActions.js +58 -0
  354. package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
  355. package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
  356. package/dist/browser/PlaywrightScenarioEvents.js +253 -0
  357. package/dist/browser/PlaywrightScenarioSession.js +279 -0
  358. package/dist/browser/PlaywrightScenarioStorage.js +507 -0
  359. package/dist/browser/PngVisualDiff.js +380 -0
  360. package/dist/browser/WebSourceMapFetcher.js +718 -0
  361. package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
  362. package/dist/browser/assets/PageScriptCapture.js +32 -0
  363. package/dist/browser/assets/PublishWebScripts.js +140 -0
  364. package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
  365. package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
  366. package/dist/browser/assets/WebArtifactReads.js +78 -0
  367. package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
  368. package/dist/browser/execution/CdpEventListeners.js +79 -0
  369. package/dist/browser/execution/CdpExecutionCapture.js +135 -0
  370. package/dist/browser/execution/CdpExecutionCollection.js +57 -0
  371. package/dist/browser/execution/CdpExecutionWindow.js +100 -0
  372. package/dist/browser/execution/CdpListenerSelector.js +22 -0
  373. package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
  374. package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
  375. package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
  376. package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
  377. package/dist/browser/execution/CdpRuntimeSession.js +163 -0
  378. package/dist/browser/execution/CdpRuntimeSources.js +223 -0
  379. package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
  380. package/dist/browser/history/CaptureFailures.js +153 -0
  381. package/dist/browser/history/CaptureFormatError.js +10 -0
  382. package/dist/browser/history/CaptureRedaction.js +68 -0
  383. package/dist/browser/history/CaptureRelease.js +23 -0
  384. package/dist/browser/history/HarCapture.js +179 -0
  385. package/dist/browser/history/HarCaptureAdapter.js +23 -0
  386. package/dist/browser/history/HarCaptureProcess.js +49 -0
  387. package/dist/browser/history/HarJson.js +92 -0
  388. package/dist/browser/history/HarSchema.js +72 -0
  389. package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
  390. package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
  391. package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
  392. package/dist/browser/modules/NativeModuleResolver.js +277 -0
  393. package/dist/browser/modules/WebModuleArtifacts.js +41 -0
  394. package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
  395. package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
  396. package/dist/browser/providerIdentities.js +24 -0
  397. package/dist/catalogIdentity.js +65 -0
  398. package/dist/cli/adbCommands.js +337 -0
  399. package/dist/cli/analysisSelector.js +23 -0
  400. package/dist/cli/analysisViewCommands.js +74 -0
  401. package/dist/cli/androidCommands.js +91 -0
  402. package/dist/cli/apktoolCommands.js +53 -0
  403. package/dist/cli/applicationCommands.js +173 -0
  404. package/dist/cli/artifactCommands.js +160 -0
  405. package/dist/cli/binaryDiagnosticsCommands.js +57 -0
  406. package/dist/cli/browserAdvancedCommands.js +189 -0
  407. package/dist/cli/browserCommands.js +125 -0
  408. package/dist/cli/commandCancellation.js +24 -0
  409. package/dist/cli/coreAnalysisCommands.js +7 -0
  410. package/dist/cli/coreBinaryCommands.js +283 -0
  411. package/dist/cli/coreNativeCommands.js +269 -0
  412. package/dist/cli/electronCommands.js +150 -0
  413. package/dist/cli/evmCommands.js +33 -0
  414. package/dist/cli/firmwareCommands.js +61 -0
  415. package/dist/cli/goCommands.js +21 -0
  416. package/dist/cli/interactiveSetup.js +236 -0
  417. package/dist/cli/javascriptApplicationAnalysis.js +34 -0
  418. package/dist/cli/javascriptRecoveryCommands.js +59 -0
  419. package/dist/cli/jebCommands.js +99 -0
  420. package/dist/cli/jsonOutput.js +46 -0
  421. package/dist/cli/managedCommands.js +129 -0
  422. package/dist/cli/managedProjectGraphCommand.js +24 -0
  423. package/dist/cli/nativeCallCommands.js +33 -0
  424. package/dist/cli/omittableDefaults.js +50 -0
  425. package/dist/cli/options.js +33 -0
  426. package/dist/cli/processCommands.js +25 -0
  427. package/dist/cli/referenceSourceImportStatus.js +22 -0
  428. package/dist/cli/setupCommands.js +189 -0
  429. package/dist/cli/streamedJsonOutput.js +134 -0
  430. package/dist/cli/types.js +1 -0
  431. package/dist/cli/utilityCommands.js +226 -0
  432. package/dist/cli/wasmCommands.js +44 -0
  433. package/dist/cli/webModuleCommands.js +60 -0
  434. package/dist/cli/webNetworkCaptureCommands.js +40 -0
  435. package/dist/cli/webRuntimeCommands.js +60 -0
  436. package/dist/cli/webScriptCommands.js +50 -0
  437. package/dist/cli/webSourceLocationCommands.js +54 -0
  438. package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
  439. package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
  440. package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
  441. package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
  442. package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
  443. package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
  444. package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
  445. package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
  446. package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
  447. package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
  448. package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
  449. package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
  450. package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
  451. package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
  452. package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
  453. package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
  454. package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
  455. package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
  456. package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
  457. package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
  458. package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
  459. package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
  460. package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
  461. package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
  462. package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
  463. package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
  464. package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
  465. package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
  466. package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
  467. package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
  468. package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
  469. package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
  470. package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
  471. package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
  472. package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
  473. package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
  474. package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
  475. package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
  476. package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
  477. package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
  478. package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
  479. package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
  480. package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
  481. package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
  482. package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
  483. package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
  484. package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
  485. package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
  486. package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
  487. package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
  488. package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
  489. package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
  490. package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
  491. package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
  492. package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
  493. package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
  494. package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
  495. package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
  496. package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
  497. package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
  498. package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
  499. package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
  500. package/dist/cli-runtime/cli.js +28528 -0
  501. package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
  502. package/dist/cli-runtime/cliOutput.js +5 -0
  503. package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
  504. package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
  505. package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
  506. package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
  507. package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
  508. package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
  509. package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
  510. package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
  511. package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
  512. package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
  513. package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
  514. package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
  515. package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
  516. package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
  517. package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
  518. package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
  519. package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
  520. package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
  521. package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
  522. package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
  523. package/dist/cli-runtime/mcpDoctor.js +342 -0
  524. package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
  525. package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
  526. package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
  527. package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
  528. package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
  529. package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
  530. package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
  531. package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
  532. package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
  533. package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
  534. package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
  535. package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
  536. package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
  537. package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
  538. package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
  539. package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
  540. package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
  541. package/dist/cli-runtime/streamedJsonOutput.js +5 -0
  542. package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
  543. package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
  544. package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
  545. package/dist/cli.js +91 -0
  546. package/dist/cliBrowserContext.js +11 -0
  547. package/dist/cliBrowserScenarioCommands.js +73 -0
  548. package/dist/cliCommandNames.js +205 -0
  549. package/dist/cliEvidenceCommands.js +51 -0
  550. package/dist/cliJavaScriptRuntimeCommands.js +69 -0
  551. package/dist/cliJsonInput.js +129 -0
  552. package/dist/cliLogging.js +48 -0
  553. package/dist/cliObservationOptions.js +73 -0
  554. package/dist/cliOutput.js +97 -0
  555. package/dist/composition/adb.js +3 -0
  556. package/dist/composition/android.js +3 -0
  557. package/dist/composition/apktool.js +3 -0
  558. package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
  559. package/dist/composition/binary.js +25 -0
  560. package/dist/composition/binaryDiagnostics.js +12 -0
  561. package/dist/composition/browserObservation.js +3 -0
  562. package/dist/composition/browserScenario.js +4 -0
  563. package/dist/composition/directAnalysis.js +44 -0
  564. package/dist/composition/electronObservation.js +3 -0
  565. package/dist/composition/electronScenario.js +3 -0
  566. package/dist/composition/evm.js +4 -0
  567. package/dist/composition/firmware.js +3 -0
  568. package/dist/composition/go.js +4 -0
  569. package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
  570. package/dist/composition/javascriptRecovery.js +3 -0
  571. package/dist/composition/javascriptRuntimeObservation.js +3 -0
  572. package/dist/composition/jeb.js +6 -0
  573. package/dist/composition/optionalObservationProviders.js +54 -0
  574. package/dist/composition/wasm.js +4 -0
  575. package/dist/composition/webModules.js +5 -0
  576. package/dist/composition/webNetworkCaptures.js +6 -0
  577. package/dist/composition/webRuntime.js +4 -0
  578. package/dist/composition/webSourceLocations.js +5 -0
  579. package/dist/config/environment.js +73 -0
  580. package/dist/config/ghidraDisabledAnalyzers.js +25 -0
  581. package/dist/config/ghidraLanguageOverride.js +9 -0
  582. package/dist/config/homeDirectory.js +12 -0
  583. package/dist/config/mcpInputSchemaProfile.js +27 -0
  584. package/dist/config/mcpResponseBudget.js +30 -0
  585. package/dist/config/parseConfig.js +93 -0
  586. package/dist/config/parsers.js +30 -0
  587. package/dist/config/providerStartupTimeout.js +13 -0
  588. package/dist/config/types.js +1 -0
  589. package/dist/contracts/adb/adbToolContracts.js +353 -0
  590. package/dist/contracts/advertisedInputExamples.js +48 -0
  591. package/dist/contracts/analysisDetail.js +13 -0
  592. package/dist/contracts/analysisSearchContract.js +14 -0
  593. package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
  594. package/dist/contracts/analysisViewToolContracts.js +76 -0
  595. package/dist/contracts/android/androidToolContracts.js +77 -0
  596. package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
  597. package/dist/contracts/applicationToolContracts.js +261 -0
  598. package/dist/contracts/artifactComparisonExample.js +86 -0
  599. package/dist/contracts/artifactToolContracts.js +68 -0
  600. package/dist/contracts/browserProviderToolContracts.js +7 -0
  601. package/dist/contracts/browserScenarioToolContracts.js +32 -0
  602. package/dist/contracts/browserToolContracts.js +256 -0
  603. package/dist/contracts/compactInputSchema.js +256 -0
  604. package/dist/contracts/enhancedInputs.js +74 -0
  605. package/dist/contracts/enhancedToolContracts.js +32 -0
  606. package/dist/contracts/errorSchemas.js +87 -0
  607. package/dist/contracts/evidenceInputContracts.js +13 -0
  608. package/dist/contracts/evm/evmToolContracts.js +20 -0
  609. package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
  610. package/dist/contracts/functionComparisonExample.js +51 -0
  611. package/dist/contracts/functionInstructionContract.js +6 -0
  612. package/dist/contracts/functionWorkflowToolContracts.js +29 -0
  613. package/dist/contracts/go/goToolContracts.js +20 -0
  614. package/dist/contracts/hopperMemoryContracts.js +19 -0
  615. package/dist/contracts/inputSchemaPresentation.js +181 -0
  616. package/dist/contracts/investigationExamples.js +116 -0
  617. package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
  618. package/dist/contracts/javascript/electronToolContracts.js +118 -0
  619. package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
  620. package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
  621. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
  622. package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
  623. package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
  624. package/dist/contracts/jeb/jebToolContracts.js +64 -0
  625. package/dist/contracts/managed/managedToolContracts.js +87 -0
  626. package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
  627. package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
  628. package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
  629. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
  630. package/dist/contracts/native/nativeToolContracts.js +77 -0
  631. package/dist/contracts/officialToolContracts.js +69 -0
  632. package/dist/contracts/promptContracts.js +253 -0
  633. package/dist/contracts/providerSelection.js +29 -0
  634. package/dist/contracts/reconstructionReadinessExample.js +438 -0
  635. package/dist/contracts/sessionLifecycleInputs.js +63 -0
  636. package/dist/contracts/sessionStatusContract.js +17 -0
  637. package/dist/contracts/sessionToolContracts.js +61 -0
  638. package/dist/contracts/sessionToolSchemas.js +51 -0
  639. package/dist/contracts/toolContractExamples.js +77 -0
  640. package/dist/contracts/toolContractHelpers.js +22 -0
  641. package/dist/contracts/toolContractTypes.js +18 -0
  642. package/dist/contracts/toolContracts.js +60 -0
  643. package/dist/contracts/toolEffects.js +544 -0
  644. package/dist/contracts/toolOutputSchemaGroups.js +411 -0
  645. package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
  646. package/dist/contracts/toolSchemaMetadata.js +197 -0
  647. package/dist/contracts/unknownContractExamples.js +31 -0
  648. package/dist/contracts/wasm/wasmToolContracts.js +24 -0
  649. package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
  650. package/dist/contracts/webRuntimeToolContracts.js +43 -0
  651. package/dist/contracts/webScriptToolContracts.js +68 -0
  652. package/dist/doctorRuntime.js +53 -0
  653. package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
  654. package/dist/domain/analysisErrorBase.js +58 -0
  655. package/dist/domain/analysisErrorCleanup.js +29 -0
  656. package/dist/domain/analysisErrorCore.js +123 -0
  657. package/dist/domain/analysisErrorPresentation.js +372 -0
  658. package/dist/domain/analysisErrorProjection.js +454 -0
  659. package/dist/domain/analysisProfile.js +50 -0
  660. package/dist/domain/analysisSnapshot.js +538 -0
  661. package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
  662. package/dist/domain/analysisView/analysisView.js +340 -0
  663. package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
  664. package/dist/domain/analysisView/binaryLayoutView.js +161 -0
  665. package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
  666. package/dist/domain/analysisView/nativeFunctionView.js +155 -0
  667. package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
  668. package/dist/domain/android/androidAnalysis.js +143 -0
  669. package/dist/domain/android/androidApplication.js +144 -0
  670. package/dist/domain/android/androidPartialObservation.js +36 -0
  671. package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
  672. package/dist/domain/apple/appleApplication.js +315 -0
  673. package/dist/domain/apple/appleAssetCatalog.js +127 -0
  674. package/dist/domain/apple/appleBundleAnatomy.js +303 -0
  675. package/dist/domain/apple/dyldEnvironment.js +73 -0
  676. package/dist/domain/apple/dyldPaths.js +89 -0
  677. package/dist/domain/apple/dylibResolution.js +485 -0
  678. package/dist/domain/apple/dylibResolutionFindings.js +77 -0
  679. package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
  680. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
  681. package/dist/domain/apple/keyedArchive.js +214 -0
  682. package/dist/domain/apple/machoContainer.js +54 -0
  683. package/dist/domain/apple/plistNumbers.js +76 -0
  684. package/dist/domain/apple/plistValue.js +35 -0
  685. package/dist/domain/artifactComparison.js +348 -0
  686. package/dist/domain/artifactGraph.js +213 -0
  687. package/dist/domain/artifactIdentity.js +57 -0
  688. package/dist/domain/artifactInspection.js +279 -0
  689. package/dist/domain/artifactIntegrityPolicy.js +10 -0
  690. package/dist/domain/artifactInventoryEvidence.js +166 -0
  691. package/dist/domain/artifactInventorySnapshot.js +1 -0
  692. package/dist/domain/artifactOperationError.js +20 -0
  693. package/dist/domain/artifactPartialObservation.js +1 -0
  694. package/dist/domain/artifactPathSyntax.js +75 -0
  695. package/dist/domain/binaryTarget.js +233 -0
  696. package/dist/domain/binaryTargetTypes.js +10 -0
  697. package/dist/domain/bridgeCandidateProjection.js +71 -0
  698. package/dist/domain/browserCaptureComparison.js +21 -0
  699. package/dist/domain/browserCompleteness.js +103 -0
  700. package/dist/domain/browserNetworkEvidence.js +92 -0
  701. package/dist/domain/browserObservation.js +187 -0
  702. package/dist/domain/browserObservationError.js +44 -0
  703. package/dist/domain/browserObservationErrors.js +1 -0
  704. package/dist/domain/browserObservationSchemas.js +327 -0
  705. package/dist/domain/browserScenario.js +61 -0
  706. package/dist/domain/browserScenarioCapture.js +76 -0
  707. package/dist/domain/browserScenarioCaptureValues.js +292 -0
  708. package/dist/domain/browserScenarioDiff.js +266 -0
  709. package/dist/domain/browserScenarioDiffEvidence.js +73 -0
  710. package/dist/domain/browserScenarioDiffValues.js +140 -0
  711. package/dist/domain/browserScenarioNormalization.js +40 -0
  712. package/dist/domain/browserScenarioValues.js +268 -0
  713. package/dist/domain/browserSession.js +55 -0
  714. package/dist/domain/bundleComparison.js +243 -0
  715. package/dist/domain/callPath.js +301 -0
  716. package/dist/domain/callPathSchemas.js +89 -0
  717. package/dist/domain/canonicalDigest.js +83 -0
  718. package/dist/domain/canonicalJsonDigestSteps.js +155 -0
  719. package/dist/domain/canonicalOrdering.js +3 -0
  720. package/dist/domain/changedBehavior.js +282 -0
  721. package/dist/domain/compactStringIdentity.js +9 -0
  722. package/dist/domain/comparisonSemantics.js +12 -0
  723. package/dist/domain/comparisonSourceEvidence.js +40 -0
  724. package/dist/domain/comparisonStatus.js +11 -0
  725. package/dist/domain/completionLedgerGeneration.js +186 -0
  726. package/dist/domain/configurationErrors.js +37 -0
  727. package/dist/domain/conformancePackage.js +200 -0
  728. package/dist/domain/conformanceReplay.js +132 -0
  729. package/dist/domain/conformanceTrustGate.js +319 -0
  730. package/dist/domain/digests.js +27 -0
  731. package/dist/domain/dosCom.js +8 -0
  732. package/dist/domain/dosMz.js +83 -0
  733. package/dist/domain/emptyArraySchema.js +3 -0
  734. package/dist/domain/evidence.js +305 -0
  735. package/dist/domain/evidenceBundle.js +413 -0
  736. package/dist/domain/evidenceCompletionLedger.js +113 -0
  737. package/dist/domain/evidenceErrors.js +46 -0
  738. package/dist/domain/evidenceRecordSummary.js +144 -0
  739. package/dist/domain/evm/evmInterface.js +61 -0
  740. package/dist/domain/explicitSensitiveFailure.js +108 -0
  741. package/dist/domain/explicitSensitiveValues.js +10 -0
  742. package/dist/domain/firmware/firmwareAnalysis.js +128 -0
  743. package/dist/domain/functionComparison.js +38 -0
  744. package/dist/domain/functionComparisonDimensions.js +199 -0
  745. package/dist/domain/functionComparisonNormalization.js +150 -0
  746. package/dist/domain/functionComparisonResults.js +54 -0
  747. package/dist/domain/functionComparisonSchemas.js +88 -0
  748. package/dist/domain/functionDossierEvidence.js +20 -0
  749. package/dist/domain/go/goBinary.js +96 -0
  750. package/dist/domain/harmony/harmonyApplication.js +169 -0
  751. package/dist/domain/hopperErrors.js +98 -0
  752. package/dist/domain/hopperStartupFailure.js +64 -0
  753. package/dist/domain/hopperValues.js +368 -0
  754. package/dist/domain/immutableJson.js +114 -0
  755. package/dist/domain/inputIssueProjection.js +94 -0
  756. package/dist/domain/javascript/electronActiveObservation.js +237 -0
  757. package/dist/domain/javascript/electronObservation.js +122 -0
  758. package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
  759. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
  760. package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
  761. package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
  762. package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
  763. package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
  764. package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
  765. package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
  766. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
  767. package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
  768. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
  769. package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
  770. package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
  771. package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
  772. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
  773. package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
  774. package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
  775. package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
  776. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
  777. package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
  778. package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
  779. package/dist/domain/javascript/javascriptAstValues.js +99 -0
  780. package/dist/domain/javascript/javascriptBootstrap.js +94 -0
  781. package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
  782. package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
  783. package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
  784. package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
  785. package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
  786. package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
  787. package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
  788. package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
  789. package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
  790. package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
  791. package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
  792. package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
  793. package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
  794. package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
  795. package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
  796. package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
  797. package/dist/domain/javascript/javascriptRecovery.js +90 -0
  798. package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
  799. package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
  800. package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
  801. package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
  802. package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
  803. package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
  804. package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
  805. package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
  806. package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
  807. package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
  808. package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
  809. package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
  810. package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
  811. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
  812. package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
  813. package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
  814. package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
  815. package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
  816. package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
  817. package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
  818. package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
  819. package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
  820. package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
  821. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
  822. package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
  823. package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
  824. package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
  825. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
  826. package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
  827. package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
  828. package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
  829. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
  830. package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
  831. package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
  832. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
  833. package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
  834. package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
  835. package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
  836. package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
  837. package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
  838. package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
  839. package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
  840. package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
  841. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
  842. package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
  843. package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
  844. package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
  845. package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
  846. package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
  847. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
  848. package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
  849. package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
  850. package/dist/domain/javascript/javascriptSemanticState.js +116 -0
  851. package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
  852. package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
  853. package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
  854. package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
  855. package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
  856. package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
  857. package/dist/domain/javascript/javascriptSourceParser.js +50 -0
  858. package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
  859. package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
  860. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
  861. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
  862. package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
  863. package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
  864. package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
  865. package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
  866. package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
  867. package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
  868. package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
  869. package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
  870. package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
  871. package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
  872. package/dist/domain/jeb/jebAnalysis.js +114 -0
  873. package/dist/domain/jsonSerialization.js +163 -0
  874. package/dist/domain/jsonShape.js +141 -0
  875. package/dist/domain/jsonValue.js +96 -0
  876. package/dist/domain/localPath.js +24 -0
  877. package/dist/domain/managed/managedApplicationGraph.js +221 -0
  878. package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
  879. package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
  880. package/dist/domain/managed/managedArtifact.js +465 -0
  881. package/dist/domain/managed/managedInspectionEvidence.js +28 -0
  882. package/dist/domain/managed/managedMemberComparison.js +211 -0
  883. package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
  884. package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
  885. package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
  886. package/dist/domain/managed/managedNativeVerification.js +35 -0
  887. package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
  888. package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
  889. package/dist/domain/managed/managedReconstruction.js +190 -0
  890. package/dist/domain/mobileApplicationGraphProjection.js +61 -0
  891. package/dist/domain/native/binaryLayout.js +354 -0
  892. package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
  893. package/dist/domain/native/nativeAotPe.js +1408 -0
  894. package/dist/domain/native/nativeApiBoundary.js +140 -0
  895. package/dist/domain/native/nativeCallObservation.js +186 -0
  896. package/dist/domain/native/nativeCallPartialObservation.js +33 -0
  897. package/dist/domain/native/nativeDataType.js +53 -0
  898. package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
  899. package/dist/domain/native/nativeInspection.js +174 -0
  900. package/dist/domain/native/nativeInstruction.js +125 -0
  901. package/dist/domain/native/nativeInvestigationGraph.js +364 -0
  902. package/dist/domain/native/nativeLoadImage.js +112 -0
  903. package/dist/domain/native/nativeMetadataRecovery.js +128 -0
  904. package/dist/domain/native/nativeUiObservation.js +137 -0
  905. package/dist/domain/native/nativeValueFlow.js +72 -0
  906. package/dist/domain/native/nativeValueTrace.js +64 -0
  907. package/dist/domain/native/objcSwiftMetadata.js +419 -0
  908. package/dist/domain/native/peResources.js +100 -0
  909. package/dist/domain/native/recordedCrash.js +263 -0
  910. package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
  911. package/dist/domain/nativeConvention.js +33 -0
  912. package/dist/domain/offsetDateTime.js +17 -0
  913. package/dist/domain/peMachine.js +36 -0
  914. package/dist/domain/process/processCapture.js +412 -0
  915. package/dist/domain/process/processCaptureCoverage.js +70 -0
  916. package/dist/domain/process/processCaptureExample.js +132 -0
  917. package/dist/domain/process/processCaptureParsing.js +21 -0
  918. package/dist/domain/process/processCaptureValidation.js +246 -0
  919. package/dist/domain/process/processComparison.js +315 -0
  920. package/dist/domain/process/processEvidenceProvider.js +11 -0
  921. package/dist/domain/process/processObservation.js +140 -0
  922. package/dist/domain/process/processScenario.js +247 -0
  923. package/dist/domain/process/processTraceComparison.js +34 -0
  924. package/dist/domain/process/processTraceDimensionProjection.js +35 -0
  925. package/dist/domain/process/processTraceEvaluation.js +320 -0
  926. package/dist/domain/process/processTraceSpecification.js +382 -0
  927. package/dist/domain/propertyListKeys.js +107 -0
  928. package/dist/domain/propertyListXmlText.js +19 -0
  929. package/dist/domain/providerAdapterError.js +19 -0
  930. package/dist/domain/providerCleanupError.js +18 -0
  931. package/dist/domain/providerConfigurationRefusal.js +12 -0
  932. package/dist/domain/providerOperationHealth.js +54 -0
  933. package/dist/domain/providerSelectionError.js +46 -0
  934. package/dist/domain/rawBinary.js +93 -0
  935. package/dist/domain/reconstructionCoverage.js +325 -0
  936. package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
  937. package/dist/domain/reconstructionCoverageInput.js +7 -0
  938. package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
  939. package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
  940. package/dist/domain/reconstructionReadiness.js +116 -0
  941. package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
  942. package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
  943. package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
  944. package/dist/domain/reconstructionReadinessSchemas.js +268 -0
  945. package/dist/domain/reconstructionUnknowns.js +91 -0
  946. package/dist/domain/reconstructionVerification.js +218 -0
  947. package/dist/domain/reconstructionVerificationSchemas.js +141 -0
  948. package/dist/domain/recordedTransportUrl.js +51 -0
  949. package/dist/domain/referenceSourceClassification.js +385 -0
  950. package/dist/domain/referenceSourceGraph.js +380 -0
  951. package/dist/domain/referenceSourceImportParsing.js +238 -0
  952. package/dist/domain/referenceSourcePathIdentity.js +22 -0
  953. package/dist/domain/referenceSourcePolicy.js +1 -0
  954. package/dist/domain/referenceSourceRequireBindings.js +137 -0
  955. package/dist/domain/relationshipCoverage.js +20 -0
  956. package/dist/domain/residualUnknown.js +252 -0
  957. package/dist/domain/result.js +4 -0
  958. package/dist/domain/runtimeVersion.js +15 -0
  959. package/dist/domain/safeJson.js +13 -0
  960. package/dist/domain/sourceMapContents.js +6 -0
  961. package/dist/domain/sourceMapEnvelope.js +44 -0
  962. package/dist/domain/staticRuntimeCorrelation.js +334 -0
  963. package/dist/domain/stringPatterns.js +6 -0
  964. package/dist/domain/swiftSymbolClassification.js +66 -0
  965. package/dist/domain/symbolAnalysis.js +122 -0
  966. package/dist/domain/unicodeCodePointOrder.js +23 -0
  967. package/dist/domain/unknownRegistryError.js +10 -0
  968. package/dist/domain/wasm/wasmArtifact.js +105 -0
  969. package/dist/domain/webBundleAnalysis.js +192 -0
  970. package/dist/domain/webBundleAnalyzer.js +15 -0
  971. package/dist/domain/webBundleAnalyzerAst.js +49 -0
  972. package/dist/domain/webBundleAnalyzerInspection.js +315 -0
  973. package/dist/domain/webBundleAnalyzerResult.js +142 -0
  974. package/dist/domain/webCaptureDiff.js +423 -0
  975. package/dist/domain/webCaptureDiffSchemas.js +84 -0
  976. package/dist/domain/webContentArtifact.js +38 -0
  977. package/dist/domain/webEventListeners.js +29 -0
  978. package/dist/domain/webExecution.js +75 -0
  979. package/dist/domain/webInventory.js +62 -0
  980. package/dist/domain/webMcpDiscovery.js +53 -0
  981. package/dist/domain/webModuleImports.js +99 -0
  982. package/dist/domain/webModuleTrace.js +101 -0
  983. package/dist/domain/webNetworkCapture.js +142 -0
  984. package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
  985. package/dist/domain/webRuntime.js +80 -0
  986. package/dist/domain/webScreenshot.js +132 -0
  987. package/dist/domain/webScriptArtifacts.js +37 -0
  988. package/dist/domain/webScriptExport.js +84 -0
  989. package/dist/domain/webScriptExportError.js +19 -0
  990. package/dist/domain/webScriptExportPlan.js +104 -0
  991. package/dist/domain/webSourceLocation.js +118 -0
  992. package/dist/domain/webSourcePosition.js +21 -0
  993. package/dist/domain/zipPackageFormat.js +52 -0
  994. package/dist/domain/zodCollectionSteps.js +24 -0
  995. package/dist/dotnet/ManagedArtifactInspector.js +308 -0
  996. package/dist/dotnet/ManagedDecodeBudget.js +138 -0
  997. package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
  998. package/dist/dotnet/ManagedMemberInspector.js +173 -0
  999. package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
  1000. package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
  1001. package/dist/dotnet/ManagedMemberOwnership.js +71 -0
  1002. package/dist/dotnet/ManagedMemberPointers.js +62 -0
  1003. package/dist/dotnet/ManagedMemberRows.js +227 -0
  1004. package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
  1005. package/dist/dotnet/ManagedMetadataInventory.js +99 -0
  1006. package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
  1007. package/dist/dotnet/ManagedMetadataLayout.js +270 -0
  1008. package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
  1009. package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
  1010. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
  1011. package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
  1012. package/dist/dotnet/ManagedPeReader.js +233 -0
  1013. package/dist/dotnet/ManagedReaderFailure.js +27 -0
  1014. package/dist/dotnet/ManagedSnapshot.js +88 -0
  1015. package/dist/dotnet/ManagedStaticProvider.js +158 -0
  1016. package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
  1017. package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
  1018. package/dist/evaluation/AgentEvaluationReport.js +32 -0
  1019. package/dist/evaluation/CodexAgentEval.js +188 -0
  1020. package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
  1021. package/dist/evm/EvmBytecodeCarrier.js +21 -0
  1022. package/dist/evm/EvmWorkerLimits.js +40 -0
  1023. package/dist/evm/EvmoleFailures.js +124 -0
  1024. package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
  1025. package/dist/evm/EvmoleInterfaceProvider.js +339 -0
  1026. package/dist/evm/EvmoleInterfaceWorker.js +87 -0
  1027. package/dist/evm/EvmoleRelease.js +16 -0
  1028. package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
  1029. package/dist/filesystem/OwnedFileHandle.js +36 -0
  1030. package/dist/filesystem/OwnedStagedOutput.js +138 -0
  1031. package/dist/filesystem/RegularFile.js +73 -0
  1032. package/dist/filesystem/StableFileHash.js +46 -0
  1033. package/dist/filesystem/readFileHandleChunks.js +35 -0
  1034. package/dist/firmware/FirmwareCommand.js +190 -0
  1035. package/dist/firmware/FirmwareFiles.js +206 -0
  1036. package/dist/firmware/FirmwareProvider.js +388 -0
  1037. package/dist/firmware/FirmwarePublication.js +105 -0
  1038. package/dist/firmware/FirmwareRelease.js +33 -0
  1039. package/dist/firmware/FirmwareReports.js +287 -0
  1040. package/dist/firmware/FirmwareVersion.js +80 -0
  1041. package/dist/generatedPackageMetadata.js +9 -0
  1042. package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
  1043. package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
  1044. package/dist/ghidra/GhidraClient.js +725 -0
  1045. package/dist/ghidra/GhidraClientStartup.js +27 -0
  1046. package/dist/ghidra/GhidraClientTypes.js +1 -0
  1047. package/dist/ghidra/GhidraClientWire.js +38 -0
  1048. package/dist/ghidra/GhidraDiagnostics.js +53 -0
  1049. package/dist/ghidra/GhidraDoctor.js +88 -0
  1050. package/dist/ghidra/GhidraFunctionValues.js +328 -0
  1051. package/dist/ghidra/GhidraInstallation.js +443 -0
  1052. package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
  1053. package/dist/ghidra/GhidraInventoryValues.js +262 -0
  1054. package/dist/ghidra/GhidraJavaLaunch.js +66 -0
  1055. package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
  1056. package/dist/ghidra/GhidraLauncher.js +490 -0
  1057. package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
  1058. package/dist/ghidra/GhidraLoadImageValues.js +260 -0
  1059. package/dist/ghidra/GhidraMipsProfile.js +187 -0
  1060. package/dist/ghidra/GhidraProvider.js +250 -0
  1061. package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
  1062. package/dist/ghidra/GhidraProviderClient.js +613 -0
  1063. package/dist/ghidra/GhidraPspExtension.js +144 -0
  1064. package/dist/ghidra/GhidraPspProfile.js +50 -0
  1065. package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
  1066. package/dist/ghidra/GhidraRequestQueue.js +115 -0
  1067. package/dist/ghidra/GhidraResponseBuffer.js +31 -0
  1068. package/dist/ghidra/GhidraResponseRouter.js +24 -0
  1069. package/dist/ghidra/GhidraSessionError.js +180 -0
  1070. package/dist/ghidra/GhidraSessionRoot.js +39 -0
  1071. package/dist/ghidra/GhidraSessionValues.js +86 -0
  1072. package/dist/ghidra/GhidraSocketConnection.js +83 -0
  1073. package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
  1074. package/dist/ghidra/GhidraTransport.js +101 -0
  1075. package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
  1076. package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
  1077. package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
  1078. package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
  1079. package/dist/ghidra/protocol.js +46 -0
  1080. package/dist/go/GoBinaryContainer.js +125 -0
  1081. package/dist/go/GoBinaryImage.js +172 -0
  1082. package/dist/go/GoBinaryProvider.js +137 -0
  1083. package/dist/go/GoElfImage.js +149 -0
  1084. package/dist/go/GoMachoImage.js +113 -0
  1085. package/dist/go/GoModuleText.js +217 -0
  1086. package/dist/go/GoPeImage.js +102 -0
  1087. package/dist/hopper/BridgeLauncher.js +305 -0
  1088. package/dist/hopper/HopperAnalysisProfile.js +168 -0
  1089. package/dist/hopper/HopperCleanup.js +245 -0
  1090. package/dist/hopper/HopperClient.js +767 -0
  1091. package/dist/hopper/HopperDiagnostics.js +14 -0
  1092. package/dist/hopper/HopperFileOffset.js +237 -0
  1093. package/dist/hopper/HopperMachOImage.js +200 -0
  1094. package/dist/hopper/HopperOperationStage.js +6 -0
  1095. package/dist/hopper/HopperProcessDiagnostic.js +26 -0
  1096. package/dist/hopper/HopperProvider.js +269 -0
  1097. package/dist/hopper/HopperProviderCapabilities.js +91 -0
  1098. package/dist/hopper/HopperRegexSearch.js +134 -0
  1099. package/dist/hopper/HopperRegexWorker.js +27 -0
  1100. package/dist/hopper/HopperRequestQueue.js +261 -0
  1101. package/dist/hopper/HopperResponseStream.js +44 -0
  1102. package/dist/hopper/HopperSessionValues.js +30 -0
  1103. package/dist/hopper/HopperSocketConnection.js +31 -0
  1104. package/dist/hopper/HopperTargetLease.js +233 -0
  1105. package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
  1106. package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
  1107. package/dist/hopper/protocol.js +88 -0
  1108. package/dist/ida/IdaBusyHealth.js +44 -0
  1109. package/dist/ida/IdaCallGraph.js +134 -0
  1110. package/dist/ida/IdaConfiguration.js +61 -0
  1111. package/dist/ida/IdaDoctor.js +53 -0
  1112. package/dist/ida/IdaInput.js +56 -0
  1113. package/dist/ida/IdaMcpConnection.js +115 -0
  1114. package/dist/ida/IdaOperationRunner.js +376 -0
  1115. package/dist/ida/IdaProtocolValues.js +208 -0
  1116. package/dist/ida/IdaProvider.js +136 -0
  1117. package/dist/ida/IdaProviderCapabilities.js +64 -0
  1118. package/dist/ida/IdaSessionClient.js +444 -0
  1119. package/dist/ida/IdaWorkspace.js +55 -0
  1120. package/dist/identity.js +25 -0
  1121. package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
  1122. package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
  1123. package/dist/inspector/V8InspectorEndpoint.js +70 -0
  1124. package/dist/inspector/V8InspectorProvider.js +378 -0
  1125. package/dist/inspector/providerIdentity.js +6 -0
  1126. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
  1127. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
  1128. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
  1129. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
  1130. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
  1131. package/dist/javascript/recovery/RecoveryFiles.js +175 -0
  1132. package/dist/javascript/recovery/WakaruCommand.js +137 -0
  1133. package/dist/javascript/recovery/WakaruExecution.js +115 -0
  1134. package/dist/javascript/recovery/WakaruProvider.js +218 -0
  1135. package/dist/javascript/recovery/WakaruPublication.js +126 -0
  1136. package/dist/javascript/recovery/WakaruRelease.js +36 -0
  1137. package/dist/javascript/recovery/WakaruReport.js +140 -0
  1138. package/dist/javascript/recovery/WakaruVersion.js +24 -0
  1139. package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
  1140. package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
  1141. package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
  1142. package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
  1143. package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
  1144. package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
  1145. package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
  1146. package/dist/jeb/JebMcpConnection.js +186 -0
  1147. package/dist/jeb/JebMcpEndpoint.js +40 -0
  1148. package/dist/jeb/JebProvider.js +297 -0
  1149. package/dist/logger.js +14 -0
  1150. package/dist/main/messages.js +4 -0
  1151. package/dist/main/shutdown.js +102 -0
  1152. package/dist/main/startup.js +21 -0
  1153. package/dist/main/transport.js +72 -0
  1154. package/dist/main/types.js +1 -0
  1155. package/dist/main.js +92 -0
  1156. package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
  1157. package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
  1158. package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
  1159. package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
  1160. package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
  1161. package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
  1162. package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
  1163. package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
  1164. package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
  1165. package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
  1166. package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
  1167. package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
  1168. package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
  1169. package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
  1170. package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
  1171. package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
  1172. package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
  1173. package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
  1174. package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
  1175. package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
  1176. package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
  1177. package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
  1178. package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
  1179. package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
  1180. package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
  1181. package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
  1182. package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
  1183. package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
  1184. package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
  1185. package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
  1186. package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
  1187. package/dist/mcp/digests-Dugt3H71.js +199 -0
  1188. package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
  1189. package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
  1190. package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
  1191. package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
  1192. package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
  1193. package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
  1194. package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
  1195. package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
  1196. package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
  1197. package/dist/mcp/lipo-Do-2eBrl.js +465 -0
  1198. package/dist/mcp/localPath-AxvW9aPe.js +19 -0
  1199. package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
  1200. package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
  1201. package/dist/mcp/main-WQSCuTNt.js +52791 -0
  1202. package/dist/mcp/main.js +6 -0
  1203. package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
  1204. package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
  1205. package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
  1206. package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
  1207. package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
  1208. package/dist/mcp/providerIdentities--ptAh481.js +31 -0
  1209. package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
  1210. package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
  1211. package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
  1212. package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
  1213. package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
  1214. package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
  1215. package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
  1216. package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
  1217. package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
  1218. package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
  1219. package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
  1220. package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
  1221. package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
  1222. package/dist/mcpDoctor.js +360 -0
  1223. package/dist/mcpStartupPolicy.js +14 -0
  1224. package/dist/native/AppleDispatchCoverage.js +112 -0
  1225. package/dist/native/AppleDispatchDecodeFacts.js +6 -0
  1226. package/dist/native/AppleDispatchMetadata.js +176 -0
  1227. package/dist/native/AppleMachoFixups.js +372 -0
  1228. package/dist/native/AppleMachoSelection.js +234 -0
  1229. package/dist/native/AppleObjcCategories.js +63 -0
  1230. package/dist/native/AppleObjcDispatchFacets.js +260 -0
  1231. package/dist/native/AppleObjcProperties.js +79 -0
  1232. package/dist/native/AppleObjcProtocols.js +89 -0
  1233. package/dist/native/AppleSwiftDispatchFacets.js +156 -0
  1234. package/dist/native/AppleSwiftVtables.js +92 -0
  1235. package/dist/native/CommandRunner.js +240 -0
  1236. package/dist/native/LldbCallTracer.js +713 -0
  1237. package/dist/native/LldbRetainedObservations.js +178 -0
  1238. package/dist/native/NativeCallObservation.js +195 -0
  1239. package/dist/native/NativeMacOSProvider.js +701 -0
  1240. package/dist/native/NativeMacOSProviderMetadata.js +46 -0
  1241. package/dist/native/NativeMachoInspection.js +273 -0
  1242. package/dist/native/NativeUiHelperRuntime.js +66 -0
  1243. package/dist/native/NativeUiObservation.js +183 -0
  1244. package/dist/native/NativeUiOutputBudget.js +8 -0
  1245. package/dist/native/SignatureTargetBinding.js +155 -0
  1246. package/dist/native/parsers/codesign.js +93 -0
  1247. package/dist/native/parsers/demangle.js +30 -0
  1248. package/dist/native/parsers/dyldInfo.js +60 -0
  1249. package/dist/native/parsers/echoedPath.js +14 -0
  1250. package/dist/native/parsers/lipo.js +177 -0
  1251. package/dist/native/parsers/machoUuid.js +150 -0
  1252. package/dist/native/parsers/otool.js +379 -0
  1253. package/dist/native/parsers/plist.js +187 -0
  1254. package/dist/native/pe/PeResourceLayout.js +120 -0
  1255. package/dist/native/pe/PeResourceParser.js +286 -0
  1256. package/dist/native/pe/PeResourcesProvider.js +63 -0
  1257. package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
  1258. package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
  1259. package/dist/native/pwntools/PwntoolsFailures.js +180 -0
  1260. package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
  1261. package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
  1262. package/dist/native/pwntools/PwntoolsRelease.js +19 -0
  1263. package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
  1264. package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
  1265. package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
  1266. package/dist/process/BoundedFileBytes.js +40 -0
  1267. package/dist/process/DarwinProcessRunTokenReader.js +376 -0
  1268. package/dist/process/ExecFileOutput.js +124 -0
  1269. package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
  1270. package/dist/process/OwnedCommand.js +131 -0
  1271. package/dist/process/PendingOperations.js +61 -0
  1272. package/dist/process/PrivateRuntimeRoot.js +61 -0
  1273. package/dist/process/ProcessCommandIdentity.js +19 -0
  1274. package/dist/process/ProcessOwnership.js +636 -0
  1275. package/dist/process/ProcessOwnershipIdentity.js +13 -0
  1276. package/dist/process/ProcessOwnershipObservation.js +407 -0
  1277. package/dist/process/ProcessOwnershipProcessTree.js +35 -0
  1278. package/dist/process/ProcessRunTokenObservations.js +48 -0
  1279. package/dist/process/ProviderDeadline.js +91 -0
  1280. package/dist/process/ProviderDiagnosticRedaction.js +17 -0
  1281. package/dist/process/ProviderProcess.js +381 -0
  1282. package/dist/process/ProviderRunLineage.js +21 -0
  1283. package/dist/process/WindowsAuthority.js +51 -0
  1284. package/dist/process/WindowsBatchCommand.js +46 -0
  1285. package/dist/process/boundedUtf8Text.js +13 -0
  1286. package/dist/process/capture/FilesystemSnapshot.js +268 -0
  1287. package/dist/process/capture/ProcessCaptureCapability.js +65 -0
  1288. package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
  1289. package/dist/process/capture/ProcessCaptureError.js +74 -0
  1290. package/dist/process/capture/ProcessCaptureJournal.js +61 -0
  1291. package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
  1292. package/dist/process/capture/ProcessCaptureProgress.js +62 -0
  1293. package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
  1294. package/dist/process/capture/ProcessHarness.js +602 -0
  1295. package/dist/process/capture/ProcessNormalization.js +88 -0
  1296. package/dist/process/capture/ProcessSampling.js +415 -0
  1297. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
  1298. package/dist/process/capture/ProcessTimer.js +39 -0
  1299. package/dist/process/capture/TerminalRenderer.js +124 -0
  1300. package/dist/process/snapshotEnvironment.js +14 -0
  1301. package/dist/reference/ReferenceSourceReader.js +73 -0
  1302. package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
  1303. package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
  1304. package/dist/reference/ReferenceSourceReaderFile.js +147 -0
  1305. package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
  1306. package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
  1307. package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
  1308. package/dist/server/EvidenceMcpServer.js +216 -0
  1309. package/dist/server/admittedToolOperation.js +9 -0
  1310. package/dist/server/analysisAdmission.js +8 -0
  1311. package/dist/server/contractToolHandler.js +21 -0
  1312. package/dist/server/createServer.js +344 -0
  1313. package/dist/server/lifecycleProgress.js +10 -0
  1314. package/dist/server/mcpClientMetadata.js +42 -0
  1315. package/dist/server/mcpProgress.js +26 -0
  1316. package/dist/server/promptCompletion.js +141 -0
  1317. package/dist/server/recordDerivedEvidence.js +10 -0
  1318. package/dist/server/registerAdbTools.js +36 -0
  1319. package/dist/server/registerAnalysisViewTool.js +10 -0
  1320. package/dist/server/registerAndroidTools.js +31 -0
  1321. package/dist/server/registerApktoolTools.js +14 -0
  1322. package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
  1323. package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
  1324. package/dist/server/registerApplicationTools/compareVersions.js +34 -0
  1325. package/dist/server/registerApplicationTools/coverage.js +13 -0
  1326. package/dist/server/registerApplicationTools/helpers.js +37 -0
  1327. package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
  1328. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
  1329. package/dist/server/registerApplicationTools/traceFeature.js +26 -0
  1330. package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
  1331. package/dist/server/registerApplicationTools/types.js +1 -0
  1332. package/dist/server/registerApplicationTools.js +19 -0
  1333. package/dist/server/registerArtifactComparisonTool.js +71 -0
  1334. package/dist/server/registerArtifactTools.js +14 -0
  1335. package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
  1336. package/dist/server/registerBrowserScenarioTool.js +26 -0
  1337. package/dist/server/registerBrowserTools.js +58 -0
  1338. package/dist/server/registerBundleComparisonTool.js +54 -0
  1339. package/dist/server/registerCloseLifecycleTool.js +55 -0
  1340. package/dist/server/registerElectronTools.js +70 -0
  1341. package/dist/server/registerEnhancedTools.js +169 -0
  1342. package/dist/server/registerEvidenceTools.js +68 -0
  1343. package/dist/server/registerEvmTools.js +9 -0
  1344. package/dist/server/registerFirmwareTools.js +11 -0
  1345. package/dist/server/registerFunctionComparisonTool.js +86 -0
  1346. package/dist/server/registerGoTools.js +9 -0
  1347. package/dist/server/registerInvestigationTools/helpers.js +46 -0
  1348. package/dist/server/registerInvestigationTools/types.js +1 -0
  1349. package/dist/server/registerInvestigationTools.js +168 -0
  1350. package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
  1351. package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
  1352. package/dist/server/registerJebTools.js +16 -0
  1353. package/dist/server/registerManagedTools.js +40 -0
  1354. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
  1355. package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
  1356. package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
  1357. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
  1358. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
  1359. package/dist/server/registerManagedWorkflowTools/types.js +1 -0
  1360. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
  1361. package/dist/server/registerManagedWorkflowTools.js +11 -0
  1362. package/dist/server/registerOfficialTools.js +74 -0
  1363. package/dist/server/registerPeResourcesTool.js +9 -0
  1364. package/dist/server/registerProcessComparisonTool.js +156 -0
  1365. package/dist/server/registerPrompts.js +73 -0
  1366. package/dist/server/registerRecordedCrashTools.js +9 -0
  1367. package/dist/server/registerSessionRecordTools.js +90 -0
  1368. package/dist/server/registerSessionStatusTool.js +61 -0
  1369. package/dist/server/registerSessionTools.js +217 -0
  1370. package/dist/server/registerWasmTools.js +9 -0
  1371. package/dist/server/registerWebModuleTool.js +9 -0
  1372. package/dist/server/registerWebNetworkCaptureTool.js +20 -0
  1373. package/dist/server/registerWebRuntimeTools.js +27 -0
  1374. package/dist/server/registerWebScriptTool.js +18 -0
  1375. package/dist/server/registerWebSourceLocationTool.js +9 -0
  1376. package/dist/server/runDerivedOperation.js +55 -0
  1377. package/dist/server/sessionAvailabilityPolicy.js +29 -0
  1378. package/dist/server/sessionEvidence.js +11 -0
  1379. package/dist/server/toolLogging.js +11 -0
  1380. package/dist/server/toolRegistrationOptions.js +9 -0
  1381. package/dist/server/toolResult.js +119 -0
  1382. package/dist/server/toolResultEncoding.js +34 -0
  1383. package/dist/serverIdentity.js +69 -0
  1384. package/dist/wasm/WabtArtifactProvider.js +313 -0
  1385. package/dist/wasm/WabtFailures.js +62 -0
  1386. package/dist/wasm/WabtOutput.js +60 -0
  1387. package/dist/wasm/WabtRelease.js +12 -0
  1388. package/dist/wasm/WabtWat.js +184 -0
  1389. package/dist/wasm/WasmGlueAdapter.js +51 -0
  1390. package/dist/windows/WindowsNativeLoader.js +124 -0
  1391. package/dist/windows/WindowsOwnedProcess.js +265 -0
  1392. package/dist/windows/WindowsPrivateRuntime.js +143 -0
  1393. package/hooks/hooks.json +17 -0
  1394. package/install.sh +172 -0
  1395. package/licenses/Apache-2.0.txt +202 -0
  1396. package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
  1397. package/licenses/GPL-3.0.txt +674 -0
  1398. package/licenses/MIT-template.txt +18 -0
  1399. package/licenses/MinGW-w64-runtime.txt +240 -0
  1400. package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
  1401. package/licenses/README.md +54 -0
  1402. package/licenses/cfworker-MIT.txt +21 -0
  1403. package/licenses/digfox-MIT.txt +21 -0
  1404. package/licenses/dotnet-runtime-MIT.txt +23 -0
  1405. package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
  1406. package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
  1407. package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
  1408. package/licenses/nativeaot-parser-MIT.txt +28 -0
  1409. package/licenses/npm-dependencies.txt +2812 -0
  1410. package/licenses/npm-runtime-notices.txt +6632 -0
  1411. package/licenses/rea-jev-MIT.txt +21 -0
  1412. package/licenses/rea-lab-MIT.txt +21 -0
  1413. package/licenses/upstream-sources.json +62 -0
  1414. package/licenses/xterm-MIT.txt +21 -0
  1415. package/native/windows/README.md +156 -0
  1416. package/native/windows/build/manifest.json +9 -0
  1417. package/native/windows/build/rea-windows-x64.node +0 -0
  1418. package/package.json +371 -4
  1419. package/port/cli.mjs +210 -0
  1420. package/port/hooks/guard.mjs +140 -0
  1421. package/port/knowledge/engines.json +67 -0
  1422. package/port/knowledge/footprints.json +189 -0
  1423. package/port/knowledge/maps/godot-godot-csharp.json +38 -0
  1424. package/port/knowledge/maps/godot-threejs.json +42 -0
  1425. package/port/knowledge/maps/godot-unity.json +62 -0
  1426. package/port/knowledge/maps/godot-unreal.json +48 -0
  1427. package/port/knowledge/maps/unity-godot.json +52 -0
  1428. package/port/knowledge/maps/unity-unreal.json +33 -0
  1429. package/port/knowledge/systems.json +1554 -0
  1430. package/port/mcp.mjs +62 -0
  1431. package/port/plugin/mcp-launch.mjs +19 -0
  1432. package/port/server.mjs +129 -0
  1433. package/port/src/agent.mjs +257 -0
  1434. package/port/src/archive.mjs +324 -0
  1435. package/port/src/binary.mjs +606 -0
  1436. package/port/src/blueprint.mjs +225 -0
  1437. package/port/src/compare.mjs +165 -0
  1438. package/port/src/connect.mjs +58 -0
  1439. package/port/src/convert.mjs +134 -0
  1440. package/port/src/formats.mjs +229 -0
  1441. package/port/src/graph.mjs +275 -0
  1442. package/port/src/knowledge.mjs +90 -0
  1443. package/port/src/lookup.mjs +615 -0
  1444. package/port/src/main-module.mjs +10 -0
  1445. package/port/src/plan.mjs +606 -0
  1446. package/port/src/porters.mjs +360 -0
  1447. package/port/src/proofcase.mjs +343 -0
  1448. package/port/src/relay.mjs +493 -0
  1449. package/port/src/scan.mjs +189 -0
  1450. package/port/src/scene.mjs +338 -0
  1451. package/port/src/stashpad.mjs +114 -0
  1452. package/port/src/symbols.mjs +201 -0
  1453. package/port/src/tools.mjs +198 -0
  1454. package/port/src/util.mjs +162 -0
  1455. package/port/src/workspace.mjs +39 -0
  1456. package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
  1457. package/scripts/electron-active-hook-boundaries.cjs +392 -0
  1458. package/scripts/electron-active-hook.cjs +673 -0
  1459. package/scripts/hopper-demo-x11.py +787 -0
  1460. package/scripts/prepack.mjs +60 -0
  1461. package/scripts/prepare.mjs +28 -0
  1462. package/scripts/rea.mjs +110 -0
  1463. package/scripts/verify-windows-native-artifact.mjs +39 -0
  1464. package/skills/build-inspector/SKILL.md +44 -0
  1465. package/skills/godot-port/SKILL.md +42 -0
  1466. package/skills/port-project/SKILL.md +59 -0
  1467. package/skills/port-verify/SKILL.md +35 -0
  1468. package/skills/proof-case/SKILL.md +52 -0
  1469. package/skills/rebuild/SKILL.md +66 -0
  1470. package/skills/reverse-engineer/SKILL.md +67 -0
  1471. package/skills/reverse-engineer-anything/SKILL.md +204 -0
  1472. package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
  1473. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
  1474. package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
  1475. package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
  1476. package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
  1477. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
  1478. package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
  1479. package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
  1480. package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
  1481. package/skills/troubleshoot/SKILL.md +27 -0
  1482. package/skills/unity-to-godot/SKILL.md +37 -0
  1483. package/third_party/README.md +60 -0
  1484. package/third_party/evmole/LICENSE +21 -0
  1485. package/third_party/evmole/README.md +22 -0
  1486. package/third_party/pwndbg/LICENSE.md +21 -0
  1487. package/third_party/pwndbg/README.md +23 -0
  1488. package/third_party/pwntools/README.md +40 -0
  1489. package/third_party/wabt/README.md +24 -0
@@ -0,0 +1,4460 @@
1
+ import { n as __exportAll, t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
2
+ import { c as AnalysisResourceConstraintError, d as init_analysisErrorCore, f as err, g as init_analysisErrorBase, h as AnalysisError, i as AnalysisCapabilityUnavailableError, m as ok, p as init_result, r as AnalysisCancelledError } from "./analysisErrorCore-BqyeMw3_.js";
3
+ import { d as init_evidenceErrors, l as EvidenceIntegrityError } from "./analysisErrorProjection-B7pHef2y.js";
4
+ import { At as managedMemberInspectionSchema, Ot as init_managedArtifact, jt as managedNativeBoundaryInspectionSchema, kt as managedArtifactInspectionSchema } from "./toolOutputSchemaGroups-ChxVLGoy.js";
5
+ import { i as init_AnalysisProvider, n as init_providerCleanupError, r as createAnalysisExecution, t as ProviderCleanupError } from "./providerCleanupError-DvE79aUX.js";
6
+ import { n as init_providerAdapterError, t as ProviderAdapterError } from "./providerAdapterError-CdPaQ6-Z.js";
7
+ import { i as init_analysisErrorCleanup, n as readBoundedFileBytes, r as analysisErrorWithCleanupFailure, t as init_BoundedFileBytes } from "./BoundedFileBytes-CJPW_TzE.js";
8
+ import { O as init_InvestigationProviders, x as MANAGED_STATIC_PROVIDER } from "./InterfaceBuilderDecodeBudget-CUrOtfNo.js";
9
+ import { a as init_RegularFileRead, c as withRegularFile, d as decodePeMachine, f as init_peMachine, i as RegularFileCleanupFailure, n as init_BinaryTargetResolver, t as classifyBinaryTargetFilesystemFailure } from "./BinaryTargetResolver-DbiUzRLh.js";
10
+ import { c as RegularFileChangedError, l as init_RegularFile } from "./propertyListKeys-cX-BUv2y.js";
11
+ import { a as managedTargetInputSchema, i as managedMembersInputSchema, n as init_managedToolContracts, t as MANAGED_TOOL_CONTRACTS } from "./managedToolContracts-o5LHFwHc.js";
12
+ import { r as init_ArtifactReader, t as ArtifactReaderFailure } from "./ArtifactReader-OyM03Gjn.js";
13
+ import { n as init_ArtifactResourceScope, t as ArtifactResourceScope } from "./ArtifactResourceScope-CBR5q4aK.js";
14
+ import { createHash } from "node:crypto";
15
+
16
+ //#region dist/dotnet/ManagedStaticProviderMetadata.js
17
+ var managedStaticCapabilities, limitationsFor;
18
+ function init_ManagedStaticProviderMetadata() {
19
+ return (init_ManagedStaticProviderMetadata = __esmMin((() => {
20
+ init_InvestigationProviders();
21
+ init_managedToolContracts();
22
+ managedStaticCapabilities = () => Object.freeze(MANAGED_TOOL_CONTRACTS.map((contract) => Object.freeze({
23
+ provider: MANAGED_STATIC_PROVIDER,
24
+ operation: contract.name,
25
+ available: true,
26
+ reason: null,
27
+ effects: Object.freeze({
28
+ mutatesArtifact: false,
29
+ launchesProcess: false,
30
+ mayShowUi: false,
31
+ mayAccessNetwork: false,
32
+ mayWriteFilesystem: false,
33
+ changesPermissions: false,
34
+ requiresRoot: false
35
+ }),
36
+ limitations: limitationsFor(contract.name)
37
+ })));
38
+ limitationsFor = (operation) => Object.freeze(operation === "inspect_managed_artifact" ? ["This capability inventories PE/CLI identity only; inspect_managed_members admits metadata members, signatures, and CIL anchors.", "It never loads the target assembly, resolves dependencies through a CLR, decompiles C#, or executes target code."] : operation === "inspect_managed_native_boundaries" ? ["This capability inventories managed declarations for native boundaries only; native exports, thunks, and addresses require separate native-provider evidence.", "It never loads the target assembly, resolves dependencies through a CLR, decompiles C#, or executes target code."] : ["This capability decodes PE/CLI metadata members, signatures, and file-backed method bodies; decompiled C# reconstruction and cross-build member comparison are separate operations.", "It never loads the target assembly, resolves dependencies through a CLR, decompiles C#, or executes target code."]);
39
+ })))();
40
+ }
41
+
42
+ //#endregion
43
+ //#region dist/dotnet/ManagedReaderFailure.js
44
+ var ManagedReaderFailure, managedFailure, readManagedValue, uniqueManagedParseIssues;
45
+ function init_ManagedReaderFailure() {
46
+ return (init_ManagedReaderFailure = __esmMin((() => {
47
+ ManagedReaderFailure = class extends Error {
48
+ issue;
49
+ constructor(issue, options) {
50
+ super(issue.detail, options);
51
+ this.issue = issue;
52
+ }
53
+ };
54
+ managedFailure = (code, scope, detail, offset = null) => new ManagedReaderFailure({
55
+ code,
56
+ scope,
57
+ offset,
58
+ detail
59
+ });
60
+ readManagedValue = (operation, issues) => {
61
+ try {
62
+ return operation();
63
+ } catch (cause) {
64
+ if (!(cause instanceof ManagedReaderFailure) || cause.issue.code === "resource-limit") throw cause;
65
+ issues.push(cause.issue);
66
+ return undefined;
67
+ }
68
+ };
69
+ uniqueManagedParseIssues = (issues) => [...new Map(issues.map((issue) => [JSON.stringify(issue), issue])).values()];
70
+ })))();
71
+ }
72
+
73
+ //#endregion
74
+ //#region dist/dotnet/ManagedDecodeBudget.js
75
+ var MAX_METADATA_REPRESENTATION_BYTES, ManagedDecodeBudget, budgets, attachManagedDecodeBudget, managedDecodeBudget, managedJsonStringBytes, jsonBytes, admitManagedProjection;
76
+ function init_ManagedDecodeBudget() {
77
+ return (init_ManagedDecodeBudget = __esmMin((() => {
78
+ init_ManagedReaderFailure();
79
+ MAX_METADATA_REPRESENTATION_BYTES = 64 * 1024 * 1024;
80
+ ManagedDecodeBudget = class {
81
+ #remaining = MAX_METADATA_REPRESENTATION_BYTES;
82
+ #transient = 0;
83
+ #rows = new Map();
84
+ #strings = new Map();
85
+ #digests = new WeakMap();
86
+ reserve(bytes, offset) {
87
+ this.#admit(bytes, offset);
88
+ this.#remaining -= bytes;
89
+ }
90
+ /** Retain one bookkeeping reservation per physical row, independently of lookup replay. */
91
+ reserveRow(table, row, offset) {
92
+ let rows = this.#rows.get(table);
93
+ if (rows?.has(row) === true) return;
94
+ this.reserve(256, offset);
95
+ if (rows === undefined) {
96
+ rows = new Set();
97
+ this.#rows.set(table, rows);
98
+ }
99
+ rows.add(row);
100
+ }
101
+ /** Bound a decoding allocation that stays live until `releaseTransient`; only retained output is reserved. */
102
+ admitTransient(bytes, offset) {
103
+ this.#admit(bytes, offset);
104
+ this.#transient += bytes;
105
+ }
106
+ /** End the current item's decoding; its bookkeeping is unreachable and only reserved output remains. */
107
+ releaseTransient() {
108
+ this.#transient = 0;
109
+ }
110
+ #admit(bytes, offset) {
111
+ if (!Number.isSafeInteger(bytes) || bytes < 0 || bytes > this.#remaining - this.#transient) throw managedFailure("resource-limit", "metadata.representation", `Managed metadata exceeds the ${String(MAX_METADATA_REPRESENTATION_BYTES)} byte representation budget`, offset);
112
+ }
113
+ /** UTF-8 cannot decode to more UTF-16 units than bytes; JSON uses at most six bytes per unit. */
114
+ reserveString(encodedBytes, offset) {
115
+ this.reserve(encodedBytes * 6 + 2, offset);
116
+ }
117
+ /** Snapshot buffers are immutable within a layout; cache exact backing-buffer ranges. */
118
+ digest(bytes, algorithm) {
119
+ let ranges = this.#digests.get(bytes.buffer);
120
+ if (ranges === undefined) {
121
+ ranges = new Map();
122
+ this.#digests.set(bytes.buffer, ranges);
123
+ }
124
+ const key = `${algorithm}:${String(bytes.byteOffset)}:${String(bytes.byteLength)}`;
125
+ const cached = ranges.get(key);
126
+ if (cached !== undefined) return cached;
127
+ this.reserve(256, null);
128
+ const digest = createHash(algorithm).update(bytes).digest("hex");
129
+ ranges.set(key, digest);
130
+ return digest;
131
+ }
132
+ cachedString(index) {
133
+ return this.#strings.get(index);
134
+ }
135
+ cacheString(index, value, encodedBytes) {
136
+ this.#strings.set(index, {
137
+ value,
138
+ encodedBytes
139
+ });
140
+ }
141
+ };
142
+ budgets = new WeakMap();
143
+ attachManagedDecodeBudget = (layout, budget) => {
144
+ budgets.set(layout, budget);
145
+ };
146
+ managedDecodeBudget = (layout) => {
147
+ let budget = budgets.get(layout);
148
+ if (budget === undefined) {
149
+ budget = new ManagedDecodeBudget();
150
+ budgets.set(layout, budget);
151
+ }
152
+ return budget;
153
+ };
154
+ managedJsonStringBytes = (value) => {
155
+ let bytes = 2;
156
+ for (let index = 0; index < value.length; index++) {
157
+ const unit = value.charCodeAt(index);
158
+ if (unit === 34 || unit === 92) bytes += 2;
159
+ else if (unit < 32) bytes += [
160
+ 8,
161
+ 9,
162
+ 10,
163
+ 12,
164
+ 13
165
+ ].includes(unit) ? 2 : 6;
166
+ else if (unit < 128) bytes += 1;
167
+ else if (unit < 2048) bytes += 2;
168
+ else if (unit >= 55296 && unit <= 56319) {
169
+ const next = value.charCodeAt(index + 1);
170
+ if (next >= 56320 && next <= 57343) {
171
+ bytes += 4;
172
+ index++;
173
+ } else bytes += 6;
174
+ } else if (unit >= 56320 && unit <= 57343) bytes += 6;
175
+ else bytes += 3;
176
+ }
177
+ return bytes;
178
+ };
179
+ jsonBytes = (item) => typeof item === "string" ? managedJsonStringBytes(item) : Buffer.byteLength(JSON.stringify(item) ?? "null");
180
+ admitManagedProjection = (value, budget = new ManagedDecodeBudget()) => {
181
+ const visit = (item) => {
182
+ if (Array.isArray(item)) {
183
+ budget.reserve(item.length + 2, null);
184
+ for (const child of item) visit(child);
185
+ } else if (item !== null && typeof item === "object") {
186
+ budget.reserve(2, null);
187
+ for (const key of Object.keys(item)) {
188
+ budget.reserve(jsonBytes(key) + 2, null);
189
+ visit(Reflect.get(item, key));
190
+ }
191
+ } else {
192
+ budget.reserve(jsonBytes(item), null);
193
+ }
194
+ };
195
+ visit(value);
196
+ return value;
197
+ };
198
+ })))();
199
+ }
200
+
201
+ //#endregion
202
+ //#region dist/dotnet/ManagedPeReader.js
203
+ var requireRange$2, add, architectureFor, resolveRva, mapRva, readDirectory, readCliHeader, readCoffHeader, readOptionalHeader, readSections, readCliDirectory, readManagedPeLayout;
204
+ function init_ManagedPeReader() {
205
+ return (init_ManagedPeReader = __esmMin((() => {
206
+ init_peMachine();
207
+ init_ManagedReaderFailure();
208
+ requireRange$2 = (bytes, offset, length, scope) => {
209
+ if (!Number.isSafeInteger(offset) || !Number.isSafeInteger(length) || offset < 0 || length < 0 || offset > bytes.length - length) throw managedFailure("invalid-directory", scope, `${scope} leaves the artifact byte range`, Number.isSafeInteger(offset) && offset >= 0 ? offset : null);
210
+ };
211
+ add = (left, right, scope) => {
212
+ const result = left + right;
213
+ if (!Number.isSafeInteger(result) || result < left) throw managedFailure("invalid-directory", scope, `${scope} offset arithmetic overflowed`, left);
214
+ return result;
215
+ };
216
+ architectureFor = (machine, managed) => {
217
+ const decoded = decodePeMachine(machine);
218
+ if (decoded === undefined || decoded.nativeOsOverride && !managed) throw managedFailure("invalid-directory", "pe.machine", `Unsupported PE machine 0x${machine.toString(16).padStart(4, "0")}`);
219
+ return decoded.architecture;
220
+ };
221
+ resolveRva = (mapping) => {
222
+ const { bytes, sections, rva, size, scope } = mapping;
223
+ if (!Number.isSafeInteger(rva) || !Number.isSafeInteger(size) || rva < 0 || size < 0 || rva > 4294967295 || size > 0 && size > 4294967296 - rva) throw managedFailure("invalid-directory", scope, `${scope} has an invalid RVA range`);
224
+ const selected = sections.find((section) => {
225
+ const within = rva - section.virtualAddress;
226
+ return section.virtualSize > 0 && within >= 0 && within < section.virtualSize && size <= section.virtualSize - within;
227
+ });
228
+ if (selected === undefined) throw managedFailure("invalid-directory", scope, `${scope} RVA is not covered by one PE section`);
229
+ for (const section of sections) {
230
+ if (section === selected || section.virtualSize === 0) continue;
231
+ const end = section.virtualAddress + section.virtualSize;
232
+ const intersects = size === 0 ? rva >= section.virtualAddress && rva < end : rva < end && rva + size > section.virtualAddress;
233
+ if (intersects) throw managedFailure("invalid-directory", scope, `${scope} RVA range has ambiguous overlapping PE section mappings`);
234
+ }
235
+ const within = rva - selected.virtualAddress;
236
+ if (within > selected.rawSize || size > selected.rawSize - within) throw managedFailure("invalid-directory", scope, `${scope} occupies virtual bytes without file-backed data`);
237
+ const offset = add(selected.rawOffset, within, scope);
238
+ requireRange$2(bytes, offset, size, scope);
239
+ let available = Math.min(selected.virtualSize - within, selected.rawSize - within, bytes.length - offset, 4294967296 - rva);
240
+ for (const section of sections) if (section !== selected && section.virtualAddress > rva && section.virtualSize > 0) available = Math.min(available, section.virtualAddress - rva);
241
+ return {
242
+ offset,
243
+ available
244
+ };
245
+ };
246
+ mapRva = (mapping) => mapping.rva === 0 && mapping.size === 0 ? 0 : resolveRva(mapping).offset;
247
+ readDirectory = (bytes, offset) => {
248
+ requireRange$2(bytes, offset, 8, "pe.data-directory");
249
+ return {
250
+ rva: bytes.readUInt32LE(offset),
251
+ size: bytes.readUInt32LE(offset + 4)
252
+ };
253
+ };
254
+ readCliHeader = (bytes, sections, directory) => {
255
+ if (directory.size < 72) throw managedFailure("invalid-cli-header", "cli.header", "CLI header is shorter than the required 72 bytes");
256
+ const offset = mapRva({
257
+ bytes,
258
+ sections,
259
+ rva: directory.rva,
260
+ size: 72,
261
+ scope: "cli.header"
262
+ });
263
+ const headerSize = bytes.readUInt32LE(offset);
264
+ if (headerSize < 72 || headerSize > directory.size) throw managedFailure("invalid-cli-header", "cli.header", "CLI header size is outside its PE data directory", offset);
265
+ const metadata = readDirectory(bytes, offset + 8);
266
+ if (metadata.rva === 0 || metadata.size === 0) throw managedFailure("invalid-cli-header", "cli.metadata", "CLI metadata directory is absent", offset + 8);
267
+ const flags = bytes.readUInt32LE(offset + 16);
268
+ const managedNativeHeader = readDirectory(bytes, offset + 64);
269
+ let readyToRunSignature = false;
270
+ if (managedNativeHeader.rva !== 0 && managedNativeHeader.size >= 4) {
271
+ const nativeOffset = mapRva({
272
+ bytes,
273
+ sections,
274
+ rva: managedNativeHeader.rva,
275
+ size: 4,
276
+ scope: "cli.managed-native-header"
277
+ });
278
+ readyToRunSignature = bytes.readUInt32LE(nativeOffset) === 5395538;
279
+ }
280
+ return {
281
+ headerOffset: offset,
282
+ headerSize,
283
+ runtimeMajor: bytes.readUInt16LE(offset + 4),
284
+ runtimeMinor: bytes.readUInt16LE(offset + 6),
285
+ metadata,
286
+ flags,
287
+ entryPoint: bytes.readUInt32LE(offset + 20),
288
+ resources: readDirectory(bytes, offset + 24),
289
+ strongName: readDirectory(bytes, offset + 32),
290
+ managedNativeHeader,
291
+ readyToRunSignature
292
+ };
293
+ };
294
+ readCoffHeader = (bytes) => {
295
+ const peOffset = bytes.readUInt32LE(60);
296
+ requireRange$2(bytes, peOffset, 24, "pe.coff-header");
297
+ if (bytes.readUInt32LE(peOffset) !== 17744) throw managedFailure("invalid-directory", "pe.signature", "PE signature is invalid", peOffset);
298
+ const coff = peOffset + 4;
299
+ const machine = bytes.readUInt16LE(coff);
300
+ const sectionCount = bytes.readUInt16LE(coff + 2);
301
+ if (sectionCount === 0) throw managedFailure("invalid-directory", "pe.sections", "PE section count must be positive", coff + 2);
302
+ const optionalSize = bytes.readUInt16LE(coff + 16);
303
+ const characteristics = bytes.readUInt16LE(coff + 18);
304
+ return {
305
+ coff,
306
+ machine,
307
+ sectionCount,
308
+ optionalSize,
309
+ characteristics
310
+ };
311
+ };
312
+ readOptionalHeader = (bytes, coff) => {
313
+ const optionalOffset = coff.coff + 20;
314
+ requireRange$2(bytes, optionalOffset, coff.optionalSize, "pe.optional-header");
315
+ if (coff.optionalSize < 96) throw managedFailure("invalid-directory", "pe.optional-header", "PE optional header is too short", optionalOffset);
316
+ const magic = bytes.readUInt16LE(optionalOffset);
317
+ const optionalHeader = magic === 267 ? "pe32" : magic === 523 ? "pe32-plus" : undefined;
318
+ if (optionalHeader === undefined) throw managedFailure("invalid-directory", "pe.optional-header", "PE optional header magic is unsupported", optionalOffset);
319
+ return {
320
+ optionalOffset,
321
+ optionalHeader,
322
+ directoryCountOffset: optionalOffset + (optionalHeader === "pe32" ? 92 : 108),
323
+ directoryOffset: optionalOffset + (optionalHeader === "pe32" ? 96 : 112)
324
+ };
325
+ };
326
+ readSections = (bytes, coff, optional) => {
327
+ const sectionOffset = add(optional.optionalOffset, coff.optionalSize, "pe.sections");
328
+ requireRange$2(bytes, sectionOffset, coff.sectionCount * 40, "pe.sections");
329
+ const sections = [];
330
+ for (let index = 0; index < coff.sectionCount; index += 1) {
331
+ const offset = sectionOffset + index * 40;
332
+ const section = {
333
+ virtualSize: bytes.readUInt32LE(offset + 8),
334
+ virtualAddress: bytes.readUInt32LE(offset + 12),
335
+ rawSize: bytes.readUInt32LE(offset + 16),
336
+ rawOffset: bytes.readUInt32LE(offset + 20)
337
+ };
338
+ if (section.rawSize > 0) requireRange$2(bytes, section.rawOffset, section.rawSize, "pe.section-data");
339
+ sections.push(section);
340
+ }
341
+ return sections;
342
+ };
343
+ readCliDirectory = (bytes, coff, optional) => {
344
+ const countOffset = optional.directoryCountOffset - optional.optionalOffset;
345
+ if (countOffset + 4 > coff.optionalSize) return {
346
+ kind: "unreadable",
347
+ issue: {
348
+ code: "invalid-directory",
349
+ scope: "pe.optional-header",
350
+ detail: "PE optional header does not contain its directory count",
351
+ offset: optional.directoryCountOffset
352
+ }
353
+ };
354
+ const directoryCount = bytes.readUInt32LE(optional.directoryCountOffset);
355
+ if (directoryCount <= 14) return { kind: "absent" };
356
+ const availableDirectoryCount = Math.floor((coff.optionalSize - (optional.directoryOffset - optional.optionalOffset)) / 8);
357
+ if (availableDirectoryCount < 15) return {
358
+ kind: "unreadable",
359
+ issue: {
360
+ code: "invalid-directory",
361
+ scope: "pe.data-directories",
362
+ detail: "PE data-directory count exceeds the optional-header extent",
363
+ offset: optional.directoryCountOffset
364
+ }
365
+ };
366
+ const directory = readDirectory(bytes, optional.directoryOffset + 14 * 8);
367
+ return directory.rva !== 0 || directory.size !== 0 ? {
368
+ kind: "present",
369
+ directory
370
+ } : { kind: "absent" };
371
+ };
372
+ readManagedPeLayout = (bytes) => {
373
+ requireRange$2(bytes, 0, 64, "pe.dos-header");
374
+ if (bytes[0] !== 77 || bytes[1] !== 90) throw managedFailure("invalid-directory", "pe.dos-header", "Artifact does not start with an MZ header", 0);
375
+ const coff = readCoffHeader(bytes);
376
+ const optional = readOptionalHeader(bytes, coff);
377
+ const sections = readSections(bytes, coff, optional);
378
+ const cliDirectoryRead = readCliDirectory(bytes, coff, optional);
379
+ const cliDirectoryState = cliDirectoryRead.kind;
380
+ let cli = null;
381
+ let cliIssue = cliDirectoryRead.kind === "unreadable" ? cliDirectoryRead.issue : null;
382
+ if (cliDirectoryRead.kind === "present") {
383
+ try {
384
+ cli = readCliHeader(bytes, sections, cliDirectoryRead.directory);
385
+ } catch (cause) {
386
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
387
+ cliIssue = cause.issue;
388
+ }
389
+ }
390
+ return {
391
+ machine: coff.machine,
392
+ architecture: architectureFor(coff.machine, cliDirectoryState !== "absent"),
393
+ optionalHeader: optional.optionalHeader,
394
+ sectionCount: coff.sectionCount,
395
+ characteristics: coff.characteristics,
396
+ sections,
397
+ cli,
398
+ cliDirectoryState,
399
+ cliIssue,
400
+ rvaToOffset: (rva, size, scope) => mapRva({
401
+ bytes,
402
+ sections,
403
+ rva,
404
+ size,
405
+ scope
406
+ }),
407
+ rvaAvailableBytes: (rva, scope) => resolveRva({
408
+ bytes,
409
+ sections,
410
+ rva,
411
+ size: 1,
412
+ scope
413
+ }).available
414
+ };
415
+ };
416
+ })))();
417
+ }
418
+
419
+ //#endregion
420
+ //#region dist/dotnet/ManagedMetadataRowSizes.js
421
+ var ROW_SIZE_FACTORIES, computeRowSize;
422
+ function init_ManagedMetadataRowSizes() {
423
+ return (init_ManagedMetadataRowSizes = __esmMin((() => {
424
+ init_ManagedReaderFailure();
425
+ ROW_SIZE_FACTORIES = [
426
+ ({ stringSize: s, guidSize: g }) => 2 + s + g * 3,
427
+ ({ codedSize: c, stringSize: s }) => c("ResolutionScope") + s * 2,
428
+ ({ tableSize: t, codedSize: c, stringSize: s }) => 4 + s * 2 + c("TypeDefOrRef") + Math.max(t(3), t(4)) + Math.max(t(5), t(6)),
429
+ ({ tableSize: t }) => t(4),
430
+ ({ stringSize: s, blobSize: b }) => 2 + s + b,
431
+ ({ tableSize: t }) => t(6),
432
+ ({ tableSize: t, stringSize: s, blobSize: b }) => 8 + s + b + t(8),
433
+ ({ tableSize: t }) => t(8),
434
+ ({ stringSize: s }) => 4 + s,
435
+ ({ tableSize: t, codedSize: c }) => t(2) + c("TypeDefOrRef"),
436
+ ({ codedSize: c, stringSize: s, blobSize: b }) => c("MemberRefParent") + s + b,
437
+ ({ codedSize: c, blobSize: b }) => 2 + c("HasConstant") + b,
438
+ ({ codedSize: c, blobSize: b }) => c("HasCustomAttribute") + c("CustomAttributeType") + b,
439
+ ({ codedSize: c, blobSize: b }) => c("HasFieldMarshal") + b,
440
+ ({ codedSize: c, blobSize: b }) => 2 + c("HasDeclSecurity") + b,
441
+ ({ tableSize: t }) => 6 + t(2),
442
+ ({ tableSize: t }) => 4 + t(4),
443
+ ({ blobSize: b }) => b,
444
+ ({ tableSize: t }) => t(2) + t(20),
445
+ ({ tableSize: t }) => t(20),
446
+ ({ stringSize: s, codedSize: c }) => 2 + s + c("TypeDefOrRef"),
447
+ ({ tableSize: t }) => t(2) + t(23),
448
+ ({ tableSize: t }) => t(23),
449
+ ({ stringSize: s, blobSize: b }) => 2 + s + b,
450
+ ({ tableSize: t, codedSize: c }) => 2 + t(6) + c("HasSemantics"),
451
+ ({ tableSize: t, codedSize: c }) => t(2) + c("MethodDefOrRef") * 2,
452
+ ({ stringSize: s }) => s,
453
+ ({ blobSize: b }) => b,
454
+ ({ tableSize: t, codedSize: c, stringSize: s }) => 2 + c("MemberForwarded") + s + t(26),
455
+ ({ tableSize: t }) => 4 + t(4),
456
+ () => 8,
457
+ () => 4,
458
+ ({ blobSize: b, stringSize: s }) => 16 + b + s * 2,
459
+ () => 4,
460
+ () => 12,
461
+ ({ blobSize: b, stringSize: s }) => 12 + b * 2 + s * 2,
462
+ ({ tableSize: t }) => 4 + t(35),
463
+ ({ tableSize: t }) => 12 + t(35),
464
+ ({ stringSize: s, blobSize: b }) => 4 + s + b,
465
+ ({ stringSize: s, codedSize: c }) => 8 + s * 2 + c("Implementation"),
466
+ ({ stringSize: s, codedSize: c }) => 8 + s + c("Implementation"),
467
+ ({ tableSize: t }) => t(2) * 2,
468
+ ({ stringSize: s, codedSize: c }) => 4 + c("TypeOrMethodDef") + s,
469
+ ({ codedSize: c, blobSize: b }) => c("MethodDefOrRef") + b,
470
+ ({ tableSize: t, codedSize: c }) => t(42) + c("TypeDefOrRef")
471
+ ];
472
+ computeRowSize = (table, context) => {
473
+ const factory = ROW_SIZE_FACTORIES[table];
474
+ if (factory === undefined) throw managedFailure("invalid-tables", "metadata.tables", `Metadata table ${String(table)} is unsupported`);
475
+ return factory(context);
476
+ };
477
+ })))();
478
+ }
479
+
480
+ //#endregion
481
+ //#region dist/dotnet/ManagedMetadataLayout.js
482
+ var METADATA_TABLE_NAMES, CODED_INDEXES, SUPPORTED_TABLE_MASK, requireRange$1, align4, readStreamName, streamByName, requireStream, codedSize, tableSize, readMetadataStreams, readTablesHeader, readRowCounts, buildRowSizeContext, buildMetadataTables, readManagedMetadataLayout, metadataRowOffset;
483
+ function init_ManagedMetadataLayout() {
484
+ return (init_ManagedMetadataLayout = __esmMin((() => {
485
+ init_ManagedDecodeBudget();
486
+ init_ManagedReaderFailure();
487
+ init_ManagedMetadataRowSizes();
488
+ METADATA_TABLE_NAMES = [
489
+ "Module",
490
+ "TypeRef",
491
+ "TypeDef",
492
+ "FieldPtr",
493
+ "Field",
494
+ "MethodPtr",
495
+ "MethodDef",
496
+ "ParamPtr",
497
+ "Param",
498
+ "InterfaceImpl",
499
+ "MemberRef",
500
+ "Constant",
501
+ "CustomAttribute",
502
+ "FieldMarshal",
503
+ "DeclSecurity",
504
+ "ClassLayout",
505
+ "FieldLayout",
506
+ "StandAloneSig",
507
+ "EventMap",
508
+ "EventPtr",
509
+ "Event",
510
+ "PropertyMap",
511
+ "PropertyPtr",
512
+ "Property",
513
+ "MethodSemantics",
514
+ "MethodImpl",
515
+ "ModuleRef",
516
+ "TypeSpec",
517
+ "ImplMap",
518
+ "FieldRVA",
519
+ "ENCLog",
520
+ "ENCMap",
521
+ "Assembly",
522
+ "AssemblyProcessor",
523
+ "AssemblyOS",
524
+ "AssemblyRef",
525
+ "AssemblyRefProcessor",
526
+ "AssemblyRefOS",
527
+ "File",
528
+ "ExportedType",
529
+ "ManifestResource",
530
+ "NestedClass",
531
+ "GenericParam",
532
+ "MethodSpec",
533
+ "GenericParamConstraint"
534
+ ];
535
+ CODED_INDEXES = {
536
+ TypeDefOrRef: {
537
+ bits: 2,
538
+ tables: [
539
+ 2,
540
+ 1,
541
+ 27
542
+ ]
543
+ },
544
+ HasConstant: {
545
+ bits: 2,
546
+ tables: [
547
+ 4,
548
+ 8,
549
+ 23
550
+ ]
551
+ },
552
+ HasCustomAttribute: {
553
+ bits: 5,
554
+ tables: [
555
+ 6,
556
+ 4,
557
+ 1,
558
+ 2,
559
+ 8,
560
+ 9,
561
+ 10,
562
+ 0,
563
+ 14,
564
+ 23,
565
+ 20,
566
+ 17,
567
+ 26,
568
+ 27,
569
+ 32,
570
+ 35,
571
+ 38,
572
+ 39,
573
+ 40,
574
+ 42,
575
+ 44,
576
+ 43
577
+ ]
578
+ },
579
+ HasFieldMarshal: {
580
+ bits: 1,
581
+ tables: [4, 8]
582
+ },
583
+ HasDeclSecurity: {
584
+ bits: 2,
585
+ tables: [
586
+ 2,
587
+ 6,
588
+ 32
589
+ ]
590
+ },
591
+ MemberRefParent: {
592
+ bits: 3,
593
+ tables: [
594
+ 2,
595
+ 1,
596
+ 26,
597
+ 6,
598
+ 27
599
+ ]
600
+ },
601
+ HasSemantics: {
602
+ bits: 1,
603
+ tables: [20, 23]
604
+ },
605
+ MethodDefOrRef: {
606
+ bits: 1,
607
+ tables: [6, 10]
608
+ },
609
+ MemberForwarded: {
610
+ bits: 1,
611
+ tables: [4, 6]
612
+ },
613
+ Implementation: {
614
+ bits: 2,
615
+ tables: [
616
+ 38,
617
+ 35,
618
+ 39
619
+ ]
620
+ },
621
+ CustomAttributeType: {
622
+ bits: 3,
623
+ tables: [6, 10]
624
+ },
625
+ ResolutionScope: {
626
+ bits: 2,
627
+ tables: [
628
+ 0,
629
+ 26,
630
+ 35,
631
+ 1
632
+ ]
633
+ },
634
+ TypeOrMethodDef: {
635
+ bits: 1,
636
+ tables: [2, 6]
637
+ }
638
+ };
639
+ SUPPORTED_TABLE_MASK = (1n << BigInt(METADATA_TABLE_NAMES.length)) - 1n;
640
+ requireRange$1 = (bytes, offset, length, scope) => {
641
+ if (!Number.isSafeInteger(offset) || !Number.isSafeInteger(length) || offset < 0 || length < 0 || offset > bytes.length - length) throw managedFailure("invalid-metadata-root", scope, `${scope} leaves the metadata byte range`, Number.isSafeInteger(offset) && offset >= 0 ? offset : null);
642
+ };
643
+ align4 = (value) => Math.ceil(value / 4) * 4;
644
+ readStreamName = (bytes, offset) => {
645
+ const endLimit = Math.min(bytes.length, offset + 32);
646
+ let end = offset;
647
+ while (end < endLimit && bytes[end] !== 0) end += 1;
648
+ if (end === endLimit) throw managedFailure("invalid-stream", "metadata.stream-name", "Metadata stream name is missing a bounded terminator", offset);
649
+ const nameBytes = bytes.subarray(offset, end);
650
+ if (nameBytes.some((byte) => byte < 32 || byte > 126)) throw managedFailure("invalid-stream", "metadata.stream-name", "Metadata stream name is not printable ASCII", offset);
651
+ return {
652
+ name: nameBytes.toString("ascii"),
653
+ next: align4(end + 1)
654
+ };
655
+ };
656
+ streamByName = (streams, names) => {
657
+ for (const name of names) {
658
+ const stream = streams.get(name);
659
+ if (stream !== undefined) return stream;
660
+ }
661
+ return undefined;
662
+ };
663
+ requireStream = (streams, name) => {
664
+ const stream = streams.get(name);
665
+ if (stream === undefined) throw managedFailure("missing-stream", `metadata.${name}`, `Required metadata stream ${name} is absent`);
666
+ return stream;
667
+ };
668
+ codedSize = (name, rowCounts) => {
669
+ const descriptor = CODED_INDEXES[name];
670
+ let maximum = 0;
671
+ for (const table of descriptor.tables) maximum = Math.max(maximum, rowCounts[table] ?? 0);
672
+ return maximum < 2 ** (16 - descriptor.bits) ? 2 : 4;
673
+ };
674
+ tableSize = (index, rows) => (rows[index] ?? 0) < 65536 ? 2 : 4;
675
+ readMetadataStreams = (bytes, rootOffset, budget) => {
676
+ if (bytes.readUInt32LE(0) !== 1112167234) throw managedFailure("invalid-metadata-root", "metadata.signature", "CLI metadata signature is not BSJB", rootOffset);
677
+ const versionLength = bytes.readUInt32LE(12);
678
+ requireRange$1(bytes, 16, versionLength, "metadata.version");
679
+ const versionBytes = bytes.subarray(16, 16 + versionLength);
680
+ const zero = versionBytes.indexOf(0);
681
+ const decodedVersionLength = zero < 0 ? versionBytes.length : zero;
682
+ budget.reserveString(decodedVersionLength, rootOffset + 16);
683
+ const version = versionBytes.subarray(0, decodedVersionLength).toString("utf8");
684
+ let cursor = align4(16 + versionLength);
685
+ requireRange$1(bytes, cursor, 4, "metadata.stream-count");
686
+ const streamCount = bytes.readUInt16LE(cursor + 2);
687
+ if (streamCount === 0 || streamCount > 64) throw managedFailure("invalid-stream", "metadata.stream-count", "Metadata stream count is outside the admitted range", rootOffset + cursor + 2);
688
+ cursor += 4;
689
+ const streams = new Map();
690
+ for (let index = 0; index < streamCount; index += 1) {
691
+ requireRange$1(bytes, cursor, 8, "metadata.stream-header");
692
+ const relativeOffset = bytes.readUInt32LE(cursor);
693
+ const streamSize = bytes.readUInt32LE(cursor + 4);
694
+ const named = readStreamName(bytes, cursor + 8);
695
+ if (streams.has(named.name)) throw managedFailure("invalid-stream", "metadata.stream-header", `Duplicate metadata stream ${named.name}`, rootOffset + cursor);
696
+ requireRange$1(bytes, relativeOffset, streamSize, `metadata.${named.name}`);
697
+ streams.set(named.name, {
698
+ name: named.name,
699
+ offset: rootOffset + relativeOffset,
700
+ size: streamSize
701
+ });
702
+ cursor = named.next;
703
+ }
704
+ return {
705
+ streams,
706
+ version
707
+ };
708
+ };
709
+ readTablesHeader = (bytes, streams) => {
710
+ const tablesStream = streamByName(streams, ["#~", "#-"]);
711
+ if (tablesStream === undefined) throw managedFailure("missing-stream", "metadata.tables", "Required metadata table stream #~ or #- is absent");
712
+ const tableBytes = bytes.subarray(tablesStream.offset, tablesStream.offset + tablesStream.size);
713
+ requireRange$1(tableBytes, 0, 24, "metadata.tables-header");
714
+ const heapSizes = tableBytes[6] ?? 0;
715
+ const heaps = {
716
+ string: (heapSizes & 1) === 0 ? 2 : 4,
717
+ guid: (heapSizes & 2) === 0 ? 2 : 4,
718
+ blob: (heapSizes & 4) === 0 ? 2 : 4
719
+ };
720
+ const valid = tableBytes.readBigUInt64LE(8);
721
+ if ((valid & ~SUPPORTED_TABLE_MASK) !== 0n) throw managedFailure("invalid-tables", "metadata.valid-mask", "Metadata valid mask names unsupported tables outside the admitted ECMA-335 range", tablesStream.offset + 8);
722
+ return {
723
+ tableBytes,
724
+ tablesOffset: tablesStream.offset,
725
+ heaps,
726
+ valid
727
+ };
728
+ };
729
+ readRowCounts = (tableBytes, valid) => {
730
+ const rowCounts = Array(METADATA_TABLE_NAMES.length).fill(0);
731
+ let tableCursor = 24;
732
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
733
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
734
+ requireRange$1(tableBytes, tableCursor, 4, "metadata.table-row-count");
735
+ const count = tableBytes.readUInt32LE(tableCursor);
736
+ rowCounts[index] = count;
737
+ tableCursor += 4;
738
+ }
739
+ return rowCounts;
740
+ };
741
+ buildRowSizeContext = (rowCounts, heaps) => ({
742
+ tableSize: (index) => tableSize(index, rowCounts),
743
+ codedSize: (name) => codedSize(name, rowCounts),
744
+ stringSize: heaps.string,
745
+ guidSize: heaps.guid,
746
+ blobSize: heaps.blob
747
+ });
748
+ buildMetadataTables = ({ tableBytes, rowCounts, heaps, valid, tablesOffset }) => {
749
+ const tables = new Map();
750
+ const context = buildRowSizeContext(rowCounts, heaps);
751
+ let tableCursor = 24;
752
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
753
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
754
+ tableCursor += 4;
755
+ }
756
+ if (((tableBytes[6] ?? 0) & 64) !== 0) {
757
+ if (tableCursor > tableBytes.length - 4) throw managedFailure("invalid-metadata-root", "metadata.tables-extra-data", "Metadata tables extra-data word is truncated", tablesOffset + tableCursor);
758
+ tableCursor += 4;
759
+ }
760
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
761
+ const count = rowCounts[index] ?? 0;
762
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
763
+ const sizeOfRow = computeRowSize(index, context);
764
+ const byteLength = count * sizeOfRow;
765
+ if (!Number.isSafeInteger(byteLength)) throw managedFailure("invalid-tables", "metadata.tables", "Metadata table byte size overflowed", tablesOffset + tableCursor);
766
+ requireRange$1(tableBytes, tableCursor, byteLength, "metadata.table-data");
767
+ tables.set(index, {
768
+ index,
769
+ name: METADATA_TABLE_NAMES[index] ?? `Table${String(index)}`,
770
+ rowCount: count,
771
+ rowSize: sizeOfRow,
772
+ offset: tablesOffset + tableCursor
773
+ });
774
+ tableCursor += byteLength;
775
+ }
776
+ return tables;
777
+ };
778
+ readManagedMetadataLayout = (artifact, rootOffset, size) => {
779
+ if (size < 20 || rootOffset < 0 || rootOffset > artifact.length - size) throw managedFailure("invalid-metadata-root", "metadata.root", "CLI metadata directory leaves the artifact byte range", rootOffset);
780
+ const bytes = artifact.subarray(rootOffset, rootOffset + size);
781
+ const budget = new ManagedDecodeBudget();
782
+ const { streams, version } = readMetadataStreams(bytes, rootOffset, budget);
783
+ const { tableBytes, tablesOffset, heaps, valid } = readTablesHeader(artifact, streams);
784
+ const rowCounts = readRowCounts(tableBytes, valid);
785
+ const tables = buildMetadataTables({
786
+ tableBytes,
787
+ rowCounts,
788
+ heaps,
789
+ valid,
790
+ tablesOffset
791
+ });
792
+ const layout = {
793
+ rootOffset,
794
+ size,
795
+ version,
796
+ streamNames: [...streams.keys()].sort(),
797
+ strings: requireStream(streams, "#Strings"),
798
+ guid: requireStream(streams, "#GUID"),
799
+ blob: requireStream(streams, "#Blob"),
800
+ tables,
801
+ rowCounts,
802
+ stringIndexSize: heaps.string,
803
+ guidIndexSize: heaps.guid,
804
+ blobIndexSize: heaps.blob,
805
+ table: (index) => tables.get(index),
806
+ tableIndexSize: (index) => tableSize(index, rowCounts),
807
+ codedIndexSize: (name) => codedSize(name, rowCounts)
808
+ };
809
+ attachManagedDecodeBudget(layout, budget);
810
+ return layout;
811
+ };
812
+ metadataRowOffset = (layout, table, row) => {
813
+ const descriptor = layout.table(table);
814
+ if (descriptor === undefined || row < 1 || row > descriptor.rowCount) throw managedFailure("invalid-row", `metadata.${METADATA_TABLE_NAMES[table] ?? String(table)}`, `Metadata row ${String(row)} is outside its table`);
815
+ return descriptor.offset + (row - 1) * descriptor.rowSize;
816
+ };
817
+ })))();
818
+ }
819
+
820
+ //#endregion
821
+ //#region dist/dotnet/ManagedMetadataHeaps.js
822
+ var requireRange, MetadataRowCursor, compressedLength, readMetadataString, readMetadataBlob, readMetadataGuid, metadataToken, sha256Bytes, metadataRowCursor, metadataCodedToken, metadataCodedTokenInvalidReason;
823
+ function init_ManagedMetadataHeaps() {
824
+ return (init_ManagedMetadataHeaps = __esmMin((() => {
825
+ init_ManagedDecodeBudget();
826
+ init_ManagedMetadataLayout();
827
+ init_ManagedReaderFailure();
828
+ requireRange = (bytes, offset, length, scope) => {
829
+ if (offset < 0 || length < 0 || offset > bytes.length - length) throw managedFailure("invalid-row", scope, `${scope} leaves the artifact byte range`, offset >= 0 ? offset : null);
830
+ };
831
+ MetadataRowCursor = class {
832
+ bytes;
833
+ start;
834
+ end;
835
+ scope;
836
+ #offset;
837
+ constructor(bytes, start, end, scope) {
838
+ this.bytes = bytes;
839
+ this.start = start;
840
+ this.end = end;
841
+ this.scope = scope;
842
+ this.#offset = start;
843
+ }
844
+ get offset() {
845
+ return this.#offset;
846
+ }
847
+ readUInt16() {
848
+ this.require(2);
849
+ const value = this.bytes.readUInt16LE(this.#offset);
850
+ this.#offset += 2;
851
+ return value;
852
+ }
853
+ readUInt32() {
854
+ this.require(4);
855
+ const value = this.bytes.readUInt32LE(this.#offset);
856
+ this.#offset += 4;
857
+ return value;
858
+ }
859
+ readIndex(size) {
860
+ return size === 2 ? this.readUInt16() : this.readUInt32();
861
+ }
862
+ require(length) {
863
+ if (this.#offset < this.start || this.#offset > this.end - length) throw managedFailure("invalid-row", this.scope, `${this.scope} row ended before all declared columns`, this.#offset);
864
+ }
865
+ };
866
+ compressedLength = (bytes, offset, scope) => {
867
+ requireRange(bytes, offset, 1, scope);
868
+ const first = bytes[offset] ?? 0;
869
+ if ((first & 128) === 0) return {
870
+ length: first,
871
+ prefix: 1
872
+ };
873
+ if ((first & 192) === 128) {
874
+ requireRange(bytes, offset, 2, scope);
875
+ return {
876
+ length: (first & 63) << 8 | (bytes[offset + 1] ?? 0),
877
+ prefix: 2
878
+ };
879
+ }
880
+ if ((first & 224) === 192) {
881
+ requireRange(bytes, offset, 4, scope);
882
+ return {
883
+ length: (first & 31) * 16777216 + (bytes[offset + 1] ?? 0) * 65536 + (bytes[offset + 2] ?? 0) * 256 + (bytes[offset + 3] ?? 0),
884
+ prefix: 4
885
+ };
886
+ }
887
+ throw managedFailure("invalid-blob", scope, "Metadata blob uses a reserved compressed-length prefix", offset);
888
+ };
889
+ readMetadataString = (bytes, layout, index, heapExtent) => {
890
+ if (index === 0) return "";
891
+ if (index < 0 || index >= layout.strings.size) throw managedFailure("invalid-heap-index", "metadata.#Strings", "String heap index is outside #Strings", layout.strings.offset + Math.max(index, 0));
892
+ const start = layout.strings.offset + index;
893
+ const cached = managedDecodeBudget(layout).cachedString(index);
894
+ if (cached !== undefined && cached.encodedBytes <= heapExtent) {
895
+ managedDecodeBudget(layout).reserveString(cached.encodedBytes, start);
896
+ return cached.value;
897
+ }
898
+ const maximum = Math.min(layout.strings.offset + layout.strings.size, start + heapExtent + 1);
899
+ let end = start;
900
+ while (end < maximum && bytes[end] !== 0) end += 1;
901
+ if (end === maximum) throw managedFailure("invalid-string", "metadata.#Strings", "String heap item has no terminator within #Strings", start);
902
+ managedDecodeBudget(layout).reserveString(end - start, start);
903
+ try {
904
+ const value = new TextDecoder("utf-8", {
905
+ fatal: true,
906
+ ignoreBOM: true
907
+ }).decode(bytes.subarray(start, end));
908
+ managedDecodeBudget(layout).cacheString(index, value, end - start);
909
+ return value;
910
+ } catch (cause) {
911
+ void cause;
912
+ throw managedFailure("invalid-string", "metadata.#Strings", "String heap item is not valid UTF-8", start);
913
+ }
914
+ };
915
+ readMetadataBlob = (bytes, layout, index, heapExtent) => {
916
+ if (index === 0) return Buffer.alloc(0);
917
+ if (index < 0 || index >= layout.blob.size) throw managedFailure("invalid-heap-index", "metadata.#Blob", "Blob heap index is outside #Blob", layout.blob.offset + Math.max(index, 0));
918
+ const start = layout.blob.offset + index;
919
+ const decoded = compressedLength(bytes, start, "metadata.#Blob");
920
+ if (decoded.length > heapExtent) throw managedFailure("invalid-blob", "metadata.#Blob", "Blob length exceeds the admitted heap extent", start);
921
+ const content = start + decoded.prefix;
922
+ if (content > layout.blob.offset + layout.blob.size - decoded.length) throw managedFailure("invalid-blob", "metadata.#Blob", "Blob heap item leaves #Blob", start);
923
+ return bytes.subarray(content, content + decoded.length);
924
+ };
925
+ readMetadataGuid = (bytes, layout, index) => {
926
+ if (index === 0) return null;
927
+ const relative = (index - 1) * 16;
928
+ if (relative < 0 || relative > layout.guid.size - 16) throw managedFailure("invalid-guid", "metadata.#GUID", "GUID heap index is outside #GUID", layout.guid.offset + Math.max(relative, 0));
929
+ const offset = layout.guid.offset + relative;
930
+ const part1 = bytes.readUInt32LE(offset).toString(16).padStart(8, "0");
931
+ const part2 = bytes.readUInt16LE(offset + 4).toString(16).padStart(4, "0");
932
+ const part3 = bytes.readUInt16LE(offset + 6).toString(16).padStart(4, "0");
933
+ const part4 = bytes.subarray(offset + 8, offset + 10).toString("hex");
934
+ const part5 = bytes.subarray(offset + 10, offset + 16).toString("hex");
935
+ return `${part1}-${part2}-${part3}-${part4}-${part5}`;
936
+ };
937
+ metadataToken = (table, row) => `0x${(table * 16777216 + row).toString(16).padStart(8, "0")}`;
938
+ sha256Bytes = (bytes) => createHash("sha256").update(bytes).digest("hex");
939
+ metadataRowCursor = (bytes, layout, table, row) => {
940
+ const descriptor = layout.table(table);
941
+ const start = metadataRowOffset(layout, table, row);
942
+ if (descriptor === undefined) throw managedFailure("invalid-row", `metadata.${String(table)}`, "Metadata table is absent", start);
943
+ managedDecodeBudget(layout).reserveRow(table, row, start);
944
+ return new MetadataRowCursor(bytes, start, start + descriptor.rowSize, `metadata.${descriptor.name}`);
945
+ };
946
+ metadataCodedToken = (raw, bits, tables, rowCounts) => {
947
+ if (raw === 0) return null;
948
+ const tag = raw & 2 ** bits - 1;
949
+ const row = Math.floor(raw / 2 ** bits);
950
+ const table = tables[tag];
951
+ return table === undefined || row === 0 || row > (rowCounts[table] ?? 0) ? null : metadataToken(table, row);
952
+ };
953
+ metadataCodedTokenInvalidReason = (raw, bits, tables, rowCounts) => {
954
+ if (raw === 0) return null;
955
+ const tag = raw & 2 ** bits - 1;
956
+ const row = Math.floor(raw / 2 ** bits);
957
+ const table = tables[tag];
958
+ if (table === undefined) return `coded index tag ${tag} is not defined`;
959
+ if (row === 0) return `coded index selects row zero in table ${table}`;
960
+ const count = rowCounts[table] ?? 0;
961
+ return row > count ? `coded index selects row ${row} in table ${table}, which has ${count} rows` : null;
962
+ };
963
+ })))();
964
+ }
965
+
966
+ //#endregion
967
+ //#region dist/dotnet/ManagedMemberPointers.js
968
+ var lookups$1, memberListTable, memberListIndexSize, memberListRowLookup;
969
+ function init_ManagedMemberPointers() {
970
+ return (init_ManagedMemberPointers = __esmMin((() => {
971
+ init_ManagedDecodeBudget();
972
+ init_ManagedReaderFailure();
973
+ lookups$1 = new WeakMap();
974
+ memberListTable = (layout, table) => {
975
+ const pointers = layout.table(table - 1);
976
+ return pointers !== undefined && pointers.rowCount > 0 ? pointers : layout.table(table);
977
+ };
978
+ memberListIndexSize = (layout, table) => layout.tableIndexSize(table - 1) === 4 || layout.tableIndexSize(table) === 4 ? 4 : 2;
979
+ memberListRowLookup = (bytes, layout, table) => {
980
+ const pointers = layout.table(table - 1);
981
+ if (pointers === undefined || pointers.rowCount === 0) return (row) => row;
982
+ let byTable = lookups$1.get(layout);
983
+ const cached = byTable?.get(table);
984
+ if (cached instanceof ManagedReaderFailure) throw cached;
985
+ if (cached !== undefined) return cached;
986
+ const definitionCount = layout.table(table)?.rowCount ?? 0;
987
+ managedDecodeBudget(layout).reserve((definitionCount + 1) * Uint32Array.BYTES_PER_ELEMENT + 256, pointers.offset);
988
+ if (byTable === undefined) {
989
+ byTable = new Map();
990
+ lookups$1.set(layout, byTable);
991
+ }
992
+ const positions = new Uint32Array(definitionCount + 1);
993
+ try {
994
+ const width = layout.tableIndexSize(table);
995
+ for (let row = 1; row <= pointers.rowCount; row += 1) {
996
+ const offset = pointers.offset + (row - 1) * pointers.rowSize;
997
+ const definition = width === 2 ? bytes.readUInt16LE(offset) : bytes.readUInt32LE(offset);
998
+ if (definition === 0 || definition > definitionCount) throw managedFailure("invalid-row", `metadata.${pointers.name}`, `Pointer row ${String(row)} names an out-of-range definition row ${String(definition)}`, offset);
999
+ if (positions[definition] !== 0) throw managedFailure("invalid-row", `metadata.${pointers.name}`, `Definition row ${String(definition)} has more than one pointer row; its declaring type is ambiguous`, offset);
1000
+ positions[definition] = row;
1001
+ }
1002
+ const lookup = (definition) => {
1003
+ const position = positions[definition] ?? 0;
1004
+ if (position === 0) throw managedFailure("invalid-row", `metadata.${pointers.name}`, `Definition row ${String(definition)} has no pointer row identifying its declaring type`, pointers.offset);
1005
+ return position;
1006
+ };
1007
+ byTable.set(table, lookup);
1008
+ return lookup;
1009
+ } catch (cause) {
1010
+ if (cause instanceof ManagedReaderFailure) byTable.set(table, cause);
1011
+ throw cause;
1012
+ }
1013
+ };
1014
+ })))();
1015
+ }
1016
+
1017
+ //#endregion
1018
+ //#region dist/dotnet/ManagedMemberOwnership.js
1019
+ var lookups, memberDeclaringTypeRowLookup;
1020
+ function init_ManagedMemberOwnership() {
1021
+ return (init_ManagedMemberOwnership = __esmMin((() => {
1022
+ init_ManagedDecodeBudget();
1023
+ init_ManagedMetadataHeaps();
1024
+ init_ManagedMemberPointers();
1025
+ init_ManagedReaderFailure();
1026
+ lookups = new WeakMap();
1027
+ memberDeclaringTypeRowLookup = (bytes, layout, table) => {
1028
+ let byTable = lookups.get(layout);
1029
+ const cached = byTable?.get(table);
1030
+ if (cached instanceof ManagedReaderFailure) throw cached;
1031
+ if (cached !== undefined) return cached;
1032
+ if (byTable === undefined) {
1033
+ byTable = new Map();
1034
+ lookups.set(layout, byTable);
1035
+ }
1036
+ try {
1037
+ const positionOf = memberListRowLookup(bytes, layout, table);
1038
+ const positions = memberListTable(layout, table)?.rowCount ?? 0;
1039
+ const types = layout.table(2)?.rowCount ?? 0;
1040
+ managedDecodeBudget(layout).reserve((2 * positions + 3) * Uint32Array.BYTES_PER_ELEMENT + 256, layout.table(2)?.offset ?? null);
1041
+ const owners = new Uint32Array(positions + 1);
1042
+ const next = Uint32Array.from({ length: positions + 2 }, (_, p) => p);
1043
+ const unowned = (position) => {
1044
+ let root = position;
1045
+ while (next[root] !== root) root = next[root] ?? root;
1046
+ for (let p = position; p !== root;) {
1047
+ const following = next[p] ?? root;
1048
+ next[p] = root;
1049
+ p = following;
1050
+ }
1051
+ return root;
1052
+ };
1053
+ const startForType = (row) => {
1054
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1055
+ cursor.readUInt32();
1056
+ cursor.readIndex(layout.stringIndexSize);
1057
+ cursor.readIndex(layout.stringIndexSize);
1058
+ cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1059
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1060
+ return table === 4 ? fieldStart : cursor.readIndex(memberListIndexSize(layout, 6));
1061
+ };
1062
+ let start = types === 0 ? 0 : startForType(1);
1063
+ for (let row = 1; row <= types; row += 1) {
1064
+ const end = row === types ? positions + 1 : startForType(row + 1);
1065
+ const limit = Math.min(end, positions + 1);
1066
+ for (let p = unowned(Math.min(Math.max(start, 1), positions + 1)); p < limit; p = unowned(p + 1)) {
1067
+ owners[p] = row;
1068
+ next[p] = p + 1;
1069
+ }
1070
+ start = end;
1071
+ }
1072
+ const definitions = layout.table(table)?.rowCount ?? 0;
1073
+ const lookup = (definition) => definition < 1 || definition > definitions ? 0 : owners[positionOf(definition)] ?? 0;
1074
+ byTable.set(table, lookup);
1075
+ return lookup;
1076
+ } catch (cause) {
1077
+ if (cause instanceof ManagedReaderFailure) byTable.set(table, cause);
1078
+ throw cause;
1079
+ }
1080
+ };
1081
+ })))();
1082
+ }
1083
+
1084
+ //#endregion
1085
+ //#region dist/dotnet/ManagedMetadataInventoryRows.js
1086
+ var HAS_CUSTOM_ATTRIBUTE_TABLES, CUSTOM_ATTRIBUTE_TYPE_TABLES, publicKeyIdentity, readModule, readAssembly, readAssemblyReference, readTypeName, declaringTypeForMethod, attributeTypeName, decodeCompressedLength, decodeFixedString, readCustomAttribute, readResource;
1087
+ function init_ManagedMetadataInventoryRows() {
1088
+ return (init_ManagedMetadataInventoryRows = __esmMin((() => {
1089
+ init_ManagedDecodeBudget();
1090
+ init_ManagedMemberOwnership();
1091
+ init_ManagedMetadataLayout();
1092
+ init_ManagedMetadataHeaps();
1093
+ init_ManagedReaderFailure();
1094
+ HAS_CUSTOM_ATTRIBUTE_TABLES = [
1095
+ 6,
1096
+ 4,
1097
+ 1,
1098
+ 2,
1099
+ 8,
1100
+ 9,
1101
+ 10,
1102
+ 0,
1103
+ 14,
1104
+ 23,
1105
+ 20,
1106
+ 17,
1107
+ 26,
1108
+ 27,
1109
+ 32,
1110
+ 35,
1111
+ 38,
1112
+ 39,
1113
+ 40,
1114
+ 42,
1115
+ 44,
1116
+ 43
1117
+ ];
1118
+ CUSTOM_ATTRIBUTE_TYPE_TABLES = [
1119
+ undefined,
1120
+ undefined,
1121
+ 6,
1122
+ 10
1123
+ ];
1124
+ publicKeyIdentity = (bytes, kind, layout) => ({
1125
+ kind: bytes.length === 0 ? "none" : kind,
1126
+ byte_length: bytes.length,
1127
+ sha256: bytes.length === 0 ? null : managedDecodeBudget(layout).digest(bytes, "sha256"),
1128
+ token: bytes.length === 0 ? null : kind === "public-key" ? Buffer.from(managedDecodeBudget(layout).digest(bytes, "sha1"), "hex").subarray(-8).reverse().toString("hex") : bytes.length === 8 ? bytes.toString("hex") : null
1129
+ });
1130
+ readModule = (bytes, layout, heapExtent) => {
1131
+ const table = layout.table(0);
1132
+ if (table === undefined || table.rowCount === 0) return null;
1133
+ const cursor = metadataRowCursor(bytes, layout, 0, 1);
1134
+ const generation = cursor.readUInt16();
1135
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1136
+ const mvid = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1137
+ const encId = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1138
+ const encBaseId = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1139
+ return {
1140
+ name,
1141
+ generation,
1142
+ mvid,
1143
+ enc_id: encId,
1144
+ enc_base_id: encBaseId,
1145
+ token: metadataToken(0, 1),
1146
+ row_offset: table.offset
1147
+ };
1148
+ };
1149
+ readAssembly = (bytes, layout, heapExtent) => {
1150
+ const table = layout.table(32);
1151
+ if (table === undefined || table.rowCount === 0) return null;
1152
+ const cursor = metadataRowCursor(bytes, layout, 32, 1);
1153
+ const hashAlgorithm = cursor.readUInt32();
1154
+ const version = [
1155
+ cursor.readUInt16(),
1156
+ cursor.readUInt16(),
1157
+ cursor.readUInt16(),
1158
+ cursor.readUInt16()
1159
+ ].join(".");
1160
+ const flags = cursor.readUInt32();
1161
+ const key = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1162
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1163
+ const culture = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1164
+ return {
1165
+ name,
1166
+ version,
1167
+ culture: culture.length === 0 ? null : culture,
1168
+ flags,
1169
+ hash_algorithm: hashAlgorithm,
1170
+ public_key: publicKeyIdentity(key, (flags & 1) === 0 ? "public-key-token" : "public-key", layout),
1171
+ token: metadataToken(32, 1),
1172
+ row_offset: table.offset
1173
+ };
1174
+ };
1175
+ readAssemblyReference = (bytes, layout, row, heapExtent) => {
1176
+ const cursor = metadataRowCursor(bytes, layout, 35, row);
1177
+ const version = [
1178
+ cursor.readUInt16(),
1179
+ cursor.readUInt16(),
1180
+ cursor.readUInt16(),
1181
+ cursor.readUInt16()
1182
+ ].join(".");
1183
+ const flags = cursor.readUInt32();
1184
+ const keyOrToken = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1185
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1186
+ const culture = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1187
+ const hashValue = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1188
+ return {
1189
+ name,
1190
+ version,
1191
+ culture: culture.length === 0 ? null : culture,
1192
+ flags,
1193
+ public_key_or_token: publicKeyIdentity(keyOrToken, (flags & 1) === 0 ? "public-key-token" : "public-key", layout),
1194
+ hash_value_sha256: hashValue.length === 0 ? null : managedDecodeBudget(layout).digest(hashValue, "sha256"),
1195
+ hash_value_length: hashValue.length,
1196
+ token: metadataToken(35, row),
1197
+ row_offset: metadataRowOffset(layout, 35, row)
1198
+ };
1199
+ };
1200
+ readTypeName = ({ bytes, layout, table, row, heapExtent }) => {
1201
+ const descriptor = layout.table(table);
1202
+ if (descriptor === undefined || row < 1 || row > descriptor.rowCount) return null;
1203
+ const cursor = metadataRowCursor(bytes, layout, table, row);
1204
+ if (table === 1) cursor.readIndex(layout.codedIndexSize("ResolutionScope"));
1205
+ else cursor.readUInt32();
1206
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1207
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1208
+ return namespace.length === 0 ? name : `${namespace}.${name}`;
1209
+ };
1210
+ declaringTypeForMethod = (bytes, layout, methodRow, heapExtent) => {
1211
+ const owner = memberDeclaringTypeRowLookup(bytes, layout, 6)(methodRow);
1212
+ if (owner === 0) return null;
1213
+ return readTypeName({
1214
+ bytes,
1215
+ layout,
1216
+ table: 2,
1217
+ row: owner,
1218
+ heapExtent
1219
+ });
1220
+ };
1221
+ attributeTypeName = (bytes, layout, rawType, heapExtent) => {
1222
+ const tag = rawType & 7;
1223
+ const row = Math.floor(rawType / 8);
1224
+ if (row === 0) return null;
1225
+ if (tag === 2) return declaringTypeForMethod(bytes, layout, row, heapExtent);
1226
+ if (tag !== 3) return null;
1227
+ const memberRefs = layout.table(10);
1228
+ if (memberRefs === undefined || row > memberRefs.rowCount) return null;
1229
+ const cursor = metadataRowCursor(bytes, layout, 10, row);
1230
+ const parent = cursor.readIndex(layout.codedIndexSize("MemberRefParent"));
1231
+ const parentTag = parent & 7;
1232
+ const parentRow = Math.floor(parent / 8);
1233
+ if (parentTag === 0) return readTypeName({
1234
+ bytes,
1235
+ layout,
1236
+ table: 2,
1237
+ row: parentRow,
1238
+ heapExtent
1239
+ });
1240
+ if (parentTag === 1) return readTypeName({
1241
+ bytes,
1242
+ layout,
1243
+ table: 1,
1244
+ row: parentRow,
1245
+ heapExtent
1246
+ });
1247
+ if (parentTag === 3) return declaringTypeForMethod(bytes, layout, parentRow, heapExtent);
1248
+ return null;
1249
+ };
1250
+ decodeCompressedLength = (blob, offset) => {
1251
+ const first = blob[offset];
1252
+ if (first === undefined) return undefined;
1253
+ if ((first & 128) === 0) return {
1254
+ length: first,
1255
+ prefix: 1
1256
+ };
1257
+ if ((first & 192) === 128 && blob[offset + 1] !== undefined) return {
1258
+ length: (first & 63) << 8 | (blob[offset + 1] ?? 0),
1259
+ prefix: 2
1260
+ };
1261
+ if ((first & 224) === 192 && blob[offset + 1] !== undefined && blob[offset + 2] !== undefined && blob[offset + 3] !== undefined) return {
1262
+ length: (first & 31) * 16777216 + (blob[offset + 1] ?? 0) * 65536 + (blob[offset + 2] ?? 0) * 256 + (blob[offset + 3] ?? 0),
1263
+ prefix: 4
1264
+ };
1265
+ return undefined;
1266
+ };
1267
+ decodeFixedString = (blob, layout) => {
1268
+ if (blob.length < 3 || blob.readUInt16LE(0) !== 1 || blob[2] === 255) return null;
1269
+ const length = decodeCompressedLength(blob, 2);
1270
+ if (length === undefined) return null;
1271
+ const start = 2 + length.prefix;
1272
+ if (start > blob.length - length.length) return null;
1273
+ managedDecodeBudget(layout).reserveString(length.length, layout.blob.offset);
1274
+ try {
1275
+ return new TextDecoder("utf-8", {
1276
+ fatal: true,
1277
+ ignoreBOM: true
1278
+ }).decode(blob.subarray(start, start + length.length));
1279
+ } catch (cause) {
1280
+ void cause;
1281
+ return null;
1282
+ }
1283
+ };
1284
+ readCustomAttribute = (bytes, layout, row, heapExtent, issues) => {
1285
+ const cursor = metadataRowCursor(bytes, layout, 12, row);
1286
+ const parentRaw = cursor.readIndex(layout.codedIndexSize("HasCustomAttribute"));
1287
+ const typeOffset = cursor.offset;
1288
+ const typeRaw = cursor.readIndex(layout.codedIndexSize("CustomAttributeType"));
1289
+ const value = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1290
+ const parent = metadataCodedToken(parentRaw, 5, HAS_CUSTOM_ATTRIBUTE_TABLES, layout.rowCounts);
1291
+ if (parent === null) {
1292
+ const parentReason = metadataCodedTokenInvalidReason(parentRaw, 5, HAS_CUSTOM_ATTRIBUTE_TABLES, layout.rowCounts);
1293
+ throw managedFailure("invalid-row", `metadata.CustomAttribute:${metadataToken(12, row)}`, `CustomAttribute parent coded index 0x${parentRaw.toString(16)} is invalid${parentReason === null ? " because the required parent is null" : `: ${parentReason}`}`, cursor.start);
1294
+ }
1295
+ const constructor = metadataCodedToken(typeRaw, 3, CUSTOM_ATTRIBUTE_TYPE_TABLES, layout.rowCounts);
1296
+ if (constructor === null) {
1297
+ const typeReason = metadataCodedTokenInvalidReason(typeRaw, 3, CUSTOM_ATTRIBUTE_TYPE_TABLES, layout.rowCounts);
1298
+ issues.push({
1299
+ code: "invalid-row",
1300
+ scope: `metadata.CustomAttribute:${metadataToken(12, row)}`,
1301
+ offset: typeOffset,
1302
+ detail: typeReason === null ? "CustomAttribute constructor coded index 0x0 is null, but Type must reference a MethodDef or MemberRef row" : `CustomAttribute constructor coded index 0x${typeRaw.toString(16)} is invalid: ${typeReason}`
1303
+ });
1304
+ }
1305
+ let typeName = null;
1306
+ if (constructor !== null) typeName = readManagedValue(() => attributeTypeName(bytes, layout, typeRaw, heapExtent), issues) ?? null;
1307
+ return {
1308
+ parent_token: parent,
1309
+ constructor_token: constructor,
1310
+ type_name: typeName,
1311
+ value_length: value.length,
1312
+ value_sha256: managedDecodeBudget(layout).digest(value, "sha256"),
1313
+ decoded_fixed_string: typeName === "System.Runtime.Versioning.TargetFrameworkAttribute" ? decodeFixedString(value, layout) : null,
1314
+ token: metadataToken(12, row),
1315
+ row_offset: cursor.start
1316
+ };
1317
+ };
1318
+ readResource = ({ bytes, layout, row, directory, issues }) => {
1319
+ const cursor = metadataRowCursor(bytes, layout, 40, row);
1320
+ const declaredOffset = cursor.readUInt32();
1321
+ const flags = cursor.readUInt32();
1322
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), Math.max(layout.strings.size, layout.blob.size));
1323
+ const implementationOffset = cursor.offset;
1324
+ const implementationRaw = cursor.readIndex(layout.codedIndexSize("Implementation"));
1325
+ const implementationToken = metadataCodedToken(implementationRaw, 2, [
1326
+ 38,
1327
+ 35,
1328
+ 39
1329
+ ], layout.rowCounts);
1330
+ const implementationReason = metadataCodedTokenInvalidReason(implementationRaw, 2, [
1331
+ 38,
1332
+ 35,
1333
+ 39
1334
+ ], layout.rowCounts);
1335
+ if (implementationReason !== null) issues.push({
1336
+ code: "invalid-row",
1337
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1338
+ offset: implementationOffset,
1339
+ detail: `ManifestResource implementation coded index 0x${implementationRaw.toString(16)} is invalid: ${implementationReason}`
1340
+ });
1341
+ let dataLength = null;
1342
+ let dataSha256 = null;
1343
+ if (implementationRaw === 0) {
1344
+ if (directory === null || declaredOffset > directory.size - 4) {
1345
+ issues.push({
1346
+ code: "invalid-resource",
1347
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1348
+ offset: directory?.offset ?? null,
1349
+ detail: "Embedded resource offset leaves the CLI resources directory"
1350
+ });
1351
+ } else {
1352
+ const start = directory.offset + declaredOffset;
1353
+ dataLength = bytes.readUInt32LE(start);
1354
+ if (dataLength > directory.size - declaredOffset - 4) {
1355
+ issues.push({
1356
+ code: "invalid-resource",
1357
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1358
+ offset: start,
1359
+ detail: "Embedded resource length leaves the CLI resources directory"
1360
+ });
1361
+ } else {
1362
+ dataSha256 = managedDecodeBudget(layout).digest(bytes.subarray(start + 4, start + 4 + dataLength), "sha256");
1363
+ }
1364
+ }
1365
+ }
1366
+ return {
1367
+ name,
1368
+ flags,
1369
+ visibility: (flags & 7) === 1 ? "public" : (flags & 7) === 2 ? "private" : "unknown",
1370
+ implementation_token: implementationToken,
1371
+ embedded: implementationRaw === 0,
1372
+ declared_offset: declaredOffset,
1373
+ data_length: dataLength,
1374
+ data_sha256: dataSha256,
1375
+ token: metadataToken(40, row),
1376
+ row_offset: cursor.start
1377
+ };
1378
+ };
1379
+ })))();
1380
+ }
1381
+
1382
+ //#endregion
1383
+ //#region dist/dotnet/ManagedMetadataInventory.js
1384
+ var readManagedResourceDirectory, readRows, heapExtent, validateIdentityTableCounts, readReferences, readResources, readAttributes, readManagedMetadataInventory, managedTableRowCounts;
1385
+ function init_ManagedMetadataInventory() {
1386
+ return (init_ManagedMetadataInventory = __esmMin((() => {
1387
+ init_ManagedMetadataLayout();
1388
+ init_ManagedMetadataInventoryRows();
1389
+ init_ManagedMetadataHeaps();
1390
+ init_ManagedReaderFailure();
1391
+ readManagedResourceDirectory = (pe, issues) => {
1392
+ const resources = pe.cli?.resources;
1393
+ if (resources === undefined || resources.rva === 0 && resources.size === 0) return null;
1394
+ return readManagedValue(() => ({
1395
+ offset: pe.rvaToOffset(resources.rva, resources.size, "cli.resources"),
1396
+ size: resources.size
1397
+ }), issues) ?? null;
1398
+ };
1399
+ readRows = (descriptor, read) => {
1400
+ const total = descriptor?.rowCount ?? 0;
1401
+ const items = [];
1402
+ for (let index = 0; index < total; index += 1) {
1403
+ const item = read(index + 1);
1404
+ if (item !== undefined) items.push(item);
1405
+ }
1406
+ return items;
1407
+ };
1408
+ heapExtent = (layout) => Math.max(layout.strings.size, layout.blob.size);
1409
+ validateIdentityTableCounts = (layout, issues) => {
1410
+ const moduleRows = layout.table(0)?.rowCount ?? 0;
1411
+ if (moduleRows !== 1) issues.push({
1412
+ code: "invalid-row",
1413
+ scope: "metadata.Module",
1414
+ offset: layout.table(0)?.offset ?? null,
1415
+ detail: `Module table must contain exactly one row; found ${String(moduleRows)}`
1416
+ });
1417
+ const assemblyRows = layout.table(32)?.rowCount ?? 0;
1418
+ if (assemblyRows > 1) issues.push({
1419
+ code: "invalid-row",
1420
+ scope: "metadata.Assembly",
1421
+ offset: layout.table(32)?.offset ?? null,
1422
+ detail: `Assembly table can contain at most one row; found ${String(assemblyRows)}`
1423
+ });
1424
+ };
1425
+ readReferences = (bytes, layout, issues) => {
1426
+ const references = readRows(layout.table(35), (row) => readManagedValue(() => readAssemblyReference(bytes, layout, row, heapExtent(layout)), issues));
1427
+ return {
1428
+ references,
1429
+ referenceNames: [...new Set(references.map(({ name }) => name))].sort()
1430
+ };
1431
+ };
1432
+ readResources = ({ bytes, layout, resourceDirectory, issues }) => readRows(layout.table(40), (row) => readManagedValue(() => readResource({
1433
+ bytes,
1434
+ layout,
1435
+ row,
1436
+ directory: resourceDirectory,
1437
+ issues
1438
+ }), issues));
1439
+ readAttributes = (bytes, layout, issues) => {
1440
+ const attributes = readRows(layout.table(12), (row) => readManagedValue(() => readCustomAttribute(bytes, layout, row, heapExtent(layout), issues), issues));
1441
+ const targetFrameworks = new Set();
1442
+ for (const attribute of attributes) {
1443
+ if (attribute.parent_token === metadataToken(32, 1) && attribute.type_name === "System.Runtime.Versioning.TargetFrameworkAttribute" && attribute.decoded_fixed_string !== null) targetFrameworks.add(attribute.decoded_fixed_string);
1444
+ }
1445
+ return {
1446
+ attributes,
1447
+ targetFrameworks: [...targetFrameworks].sort()
1448
+ };
1449
+ };
1450
+ readManagedMetadataInventory = (bytes, layout, resourceDirectory) => {
1451
+ const issues = [];
1452
+ validateIdentityTableCounts(layout, issues);
1453
+ const module = readManagedValue(() => readModule(bytes, layout, heapExtent(layout)), issues) ?? null;
1454
+ const assembly = readManagedValue(() => readAssembly(bytes, layout, heapExtent(layout)), issues) ?? null;
1455
+ const { references, referenceNames } = readReferences(bytes, layout, issues);
1456
+ const resources = readResources({
1457
+ bytes,
1458
+ layout,
1459
+ resourceDirectory,
1460
+ issues
1461
+ });
1462
+ const { attributes, targetFrameworks } = readAttributes(bytes, layout, issues);
1463
+ return {
1464
+ module,
1465
+ assembly,
1466
+ targetFrameworks,
1467
+ referenceNames,
1468
+ references,
1469
+ resources,
1470
+ attributes,
1471
+ issues: uniqueManagedParseIssues(issues)
1472
+ };
1473
+ };
1474
+ managedTableRowCounts = (layout) => Object.fromEntries([...layout.tables.values()].map(({ index, rowCount }) => [METADATA_TABLE_NAMES[index] ?? `Table${String(index)}`, rowCount]));
1475
+ })))();
1476
+ }
1477
+
1478
+ //#endregion
1479
+ //#region dist/dotnet/ManagedArtifactInspector.js
1480
+ var flagNames, cliProjection, peProjection, base, unavailableResult, runtimeFamilyFor, implementationFor, managedArchitectureFor, runtimeClassification, partialMetadataResult, inspectManagedArtifactBytes;
1481
+ function init_ManagedArtifactInspector() {
1482
+ return (init_ManagedArtifactInspector = __esmMin((() => {
1483
+ init_ManagedDecodeBudget();
1484
+ init_managedArtifact();
1485
+ init_ManagedPeReader();
1486
+ init_ManagedMetadataInventory();
1487
+ init_ManagedMetadataLayout();
1488
+ init_ManagedReaderFailure();
1489
+ flagNames = (flags) => {
1490
+ const names = [];
1491
+ for (const [mask, name] of [
1492
+ [1, "il-only"],
1493
+ [2, "32-bit-required"],
1494
+ [4, "il-library"],
1495
+ [8, "strong-name-signed"],
1496
+ [16, "native-entry-point"],
1497
+ [65536, "track-debug-data"],
1498
+ [131072, "32-bit-preferred"]
1499
+ ]) if ((flags & mask) !== 0) names.push(name);
1500
+ return names;
1501
+ };
1502
+ cliProjection = (cli) => ({
1503
+ header_offset: cli.headerOffset,
1504
+ header_size: cli.headerSize,
1505
+ runtime_version: `${String(cli.runtimeMajor)}.${String(cli.runtimeMinor)}`,
1506
+ flags: cli.flags,
1507
+ flag_names: flagNames(cli.flags),
1508
+ entry_point: cli.entryPoint === 0 ? {
1509
+ kind: "none",
1510
+ value: null
1511
+ } : (cli.flags & 16) !== 0 ? {
1512
+ kind: "native-rva",
1513
+ value: `0x${cli.entryPoint.toString(16)}`
1514
+ } : {
1515
+ kind: "metadata-token",
1516
+ value: `0x${cli.entryPoint.toString(16).padStart(8, "0")}`
1517
+ },
1518
+ metadata_rva: cli.metadata.rva,
1519
+ metadata_size: cli.metadata.size,
1520
+ resources_rva: cli.resources.rva,
1521
+ resources_size: cli.resources.size,
1522
+ strong_name_rva: cli.strongName.rva,
1523
+ strong_name_size: cli.strongName.size,
1524
+ managed_native_header_rva: cli.managedNativeHeader.rva,
1525
+ managed_native_header_size: cli.managedNativeHeader.size,
1526
+ ready_to_run_signature: cli.readyToRunSignature
1527
+ });
1528
+ peProjection = (layout) => ({
1529
+ machine: layout.machine,
1530
+ machine_hex: `0x${layout.machine.toString(16).padStart(4, "0")}`,
1531
+ architecture: layout.architecture,
1532
+ optional_header: layout.optionalHeader,
1533
+ section_count: layout.sectionCount,
1534
+ characteristics: layout.characteristics,
1535
+ cli: layout.cli === null ? null : cliProjection(layout.cli)
1536
+ });
1537
+ base = (target, bytes, layout) => ({
1538
+ artifact: {
1539
+ path: target.path,
1540
+ sha256: target.sha256,
1541
+ byte_length: bytes.length,
1542
+ format: "pe"
1543
+ },
1544
+ pe: peProjection(layout)
1545
+ });
1546
+ unavailableResult = (target, bytes, layout) => {
1547
+ const malformed = layout.cliDirectoryState !== "absent";
1548
+ const issues = layout.cliIssue === null ? [] : [layout.cliIssue];
1549
+ const limitations = malformed ? ["The PE declares a CLI directory, but its CLI header could not be admitted."] : ["The PE has no CLI data directory; managed metadata and CIL are unavailable."];
1550
+ return managedArtifactInspectionSchema.parse(admitManagedProjection({
1551
+ ...base(target, bytes, layout),
1552
+ classification: {
1553
+ status: malformed ? "malformed" : "not-managed",
1554
+ container: "pe",
1555
+ runtime_family: "unknown",
1556
+ implementation: malformed ? "unknown" : "not-managed",
1557
+ managed_architecture: "unknown",
1558
+ evidence: [{
1559
+ code: malformed ? "cli-directory-malformed" : "cli-directory-absent",
1560
+ detail: limitations[0],
1561
+ file_offset: layout.cliIssue?.offset ?? null
1562
+ }]
1563
+ },
1564
+ metadata: {
1565
+ status: malformed ? "malformed" : "absent",
1566
+ version: null,
1567
+ stream_names: [],
1568
+ table_row_counts: {}
1569
+ },
1570
+ module: null,
1571
+ assembly: null,
1572
+ target_frameworks: [],
1573
+ references: [],
1574
+ resources: [],
1575
+ attributes: [],
1576
+ coverage: {
1577
+ state: malformed ? "partial" : "unavailable",
1578
+ issues
1579
+ },
1580
+ limitations
1581
+ }));
1582
+ };
1583
+ runtimeFamilyFor = (cli, inventory, metadata, layout) => {
1584
+ const evidence = [{
1585
+ code: "cli-header-observed",
1586
+ detail: "A file-backed PE CLI header and metadata root were admitted.",
1587
+ file_offset: cli.headerOffset
1588
+ }];
1589
+ const frameworks = inventory.targetFrameworks;
1590
+ const hasUnity = inventory.referenceNames.some((name) => name === "UnityEngine" || name.startsWith("UnityEngine."));
1591
+ let runtimeFamily = "unknown";
1592
+ if ((cli.flags & 1) === 0) {
1593
+ runtimeFamily = "mixed-clr-native";
1594
+ evidence.push({
1595
+ code: "cli-il-only-clear",
1596
+ detail: "COMIMAGE_FLAGS_ILONLY is clear, so managed and native analysis must remain composed.",
1597
+ file_offset: cli.headerOffset + 16
1598
+ });
1599
+ } else if (hasUnity) {
1600
+ runtimeFamily = "unity-mono";
1601
+ evidence.push({
1602
+ code: "unity-reference-observed",
1603
+ detail: "The admitted AssemblyRef table contains a UnityEngine reference.",
1604
+ file_offset: metadata.table(35)?.offset ?? null
1605
+ });
1606
+ } else if (frameworks.some((value) => value.startsWith(".NETFramework,"))) {
1607
+ runtimeFamily = "dotnet-framework";
1608
+ evidence.push({
1609
+ code: "target-framework-observed",
1610
+ detail: "An assembly-level TargetFrameworkAttribute names .NET Framework.",
1611
+ file_offset: metadata.table(12)?.offset ?? null
1612
+ });
1613
+ } else if (frameworks.some((value) => value.startsWith(".NETCoreApp,")) || cli.readyToRunSignature) {
1614
+ runtimeFamily = "modern-dotnet";
1615
+ evidence.push({
1616
+ code: cli.readyToRunSignature ? "ready-to-run-signature-observed" : "target-framework-observed",
1617
+ detail: cli.readyToRunSignature ? "The managed native header has the ReadyToRun signature." : "An assembly-level TargetFrameworkAttribute names modern .NET.",
1618
+ file_offset: cli.readyToRunSignature ? layout.rvaToOffset(cli.managedNativeHeader.rva, 4, "cli.managed-native-header") : metadata.table(12)?.offset ?? null
1619
+ });
1620
+ } else if (frameworks.some((value) => value.startsWith(".NETStandard,"))) {
1621
+ evidence.push({
1622
+ code: "target-framework-observed",
1623
+ detail: "An assembly-level TargetFrameworkAttribute names .NET Standard, an API specification that does not identify a runtime family.",
1624
+ file_offset: metadata.table(12)?.offset ?? null
1625
+ });
1626
+ }
1627
+ return {
1628
+ runtime_family: runtimeFamily,
1629
+ evidence
1630
+ };
1631
+ };
1632
+ implementationFor = (cli, metadata) => {
1633
+ if ((cli.flags & 1) === 0) return "cpp-cli-mixed";
1634
+ if (cli.readyToRunSignature) return "cil-and-ready-to-run";
1635
+ return (metadata.rowCounts[6] ?? 0) === 0 ? "metadata-only" : "cil";
1636
+ };
1637
+ managedArchitectureFor = (layout, cli) => {
1638
+ if (layout.architecture !== "x86" || (cli.flags & 1) === 0) return layout.architecture;
1639
+ if ((cli.flags & 2) !== 0) return "x86";
1640
+ if ((cli.flags & 131072) !== 0) return "anycpu-prefer-32";
1641
+ return "anycpu";
1642
+ };
1643
+ runtimeClassification = ({ layout, metadata, inventory }) => {
1644
+ const cli = layout.cli;
1645
+ if (cli === null) throw new TypeError("Managed classification requires CLI");
1646
+ const { runtime_family: runtimeFamily, evidence } = runtimeFamilyFor(cli, inventory, metadata, layout);
1647
+ const implementation = implementationFor(cli, metadata);
1648
+ const managedArchitecture = managedArchitectureFor(layout, cli);
1649
+ evidence.push({
1650
+ code: "managed-architecture-derived",
1651
+ detail: `Managed architecture ${managedArchitecture} is derived from PE machine and CLI flags.`,
1652
+ file_offset: cli.headerOffset + 16
1653
+ });
1654
+ return {
1655
+ runtime_family: runtimeFamily,
1656
+ implementation,
1657
+ managed_architecture: managedArchitecture,
1658
+ evidence
1659
+ };
1660
+ };
1661
+ partialMetadataResult = ({ target, bytes, layout, issue }) => ({
1662
+ ...base(target, bytes, layout),
1663
+ classification: {
1664
+ status: issue.code === "resource-limit" ? "managed" : "malformed",
1665
+ container: "pe",
1666
+ runtime_family: (layout.cli?.flags ?? 1) & 1 ? "unknown" : "mixed-clr-native",
1667
+ implementation: "unknown",
1668
+ managed_architecture: "unknown",
1669
+ evidence: [{
1670
+ code: "metadata-not-admitted",
1671
+ detail: issue.detail,
1672
+ file_offset: issue.offset
1673
+ }]
1674
+ },
1675
+ metadata: {
1676
+ status: issue.code === "resource-limit" ? "partial" : "malformed",
1677
+ version: null,
1678
+ stream_names: [],
1679
+ table_row_counts: {}
1680
+ },
1681
+ module: null,
1682
+ assembly: null,
1683
+ target_frameworks: [],
1684
+ references: [],
1685
+ resources: [],
1686
+ attributes: [],
1687
+ coverage: {
1688
+ state: "partial",
1689
+ issues: [issue]
1690
+ },
1691
+ limitations: [issue.code === "resource-limit" ? "CLI metadata inspection stopped at its representation budget; omitted facts are unknown." : "CLI metadata could not be read because the PE/CLI structure is malformed or unsupported."]
1692
+ });
1693
+ inspectManagedArtifactBytes = (bytes, target) => {
1694
+ const layout = readManagedPeLayout(bytes);
1695
+ if (layout.cli === null) return unavailableResult(target, bytes, layout);
1696
+ const cli = layout.cli;
1697
+ let metadata;
1698
+ try {
1699
+ const metadataOffset = layout.rvaToOffset(cli.metadata.rva, cli.metadata.size, "cli.metadata");
1700
+ metadata = readManagedMetadataLayout(bytes, metadataOffset, cli.metadata.size);
1701
+ } catch (cause) {
1702
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
1703
+ return managedArtifactInspectionSchema.parse(admitManagedProjection(partialMetadataResult({
1704
+ target,
1705
+ bytes,
1706
+ layout,
1707
+ issue: cause.issue
1708
+ })));
1709
+ }
1710
+ const resourceIssues = [];
1711
+ const resourceDirectory = readManagedResourceDirectory(layout, resourceIssues);
1712
+ try {
1713
+ const inventory = readManagedMetadataInventory(bytes, metadata, resourceDirectory);
1714
+ const issues = [...resourceIssues, ...inventory.issues];
1715
+ const limitations = [...issues.length === 0 ? [] : ["At least one metadata or resource item could not be read; coverage is partial."], "Static inspection did not load the assembly, resolve dependencies through a CLR, decompile C#, or execute target code."];
1716
+ return managedArtifactInspectionSchema.parse(admitManagedProjection({
1717
+ ...base(target, bytes, layout),
1718
+ classification: {
1719
+ status: "managed",
1720
+ container: "pe",
1721
+ ...runtimeClassification({
1722
+ layout,
1723
+ metadata,
1724
+ inventory
1725
+ })
1726
+ },
1727
+ metadata: {
1728
+ status: issues.length === 0 ? "complete" : "partial",
1729
+ version: metadata.version,
1730
+ stream_names: metadata.streamNames,
1731
+ table_row_counts: managedTableRowCounts(metadata)
1732
+ },
1733
+ module: inventory.module,
1734
+ assembly: inventory.assembly,
1735
+ target_frameworks: inventory.targetFrameworks,
1736
+ references: inventory.references,
1737
+ resources: inventory.resources,
1738
+ attributes: inventory.attributes,
1739
+ coverage: {
1740
+ state: issues.length === 0 ? "complete" : "partial",
1741
+ issues
1742
+ },
1743
+ limitations
1744
+ }, managedDecodeBudget(metadata)));
1745
+ } catch (cause) {
1746
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
1747
+ return managedArtifactInspectionSchema.parse(admitManagedProjection(partialMetadataResult({
1748
+ target,
1749
+ bytes,
1750
+ layout,
1751
+ issue: cause.issue
1752
+ })));
1753
+ }
1754
+ };
1755
+ })))();
1756
+ }
1757
+
1758
+ //#endregion
1759
+ //#region dist/dotnet/ManagedMemberInspectorCore.js
1760
+ var rowRange, fullName, readTypeRange, typeRanges, parseTypes, readCompressed, ELEMENT_TYPES, readSignedCompressed, malformedSignature, readMethodSignatureHeader, MAX_ARRAY_RANK, FUNCTION_POINTER_CONVENTIONS, arrayShape, currentPosition, POSITION_ELEMENTS, readTypeSignature, CALLING_CONVENTION_NAMES, callingConvention, signature;
1761
+ function init_ManagedMemberInspectorCore() {
1762
+ return (init_ManagedMemberInspectorCore = __esmMin((() => {
1763
+ init_ManagedReaderFailure();
1764
+ init_ManagedMetadataHeaps();
1765
+ init_ManagedMemberPointers();
1766
+ rowRange = (table, start, nextStart) => {
1767
+ const total = table?.rowCount ?? 0;
1768
+ if (total === 0 || start === 0) return {
1769
+ first: null,
1770
+ last: null,
1771
+ count: 0
1772
+ };
1773
+ const end = Math.min(nextStart === 0 ? total + 1 : nextStart, total + 1);
1774
+ if (start >= end) return {
1775
+ first: null,
1776
+ last: null,
1777
+ count: 0
1778
+ };
1779
+ return {
1780
+ first: start,
1781
+ last: end - 1,
1782
+ count: end - start
1783
+ };
1784
+ };
1785
+ fullName = (namespace, name) => namespace.length === 0 ? name : `${namespace}.${name}`;
1786
+ readTypeRange = (bytes, layout, row, issues) => {
1787
+ const methods = memberListTable(layout, 6);
1788
+ const fields = memberListTable(layout, 4);
1789
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1790
+ cursor.readUInt32();
1791
+ const nameIndex = cursor.readIndex(layout.stringIndexSize);
1792
+ const namespaceIndex = cursor.readIndex(layout.stringIndexSize);
1793
+ const declaredName = readManagedValue(() => fullName(readMetadataString(bytes, layout, namespaceIndex, layout.strings.size), readMetadataString(bytes, layout, nameIndex, layout.strings.size)), issues) ?? null;
1794
+ cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1795
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1796
+ const methodStart = cursor.readIndex(memberListIndexSize(layout, 6));
1797
+ let nextField = (fields?.rowCount ?? 0) + 1;
1798
+ let nextMethod = (methods?.rowCount ?? 0) + 1;
1799
+ const typeTable = layout.table(2);
1800
+ if (typeTable !== undefined && row < typeTable.rowCount) {
1801
+ const next = metadataRowCursor(bytes, layout, 2, row + 1);
1802
+ next.readUInt32();
1803
+ next.readIndex(layout.stringIndexSize);
1804
+ next.readIndex(layout.stringIndexSize);
1805
+ next.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1806
+ nextField = next.readIndex(memberListIndexSize(layout, 4));
1807
+ nextMethod = next.readIndex(memberListIndexSize(layout, 6));
1808
+ }
1809
+ return {
1810
+ token: metadataToken(2, row),
1811
+ fullName: declaredName,
1812
+ fieldStart,
1813
+ fieldEnd: nextField,
1814
+ methodStart,
1815
+ methodEnd: nextMethod
1816
+ };
1817
+ };
1818
+ typeRanges = (bytes, layout, issues) => {
1819
+ const typeTable = layout.table(2);
1820
+ const ranges = [];
1821
+ for (let row = 1; row <= (typeTable?.rowCount ?? 0); row += 1) ranges.push(readTypeRange(bytes, layout, row, issues));
1822
+ return ranges;
1823
+ };
1824
+ parseTypes = (bytes, layout, ranges) => {
1825
+ const typeTable = layout.table(2);
1826
+ const fields = memberListTable(layout, 4);
1827
+ const methods = memberListTable(layout, 6);
1828
+ const items = [];
1829
+ const issues = [];
1830
+ for (let row = 1; row <= (typeTable?.rowCount ?? 0); row += 1) {
1831
+ readManagedValue(() => {
1832
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1833
+ const flags = cursor.readUInt32();
1834
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
1835
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
1836
+ const extendsOffset = cursor.offset;
1837
+ const extendsRaw = cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1838
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1839
+ const methodStart = cursor.readIndex(memberListIndexSize(layout, 6));
1840
+ const nextRange = ranges[row] ?? null;
1841
+ const fieldRange = rowRange(fields, fieldStart, nextRange?.fieldStart ?? 0);
1842
+ const methodRange = rowRange(methods, methodStart, nextRange?.methodStart ?? 0);
1843
+ const extendsReason = metadataCodedTokenInvalidReason(extendsRaw, 2, [
1844
+ 2,
1845
+ 1,
1846
+ 27
1847
+ ], layout.rowCounts);
1848
+ if (extendsReason !== null) issues.push({
1849
+ code: "invalid-row",
1850
+ scope: `metadata.TypeDef:${metadataToken(2, row)}`,
1851
+ offset: extendsOffset,
1852
+ detail: `TypeDef Extends coded index 0x${extendsRaw.toString(16)} is invalid: ${extendsReason}`
1853
+ });
1854
+ items.push({
1855
+ token: metadataToken(2, row),
1856
+ row_offset: cursor.start,
1857
+ namespace,
1858
+ name,
1859
+ full_name: fullName(namespace, name),
1860
+ flags,
1861
+ extends_token: metadataCodedToken(extendsRaw, 2, [
1862
+ 2,
1863
+ 1,
1864
+ 27
1865
+ ], layout.rowCounts),
1866
+ field_list: {
1867
+ first_row: fieldRange.first,
1868
+ last_row: fieldRange.last,
1869
+ count: fieldRange.count
1870
+ },
1871
+ method_list: {
1872
+ first_row: methodRange.first,
1873
+ last_row: methodRange.last,
1874
+ count: methodRange.count
1875
+ }
1876
+ });
1877
+ }, issues);
1878
+ }
1879
+ return {
1880
+ types: items,
1881
+ issues
1882
+ };
1883
+ };
1884
+ readCompressed = (bytes, offset) => {
1885
+ const first = bytes[offset];
1886
+ if (first === undefined) throw managedFailure("invalid-blob", "signature", "truncated compressed integer", offset);
1887
+ if ((first & 128) === 0) return {
1888
+ value: first,
1889
+ next: offset + 1
1890
+ };
1891
+ const second = bytes[offset + 1];
1892
+ if ((first & 192) === 128 && second !== undefined) return {
1893
+ value: (first & 63) << 8 | second,
1894
+ next: offset + 2
1895
+ };
1896
+ const b1 = bytes[offset + 1];
1897
+ const b2 = bytes[offset + 2];
1898
+ const b3 = bytes[offset + 3];
1899
+ if ((first & 224) === 192 && b1 !== undefined && b2 !== undefined && b3 !== undefined) return {
1900
+ value: (first & 31) * 16777216 + b1 * 65536 + b2 * 256 + b3,
1901
+ next: offset + 4
1902
+ };
1903
+ throw managedFailure("invalid-blob", "signature", "reserved compressed integer", offset);
1904
+ };
1905
+ ELEMENT_TYPES = new Map([
1906
+ [1, "void"],
1907
+ [2, "bool"],
1908
+ [3, "char"],
1909
+ [4, "i1"],
1910
+ [5, "u1"],
1911
+ [6, "i2"],
1912
+ [7, "u2"],
1913
+ [8, "i4"],
1914
+ [9, "u4"],
1915
+ [10, "i8"],
1916
+ [11, "u8"],
1917
+ [12, "r4"],
1918
+ [13, "r8"],
1919
+ [14, "string"],
1920
+ [24, "native-int"],
1921
+ [25, "native-uint"],
1922
+ [28, "object"]
1923
+ ]);
1924
+ readSignedCompressed = (bytes, offset) => {
1925
+ const encoded = readCompressed(bytes, offset);
1926
+ const width = encoded.next - offset === 1 ? 7 : encoded.next - offset === 2 ? 14 : 29;
1927
+ const magnitude = Math.floor(encoded.value / 2);
1928
+ return {
1929
+ value: encoded.value % 2 === 0 ? magnitude : magnitude - 2 ** (width - 1),
1930
+ next: encoded.next
1931
+ };
1932
+ };
1933
+ malformedSignature = (detail, offset) => {
1934
+ throw managedFailure("invalid-blob", "signature", detail, offset);
1935
+ };
1936
+ readMethodSignatureHeader = (blob, offset) => {
1937
+ const first = blob[offset];
1938
+ if (first === undefined) return malformedSignature("truncated method signature", offset);
1939
+ let next = offset + 1;
1940
+ let genericParameterCount = null;
1941
+ if ((first & 16) !== 0) {
1942
+ const generic = readCompressed(blob, next);
1943
+ genericParameterCount = generic.value;
1944
+ next = generic.next;
1945
+ }
1946
+ const parameterCount = readCompressed(blob, next);
1947
+ return {
1948
+ first,
1949
+ genericParameterCount,
1950
+ parameterCount: parameterCount.value,
1951
+ next: parameterCount.next
1952
+ };
1953
+ };
1954
+ MAX_ARRAY_RANK = 32;
1955
+ FUNCTION_POINTER_CONVENTIONS = new Set([
1956
+ 0,
1957
+ 1,
1958
+ 2,
1959
+ 3,
1960
+ 4,
1961
+ 5,
1962
+ 9
1963
+ ]);
1964
+ arrayShape = (blob, offset) => {
1965
+ const rank = readCompressed(blob, offset);
1966
+ if (rank.value === 0) return malformedSignature("array rank is zero", offset);
1967
+ if (rank.value > MAX_ARRAY_RANK) throw managedFailure("unsupported-signature", "signature", `array rank ${String(rank.value)} exceeds the ${String(MAX_ARRAY_RANK)} dimensions the CLR supports`, offset);
1968
+ const sizeCount = readCompressed(blob, rank.next);
1969
+ if (sizeCount.value > rank.value) return malformedSignature("array has more sizes than dimensions", offset);
1970
+ const sizes = [];
1971
+ let next = sizeCount.next;
1972
+ for (let index = 0; index < sizeCount.value; index += 1) {
1973
+ const size = readCompressed(blob, next);
1974
+ sizes.push(size.value);
1975
+ next = size.next;
1976
+ }
1977
+ const boundCount = readCompressed(blob, next);
1978
+ if (boundCount.value > rank.value) return malformedSignature("array has more lower bounds than dimensions", offset);
1979
+ const lowerBounds = [];
1980
+ next = boundCount.next;
1981
+ for (let index = 0; index < boundCount.value; index += 1) {
1982
+ const bound = readSignedCompressed(blob, next);
1983
+ lowerBounds.push(bound.value);
1984
+ next = bound.next;
1985
+ }
1986
+ const dimensions = Array.from({ length: rank.value }, (_, index) => {
1987
+ const size = sizes[index];
1988
+ const lower = lowerBounds[index];
1989
+ if (lower !== undefined) return size === undefined ? `${String(lower)}...` : `${String(lower)}...${String(lower + size - 1)}`;
1990
+ if (size !== undefined) return String(size);
1991
+ return rank.value === 1 ? "..." : "";
1992
+ });
1993
+ return {
1994
+ value: `[${dimensions.join(",")}]`,
1995
+ next
1996
+ };
1997
+ };
1998
+ currentPosition = (stack, base) => {
1999
+ const frame = stack.findLast(({ kind }) => kind !== "modifiers");
2000
+ if (frame === undefined) return base;
2001
+ if (frame.kind === "suffix") return frame.suffix === "*" ? "pointee" : "type";
2002
+ if (frame.kind === "list" && frame.signatureItems) return frame.items.length === 0 ? "return" : "parameter";
2003
+ return "type";
2004
+ };
2005
+ POSITION_ELEMENTS = new Map([
2006
+ [1, ["return", "pointee"]],
2007
+ [22, ["return", "parameter"]],
2008
+ [16, [
2009
+ "return",
2010
+ "parameter",
2011
+ "field"
2012
+ ]]
2013
+ ]);
2014
+ readTypeSignature = (blob, offset, base) => {
2015
+ const stack = [];
2016
+ let cursor = offset;
2017
+ for (;;) {
2018
+ let value;
2019
+ const kind = blob[cursor];
2020
+ if (kind === undefined) return malformedSignature("truncated type signature", cursor);
2021
+ const positions = POSITION_ELEMENTS.get(kind);
2022
+ if (positions !== undefined && !positions.includes(currentPosition(stack, base))) return malformedSignature(`element type 0x${kind.toString(16)} is not valid in a ${currentPosition(stack, base)} position`, cursor);
2023
+ const named = ELEMENT_TYPES.get(kind);
2024
+ if (named !== undefined) {
2025
+ value = named;
2026
+ cursor += 1;
2027
+ } else if (kind === 15 || kind === 16 || kind === 29) {
2028
+ const suffix = kind === 15 ? "*" : kind === 16 ? "&" : "[]";
2029
+ stack.push({
2030
+ kind: "suffix",
2031
+ suffix
2032
+ });
2033
+ cursor += 1;
2034
+ } else if (kind === 31 || kind === 32) {
2035
+ const token = readCompressed(blob, cursor + 1);
2036
+ const modifier = `${kind === 31 ? "modreq" : "modopt"}:${String(token.value)}`;
2037
+ const top = stack.at(-1);
2038
+ if (top?.kind === "modifiers") top.modifiers.push(modifier);
2039
+ else stack.push({
2040
+ kind: "modifiers",
2041
+ modifiers: [modifier]
2042
+ });
2043
+ cursor = token.next;
2044
+ } else if (kind === 17 || kind === 18) {
2045
+ const token = readCompressed(blob, cursor + 1);
2046
+ value = `${kind === 17 ? "valuetype" : "class"}:${String(token.value)}`;
2047
+ cursor = token.next;
2048
+ } else if (kind === 30 || kind === 19) {
2049
+ const variable = readCompressed(blob, cursor + 1);
2050
+ value = `${kind === 30 ? "mvar" : "var"}:${String(variable.value)}`;
2051
+ cursor = variable.next;
2052
+ } else if (kind === 22) {
2053
+ value = "typedbyref";
2054
+ cursor += 1;
2055
+ } else if (kind === 20) {
2056
+ stack.push({ kind: "array" });
2057
+ cursor += 1;
2058
+ } else if (kind === 21) {
2059
+ const generic = blob[cursor + 1];
2060
+ if (generic !== 17 && generic !== 18) return malformedSignature("generic instantiation does not name a class or value type", cursor + 1);
2061
+ const token = readCompressed(blob, cursor + 2);
2062
+ const argumentCount = readCompressed(blob, token.next);
2063
+ if (argumentCount.value === 0) return malformedSignature("generic instantiation has no type arguments", token.next);
2064
+ const head = `${generic === 17 ? "valuetype" : "class"}:${String(token.value)}`;
2065
+ stack.push({
2066
+ kind: "list",
2067
+ remaining: argumentCount.value,
2068
+ items: [],
2069
+ signatureItems: false,
2070
+ render: (items) => `${head}<${items.join(",")}>`
2071
+ });
2072
+ cursor = argumentCount.next;
2073
+ } else if (kind === 27) {
2074
+ const header = readMethodSignatureHeader(blob, cursor + 1);
2075
+ if (!FUNCTION_POINTER_CONVENTIONS.has(header.first & 15) || (header.first & 128) !== 0 || (header.first & 64) !== 0 && (header.first & 32) === 0) return malformedSignature(`function pointer calling convention 0x${header.first.toString(16)} does not head a method signature`, cursor + 1);
2076
+ const convention = callingConvention(header.first);
2077
+ const head = header.genericParameterCount === null ? convention : `${convention};${String(header.genericParameterCount)}`;
2078
+ stack.push({
2079
+ kind: "list",
2080
+ remaining: header.parameterCount + 1,
2081
+ items: [],
2082
+ signatureItems: true,
2083
+ render: ([returnType, ...parameters]) => `fnptr[${head}](${parameters.join(",")})->${returnType ?? ""}`
2084
+ });
2085
+ cursor = header.next;
2086
+ } else {
2087
+ throw managedFailure("unsupported-signature", "signature", `unsupported element type 0x${kind.toString(16)}`, cursor);
2088
+ }
2089
+ while (value !== undefined) {
2090
+ const top = stack.pop();
2091
+ if (top === undefined) return {
2092
+ value,
2093
+ next: cursor
2094
+ };
2095
+ if (top.kind === "suffix") value += top.suffix;
2096
+ else if (top.kind === "modifiers") value = `${value} ${top.modifiers.join(" ")}`;
2097
+ else if (top.kind === "array") {
2098
+ const shape = arrayShape(blob, cursor);
2099
+ value += shape.value;
2100
+ cursor = shape.next;
2101
+ } else {
2102
+ top.items.push(value);
2103
+ top.remaining -= 1;
2104
+ if (top.remaining === 0) value = top.render(top.items);
2105
+ else {
2106
+ value = undefined;
2107
+ stack.push(top);
2108
+ }
2109
+ }
2110
+ }
2111
+ }
2112
+ };
2113
+ CALLING_CONVENTION_NAMES = new Map([
2114
+ [0, "default"],
2115
+ [1, "c"],
2116
+ [2, "stdcall"],
2117
+ [3, "thiscall"],
2118
+ [4, "fastcall"],
2119
+ [5, "vararg"],
2120
+ [6, "field"],
2121
+ [9, "unmanaged"]
2122
+ ]);
2123
+ callingConvention = (value) => {
2124
+ const base = value & 15;
2125
+ const flags = [
2126
+ (value & 32) === 0 ? null : "has-this",
2127
+ (value & 64) === 0 ? null : "explicit-this",
2128
+ (value & 16) === 0 ? null : "generic"
2129
+ ].filter((flag) => flag !== null);
2130
+ const name = CALLING_CONVENTION_NAMES.get(base) ?? `unknown:${String(base)}`;
2131
+ return flags.length === 0 ? name : `${name} ${flags.join(" ")}`;
2132
+ };
2133
+ signature = (blob, rawSha256) => {
2134
+ const raw = {
2135
+ raw_length: blob.length,
2136
+ raw_sha256: rawSha256 ?? sha256Bytes(blob)
2137
+ };
2138
+ try {
2139
+ if (blob.length === 0) throw managedFailure("invalid-blob", "signature", "empty signature", 0);
2140
+ const first = blob[0] ?? 0;
2141
+ if ((first & 15) === 6) {
2142
+ const fieldType = readTypeSignature(blob, 1, "field");
2143
+ return {
2144
+ ...raw,
2145
+ kind: "field",
2146
+ parse_status: fieldType.next === blob.length ? "decoded" : "partial",
2147
+ calling_convention: callingConvention(first),
2148
+ generic_parameter_count: null,
2149
+ parameter_count: null,
2150
+ return_type: null,
2151
+ parameter_types: [],
2152
+ field_type: fieldType.value,
2153
+ issue: fieldType.next === blob.length ? null : "Trailing signature data"
2154
+ };
2155
+ }
2156
+ const header = readMethodSignatureHeader(blob, 0);
2157
+ const returnType = readTypeSignature(blob, header.next, "return");
2158
+ let offset = returnType.next;
2159
+ const parameters = [];
2160
+ for (let index = 0; index < header.parameterCount; index += 1) {
2161
+ const parameter = readTypeSignature(blob, offset, "parameter");
2162
+ parameters.push(parameter.value);
2163
+ offset = parameter.next;
2164
+ }
2165
+ return {
2166
+ ...raw,
2167
+ kind: "method",
2168
+ parse_status: offset === blob.length ? "decoded" : "partial",
2169
+ calling_convention: callingConvention(first),
2170
+ generic_parameter_count: header.genericParameterCount,
2171
+ parameter_count: header.parameterCount,
2172
+ return_type: returnType.value,
2173
+ parameter_types: parameters,
2174
+ field_type: null,
2175
+ issue: offset === blob.length ? null : "Trailing signature data"
2176
+ };
2177
+ } catch (cause) {
2178
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
2179
+ if (cause.issue.code !== "invalid-blob" && cause.issue.code !== "unsupported-signature") throw cause;
2180
+ return {
2181
+ ...raw,
2182
+ kind: "unknown",
2183
+ parse_status: cause.issue.code === "unsupported-signature" ? "unsupported" : "malformed",
2184
+ calling_convention: null,
2185
+ generic_parameter_count: null,
2186
+ parameter_count: null,
2187
+ return_type: null,
2188
+ parameter_types: [],
2189
+ field_type: null,
2190
+ issue: cause.issue.detail
2191
+ };
2192
+ }
2193
+ };
2194
+ })))();
2195
+ }
2196
+
2197
+ //#endregion
2198
+ //#region dist/dotnet/ManagedMemberInstructionDecoder.js
2199
+ var PREFIX_OPCODES, OPCODES, tokenKind, FIXED_OPERAND_READERS, TOKEN_OPERAND_KINDS, readOperand, decodeInstructions, parseExceptionRegions, malformedExceptionRegions, readExceptionClauses;
2200
+ function init_ManagedMemberInstructionDecoder() {
2201
+ return (init_ManagedMemberInstructionDecoder = __esmMin((() => {
2202
+ init_ManagedReaderFailure();
2203
+ PREFIX_OPCODES = new Set([
2204
+ "unaligned.",
2205
+ "volatile.",
2206
+ "tail.",
2207
+ "constrained.",
2208
+ "readonly."
2209
+ ]);
2210
+ OPCODES = new Map([
2211
+ [0, {
2212
+ name: "nop",
2213
+ operand: "none"
2214
+ }],
2215
+ [1, {
2216
+ name: "break",
2217
+ operand: "none"
2218
+ }],
2219
+ [2, {
2220
+ name: "ldarg.0",
2221
+ operand: "none"
2222
+ }],
2223
+ [3, {
2224
+ name: "ldarg.1",
2225
+ operand: "none"
2226
+ }],
2227
+ [4, {
2228
+ name: "ldarg.2",
2229
+ operand: "none"
2230
+ }],
2231
+ [5, {
2232
+ name: "ldarg.3",
2233
+ operand: "none"
2234
+ }],
2235
+ [6, {
2236
+ name: "ldloc.0",
2237
+ operand: "none"
2238
+ }],
2239
+ [7, {
2240
+ name: "ldloc.1",
2241
+ operand: "none"
2242
+ }],
2243
+ [8, {
2244
+ name: "ldloc.2",
2245
+ operand: "none"
2246
+ }],
2247
+ [9, {
2248
+ name: "ldloc.3",
2249
+ operand: "none"
2250
+ }],
2251
+ [10, {
2252
+ name: "stloc.0",
2253
+ operand: "none"
2254
+ }],
2255
+ [11, {
2256
+ name: "stloc.1",
2257
+ operand: "none"
2258
+ }],
2259
+ [12, {
2260
+ name: "stloc.2",
2261
+ operand: "none"
2262
+ }],
2263
+ [13, {
2264
+ name: "stloc.3",
2265
+ operand: "none"
2266
+ }],
2267
+ [14, {
2268
+ name: "ldarg.s",
2269
+ operand: "short-var"
2270
+ }],
2271
+ [15, {
2272
+ name: "ldarga.s",
2273
+ operand: "short-var"
2274
+ }],
2275
+ [16, {
2276
+ name: "starg.s",
2277
+ operand: "short-var"
2278
+ }],
2279
+ [17, {
2280
+ name: "ldloc.s",
2281
+ operand: "short-var"
2282
+ }],
2283
+ [18, {
2284
+ name: "ldloca.s",
2285
+ operand: "short-var"
2286
+ }],
2287
+ [19, {
2288
+ name: "stloc.s",
2289
+ operand: "short-var"
2290
+ }],
2291
+ [20, {
2292
+ name: "ldnull",
2293
+ operand: "none"
2294
+ }],
2295
+ [21, {
2296
+ name: "ldc.i4.m1",
2297
+ operand: "none"
2298
+ }],
2299
+ [22, {
2300
+ name: "ldc.i4.0",
2301
+ operand: "none"
2302
+ }],
2303
+ [23, {
2304
+ name: "ldc.i4.1",
2305
+ operand: "none"
2306
+ }],
2307
+ [24, {
2308
+ name: "ldc.i4.2",
2309
+ operand: "none"
2310
+ }],
2311
+ [25, {
2312
+ name: "ldc.i4.3",
2313
+ operand: "none"
2314
+ }],
2315
+ [26, {
2316
+ name: "ldc.i4.4",
2317
+ operand: "none"
2318
+ }],
2319
+ [27, {
2320
+ name: "ldc.i4.5",
2321
+ operand: "none"
2322
+ }],
2323
+ [28, {
2324
+ name: "ldc.i4.6",
2325
+ operand: "none"
2326
+ }],
2327
+ [29, {
2328
+ name: "ldc.i4.7",
2329
+ operand: "none"
2330
+ }],
2331
+ [30, {
2332
+ name: "ldc.i4.8",
2333
+ operand: "none"
2334
+ }],
2335
+ [31, {
2336
+ name: "ldc.i4.s",
2337
+ operand: "short-i"
2338
+ }],
2339
+ [32, {
2340
+ name: "ldc.i4",
2341
+ operand: "i"
2342
+ }],
2343
+ [33, {
2344
+ name: "ldc.i8",
2345
+ operand: "i8"
2346
+ }],
2347
+ [34, {
2348
+ name: "ldc.r4",
2349
+ operand: "r4"
2350
+ }],
2351
+ [35, {
2352
+ name: "ldc.r8",
2353
+ operand: "r8"
2354
+ }],
2355
+ [37, {
2356
+ name: "dup",
2357
+ operand: "none"
2358
+ }],
2359
+ [38, {
2360
+ name: "pop",
2361
+ operand: "none"
2362
+ }],
2363
+ [39, {
2364
+ name: "jmp",
2365
+ operand: "method"
2366
+ }],
2367
+ [40, {
2368
+ name: "call",
2369
+ operand: "method"
2370
+ }],
2371
+ [41, {
2372
+ name: "calli",
2373
+ operand: "signature"
2374
+ }],
2375
+ [42, {
2376
+ name: "ret",
2377
+ operand: "none"
2378
+ }],
2379
+ [43, {
2380
+ name: "br.s",
2381
+ operand: "short-branch"
2382
+ }],
2383
+ [44, {
2384
+ name: "brfalse.s",
2385
+ operand: "short-branch"
2386
+ }],
2387
+ [45, {
2388
+ name: "brtrue.s",
2389
+ operand: "short-branch"
2390
+ }],
2391
+ [46, {
2392
+ name: "beq.s",
2393
+ operand: "short-branch"
2394
+ }],
2395
+ [47, {
2396
+ name: "bge.s",
2397
+ operand: "short-branch"
2398
+ }],
2399
+ [48, {
2400
+ name: "bgt.s",
2401
+ operand: "short-branch"
2402
+ }],
2403
+ [49, {
2404
+ name: "ble.s",
2405
+ operand: "short-branch"
2406
+ }],
2407
+ [50, {
2408
+ name: "blt.s",
2409
+ operand: "short-branch"
2410
+ }],
2411
+ [51, {
2412
+ name: "bne.un.s",
2413
+ operand: "short-branch"
2414
+ }],
2415
+ [52, {
2416
+ name: "bge.un.s",
2417
+ operand: "short-branch"
2418
+ }],
2419
+ [53, {
2420
+ name: "bgt.un.s",
2421
+ operand: "short-branch"
2422
+ }],
2423
+ [54, {
2424
+ name: "ble.un.s",
2425
+ operand: "short-branch"
2426
+ }],
2427
+ [55, {
2428
+ name: "blt.un.s",
2429
+ operand: "short-branch"
2430
+ }],
2431
+ [56, {
2432
+ name: "br",
2433
+ operand: "branch"
2434
+ }],
2435
+ [57, {
2436
+ name: "brfalse",
2437
+ operand: "branch"
2438
+ }],
2439
+ [58, {
2440
+ name: "brtrue",
2441
+ operand: "branch"
2442
+ }],
2443
+ [59, {
2444
+ name: "beq",
2445
+ operand: "branch"
2446
+ }],
2447
+ [60, {
2448
+ name: "bge",
2449
+ operand: "branch"
2450
+ }],
2451
+ [61, {
2452
+ name: "bgt",
2453
+ operand: "branch"
2454
+ }],
2455
+ [62, {
2456
+ name: "ble",
2457
+ operand: "branch"
2458
+ }],
2459
+ [63, {
2460
+ name: "blt",
2461
+ operand: "branch"
2462
+ }],
2463
+ [64, {
2464
+ name: "bne.un",
2465
+ operand: "branch"
2466
+ }],
2467
+ [65, {
2468
+ name: "bge.un",
2469
+ operand: "branch"
2470
+ }],
2471
+ [66, {
2472
+ name: "bgt.un",
2473
+ operand: "branch"
2474
+ }],
2475
+ [67, {
2476
+ name: "ble.un",
2477
+ operand: "branch"
2478
+ }],
2479
+ [68, {
2480
+ name: "blt.un",
2481
+ operand: "branch"
2482
+ }],
2483
+ [69, {
2484
+ name: "switch",
2485
+ operand: "switch"
2486
+ }],
2487
+ [70, {
2488
+ name: "ldind.i1",
2489
+ operand: "none"
2490
+ }],
2491
+ [71, {
2492
+ name: "ldind.u1",
2493
+ operand: "none"
2494
+ }],
2495
+ [72, {
2496
+ name: "ldind.i2",
2497
+ operand: "none"
2498
+ }],
2499
+ [73, {
2500
+ name: "ldind.u2",
2501
+ operand: "none"
2502
+ }],
2503
+ [74, {
2504
+ name: "ldind.i4",
2505
+ operand: "none"
2506
+ }],
2507
+ [75, {
2508
+ name: "ldind.u4",
2509
+ operand: "none"
2510
+ }],
2511
+ [76, {
2512
+ name: "ldind.i8",
2513
+ operand: "none"
2514
+ }],
2515
+ [77, {
2516
+ name: "ldind.i",
2517
+ operand: "none"
2518
+ }],
2519
+ [78, {
2520
+ name: "ldind.r4",
2521
+ operand: "none"
2522
+ }],
2523
+ [79, {
2524
+ name: "ldind.r8",
2525
+ operand: "none"
2526
+ }],
2527
+ [80, {
2528
+ name: "ldind.ref",
2529
+ operand: "none"
2530
+ }],
2531
+ [81, {
2532
+ name: "stind.ref",
2533
+ operand: "none"
2534
+ }],
2535
+ [82, {
2536
+ name: "stind.i1",
2537
+ operand: "none"
2538
+ }],
2539
+ [83, {
2540
+ name: "stind.i2",
2541
+ operand: "none"
2542
+ }],
2543
+ [84, {
2544
+ name: "stind.i4",
2545
+ operand: "none"
2546
+ }],
2547
+ [85, {
2548
+ name: "stind.i8",
2549
+ operand: "none"
2550
+ }],
2551
+ [86, {
2552
+ name: "stind.r4",
2553
+ operand: "none"
2554
+ }],
2555
+ [87, {
2556
+ name: "stind.r8",
2557
+ operand: "none"
2558
+ }],
2559
+ [88, {
2560
+ name: "add",
2561
+ operand: "none"
2562
+ }],
2563
+ [89, {
2564
+ name: "sub",
2565
+ operand: "none"
2566
+ }],
2567
+ [90, {
2568
+ name: "mul",
2569
+ operand: "none"
2570
+ }],
2571
+ [91, {
2572
+ name: "div",
2573
+ operand: "none"
2574
+ }],
2575
+ [92, {
2576
+ name: "div.un",
2577
+ operand: "none"
2578
+ }],
2579
+ [93, {
2580
+ name: "rem",
2581
+ operand: "none"
2582
+ }],
2583
+ [94, {
2584
+ name: "rem.un",
2585
+ operand: "none"
2586
+ }],
2587
+ [95, {
2588
+ name: "and",
2589
+ operand: "none"
2590
+ }],
2591
+ [96, {
2592
+ name: "or",
2593
+ operand: "none"
2594
+ }],
2595
+ [97, {
2596
+ name: "xor",
2597
+ operand: "none"
2598
+ }],
2599
+ [98, {
2600
+ name: "shl",
2601
+ operand: "none"
2602
+ }],
2603
+ [99, {
2604
+ name: "shr",
2605
+ operand: "none"
2606
+ }],
2607
+ [100, {
2608
+ name: "shr.un",
2609
+ operand: "none"
2610
+ }],
2611
+ [101, {
2612
+ name: "neg",
2613
+ operand: "none"
2614
+ }],
2615
+ [102, {
2616
+ name: "not",
2617
+ operand: "none"
2618
+ }],
2619
+ [103, {
2620
+ name: "conv.i1",
2621
+ operand: "none"
2622
+ }],
2623
+ [104, {
2624
+ name: "conv.i2",
2625
+ operand: "none"
2626
+ }],
2627
+ [105, {
2628
+ name: "conv.i4",
2629
+ operand: "none"
2630
+ }],
2631
+ [106, {
2632
+ name: "conv.i8",
2633
+ operand: "none"
2634
+ }],
2635
+ [107, {
2636
+ name: "conv.r4",
2637
+ operand: "none"
2638
+ }],
2639
+ [108, {
2640
+ name: "conv.r8",
2641
+ operand: "none"
2642
+ }],
2643
+ [109, {
2644
+ name: "conv.u4",
2645
+ operand: "none"
2646
+ }],
2647
+ [110, {
2648
+ name: "conv.u8",
2649
+ operand: "none"
2650
+ }],
2651
+ [111, {
2652
+ name: "callvirt",
2653
+ operand: "method"
2654
+ }],
2655
+ [112, {
2656
+ name: "cpobj",
2657
+ operand: "type"
2658
+ }],
2659
+ [113, {
2660
+ name: "ldobj",
2661
+ operand: "type"
2662
+ }],
2663
+ [114, {
2664
+ name: "ldstr",
2665
+ operand: "string"
2666
+ }],
2667
+ [115, {
2668
+ name: "newobj",
2669
+ operand: "method"
2670
+ }],
2671
+ [116, {
2672
+ name: "castclass",
2673
+ operand: "type"
2674
+ }],
2675
+ [117, {
2676
+ name: "isinst",
2677
+ operand: "type"
2678
+ }],
2679
+ [118, {
2680
+ name: "conv.r.un",
2681
+ operand: "none"
2682
+ }],
2683
+ [121, {
2684
+ name: "unbox",
2685
+ operand: "type"
2686
+ }],
2687
+ [122, {
2688
+ name: "throw",
2689
+ operand: "none"
2690
+ }],
2691
+ [123, {
2692
+ name: "ldfld",
2693
+ operand: "field"
2694
+ }],
2695
+ [124, {
2696
+ name: "ldflda",
2697
+ operand: "field"
2698
+ }],
2699
+ [125, {
2700
+ name: "stfld",
2701
+ operand: "field"
2702
+ }],
2703
+ [126, {
2704
+ name: "ldsfld",
2705
+ operand: "field"
2706
+ }],
2707
+ [127, {
2708
+ name: "ldsflda",
2709
+ operand: "field"
2710
+ }],
2711
+ [128, {
2712
+ name: "stsfld",
2713
+ operand: "field"
2714
+ }],
2715
+ [129, {
2716
+ name: "stobj",
2717
+ operand: "type"
2718
+ }],
2719
+ [130, {
2720
+ name: "conv.ovf.i1.un",
2721
+ operand: "none"
2722
+ }],
2723
+ [131, {
2724
+ name: "conv.ovf.i2.un",
2725
+ operand: "none"
2726
+ }],
2727
+ [132, {
2728
+ name: "conv.ovf.i4.un",
2729
+ operand: "none"
2730
+ }],
2731
+ [133, {
2732
+ name: "conv.ovf.i8.un",
2733
+ operand: "none"
2734
+ }],
2735
+ [134, {
2736
+ name: "conv.ovf.u1.un",
2737
+ operand: "none"
2738
+ }],
2739
+ [135, {
2740
+ name: "conv.ovf.u2.un",
2741
+ operand: "none"
2742
+ }],
2743
+ [136, {
2744
+ name: "conv.ovf.u4.un",
2745
+ operand: "none"
2746
+ }],
2747
+ [137, {
2748
+ name: "conv.ovf.u8.un",
2749
+ operand: "none"
2750
+ }],
2751
+ [138, {
2752
+ name: "conv.ovf.i.un",
2753
+ operand: "none"
2754
+ }],
2755
+ [139, {
2756
+ name: "conv.ovf.u.un",
2757
+ operand: "none"
2758
+ }],
2759
+ [140, {
2760
+ name: "box",
2761
+ operand: "type"
2762
+ }],
2763
+ [141, {
2764
+ name: "newarr",
2765
+ operand: "type"
2766
+ }],
2767
+ [142, {
2768
+ name: "ldlen",
2769
+ operand: "none"
2770
+ }],
2771
+ [143, {
2772
+ name: "ldelema",
2773
+ operand: "type"
2774
+ }],
2775
+ [144, {
2776
+ name: "ldelem.i1",
2777
+ operand: "none"
2778
+ }],
2779
+ [145, {
2780
+ name: "ldelem.u1",
2781
+ operand: "none"
2782
+ }],
2783
+ [146, {
2784
+ name: "ldelem.i2",
2785
+ operand: "none"
2786
+ }],
2787
+ [147, {
2788
+ name: "ldelem.u2",
2789
+ operand: "none"
2790
+ }],
2791
+ [148, {
2792
+ name: "ldelem.i4",
2793
+ operand: "none"
2794
+ }],
2795
+ [149, {
2796
+ name: "ldelem.u4",
2797
+ operand: "none"
2798
+ }],
2799
+ [150, {
2800
+ name: "ldelem.i8",
2801
+ operand: "none"
2802
+ }],
2803
+ [151, {
2804
+ name: "ldelem.i",
2805
+ operand: "none"
2806
+ }],
2807
+ [152, {
2808
+ name: "ldelem.r4",
2809
+ operand: "none"
2810
+ }],
2811
+ [153, {
2812
+ name: "ldelem.r8",
2813
+ operand: "none"
2814
+ }],
2815
+ [154, {
2816
+ name: "ldelem.ref",
2817
+ operand: "none"
2818
+ }],
2819
+ [155, {
2820
+ name: "stelem.i",
2821
+ operand: "none"
2822
+ }],
2823
+ [156, {
2824
+ name: "stelem.i1",
2825
+ operand: "none"
2826
+ }],
2827
+ [157, {
2828
+ name: "stelem.i2",
2829
+ operand: "none"
2830
+ }],
2831
+ [158, {
2832
+ name: "stelem.i4",
2833
+ operand: "none"
2834
+ }],
2835
+ [159, {
2836
+ name: "stelem.i8",
2837
+ operand: "none"
2838
+ }],
2839
+ [160, {
2840
+ name: "stelem.r4",
2841
+ operand: "none"
2842
+ }],
2843
+ [161, {
2844
+ name: "stelem.r8",
2845
+ operand: "none"
2846
+ }],
2847
+ [162, {
2848
+ name: "stelem.ref",
2849
+ operand: "none"
2850
+ }],
2851
+ [163, {
2852
+ name: "ldelem",
2853
+ operand: "type"
2854
+ }],
2855
+ [164, {
2856
+ name: "stelem",
2857
+ operand: "type"
2858
+ }],
2859
+ [165, {
2860
+ name: "unbox.any",
2861
+ operand: "type"
2862
+ }],
2863
+ [179, {
2864
+ name: "conv.ovf.i1",
2865
+ operand: "none"
2866
+ }],
2867
+ [180, {
2868
+ name: "conv.ovf.u1",
2869
+ operand: "none"
2870
+ }],
2871
+ [181, {
2872
+ name: "conv.ovf.i2",
2873
+ operand: "none"
2874
+ }],
2875
+ [182, {
2876
+ name: "conv.ovf.u2",
2877
+ operand: "none"
2878
+ }],
2879
+ [183, {
2880
+ name: "conv.ovf.i4",
2881
+ operand: "none"
2882
+ }],
2883
+ [184, {
2884
+ name: "conv.ovf.u4",
2885
+ operand: "none"
2886
+ }],
2887
+ [185, {
2888
+ name: "conv.ovf.i8",
2889
+ operand: "none"
2890
+ }],
2891
+ [186, {
2892
+ name: "conv.ovf.u8",
2893
+ operand: "none"
2894
+ }],
2895
+ [194, {
2896
+ name: "refanyval",
2897
+ operand: "type"
2898
+ }],
2899
+ [195, {
2900
+ name: "ckfinite",
2901
+ operand: "none"
2902
+ }],
2903
+ [198, {
2904
+ name: "mkrefany",
2905
+ operand: "type"
2906
+ }],
2907
+ [208, {
2908
+ name: "ldtoken",
2909
+ operand: "token"
2910
+ }],
2911
+ [209, {
2912
+ name: "conv.u2",
2913
+ operand: "none"
2914
+ }],
2915
+ [210, {
2916
+ name: "conv.u1",
2917
+ operand: "none"
2918
+ }],
2919
+ [211, {
2920
+ name: "conv.i",
2921
+ operand: "none"
2922
+ }],
2923
+ [212, {
2924
+ name: "conv.ovf.i",
2925
+ operand: "none"
2926
+ }],
2927
+ [213, {
2928
+ name: "conv.ovf.u",
2929
+ operand: "none"
2930
+ }],
2931
+ [214, {
2932
+ name: "add.ovf",
2933
+ operand: "none"
2934
+ }],
2935
+ [215, {
2936
+ name: "add.ovf.un",
2937
+ operand: "none"
2938
+ }],
2939
+ [216, {
2940
+ name: "mul.ovf",
2941
+ operand: "none"
2942
+ }],
2943
+ [217, {
2944
+ name: "mul.ovf.un",
2945
+ operand: "none"
2946
+ }],
2947
+ [218, {
2948
+ name: "sub.ovf",
2949
+ operand: "none"
2950
+ }],
2951
+ [219, {
2952
+ name: "sub.ovf.un",
2953
+ operand: "none"
2954
+ }],
2955
+ [220, {
2956
+ name: "endfinally",
2957
+ operand: "none"
2958
+ }],
2959
+ [221, {
2960
+ name: "leave",
2961
+ operand: "branch"
2962
+ }],
2963
+ [222, {
2964
+ name: "leave.s",
2965
+ operand: "short-branch"
2966
+ }],
2967
+ [223, {
2968
+ name: "stind.i",
2969
+ operand: "none"
2970
+ }],
2971
+ [224, {
2972
+ name: "conv.u",
2973
+ operand: "none"
2974
+ }],
2975
+ [65024, {
2976
+ name: "arglist",
2977
+ operand: "none"
2978
+ }],
2979
+ [65025, {
2980
+ name: "ceq",
2981
+ operand: "none"
2982
+ }],
2983
+ [65026, {
2984
+ name: "cgt",
2985
+ operand: "none"
2986
+ }],
2987
+ [65027, {
2988
+ name: "cgt.un",
2989
+ operand: "none"
2990
+ }],
2991
+ [65028, {
2992
+ name: "clt",
2993
+ operand: "none"
2994
+ }],
2995
+ [65029, {
2996
+ name: "clt.un",
2997
+ operand: "none"
2998
+ }],
2999
+ [65030, {
3000
+ name: "ldftn",
3001
+ operand: "method"
3002
+ }],
3003
+ [65031, {
3004
+ name: "ldvirtftn",
3005
+ operand: "method"
3006
+ }],
3007
+ [65033, {
3008
+ name: "ldarg",
3009
+ operand: "var"
3010
+ }],
3011
+ [65034, {
3012
+ name: "ldarga",
3013
+ operand: "var"
3014
+ }],
3015
+ [65035, {
3016
+ name: "starg",
3017
+ operand: "var"
3018
+ }],
3019
+ [65036, {
3020
+ name: "ldloc",
3021
+ operand: "var"
3022
+ }],
3023
+ [65037, {
3024
+ name: "ldloca",
3025
+ operand: "var"
3026
+ }],
3027
+ [65038, {
3028
+ name: "stloc",
3029
+ operand: "var"
3030
+ }],
3031
+ [65039, {
3032
+ name: "localloc",
3033
+ operand: "none"
3034
+ }],
3035
+ [65041, {
3036
+ name: "endfilter",
3037
+ operand: "none"
3038
+ }],
3039
+ [65042, {
3040
+ name: "unaligned.",
3041
+ operand: "short-i"
3042
+ }],
3043
+ [65043, {
3044
+ name: "volatile.",
3045
+ operand: "none"
3046
+ }],
3047
+ [65044, {
3048
+ name: "tail.",
3049
+ operand: "none"
3050
+ }],
3051
+ [65045, {
3052
+ name: "initobj",
3053
+ operand: "type"
3054
+ }],
3055
+ [65046, {
3056
+ name: "constrained.",
3057
+ operand: "type"
3058
+ }],
3059
+ [65047, {
3060
+ name: "cpblk",
3061
+ operand: "none"
3062
+ }],
3063
+ [65048, {
3064
+ name: "initblk",
3065
+ operand: "none"
3066
+ }],
3067
+ [65050, {
3068
+ name: "rethrow",
3069
+ operand: "none"
3070
+ }],
3071
+ [65052, {
3072
+ name: "sizeof",
3073
+ operand: "type"
3074
+ }],
3075
+ [65053, {
3076
+ name: "refanytype",
3077
+ operand: "none"
3078
+ }],
3079
+ [65054, {
3080
+ name: "readonly.",
3081
+ operand: "none"
3082
+ }]
3083
+ ]);
3084
+ tokenKind = (token) => {
3085
+ if (token.startsWith("0x06") || token.startsWith("0x0a") || token.startsWith("0x2b")) return "method";
3086
+ if (token.startsWith("0x04")) return "field";
3087
+ if (token.startsWith("0x70")) return "string";
3088
+ if (token.startsWith("0x11")) return "signature";
3089
+ if (token.startsWith("0x01") || token.startsWith("0x02") || token.startsWith("0x1b")) return "type";
3090
+ return "token";
3091
+ };
3092
+ FIXED_OPERAND_READERS = new Map([
3093
+ ["none", (_il, offset) => ({
3094
+ next: offset,
3095
+ anchorKind: "none",
3096
+ value: null
3097
+ })],
3098
+ ["short-var", (il, offset) => ({
3099
+ next: offset + 1,
3100
+ anchorKind: "variable",
3101
+ value: String(il.readUInt8(offset))
3102
+ })],
3103
+ ["var", (il, offset) => ({
3104
+ next: offset + 2,
3105
+ anchorKind: "variable",
3106
+ value: String(il.readUInt16LE(offset))
3107
+ })],
3108
+ ["short-i", (il, offset) => ({
3109
+ next: offset + 1,
3110
+ anchorKind: "constant",
3111
+ value: String(il.readInt8(offset))
3112
+ })],
3113
+ ["i", (il, offset) => ({
3114
+ next: offset + 4,
3115
+ anchorKind: "constant",
3116
+ value: String(il.readInt32LE(offset))
3117
+ })],
3118
+ ["i8", (il, offset) => ({
3119
+ next: offset + 8,
3120
+ anchorKind: "constant",
3121
+ value: il.readBigInt64LE(offset).toString()
3122
+ })],
3123
+ ["r4", (il, offset) => ({
3124
+ next: offset + 4,
3125
+ anchorKind: "constant",
3126
+ value: String(il.readFloatLE(offset))
3127
+ })],
3128
+ ["r8", (il, offset) => ({
3129
+ next: offset + 8,
3130
+ anchorKind: "constant",
3131
+ value: String(il.readDoubleLE(offset))
3132
+ })],
3133
+ ["short-branch", (il, offset) => ({
3134
+ next: offset + 1,
3135
+ anchorKind: "branch",
3136
+ value: String(offset + 1 + il.readInt8(offset))
3137
+ })],
3138
+ ["branch", (il, offset) => ({
3139
+ next: offset + 4,
3140
+ anchorKind: "branch",
3141
+ value: String(offset + 4 + il.readInt32LE(offset))
3142
+ })]
3143
+ ]);
3144
+ TOKEN_OPERAND_KINDS = new Map([
3145
+ ["method", "method"],
3146
+ ["field", "field"],
3147
+ ["type", "type"],
3148
+ ["string", "string"],
3149
+ ["signature", "signature"]
3150
+ ]);
3151
+ readOperand = (il, offset, kind) => {
3152
+ const fixed = FIXED_OPERAND_READERS.get(kind);
3153
+ if (fixed !== undefined) return fixed(il, offset);
3154
+ if (kind === "switch") {
3155
+ const count = il.readUInt32LE(offset);
3156
+ return {
3157
+ next: offset + 4 + count * 4,
3158
+ anchorKind: "switch",
3159
+ value: String(count)
3160
+ };
3161
+ }
3162
+ const raw = il.readUInt32LE(offset);
3163
+ const token = `0x${raw.toString(16).padStart(8, "0")}`;
3164
+ const tokenOperandKind = TOKEN_OPERAND_KINDS.get(kind);
3165
+ if (tokenOperandKind !== undefined) return {
3166
+ next: offset + 4,
3167
+ anchorKind: tokenOperandKind,
3168
+ value: token
3169
+ };
3170
+ if (kind === "token") return {
3171
+ next: offset + 4,
3172
+ anchorKind: tokenKind(token),
3173
+ value: token
3174
+ };
3175
+ return {
3176
+ next: offset,
3177
+ anchorKind: "unknown",
3178
+ value: null
3179
+ };
3180
+ };
3181
+ decodeInstructions = (il, admitInstruction) => {
3182
+ const parsed = [];
3183
+ const instructionStarts = [];
3184
+ let offset = 0;
3185
+ let prefixStart = null;
3186
+ let issue = null;
3187
+ try {
3188
+ while (offset < il.length) {
3189
+ const start = offset;
3190
+ const first = il.readUInt8(offset);
3191
+ offset += 1;
3192
+ const code = first === 254 ? 65024 + il.readUInt8(offset++) : first;
3193
+ const descriptor = OPCODES.get(code);
3194
+ if (descriptor === undefined) {
3195
+ issue = `Unsupported CIL opcode 0x${code.toString(16)} at IL offset ${String(start)}`;
3196
+ break;
3197
+ }
3198
+ const operand = readOperand(il, offset, descriptor.operand);
3199
+ if (operand.next < offset || operand.next > il.length) {
3200
+ issue = `Instruction ${descriptor.name} at IL offset ${String(start)} leaves method body`;
3201
+ break;
3202
+ }
3203
+ admitInstruction?.(start);
3204
+ offset = operand.next;
3205
+ if (PREFIX_OPCODES.has(descriptor.name)) {
3206
+ prefixStart ??= start;
3207
+ } else {
3208
+ instructionStarts.push(prefixStart ?? start);
3209
+ prefixStart = null;
3210
+ }
3211
+ parsed.push({
3212
+ offset: start,
3213
+ opcode: descriptor.name,
3214
+ operandKind: operand.anchorKind,
3215
+ operand: operand.value
3216
+ });
3217
+ }
3218
+ } catch (cause) {
3219
+ if (cause instanceof ManagedReaderFailure) throw cause;
3220
+ issue = cause instanceof Error ? cause.message : "Instruction decode failed";
3221
+ }
3222
+ const truncated = offset < il.length && issue === null ? 1 : 0;
3223
+ return {
3224
+ parsed,
3225
+ instructionStarts,
3226
+ count: parsed.length,
3227
+ truncated,
3228
+ issue
3229
+ };
3230
+ };
3231
+ parseExceptionRegions = (bytes, offset, methodEnd, budget) => {
3232
+ const regions = [];
3233
+ let sectionOffset = offset;
3234
+ let hasMoreSections = true;
3235
+ while (hasMoreSections) {
3236
+ if (!Number.isSafeInteger(sectionOffset) || sectionOffset < 0 || sectionOffset > methodEnd - 4 || sectionOffset > bytes.length - 4) return malformedExceptionRegions("Exception section header leaves artifact", regions);
3237
+ const kind = bytes.readUInt8(sectionOffset);
3238
+ if ((kind & 63) !== 1) return malformedExceptionRegions(`Unsupported method data section kind ${String(kind & 63)}`, regions);
3239
+ const fat = (kind & 64) !== 0;
3240
+ const size = fat ? bytes.readUInt8(sectionOffset + 1) | bytes.readUInt8(sectionOffset + 2) << 8 | bytes.readUInt8(sectionOffset + 3) << 16 : bytes.readUInt8(sectionOffset + 1);
3241
+ const clauseSize = fat ? 24 : 12;
3242
+ if (size < 4 || sectionOffset > methodEnd - size || sectionOffset > bytes.length - size) return malformedExceptionRegions("Exception section size leaves artifact", regions);
3243
+ if ((size - 4) % clauseSize !== 0) return malformedExceptionRegions("Exception section size does not contain whole clauses", regions);
3244
+ if (!fat && (bytes[sectionOffset + 2] !== 0 || bytes[sectionOffset + 3] !== 0)) return malformedExceptionRegions("Small exception section reserved bytes are nonzero", regions);
3245
+ const count = (size - 4) / clauseSize;
3246
+ budget?.admitTransient(count * 256, sectionOffset);
3247
+ for (const region of readExceptionClauses(bytes, sectionOffset + 4, count, fat)) regions.push(region);
3248
+ hasMoreSections = (kind & 128) !== 0;
3249
+ sectionOffset += size;
3250
+ }
3251
+ return {
3252
+ status: "complete",
3253
+ regions
3254
+ };
3255
+ };
3256
+ malformedExceptionRegions = (issue, regions = []) => ({
3257
+ status: "malformed",
3258
+ regions,
3259
+ issue
3260
+ });
3261
+ readExceptionClauses = (bytes, start, count, fat) => {
3262
+ const regions = [];
3263
+ const clauseSize = fat ? 24 : 12;
3264
+ for (let index = 0; index < count; index += 1) {
3265
+ const clause = start + index * clauseSize;
3266
+ const flags = fat ? bytes.readUInt32LE(clause) : bytes.readUInt16LE(clause);
3267
+ const extra = bytes.readUInt32LE(clause + (fat ? 20 : 8));
3268
+ regions.push({
3269
+ flags,
3270
+ try_offset: fat ? bytes.readUInt32LE(clause + 4) : bytes.readUInt16LE(clause + 2),
3271
+ try_length: fat ? bytes.readUInt32LE(clause + 8) : bytes.readUInt8(clause + 4),
3272
+ handler_offset: fat ? bytes.readUInt32LE(clause + 12) : bytes.readUInt16LE(clause + 5),
3273
+ handler_length: fat ? bytes.readUInt32LE(clause + 16) : bytes.readUInt8(clause + 7),
3274
+ class_token: flags === 0 ? `0x${extra.toString(16).padStart(8, "0")}` : null,
3275
+ filter_offset: flags === 1 ? extra : null
3276
+ });
3277
+ }
3278
+ return regions;
3279
+ };
3280
+ })))();
3281
+ }
3282
+
3283
+ //#endregion
3284
+ //#region dist/dotnet/ManagedExceptionRegionValidation.js
3285
+ var clauseFlagsIssue, methodExtentIssue, instructionBoundaryIssue, filterOrderingIssue, clauseIssue, validateExceptionRegionRanges;
3286
+ function init_ManagedExceptionRegionValidation() {
3287
+ return (init_ManagedExceptionRegionValidation = __esmMin((() => {
3288
+ clauseFlagsIssue = (region) => [
3289
+ 0,
3290
+ 1,
3291
+ 2,
3292
+ 4
3293
+ ].includes(region.flags) ? null : `Exception clause has unsupported flags 0x${region.flags.toString(16)}`;
3294
+ methodExtentIssue = (start, length, ilSize, name) => start <= ilSize && length <= ilSize - start ? null : `Exception clause ${name} range leaves the method IL body`;
3295
+ instructionBoundaryIssue = (start, length, boundaries, name) => {
3296
+ const end = start + length;
3297
+ return boundaries.has(start) && boundaries.has(end) ? null : `Exception clause ${name} range does not align with CIL instruction boundaries`;
3298
+ };
3299
+ filterOrderingIssue = (region, ilSize) => {
3300
+ if (region.flags !== 1) return null;
3301
+ const offset = region.filter_offset;
3302
+ return offset !== null && offset < ilSize && offset < region.handler_offset ? null : "Exception clause filter must start before its handler within the method IL body";
3303
+ };
3304
+ clauseIssue = (region, ilSize, boundaries) => clauseFlagsIssue(region) ?? methodExtentIssue(region.try_offset, region.try_length, ilSize, "try") ?? instructionBoundaryIssue(region.try_offset, region.try_length, boundaries, "try") ?? methodExtentIssue(region.handler_offset, region.handler_length, ilSize, "handler") ?? instructionBoundaryIssue(region.handler_offset, region.handler_length, boundaries, "handler") ?? (region.flags === 1 && region.filter_offset !== null ? instructionBoundaryIssue(region.filter_offset, 0, boundaries, "filter") : null) ?? filterOrderingIssue(region, ilSize);
3305
+ validateExceptionRegionRanges = (parsed, ilSize, instructionOffsets) => {
3306
+ if (parsed.status === "malformed") return parsed;
3307
+ const boundaries = new Set([...instructionOffsets, ilSize]);
3308
+ for (const region of parsed.regions) {
3309
+ const issue = clauseIssue(region, ilSize, boundaries);
3310
+ if (issue !== null) return {
3311
+ status: "malformed",
3312
+ regions: parsed.regions,
3313
+ issue
3314
+ };
3315
+ }
3316
+ return parsed;
3317
+ };
3318
+ })))();
3319
+ }
3320
+
3321
+ //#endregion
3322
+ //#region dist/dotnet/ManagedMethodBodyReader.js
3323
+ var bodyStatus, readMethodBodyHeader, methodBody, emptyMethodBody;
3324
+ function init_ManagedMethodBodyReader() {
3325
+ return (init_ManagedMethodBodyReader = __esmMin((() => {
3326
+ init_ManagedDecodeBudget();
3327
+ init_ManagedMemberInstructionDecoder();
3328
+ init_ManagedExceptionRegionValidation();
3329
+ init_ManagedMetadataHeaps();
3330
+ init_ManagedReaderFailure();
3331
+ bodyStatus = (decodedIssue, truncatedInstructions, exceptionRegions) => {
3332
+ if (decodedIssue !== null || exceptionRegions?.status === "malformed") return "malformed";
3333
+ if (truncatedInstructions > 0) return "partial";
3334
+ return "present";
3335
+ };
3336
+ readMethodBodyHeader = (bytes, offset) => {
3337
+ const first = bytes.readUInt8(offset);
3338
+ if ((first & 3) === 2) return {
3339
+ format: "tiny",
3340
+ size: 1,
3341
+ flags: 0,
3342
+ maxStack: 8,
3343
+ ilSize: first >> 2,
3344
+ localSig: 0
3345
+ };
3346
+ if ((first & 3) !== 3) throw new RangeError("Unsupported method body header");
3347
+ if (offset > bytes.length - 12) throw new RangeError("Fat method body header leaves artifact");
3348
+ const flagsAndSize = bytes.readUInt16LE(offset);
3349
+ const headerDwords = flagsAndSize >>> 12;
3350
+ if (headerDwords < 3) throw new RangeError("Fat method body header is smaller than 12 bytes");
3351
+ const size = headerDwords * 4;
3352
+ if (offset > bytes.length - size) throw new RangeError("Method body header leaves artifact");
3353
+ return {
3354
+ format: "fat",
3355
+ size,
3356
+ flags: flagsAndSize & 4095,
3357
+ maxStack: bytes.readUInt16LE(offset + 2),
3358
+ ilSize: bytes.readUInt32LE(offset + 4),
3359
+ localSig: bytes.readUInt32LE(offset + 8)
3360
+ };
3361
+ };
3362
+ methodBody = (bytes, pe, rva, implementation = {
3363
+ implFlags: 0,
3364
+ flags: 0
3365
+ }, budget) => {
3366
+ if (rva === 0) return emptyMethodBody(rva, "absent", null);
3367
+ if ((implementation.implFlags & 7) !== 0 || (implementation.flags & 8192) !== 0) return emptyMethodBody(rva, "partial", "CIL decoding is unavailable for native, runtime, unmanaged, or P/Invoke implementations");
3368
+ try {
3369
+ const offset = pe.rvaToOffset(rva, 1, "method.body");
3370
+ const methodExtent = pe.rvaAvailableBytes(rva, "method.body");
3371
+ const header = readMethodBodyHeader(bytes, offset);
3372
+ if (header.size > methodExtent || header.ilSize > methodExtent - header.size) throw new RangeError("Method body leaves file-backed PE section data");
3373
+ const ilOffset = offset + header.size;
3374
+ if (ilOffset > bytes.length - header.ilSize) throw new RangeError("Method IL bytes leave artifact");
3375
+ const il = bytes.subarray(ilOffset, ilOffset + header.ilSize);
3376
+ const decoded = decodeInstructions(il, budget === undefined ? undefined : (start) => budget.admitTransient(256, ilOffset + start));
3377
+ const opcodeCounts = {};
3378
+ for (const instruction of decoded.parsed) opcodeCounts[instruction.opcode] = (opcodeCounts[instruction.opcode] ?? 0) + 1;
3379
+ const anchors = decoded.parsed.filter((instruction) => instruction.operandKind !== "none").map((instruction) => ({
3380
+ il_offset: instruction.offset,
3381
+ opcode: instruction.opcode,
3382
+ operand_kind: instruction.operandKind,
3383
+ operand: instruction.operand
3384
+ }));
3385
+ const normalized = Buffer.from(JSON.stringify(decoded.parsed.map(({ opcode, operandKind, operand }) => [
3386
+ opcode,
3387
+ operandKind,
3388
+ operand
3389
+ ])), "utf8");
3390
+ const methodEnd = ilOffset + header.ilSize;
3391
+ const sectionOffset = Math.ceil(methodEnd / 4) * 4;
3392
+ const exceptionRegions = header.format === "fat" && (header.flags & 8) !== 0 ? validateExceptionRegionRanges(parseExceptionRegions(bytes, sectionOffset, offset + methodExtent, budget), header.ilSize, decoded.instructionStarts) : null;
3393
+ const status = bodyStatus(decoded.issue, decoded.truncated, exceptionRegions);
3394
+ const body = {
3395
+ status,
3396
+ header_format: header.format,
3397
+ rva,
3398
+ file_offset: offset,
3399
+ max_stack: header.maxStack,
3400
+ init_locals: (header.flags & 16) !== 0,
3401
+ local_var_sig_token: header.localSig === 0 ? null : `0x${header.localSig.toString(16).padStart(8, "0")}`,
3402
+ il_size: header.ilSize,
3403
+ il_sha256: sha256Bytes(il),
3404
+ normalized_il_sha256: status === "present" ? sha256Bytes(normalized) : null,
3405
+ instruction_count: decoded.count,
3406
+ decoded_instruction_count: decoded.parsed.length,
3407
+ truncated_instructions: decoded.truncated,
3408
+ opcode_counts: opcodeCounts,
3409
+ anchors,
3410
+ exception_regions: exceptionRegions?.regions ?? [],
3411
+ issue: decoded.issue ?? (exceptionRegions?.status === "malformed" ? exceptionRegions.issue : null) ?? (decoded.truncated > 0 ? "Instruction decoding stopped before the end of the method body" : null)
3412
+ };
3413
+ return budget === undefined ? body : admitManagedProjection(body, budget);
3414
+ } catch (cause) {
3415
+ if (cause instanceof ManagedReaderFailure && cause.issue.code === "resource-limit") throw cause;
3416
+ if (!(cause instanceof ManagedReaderFailure) && !(cause instanceof RangeError)) throw cause;
3417
+ return emptyMethodBody(rva, "malformed", cause instanceof Error ? cause.message : "Method body parse failed");
3418
+ } finally {
3419
+ budget?.releaseTransient();
3420
+ }
3421
+ };
3422
+ emptyMethodBody = (rva, status, issue) => ({
3423
+ status,
3424
+ header_format: status === "absent" ? "none" : "unknown",
3425
+ rva,
3426
+ file_offset: null,
3427
+ max_stack: null,
3428
+ init_locals: null,
3429
+ local_var_sig_token: null,
3430
+ il_size: 0,
3431
+ il_sha256: null,
3432
+ normalized_il_sha256: null,
3433
+ instruction_count: 0,
3434
+ decoded_instruction_count: 0,
3435
+ truncated_instructions: 0,
3436
+ opcode_counts: {},
3437
+ anchors: [],
3438
+ exception_regions: [],
3439
+ issue
3440
+ });
3441
+ })))();
3442
+ }
3443
+
3444
+ //#endregion
3445
+ //#region dist/dotnet/ManagedMemberRows.js
3446
+ var isSelected, parseFields$1, TYPE_FORWARDER_FLAG, parseExportedTypes, parseMemberRefs, parseMethods$1, targetKind, edges, callerName, callerNameBytes, budgetedSignature;
3447
+ function init_ManagedMemberRows() {
3448
+ return (init_ManagedMemberRows = __esmMin((() => {
3449
+ init_ManagedDecodeBudget();
3450
+ init_ManagedMemberInspectorCore();
3451
+ init_ManagedMetadataHeaps();
3452
+ init_ManagedReaderFailure();
3453
+ init_ManagedMethodBodyReader();
3454
+ init_ManagedMemberOwnership();
3455
+ isSelected = (selected, declared) => selected === null || declared !== undefined && selected.has(declared.token);
3456
+ parseFields$1 = (bytes, layout, ranges, selected = null) => {
3457
+ const fields = [];
3458
+ const core = new Map();
3459
+ const issues = [];
3460
+ const table = layout.table(4);
3461
+ const ownerRow = readManagedValue(() => memberDeclaringTypeRowLookup(bytes, layout, 4), issues);
3462
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3463
+ readManagedValue(() => {
3464
+ const cursor = metadataRowCursor(bytes, layout, 4, row);
3465
+ const flags = cursor.readUInt16();
3466
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3467
+ const owner = ownerRow === undefined ? 0 : readManagedValue(() => ownerRow(row), issues) ?? 0;
3468
+ const declared = ranges[owner - 1];
3469
+ const token = metadataToken(4, row);
3470
+ core.set(token, {
3471
+ token,
3472
+ name
3473
+ });
3474
+ if (!isSelected(selected, declared)) return;
3475
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3476
+ fields.push({
3477
+ token,
3478
+ row_offset: cursor.start,
3479
+ declaring_type_token: declared?.token ?? null,
3480
+ declaring_type: declared?.fullName ?? null,
3481
+ name,
3482
+ flags,
3483
+ signature: budgetedSignature(sig, layout)
3484
+ });
3485
+ }, issues);
3486
+ }
3487
+ return {
3488
+ fields,
3489
+ core,
3490
+ issues
3491
+ };
3492
+ };
3493
+ TYPE_FORWARDER_FLAG = 2097152;
3494
+ parseExportedTypes = (bytes, layout) => {
3495
+ const exportedTypes = [];
3496
+ const issues = [];
3497
+ const table = layout.table(39);
3498
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3499
+ readManagedValue(() => {
3500
+ const cursor = metadataRowCursor(bytes, layout, 39, row);
3501
+ const flags = cursor.readUInt32();
3502
+ const typeDefId = cursor.readUInt32();
3503
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3504
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3505
+ const implementationOffset = cursor.offset;
3506
+ const implementationRaw = cursor.readIndex(layout.codedIndexSize("Implementation"));
3507
+ const token = metadataToken(39, row);
3508
+ const implementationReason = metadataCodedTokenInvalidReason(implementationRaw, 2, [
3509
+ 38,
3510
+ 35,
3511
+ 39
3512
+ ], layout.rowCounts);
3513
+ if (implementationReason !== null || implementationRaw === 0) issues.push({
3514
+ code: "invalid-row",
3515
+ scope: `metadata.ExportedType:${token}`,
3516
+ offset: implementationOffset,
3517
+ detail: implementationReason === null ? "ExportedType implementation coded index 0x0 is null, but the Implementation column must reference a row" : `ExportedType implementation coded index 0x${implementationRaw.toString(16)} is invalid: ${implementationReason}`
3518
+ });
3519
+ exportedTypes.push({
3520
+ token,
3521
+ row_offset: cursor.start,
3522
+ namespace,
3523
+ name,
3524
+ flags,
3525
+ forwarder: (flags & TYPE_FORWARDER_FLAG) !== 0,
3526
+ type_def_id: typeDefId,
3527
+ implementation_token: metadataCodedToken(implementationRaw, 2, [
3528
+ 38,
3529
+ 35,
3530
+ 39
3531
+ ], layout.rowCounts)
3532
+ });
3533
+ }, issues);
3534
+ }
3535
+ return {
3536
+ exportedTypes,
3537
+ issues
3538
+ };
3539
+ };
3540
+ parseMemberRefs = (bytes, layout) => {
3541
+ const refs = [];
3542
+ const core = new Map();
3543
+ const issues = [];
3544
+ const table = layout.table(10);
3545
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3546
+ readManagedValue(() => {
3547
+ const cursor = metadataRowCursor(bytes, layout, 10, row);
3548
+ const parentRaw = cursor.readIndex(layout.codedIndexSize("MemberRefParent"));
3549
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3550
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3551
+ const token = metadataToken(10, row);
3552
+ const parentReason = metadataCodedTokenInvalidReason(parentRaw, 3, [
3553
+ 2,
3554
+ 1,
3555
+ 26,
3556
+ 6,
3557
+ 27
3558
+ ], layout.rowCounts);
3559
+ if (parentReason !== null || parentRaw === 0) issues.push({
3560
+ code: "invalid-row",
3561
+ scope: `metadata.MemberRef:${token}`,
3562
+ offset: cursor.start,
3563
+ detail: parentReason === null ? "MemberRef parent coded index 0x0 is null, but the Class column must reference a row" : `MemberRef parent coded index 0x${parentRaw.toString(16)} is invalid: ${parentReason}`
3564
+ });
3565
+ refs.push({
3566
+ token,
3567
+ row_offset: cursor.start,
3568
+ parent_token: metadataCodedToken(parentRaw, 3, [
3569
+ 2,
3570
+ 1,
3571
+ 26,
3572
+ 6,
3573
+ 27
3574
+ ], layout.rowCounts),
3575
+ name,
3576
+ signature: budgetedSignature(sig, layout)
3577
+ });
3578
+ core.set(token, {
3579
+ token,
3580
+ name
3581
+ });
3582
+ }, issues);
3583
+ }
3584
+ return {
3585
+ refs,
3586
+ core,
3587
+ issues
3588
+ };
3589
+ };
3590
+ parseMethods$1 = ({ bytes, layout, pe, ranges, selected = null }) => {
3591
+ const methods = [];
3592
+ const core = new Map();
3593
+ const issues = [];
3594
+ const table = layout.table(6);
3595
+ const ownerRow = readManagedValue(() => memberDeclaringTypeRowLookup(bytes, layout, 6), issues);
3596
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3597
+ readManagedValue(() => {
3598
+ const cursor = metadataRowCursor(bytes, layout, 6, row);
3599
+ const rva = cursor.readUInt32();
3600
+ const implFlags = cursor.readUInt16();
3601
+ const flags = cursor.readUInt16();
3602
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3603
+ const owner = ownerRow === undefined ? 0 : readManagedValue(() => ownerRow(row), issues) ?? 0;
3604
+ const declared = ranges[owner - 1];
3605
+ const token = metadataToken(6, row);
3606
+ core.set(token, {
3607
+ token,
3608
+ name,
3609
+ declaringType: declared?.fullName ?? null
3610
+ });
3611
+ if (!isSelected(selected, declared)) return;
3612
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3613
+ cursor.readIndex(layout.tableIndexSize(8));
3614
+ methods.push({
3615
+ token,
3616
+ row_offset: cursor.start,
3617
+ declaring_type_token: declared?.token ?? null,
3618
+ declaring_type: declared?.fullName ?? null,
3619
+ name,
3620
+ rva,
3621
+ impl_flags: implFlags,
3622
+ flags,
3623
+ signature: budgetedSignature(sig, layout),
3624
+ body: methodBody(bytes, pe, rva, {
3625
+ implFlags,
3626
+ flags
3627
+ }, managedDecodeBudget(layout))
3628
+ });
3629
+ }, issues);
3630
+ }
3631
+ return {
3632
+ methods,
3633
+ core,
3634
+ issues
3635
+ };
3636
+ };
3637
+ targetKind = (token) => token.startsWith("0x06") ? "method-def" : token.startsWith("0x0a") ? "member-ref" : token.startsWith("0x2b") ? "method-spec" : "unknown";
3638
+ edges = (methods, methodCore, fieldCore, refCore, budget) => {
3639
+ const callEdges = [];
3640
+ const fieldAccesses = [];
3641
+ for (const method of methods) {
3642
+ const derives = method.body.anchors.some((anchor) => anchor.opcode !== "ldtoken" && anchor.operand !== null && (anchor.operand_kind === "method" || anchor.operand_kind === "field"));
3643
+ if (derives) budget.admitTransient(callerNameBytes(method), null);
3644
+ const caller = derives ? callerName(method) : method.name;
3645
+ for (const anchor of method.body.anchors) {
3646
+ if (anchor.opcode === "ldtoken") continue;
3647
+ if (anchor.operand_kind === "method" && anchor.operand !== null) {
3648
+ const named = methodCore.get(anchor.operand)?.name ?? refCore.get(anchor.operand)?.name ?? null;
3649
+ callEdges.push(admitManagedProjection({
3650
+ caller_token: method.token,
3651
+ caller,
3652
+ opcode: anchor.opcode,
3653
+ target_token: anchor.operand,
3654
+ target_kind: targetKind(anchor.operand),
3655
+ target_name: named
3656
+ }, budget));
3657
+ }
3658
+ if (anchor.operand_kind === "field" && anchor.operand !== null) {
3659
+ fieldAccesses.push(admitManagedProjection({
3660
+ method_token: method.token,
3661
+ method: caller,
3662
+ opcode: anchor.opcode,
3663
+ field_token: anchor.operand,
3664
+ field_name: fieldCore.get(anchor.operand)?.name ?? null
3665
+ }, budget));
3666
+ }
3667
+ }
3668
+ if (derives) budget.releaseTransient();
3669
+ }
3670
+ return {
3671
+ callEdges,
3672
+ fieldAccesses
3673
+ };
3674
+ };
3675
+ callerName = (method) => method.declaring_type === null ? method.name : `${method.declaring_type}.${method.name}`;
3676
+ callerNameBytes = (method) => method.declaring_type === null ? managedJsonStringBytes(method.name) : managedJsonStringBytes(method.declaring_type) + managedJsonStringBytes(method.name) - 1;
3677
+ budgetedSignature = (bytes, layout) => {
3678
+ const budget = managedDecodeBudget(layout);
3679
+ budget.admitTransient(bytes.length * 256, layout.blob.offset);
3680
+ try {
3681
+ return admitManagedProjection(signature(bytes, budget.digest(bytes, "sha256")), budget);
3682
+ } finally {
3683
+ budget.releaseTransient();
3684
+ }
3685
+ };
3686
+ })))();
3687
+ }
3688
+
3689
+ //#endregion
3690
+ //#region dist/dotnet/ManagedMemberInspector.js
3691
+ var unavailable, readMemberInventory, selectTypes, inspectManagedMembersBytes;
3692
+ function init_ManagedMemberInspector() {
3693
+ return (init_ManagedMemberInspector = __esmMin((() => {
3694
+ init_ManagedDecodeBudget();
3695
+ init_managedArtifact();
3696
+ init_ManagedPeReader();
3697
+ init_ManagedMetadataInventory();
3698
+ init_ManagedMetadataLayout();
3699
+ init_ManagedReaderFailure();
3700
+ init_ManagedMemberInspectorCore();
3701
+ init_ManagedMemberRows();
3702
+ unavailable = (target, bytes, issue, typeNames) => managedMemberInspectionSchema.parse(admitManagedProjection({
3703
+ artifact: {
3704
+ path: target.path,
3705
+ sha256: target.sha256,
3706
+ byte_length: bytes.length,
3707
+ format: "pe"
3708
+ },
3709
+ module: null,
3710
+ metadata: {
3711
+ status: issue === null ? "absent" : issue.code === "resource-limit" ? "partial" : "malformed",
3712
+ version: null,
3713
+ table_row_counts: {}
3714
+ },
3715
+ identity_scope: {
3716
+ token_identity: "build-local",
3717
+ requires_artifact_sha256: target.sha256,
3718
+ requires_mvid: null
3719
+ },
3720
+ types: [],
3721
+ exported_types: null,
3722
+ fields: [],
3723
+ methods: [],
3724
+ member_refs: [],
3725
+ call_edges: [],
3726
+ field_accesses: [],
3727
+ selection: typeNames === undefined ? null : {
3728
+ type_names: [...typeNames],
3729
+ unmatched_type_names: []
3730
+ },
3731
+ coverage: {
3732
+ state: "unavailable",
3733
+ issues: issue === null ? [] : [issue]
3734
+ },
3735
+ limitations: [issue === null ? "The PE has no admitted CLI metadata; managed member inspection is unavailable." : "The CLI metadata could not be admitted; managed member inspection is unavailable."]
3736
+ }));
3737
+ readMemberInventory = (bytes, pe, issues) => {
3738
+ const cli = pe.cli;
3739
+ if (cli === null) throw new TypeError("Managed inventory requires CLI metadata");
3740
+ const rootOffset = pe.rvaToOffset(cli.metadata.rva, cli.metadata.size, "cli.metadata");
3741
+ const layout = readManagedMetadataLayout(bytes, rootOffset, cli.metadata.size);
3742
+ const inventory = readManagedMetadataInventory(bytes, layout, readManagedResourceDirectory(pe, issues));
3743
+ return {
3744
+ layout,
3745
+ inventory
3746
+ };
3747
+ };
3748
+ selectTypes = (ranges, typeNames) => {
3749
+ if (typeNames === undefined) return {
3750
+ tokens: null,
3751
+ selection: null,
3752
+ unreadableNames: 0
3753
+ };
3754
+ const requested = new Set(typeNames);
3755
+ const tokens = new Set();
3756
+ const matched = new Set();
3757
+ for (const range of ranges) {
3758
+ if (range.fullName === null || !requested.has(range.fullName)) continue;
3759
+ tokens.add(range.token);
3760
+ matched.add(range.fullName);
3761
+ }
3762
+ return {
3763
+ tokens,
3764
+ unreadableNames: ranges.filter(({ fullName }) => fullName === null).length,
3765
+ selection: {
3766
+ type_names: [...typeNames],
3767
+ unmatched_type_names: typeNames.filter((name) => !matched.has(name))
3768
+ }
3769
+ };
3770
+ };
3771
+ inspectManagedMembersBytes = (bytes, target, { typeNames } = {}) => {
3772
+ const pe = readManagedPeLayout(bytes);
3773
+ if (pe.cli === null) return unavailable(target, bytes, pe.cliIssue, typeNames);
3774
+ const issues = [];
3775
+ try {
3776
+ const { layout, inventory } = readMemberInventory(bytes, pe, issues);
3777
+ issues.push(...inventory.issues);
3778
+ const ranges = typeRanges(bytes, layout, issues);
3779
+ const { tokens: selected, selection, unreadableNames } = selectTypes(ranges, typeNames);
3780
+ const parsedTypes = parseTypes(bytes, layout, ranges);
3781
+ issues.push(...parsedTypes.issues);
3782
+ const exportedTypes = parseExportedTypes(bytes, layout);
3783
+ issues.push(...exportedTypes.issues);
3784
+ const fields = parseFields$1(bytes, layout, ranges, selected);
3785
+ const memberRefs = parseMemberRefs(bytes, layout);
3786
+ issues.push(...memberRefs.issues);
3787
+ const methods = parseMethods$1({
3788
+ bytes,
3789
+ layout,
3790
+ pe,
3791
+ ranges,
3792
+ selected
3793
+ });
3794
+ issues.push(...fields.issues, ...methods.issues);
3795
+ const coverageIssues = uniqueManagedParseIssues(issues);
3796
+ const incompleteMembers = [
3797
+ ...fields.fields,
3798
+ ...memberRefs.refs,
3799
+ ...methods.methods
3800
+ ].some((member) => member.signature.parse_status !== "decoded") || methods.methods.some((method) => method.body.status === "partial" || method.body.status === "malformed");
3801
+ const related = edges(methods.methods, methods.core, fields.core, memberRefs.core, managedDecodeBudget(layout));
3802
+ return managedMemberInspectionSchema.parse(admitManagedProjection({
3803
+ artifact: {
3804
+ path: target.path,
3805
+ sha256: target.sha256,
3806
+ byte_length: bytes.length,
3807
+ format: "pe"
3808
+ },
3809
+ module: inventory.module,
3810
+ metadata: {
3811
+ status: issues.length === 0 ? "complete" : "partial",
3812
+ version: layout.version,
3813
+ table_row_counts: managedTableRowCounts(layout)
3814
+ },
3815
+ identity_scope: {
3816
+ token_identity: "build-local",
3817
+ requires_artifact_sha256: target.sha256,
3818
+ requires_mvid: inventory.module?.mvid ?? null
3819
+ },
3820
+ types: selected === null ? parsedTypes.types : parsedTypes.types.filter((type) => selected.has(type.token)),
3821
+ exported_types: exportedTypes.exportedTypes,
3822
+ fields: fields.fields,
3823
+ methods: methods.methods,
3824
+ member_refs: memberRefs.refs,
3825
+ call_edges: related.callEdges,
3826
+ field_accesses: related.fieldAccesses,
3827
+ selection,
3828
+ coverage: {
3829
+ state: issues.length === 0 && !incompleteMembers ? "complete" : "partial",
3830
+ issues: coverageIssues
3831
+ },
3832
+ limitations: [
3833
+ "Metadata tokens are build-local coordinates and are only meaningful with the reported artifact SHA-256 and MVID.",
3834
+ "CIL instruction anchors are decoded from file-backed method bodies only; no target assembly is loaded or executed.",
3835
+ "Exported types are reported from ExportedType rows as declared; forwarded types are not resolved in their implementing assemblies.",
3836
+ "Member signatures decode ECMA-335 primitive, class, valuetype, generic instantiation, generic variable, pointer, byref, single-dimension and general array, function pointer, custom modifier, and typed reference forms; class and valuetype operands keep their encoded TypeDefOrRefOrSpec values, and unsupported forms such as vararg sentinels retain raw signature hashes.",
3837
+ ...selection === null ? [] : ["Types, fields, methods, call edges, and field accesses cover only the selected declaring types; coverage describes that selection. Edge targets outside it keep their names but are not described."],
3838
+ ...unreadableNames === 0 ? [] : [`${String(unreadableNames)} TypeDef name(s) could not be read; a name in selection.unmatched_type_names may belong to one of them, so its absence is not observed.`]
3839
+ ]
3840
+ }, managedDecodeBudget(layout)));
3841
+ } catch (cause) {
3842
+ if (cause instanceof ManagedReaderFailure) return unavailable(target, bytes, cause.issue, typeNames);
3843
+ throw cause;
3844
+ }
3845
+ };
3846
+ })))();
3847
+ }
3848
+
3849
+ //#endregion
3850
+ //#region dist/dotnet/ManagedNativeBoundaryHelpers.js
3851
+ var flagsHex, parseModuleRefs, parseFields, parseMethods, parseImplMaps, charSet, callConvention, bestFit, throwOnUnmappable, nativeImplementations, codeTypeFor, managedKindFor, boundaryKind, cliNative, nativeBoundarySummary, buildNativeBoundaryInspection;
3852
+ function init_ManagedNativeBoundaryHelpers() {
3853
+ return (init_ManagedNativeBoundaryHelpers = __esmMin((() => {
3854
+ init_ManagedDecodeBudget();
3855
+ init_managedArtifact();
3856
+ init_ManagedMetadataHeaps();
3857
+ init_ManagedMetadataInventory();
3858
+ init_ManagedReaderFailure();
3859
+ flagsHex = (value) => `0x${value.toString(16).padStart(4, "0")}`;
3860
+ parseModuleRefs = (bytes, layout, heapExtent, issues) => {
3861
+ const refs = [];
3862
+ const table = layout.table(26);
3863
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3864
+ readManagedValue(() => {
3865
+ const cursor = metadataRowCursor(bytes, layout, 26, row);
3866
+ refs.push({
3867
+ token: metadataToken(26, row),
3868
+ row_offset: cursor.start,
3869
+ name: readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent)
3870
+ });
3871
+ }, issues);
3872
+ }
3873
+ return refs;
3874
+ };
3875
+ parseFields = (bytes, layout, heapExtent, issues) => {
3876
+ const fields = new Map();
3877
+ const table = layout.table(4);
3878
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3879
+ readManagedValue(() => {
3880
+ const cursor = metadataRowCursor(bytes, layout, 4, row);
3881
+ const flags = cursor.readUInt16();
3882
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
3883
+ cursor.readIndex(layout.blobIndexSize);
3884
+ const token = metadataToken(4, row);
3885
+ fields.set(token, {
3886
+ token,
3887
+ rowOffset: cursor.start,
3888
+ kind: "field",
3889
+ name,
3890
+ flags,
3891
+ implFlags: null,
3892
+ rva: null
3893
+ });
3894
+ }, issues);
3895
+ }
3896
+ return fields;
3897
+ };
3898
+ parseMethods = (bytes, layout, heapExtent, issues) => {
3899
+ const methods = new Map();
3900
+ const table = layout.table(6);
3901
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3902
+ readManagedValue(() => {
3903
+ const cursor = metadataRowCursor(bytes, layout, 6, row);
3904
+ const rva = cursor.readUInt32();
3905
+ const implFlags = cursor.readUInt16();
3906
+ const flags = cursor.readUInt16();
3907
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
3908
+ cursor.readIndex(layout.blobIndexSize);
3909
+ cursor.readIndex(layout.tableIndexSize(8));
3910
+ const token = metadataToken(6, row);
3911
+ methods.set(token, {
3912
+ token,
3913
+ rowOffset: cursor.start,
3914
+ kind: "method",
3915
+ name,
3916
+ flags,
3917
+ implFlags,
3918
+ rva
3919
+ });
3920
+ }, issues);
3921
+ }
3922
+ return methods;
3923
+ };
3924
+ parseImplMaps = ({ bytes, layout, heapExtent, modules, members, issues }) => {
3925
+ const moduleNames = new Map(modules.map((module) => [module.token, module]));
3926
+ const imports = [];
3927
+ const table = layout.table(28);
3928
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3929
+ readManagedValue(() => {
3930
+ const cursor = metadataRowCursor(bytes, layout, 28, row);
3931
+ const mappingFlags = cursor.readUInt16();
3932
+ const memberForwardedOffset = cursor.offset;
3933
+ const memberForwardedRaw = cursor.readIndex(layout.codedIndexSize("MemberForwarded"));
3934
+ const memberForwardedReason = metadataCodedTokenInvalidReason(memberForwardedRaw, 1, [4, 6], layout.rowCounts);
3935
+ if (memberForwardedReason !== null || memberForwardedRaw === 0) issues.push({
3936
+ code: "invalid-row",
3937
+ scope: `metadata.ImplMap:${metadataToken(28, row)}`,
3938
+ offset: memberForwardedOffset,
3939
+ detail: memberForwardedReason === null ? "ImplMap MemberForwarded coded index 0x0 is null, but the column must reference a Field or MethodDef row" : `ImplMap MemberForwarded coded index 0x${memberForwardedRaw.toString(16)} is invalid: ${memberForwardedReason}`
3940
+ });
3941
+ const memberToken = metadataCodedToken(memberForwardedRaw, 1, [4, 6], layout.rowCounts);
3942
+ const importName = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
3943
+ const importScopeOffset = cursor.offset;
3944
+ const importScopeRow = cursor.readIndex(layout.tableIndexSize(26));
3945
+ const moduleCount = layout.table(26)?.rowCount ?? 0;
3946
+ const validImportScope = importScopeRow > 0 && importScopeRow <= moduleCount;
3947
+ if (!validImportScope) issues.push({
3948
+ code: "invalid-row",
3949
+ scope: `metadata.ImplMap:${metadataToken(28, row)}`,
3950
+ offset: importScopeOffset,
3951
+ detail: `ImplMap ImportScope row ${String(importScopeRow)} must reference a ModuleRef row between 1 and ${String(moduleCount)}`
3952
+ });
3953
+ const importScopeToken = validImportScope ? metadataToken(26, importScopeRow) : null;
3954
+ const member = memberToken === null ? undefined : members.get(memberToken);
3955
+ imports.push({
3956
+ token: metadataToken(28, row),
3957
+ row_offset: cursor.start,
3958
+ mapping_flags: mappingFlags,
3959
+ mapping_flags_hex: flagsHex(mappingFlags),
3960
+ member_token: memberToken,
3961
+ member_kind: member?.kind ?? "unknown",
3962
+ member_name: member?.name ?? null,
3963
+ import_name: importName,
3964
+ import_scope_token: importScopeToken,
3965
+ import_scope_name: importScopeToken === null ? null : moduleNames.get(importScopeToken)?.name ?? null,
3966
+ no_mangle: (mappingFlags & 1) !== 0,
3967
+ char_set: charSet(mappingFlags),
3968
+ call_convention: callConvention(mappingFlags),
3969
+ supports_last_error: (mappingFlags & 64) !== 0,
3970
+ best_fit: bestFit(mappingFlags),
3971
+ throw_on_unmappable_char: throwOnUnmappable(mappingFlags),
3972
+ verification: "managed-declaration-only"
3973
+ });
3974
+ }, issues);
3975
+ }
3976
+ return imports;
3977
+ };
3978
+ charSet = (flags) => {
3979
+ switch (flags & 6) {
3980
+ case 0: return "not-specified";
3981
+ case 2: return "ansi";
3982
+ case 4: return "unicode";
3983
+ case 6: return "auto";
3984
+ default: return "unknown";
3985
+ }
3986
+ };
3987
+ callConvention = (flags) => {
3988
+ switch (flags & 1792) {
3989
+ case 0: return "not-specified";
3990
+ case 256: return "winapi";
3991
+ case 512: return "cdecl";
3992
+ case 768: return "stdcall";
3993
+ case 1024: return "thiscall";
3994
+ case 1280: return "fastcall";
3995
+ default: return "unknown";
3996
+ }
3997
+ };
3998
+ bestFit = (flags) => {
3999
+ switch (flags & 48) {
4000
+ case 0: return "assembly-default";
4001
+ case 16: return "enabled";
4002
+ case 32: return "disabled";
4003
+ default: return "unknown";
4004
+ }
4005
+ };
4006
+ throwOnUnmappable = (flags) => {
4007
+ switch (flags & 12288) {
4008
+ case 0: return "assembly-default";
4009
+ case 4096: return "enabled";
4010
+ case 8192: return "disabled";
4011
+ default: return "unknown";
4012
+ }
4013
+ };
4014
+ nativeImplementations = (methods, pinvokeTokens) => {
4015
+ const implementations = [];
4016
+ for (const method of methods) {
4017
+ if (method.kind !== "method") continue;
4018
+ const implFlags = method.implFlags ?? 0;
4019
+ const codeType = codeTypeFor(implFlags);
4020
+ const managedKind = managedKindFor(implFlags);
4021
+ const pinvokeDeclared = pinvokeTokens.has(method.token) || (method.flags & 8192) !== 0;
4022
+ if (!pinvokeDeclared && codeType === "il" && managedKind === "managed") continue;
4023
+ implementations.push({
4024
+ token: method.token,
4025
+ row_offset: method.rowOffset,
4026
+ name: method.name,
4027
+ rva: method.rva ?? 0,
4028
+ flags: method.flags,
4029
+ impl_flags: implFlags,
4030
+ code_type: codeType,
4031
+ managed_kind: managedKind,
4032
+ pinvoke_declared: pinvokeDeclared,
4033
+ boundary_kind: boundaryKind(pinvokeDeclared, codeType, managedKind),
4034
+ body_interpretation: codeType === "il" && managedKind === "managed" && !pinvokeDeclared ? "managed-cil" : method.rva === 0 ? "not-file-backed" : "native-or-runtime"
4035
+ });
4036
+ }
4037
+ return implementations;
4038
+ };
4039
+ codeTypeFor = (implFlags) => {
4040
+ switch (implFlags & 3) {
4041
+ case 0: return "il";
4042
+ case 1: return "native";
4043
+ case 2: return "optil";
4044
+ case 3: return "runtime";
4045
+ default: return "unknown";
4046
+ }
4047
+ };
4048
+ managedKindFor = (implFlags) => {
4049
+ switch (implFlags & 4) {
4050
+ case 0: return "managed";
4051
+ case 4: return "unmanaged";
4052
+ default: return "unknown";
4053
+ }
4054
+ };
4055
+ boundaryKind = (pinvokeDeclared, codeType, managedKind) => {
4056
+ if (pinvokeDeclared) return "pinvoke";
4057
+ if (codeType === "native") return "native-body";
4058
+ if (codeType === "runtime") return "runtime-provided";
4059
+ if (managedKind === "unmanaged") return "unmanaged-method";
4060
+ return "mixed-or-unknown";
4061
+ };
4062
+ cliNative = (pe) => {
4063
+ if (pe.cli === null) return null;
4064
+ return {
4065
+ il_only: (pe.cli.flags & 1) !== 0,
4066
+ requires_32bit: (pe.cli.flags & 2) !== 0,
4067
+ strong_name_signed: (pe.cli.flags & 8) !== 0,
4068
+ native_entry_point: (pe.cli.flags & 16) !== 0,
4069
+ ready_to_run_signature: pe.cli.readyToRunSignature,
4070
+ managed_native_header_rva: pe.cli.managedNativeHeader.rva,
4071
+ managed_native_header_size: pe.cli.managedNativeHeader.size
4072
+ };
4073
+ };
4074
+ nativeBoundarySummary = (native, counts) => ({
4075
+ ...counts,
4076
+ ready_to_run: native?.ready_to_run_signature ?? null,
4077
+ mixed_mode_or_native_header: native === null ? null : native.managed_native_header_rva !== 0 || native.managed_native_header_size !== 0 || native.native_entry_point
4078
+ });
4079
+ buildNativeBoundaryInspection = ({ target, bytes, layout, inventory, moduleRefs, imports, implementations, native, issues }) => managedNativeBoundaryInspectionSchema.parse(admitManagedProjection({
4080
+ artifact: {
4081
+ path: target.path,
4082
+ sha256: target.sha256,
4083
+ byte_length: bytes.length,
4084
+ format: "pe"
4085
+ },
4086
+ module: inventory.module,
4087
+ metadata: {
4088
+ status: issues.length === 0 ? "complete" : "partial",
4089
+ version: layout.version,
4090
+ table_row_counts: managedTableRowCounts(layout)
4091
+ },
4092
+ identity_scope: {
4093
+ token_identity: "build-local",
4094
+ requires_artifact_sha256: target.sha256,
4095
+ requires_mvid: inventory.module?.mvid ?? null
4096
+ },
4097
+ cli_native: native,
4098
+ module_refs: moduleRefs,
4099
+ pinvoke_imports: imports,
4100
+ native_implementations: implementations,
4101
+ summary: nativeBoundarySummary(native, {
4102
+ module_ref_count: moduleRefs.length,
4103
+ pinvoke_import_count: imports.length,
4104
+ native_implementation_count: implementations.length
4105
+ }),
4106
+ coverage: {
4107
+ state: issues.length === 0 ? "complete" : "partial",
4108
+ issues
4109
+ },
4110
+ limitations: [
4111
+ "P/Invoke rows prove managed import declarations only; this inspection does not verify that a native library, export, thunk, or provider-qualified function exists.",
4112
+ "Managed metadata tokens are build-local coordinates and are only meaningful with the reported artifact SHA-256 and MVID.",
4113
+ "ReadyToRun, NativeAOT, C++/CLI, and IL2CPP native semantics require separately selected native-provider evidence; this tool does not translate managed tokens into native addresses."
4114
+ ]
4115
+ }, managedDecodeBudget(layout)));
4116
+ })))();
4117
+ }
4118
+
4119
+ //#endregion
4120
+ //#region dist/dotnet/ManagedNativeBoundaryInspector.js
4121
+ var emptyInspection, readBoundaryInventory, inspectManagedNativeBoundariesBytes;
4122
+ function init_ManagedNativeBoundaryInspector() {
4123
+ return (init_ManagedNativeBoundaryInspector = __esmMin((() => {
4124
+ init_ManagedDecodeBudget();
4125
+ init_managedArtifact();
4126
+ init_ManagedMetadataInventory();
4127
+ init_ManagedMetadataLayout();
4128
+ init_ManagedPeReader();
4129
+ init_ManagedReaderFailure();
4130
+ init_ManagedNativeBoundaryHelpers();
4131
+ emptyInspection = (target, bytes, classification, { native = null, issues = [] } = {}) => {
4132
+ return managedNativeBoundaryInspectionSchema.parse(admitManagedProjection({
4133
+ artifact: {
4134
+ path: target.path,
4135
+ sha256: target.sha256,
4136
+ byte_length: bytes.length,
4137
+ format: "pe"
4138
+ },
4139
+ module: null,
4140
+ metadata: {
4141
+ status: issues.some((issue) => issue.code === "resource-limit") ? "partial" : classification === "malformed" ? "malformed" : "absent",
4142
+ version: null,
4143
+ table_row_counts: {}
4144
+ },
4145
+ identity_scope: {
4146
+ token_identity: "build-local",
4147
+ requires_artifact_sha256: target.sha256,
4148
+ requires_mvid: null
4149
+ },
4150
+ cli_native: native,
4151
+ module_refs: [],
4152
+ pinvoke_imports: [],
4153
+ native_implementations: [],
4154
+ summary: nativeBoundarySummary(native, {
4155
+ module_ref_count: 0,
4156
+ pinvoke_import_count: 0,
4157
+ native_implementation_count: 0
4158
+ }),
4159
+ coverage: {
4160
+ state: "unavailable",
4161
+ issues
4162
+ },
4163
+ limitations: ["No CLI metadata was admitted; native boundary declarations are unavailable.", "Static inspection does not load or execute target code, so native export resolution is not performed."]
4164
+ }));
4165
+ };
4166
+ readBoundaryInventory = (bytes, pe, cli, issues) => {
4167
+ const metadataOffset = pe.rvaToOffset(cli.metadata.rva, cli.metadata.size, "cli.metadata");
4168
+ const layout = readManagedMetadataLayout(bytes, metadataOffset, cli.metadata.size);
4169
+ const inventory = readManagedMetadataInventory(bytes, layout, readManagedResourceDirectory(pe, issues));
4170
+ return {
4171
+ layout,
4172
+ inventory
4173
+ };
4174
+ };
4175
+ inspectManagedNativeBoundariesBytes = (bytes, target) => {
4176
+ let pe;
4177
+ try {
4178
+ pe = readManagedPeLayout(bytes);
4179
+ } catch (cause) {
4180
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
4181
+ return emptyInspection(target, bytes, "malformed", { issues: [cause.issue] });
4182
+ }
4183
+ if (pe.cli === null) return emptyInspection(target, bytes, pe.cliDirectoryState !== "absent" ? "malformed" : "not-managed", { issues: pe.cliIssue === null ? [] : [pe.cliIssue] });
4184
+ const issues = [];
4185
+ let layout;
4186
+ let inventory;
4187
+ try {
4188
+ ({layout, inventory} = readBoundaryInventory(bytes, pe, pe.cli, issues));
4189
+ } catch (cause) {
4190
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
4191
+ return emptyInspection(target, bytes, "malformed", {
4192
+ native: cliNative(pe),
4193
+ issues: [cause.issue]
4194
+ });
4195
+ }
4196
+ try {
4197
+ const heapExtent = Math.max(layout.strings.size, layout.blob.size);
4198
+ issues.push(...inventory.issues);
4199
+ const moduleRefs = parseModuleRefs(bytes, layout, heapExtent, issues);
4200
+ const members = new Map([...parseFields(bytes, layout, heapExtent, issues), ...parseMethods(bytes, layout, heapExtent, issues)]);
4201
+ const imports = parseImplMaps({
4202
+ bytes,
4203
+ layout,
4204
+ heapExtent,
4205
+ modules: moduleRefs,
4206
+ members,
4207
+ issues
4208
+ });
4209
+ const pinvokeTokens = new Set(imports.map(({ member_token }) => member_token).filter((token) => token !== null));
4210
+ const implementations = nativeImplementations(members.values(), pinvokeTokens);
4211
+ return buildNativeBoundaryInspection({
4212
+ target,
4213
+ bytes,
4214
+ pe,
4215
+ layout,
4216
+ inventory,
4217
+ moduleRefs,
4218
+ imports,
4219
+ implementations,
4220
+ native: cliNative(pe),
4221
+ issues
4222
+ });
4223
+ } catch (cause) {
4224
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
4225
+ return emptyInspection(target, bytes, "malformed", {
4226
+ native: cliNative(pe),
4227
+ issues: [...issues, cause.issue]
4228
+ });
4229
+ }
4230
+ };
4231
+ })))();
4232
+ }
4233
+
4234
+ //#endregion
4235
+ //#region dist/dotnet/ManagedSnapshot.js
4236
+ var MAX_MANAGED_SNAPSHOT_BYTES, managedSnapshotCapacityError, readManagedSnapshot, hashManagedSource, readManagedFile, normalizeManagedReadFailure, managedCleanupError, normalizeReadFailure;
4237
+ function init_ManagedSnapshot() {
4238
+ return (init_ManagedSnapshot = __esmMin((() => {
4239
+ init_InvestigationProviders();
4240
+ init_BinaryTargetResolver();
4241
+ init_RegularFileRead();
4242
+ init_ArtifactReader();
4243
+ init_analysisErrorCleanup();
4244
+ init_analysisErrorBase();
4245
+ init_analysisErrorCore();
4246
+ init_evidenceErrors();
4247
+ init_providerCleanupError();
4248
+ init_RegularFile();
4249
+ init_BoundedFileBytes();
4250
+ MAX_MANAGED_SNAPSHOT_BYTES = 128 * 1024 * 1024;
4251
+ managedSnapshotCapacityError = (operation) => new AnalysisResourceConstraintError(operation, "memory", "Managed static inspection requires an eagerly retained PE snapshot within its input byte budget.", { max_snapshot_bytes: MAX_MANAGED_SNAPSHOT_BYTES });
4252
+ readManagedSnapshot = async (path, operation, options = {}) => {
4253
+ return readManagedFile(path, operation, async (handle, metadata) => {
4254
+ const signal = options.signal;
4255
+ if (metadata.size > 134217728) throw managedSnapshotCapacityError(operation);
4256
+ const bytes = await readBoundedFileBytes(handle, MAX_MANAGED_SNAPSHOT_BYTES, signal);
4257
+ if (bytes === undefined) throw managedSnapshotCapacityError(operation);
4258
+ signal?.throwIfAborted();
4259
+ return {
4260
+ byteLength: bytes.length,
4261
+ sha256: createHash("sha256").update(bytes).digest("hex"),
4262
+ bytes
4263
+ };
4264
+ }, options);
4265
+ };
4266
+ hashManagedSource = async (path, operation, options = {}) => readManagedFile(path, operation, async (handle, metadata) => {
4267
+ const signal = options.signal;
4268
+ if (metadata.size > 134217728) throw managedSnapshotCapacityError(operation);
4269
+ const digest = createHash("sha256");
4270
+ let byteLength = 0;
4271
+ const stream = handle.createReadStream({
4272
+ autoClose: false,
4273
+ ...signal === undefined ? {} : { signal }
4274
+ });
4275
+ for await (const chunk of stream) {
4276
+ signal?.throwIfAborted();
4277
+ if (!Buffer.isBuffer(chunk)) throw new TypeError("Managed source stream returned non-buffer data");
4278
+ if (chunk.length > 134217728 - byteLength) throw managedSnapshotCapacityError(operation);
4279
+ byteLength += chunk.length;
4280
+ digest.update(chunk);
4281
+ }
4282
+ return {
4283
+ byteLength,
4284
+ sha256: digest.digest("hex")
4285
+ };
4286
+ }, options);
4287
+ readManagedFile = (path, operation, read, options) => withRegularFile(path, read, options).catch((cause) => {
4288
+ throw normalizeManagedReadFailure(cause, path, operation, options.signal);
4289
+ });
4290
+ normalizeManagedReadFailure = (cause, fallbackPath, operation, signal) => {
4291
+ const cleanupError = managedCleanupError(cause, fallbackPath, operation, signal);
4292
+ if (cleanupError !== undefined) return cleanupError;
4293
+ return normalizeReadFailure(cause, fallbackPath, operation, signal);
4294
+ };
4295
+ managedCleanupError = (cause, fallbackPath, operation, signal) => {
4296
+ if (cause instanceof RegularFileCleanupFailure) {
4297
+ const cleanup = new ProviderCleanupError(MANAGED_STATIC_PROVIDER.id, [cause.path], { reason: "A managed input file handle could not be closed" }, {
4298
+ cause,
4299
+ operation
4300
+ });
4301
+ const failure = cause.outcome.kind === "failed" ? normalizeReadFailure(cause.outcome.cause, cause.path, operation, signal) : undefined;
4302
+ return failure instanceof AnalysisError ? analysisErrorWithCleanupFailure(failure, cleanup, operation) : cleanup;
4303
+ }
4304
+ if (cause instanceof ArtifactReaderFailure && cause.cleanup !== undefined) return new ProviderCleanupError(MANAGED_STATIC_PROVIDER.id, cause.cleanup.resources.length > 0 ? cause.cleanup.resources : [fallbackPath], { reason: cause.cleanup.reason }, {
4305
+ cause,
4306
+ operation
4307
+ });
4308
+ return undefined;
4309
+ };
4310
+ normalizeReadFailure = (cause, path, operation, signal) => cause instanceof RegularFileChangedError ? new EvidenceIntegrityError(`Managed source changed while ${operation} was reading ${path}.`, { cause }) : cause instanceof AnalysisError ? cause : classifyBinaryTargetFilesystemFailure(path, cause) ?? (signal?.aborted === true ? new AnalysisCancelledError(operation, { cause }) : cause);
4311
+ })))();
4312
+ }
4313
+
4314
+ //#endregion
4315
+ //#region dist/dotnet/ManagedStaticProvider.js
4316
+ var ManagedStaticProvider_exports = /* @__PURE__ */ __exportAll({ ManagedStaticProvider: () => ManagedStaticProvider });
4317
+ var ManagedStaticProvider, ManagedStaticClient, isCleanupFailure, isManagedOperation, inspectManagedOperation, managedLocations;
4318
+ function init_ManagedStaticProvider() {
4319
+ return (init_ManagedStaticProvider = __esmMin((() => {
4320
+ init_AnalysisProvider();
4321
+ init_ArtifactReader();
4322
+ init_ArtifactResourceScope();
4323
+ init_ManagedStaticProviderMetadata();
4324
+ init_InvestigationProviders();
4325
+ init_managedToolContracts();
4326
+ init_analysisErrorBase();
4327
+ init_analysisErrorCore();
4328
+ init_evidenceErrors();
4329
+ init_providerAdapterError();
4330
+ init_providerCleanupError();
4331
+ init_result();
4332
+ init_ManagedArtifactInspector();
4333
+ init_ManagedMemberInspector();
4334
+ init_ManagedNativeBoundaryInspector();
4335
+ init_RegularFileRead();
4336
+ init_ManagedSnapshot();
4337
+ ManagedStaticProvider = class {
4338
+ #capabilities = managedStaticCapabilities();
4339
+ identity() {
4340
+ return MANAGED_STATIC_PROVIDER;
4341
+ }
4342
+ capabilities() {
4343
+ return this.#capabilities;
4344
+ }
4345
+ createClient(target) {
4346
+ return new ManagedStaticClient(target);
4347
+ }
4348
+ };
4349
+ ManagedStaticClient = class {
4350
+ target;
4351
+ #snapshotBytes;
4352
+ #resources = new ArtifactResourceScope();
4353
+ constructor(target) {
4354
+ this.target = target;
4355
+ }
4356
+ async execute(operation, parameters, options) {
4357
+ if (operation === "health") return ok(createAnalysisExecution(null, MANAGED_STATIC_PROVIDER));
4358
+ if (!isManagedOperation(operation)) return err(new AnalysisCapabilityUnavailableError(MANAGED_STATIC_PROVIDER.id, operation, "Operation is not implemented by the managed static provider."));
4359
+ if (this.target.format !== "pe") return err(new AnalysisCapabilityUnavailableError(MANAGED_STATIC_PROVIDER.id, operation, `Managed static triage requires a PE target; observed ${this.target.format}.`));
4360
+ try {
4361
+ if (options?.signal?.aborted === true) return err(new AnalysisCancelledError(operation));
4362
+ const snapshot = this.#snapshotBytes;
4363
+ const observed = snapshot === undefined ? await readManagedSnapshot(this.target.path, operation, {
4364
+ signal: options?.signal,
4365
+ resources: this.#resources
4366
+ }) : await hashManagedSource(this.target.path, operation, {
4367
+ signal: options?.signal,
4368
+ resources: this.#resources
4369
+ });
4370
+ if (observed.sha256 !== this.target.sha256) return err(new EvidenceIntegrityError(`Managed artifact digest changed after open: expected ${this.target.sha256}, observed ${observed.sha256} at ${this.target.path}`));
4371
+ const bytes = snapshot ?? observed.bytes;
4372
+ if (bytes === undefined) throw new TypeError("Managed snapshot bytes are unavailable");
4373
+ this.#snapshotBytes = bytes;
4374
+ const result = inspectManagedOperation(operation, parameters, bytes, this.target);
4375
+ return ok(createAnalysisExecution(result, MANAGED_STATIC_PROVIDER, {
4376
+ rawResult: null,
4377
+ limitations: result.limitations,
4378
+ subject: this.target,
4379
+ locations: managedLocations(result)
4380
+ }));
4381
+ } catch (cause) {
4382
+ if (isCleanupFailure(cause)) return err(this.#cleanupError(operation, cause));
4383
+ if (cause instanceof AnalysisError) return err(cause);
4384
+ if (options?.signal?.aborted === true) return err(new AnalysisCancelledError(operation));
4385
+ return err(new ProviderAdapterError(MANAGED_STATIC_PROVIDER.id, operation, { cause }));
4386
+ }
4387
+ }
4388
+ async close() {
4389
+ this.#snapshotBytes = undefined;
4390
+ try {
4391
+ await this.#resources.close();
4392
+ return ok(null);
4393
+ } catch (cause) {
4394
+ return err(this.#cleanupError("close", cause));
4395
+ }
4396
+ }
4397
+ #cleanupError(operation, cause) {
4398
+ const failure = managedCleanupError(cause, this.target.path, operation);
4399
+ if (failure instanceof ProviderCleanupError) return failure;
4400
+ const cleanup = cause instanceof ArtifactReaderFailure ? cause.cleanup : undefined;
4401
+ return new ProviderCleanupError(MANAGED_STATIC_PROVIDER.id, cleanup?.resources ?? [this.target.path], { reason: cleanup?.reason ?? (cause instanceof Error ? cause.message : String(cause)) }, {
4402
+ cause,
4403
+ operation
4404
+ });
4405
+ }
4406
+ };
4407
+ isCleanupFailure = (cause) => cause instanceof RegularFileCleanupFailure || cause instanceof ArtifactReaderFailure && cause.cleanup !== undefined;
4408
+ isManagedOperation = (operation) => MANAGED_TOOL_CONTRACTS.some(({ name }) => name === operation);
4409
+ inspectManagedOperation = (operation, parameters, bytes, target) => {
4410
+ if (operation === "inspect_managed_members") {
4411
+ const { type_names: typeNames } = managedMembersInputSchema.parse(parameters);
4412
+ return inspectManagedMembersBytes(bytes, target, typeNames === undefined ? {} : { typeNames });
4413
+ }
4414
+ managedTargetInputSchema.parse(parameters);
4415
+ if (operation === "inspect_managed_artifact") {
4416
+ return inspectManagedArtifactBytes(bytes, target);
4417
+ }
4418
+ return inspectManagedNativeBoundariesBytes(bytes, target);
4419
+ };
4420
+ managedLocations = (result) => {
4421
+ if ("pe" in result) {
4422
+ if (result.pe.cli === null) return [{
4423
+ kind: "file-offset",
4424
+ offset: 0
4425
+ }];
4426
+ return [{
4427
+ kind: "file-offset-range",
4428
+ start: result.pe.cli.header_offset,
4429
+ end: result.pe.cli.header_offset + result.pe.cli.header_size
4430
+ }, ...[result.module, result.assembly].filter((value) => value !== null).map((value) => ({
4431
+ kind: "file-offset",
4432
+ offset: value.row_offset
4433
+ }))];
4434
+ }
4435
+ if ("methods" in result) return [...result.module === null ? [{
4436
+ kind: "file-offset",
4437
+ offset: 0
4438
+ }] : [{
4439
+ kind: "file-offset",
4440
+ offset: result.module.row_offset
4441
+ }], ...result.methods.filter((method) => method.body.file_offset !== null).map((method) => ({
4442
+ kind: "file-offset",
4443
+ offset: method.body.file_offset ?? 0
4444
+ }))];
4445
+ return [...result.module === null ? [{
4446
+ kind: "file-offset",
4447
+ offset: 0
4448
+ }] : [{
4449
+ kind: "file-offset",
4450
+ offset: result.module.row_offset
4451
+ }], ...result.pinvoke_imports.map((mapping) => ({
4452
+ kind: "file-offset",
4453
+ offset: mapping.row_offset
4454
+ }))];
4455
+ };
4456
+ })))();
4457
+ }
4458
+
4459
+ //#endregion
4460
+ export { readManagedSnapshot as a, init_ManagedStaticProviderMetadata as c, init_ManagedSnapshot as i, managedStaticCapabilities as l, ManagedStaticProvider_exports as n, init_ManagedMemberInspector as o, init_ManagedStaticProvider as r, inspectManagedMembersBytes as s, ManagedStaticProvider as t };