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,3622 @@
1
+ import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
2
+ import { AnalysisCancelledError, AnalysisError, AnalysisResourceConstraintError, init_analysisErrorBase, init_analysisErrorCore } from "./providerOperationHealth-DSTcYPJe.js";
3
+ import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-BXkffc1D.js";
4
+ import { ProviderCleanupError, init_providerCleanupError } from "./providerCleanupError-Do66qCEp.js";
5
+ import { EvidenceIntegrityError, init_evidenceErrors } from "./analysisErrorPresentation-DZrKL8kS.js";
6
+ import { MANAGED_STATIC_PROVIDER, init_InvestigationProviders } from "./InvestigationProviders-D-QCy-4c.js";
7
+ import { RegularFileChangedError, init_RegularFile } from "./RegularFile-CL6meBxi.js";
8
+ import { init_BoundedFileBytes, readBoundedFileBytes } from "./BoundedFileBytes-BU30odTm.js";
9
+ import { RegularFileCleanupFailure, init_RegularFileRead, withRegularFile } from "./RegularFileRead-BMh5FMXd.js";
10
+ import { analysisErrorWithCleanupFailure, init_analysisErrorCleanup } from "./analysisErrorCleanup-DaUQNiQd.js";
11
+ import { init_managedArtifact, managedMemberInspectionSchema } from "./managedApplicationGraph-BqOr01E6.js";
12
+ import { classifyBinaryTargetFilesystemFailure, decodePeMachine, init_BinaryTargetResolver, init_peMachine } from "./BinaryTargetResolver-CKRfFhLj.js";
13
+ import { createHash } from "node:crypto";
14
+
15
+ //#region dist/dotnet/ManagedReaderFailure.js
16
+ var ManagedReaderFailure, managedFailure, readManagedValue, uniqueManagedParseIssues;
17
+ function init_ManagedReaderFailure() {
18
+ return (init_ManagedReaderFailure = __esmMin((() => {
19
+ ManagedReaderFailure = class extends Error {
20
+ issue;
21
+ constructor(issue, options) {
22
+ super(issue.detail, options);
23
+ this.issue = issue;
24
+ }
25
+ };
26
+ managedFailure = (code, scope, detail, offset = null) => new ManagedReaderFailure({
27
+ code,
28
+ scope,
29
+ offset,
30
+ detail
31
+ });
32
+ readManagedValue = (operation, issues) => {
33
+ try {
34
+ return operation();
35
+ } catch (cause) {
36
+ if (!(cause instanceof ManagedReaderFailure) || cause.issue.code === "resource-limit") throw cause;
37
+ issues.push(cause.issue);
38
+ return undefined;
39
+ }
40
+ };
41
+ uniqueManagedParseIssues = (issues) => [...new Map(issues.map((issue) => [JSON.stringify(issue), issue])).values()];
42
+ })))();
43
+ }
44
+
45
+ //#endregion
46
+ //#region dist/dotnet/ManagedDecodeBudget.js
47
+ var MAX_METADATA_REPRESENTATION_BYTES, ManagedDecodeBudget, budgets, attachManagedDecodeBudget, managedDecodeBudget, managedJsonStringBytes, jsonBytes, admitManagedProjection;
48
+ function init_ManagedDecodeBudget() {
49
+ return (init_ManagedDecodeBudget = __esmMin((() => {
50
+ init_ManagedReaderFailure();
51
+ MAX_METADATA_REPRESENTATION_BYTES = 64 * 1024 * 1024;
52
+ ManagedDecodeBudget = class {
53
+ #remaining = MAX_METADATA_REPRESENTATION_BYTES;
54
+ #transient = 0;
55
+ #rows = new Map();
56
+ #strings = new Map();
57
+ #digests = new WeakMap();
58
+ reserve(bytes, offset) {
59
+ this.#admit(bytes, offset);
60
+ this.#remaining -= bytes;
61
+ }
62
+ /** Retain one bookkeeping reservation per physical row, independently of lookup replay. */
63
+ reserveRow(table, row, offset) {
64
+ let rows = this.#rows.get(table);
65
+ if (rows?.has(row) === true) return;
66
+ this.reserve(256, offset);
67
+ if (rows === undefined) {
68
+ rows = new Set();
69
+ this.#rows.set(table, rows);
70
+ }
71
+ rows.add(row);
72
+ }
73
+ /** Bound a decoding allocation that stays live until `releaseTransient`; only retained output is reserved. */
74
+ admitTransient(bytes, offset) {
75
+ this.#admit(bytes, offset);
76
+ this.#transient += bytes;
77
+ }
78
+ /** End the current item's decoding; its bookkeeping is unreachable and only reserved output remains. */
79
+ releaseTransient() {
80
+ this.#transient = 0;
81
+ }
82
+ #admit(bytes, offset) {
83
+ 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);
84
+ }
85
+ /** UTF-8 cannot decode to more UTF-16 units than bytes; JSON uses at most six bytes per unit. */
86
+ reserveString(encodedBytes, offset) {
87
+ this.reserve(encodedBytes * 6 + 2, offset);
88
+ }
89
+ /** Snapshot buffers are immutable within a layout; cache exact backing-buffer ranges. */
90
+ digest(bytes, algorithm) {
91
+ let ranges = this.#digests.get(bytes.buffer);
92
+ if (ranges === undefined) {
93
+ ranges = new Map();
94
+ this.#digests.set(bytes.buffer, ranges);
95
+ }
96
+ const key = `${algorithm}:${String(bytes.byteOffset)}:${String(bytes.byteLength)}`;
97
+ const cached = ranges.get(key);
98
+ if (cached !== undefined) return cached;
99
+ this.reserve(256, null);
100
+ const digest = createHash(algorithm).update(bytes).digest("hex");
101
+ ranges.set(key, digest);
102
+ return digest;
103
+ }
104
+ cachedString(index) {
105
+ return this.#strings.get(index);
106
+ }
107
+ cacheString(index, value, encodedBytes) {
108
+ this.#strings.set(index, {
109
+ value,
110
+ encodedBytes
111
+ });
112
+ }
113
+ };
114
+ budgets = new WeakMap();
115
+ attachManagedDecodeBudget = (layout, budget) => {
116
+ budgets.set(layout, budget);
117
+ };
118
+ managedDecodeBudget = (layout) => {
119
+ let budget = budgets.get(layout);
120
+ if (budget === undefined) {
121
+ budget = new ManagedDecodeBudget();
122
+ budgets.set(layout, budget);
123
+ }
124
+ return budget;
125
+ };
126
+ managedJsonStringBytes = (value) => {
127
+ let bytes = 2;
128
+ for (let index = 0; index < value.length; index++) {
129
+ const unit = value.charCodeAt(index);
130
+ if (unit === 34 || unit === 92) bytes += 2;
131
+ else if (unit < 32) bytes += [
132
+ 8,
133
+ 9,
134
+ 10,
135
+ 12,
136
+ 13
137
+ ].includes(unit) ? 2 : 6;
138
+ else if (unit < 128) bytes += 1;
139
+ else if (unit < 2048) bytes += 2;
140
+ else if (unit >= 55296 && unit <= 56319) {
141
+ const next = value.charCodeAt(index + 1);
142
+ if (next >= 56320 && next <= 57343) {
143
+ bytes += 4;
144
+ index++;
145
+ } else bytes += 6;
146
+ } else if (unit >= 56320 && unit <= 57343) bytes += 6;
147
+ else bytes += 3;
148
+ }
149
+ return bytes;
150
+ };
151
+ jsonBytes = (item) => typeof item === "string" ? managedJsonStringBytes(item) : Buffer.byteLength(JSON.stringify(item) ?? "null");
152
+ admitManagedProjection = (value, budget = new ManagedDecodeBudget()) => {
153
+ const visit = (item) => {
154
+ if (Array.isArray(item)) {
155
+ budget.reserve(item.length + 2, null);
156
+ for (const child of item) visit(child);
157
+ } else if (item !== null && typeof item === "object") {
158
+ budget.reserve(2, null);
159
+ for (const key of Object.keys(item)) {
160
+ budget.reserve(jsonBytes(key) + 2, null);
161
+ visit(Reflect.get(item, key));
162
+ }
163
+ } else {
164
+ budget.reserve(jsonBytes(item), null);
165
+ }
166
+ };
167
+ visit(value);
168
+ return value;
169
+ };
170
+ })))();
171
+ }
172
+
173
+ //#endregion
174
+ //#region dist/dotnet/ManagedPeReader.js
175
+ var requireRange$2, add, architectureFor, resolveRva, mapRva, readDirectory, readCliHeader, readCoffHeader, readOptionalHeader, readSections, readCliDirectory, readManagedPeLayout;
176
+ function init_ManagedPeReader() {
177
+ return (init_ManagedPeReader = __esmMin((() => {
178
+ init_peMachine();
179
+ init_ManagedReaderFailure();
180
+ requireRange$2 = (bytes, offset, length, scope) => {
181
+ 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);
182
+ };
183
+ add = (left, right, scope) => {
184
+ const result = left + right;
185
+ if (!Number.isSafeInteger(result) || result < left) throw managedFailure("invalid-directory", scope, `${scope} offset arithmetic overflowed`, left);
186
+ return result;
187
+ };
188
+ architectureFor = (machine, managed) => {
189
+ const decoded = decodePeMachine(machine);
190
+ if (decoded === undefined || decoded.nativeOsOverride && !managed) throw managedFailure("invalid-directory", "pe.machine", `Unsupported PE machine 0x${machine.toString(16).padStart(4, "0")}`);
191
+ return decoded.architecture;
192
+ };
193
+ resolveRva = (mapping) => {
194
+ const { bytes, sections, rva, size, scope } = mapping;
195
+ 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`);
196
+ const selected = sections.find((section) => {
197
+ const within = rva - section.virtualAddress;
198
+ return section.virtualSize > 0 && within >= 0 && within < section.virtualSize && size <= section.virtualSize - within;
199
+ });
200
+ if (selected === undefined) throw managedFailure("invalid-directory", scope, `${scope} RVA is not covered by one PE section`);
201
+ for (const section of sections) {
202
+ if (section === selected || section.virtualSize === 0) continue;
203
+ const end = section.virtualAddress + section.virtualSize;
204
+ const intersects = size === 0 ? rva >= section.virtualAddress && rva < end : rva < end && rva + size > section.virtualAddress;
205
+ if (intersects) throw managedFailure("invalid-directory", scope, `${scope} RVA range has ambiguous overlapping PE section mappings`);
206
+ }
207
+ const within = rva - selected.virtualAddress;
208
+ if (within > selected.rawSize || size > selected.rawSize - within) throw managedFailure("invalid-directory", scope, `${scope} occupies virtual bytes without file-backed data`);
209
+ const offset = add(selected.rawOffset, within, scope);
210
+ requireRange$2(bytes, offset, size, scope);
211
+ let available = Math.min(selected.virtualSize - within, selected.rawSize - within, bytes.length - offset, 4294967296 - rva);
212
+ for (const section of sections) if (section !== selected && section.virtualAddress > rva && section.virtualSize > 0) available = Math.min(available, section.virtualAddress - rva);
213
+ return {
214
+ offset,
215
+ available
216
+ };
217
+ };
218
+ mapRva = (mapping) => mapping.rva === 0 && mapping.size === 0 ? 0 : resolveRva(mapping).offset;
219
+ readDirectory = (bytes, offset) => {
220
+ requireRange$2(bytes, offset, 8, "pe.data-directory");
221
+ return {
222
+ rva: bytes.readUInt32LE(offset),
223
+ size: bytes.readUInt32LE(offset + 4)
224
+ };
225
+ };
226
+ readCliHeader = (bytes, sections, directory) => {
227
+ if (directory.size < 72) throw managedFailure("invalid-cli-header", "cli.header", "CLI header is shorter than the required 72 bytes");
228
+ const offset = mapRva({
229
+ bytes,
230
+ sections,
231
+ rva: directory.rva,
232
+ size: 72,
233
+ scope: "cli.header"
234
+ });
235
+ const headerSize = bytes.readUInt32LE(offset);
236
+ if (headerSize < 72 || headerSize > directory.size) throw managedFailure("invalid-cli-header", "cli.header", "CLI header size is outside its PE data directory", offset);
237
+ const metadata = readDirectory(bytes, offset + 8);
238
+ if (metadata.rva === 0 || metadata.size === 0) throw managedFailure("invalid-cli-header", "cli.metadata", "CLI metadata directory is absent", offset + 8);
239
+ const flags = bytes.readUInt32LE(offset + 16);
240
+ const managedNativeHeader = readDirectory(bytes, offset + 64);
241
+ let readyToRunSignature = false;
242
+ if (managedNativeHeader.rva !== 0 && managedNativeHeader.size >= 4) {
243
+ const nativeOffset = mapRva({
244
+ bytes,
245
+ sections,
246
+ rva: managedNativeHeader.rva,
247
+ size: 4,
248
+ scope: "cli.managed-native-header"
249
+ });
250
+ readyToRunSignature = bytes.readUInt32LE(nativeOffset) === 5395538;
251
+ }
252
+ return {
253
+ headerOffset: offset,
254
+ headerSize,
255
+ runtimeMajor: bytes.readUInt16LE(offset + 4),
256
+ runtimeMinor: bytes.readUInt16LE(offset + 6),
257
+ metadata,
258
+ flags,
259
+ entryPoint: bytes.readUInt32LE(offset + 20),
260
+ resources: readDirectory(bytes, offset + 24),
261
+ strongName: readDirectory(bytes, offset + 32),
262
+ managedNativeHeader,
263
+ readyToRunSignature
264
+ };
265
+ };
266
+ readCoffHeader = (bytes) => {
267
+ const peOffset = bytes.readUInt32LE(60);
268
+ requireRange$2(bytes, peOffset, 24, "pe.coff-header");
269
+ if (bytes.readUInt32LE(peOffset) !== 17744) throw managedFailure("invalid-directory", "pe.signature", "PE signature is invalid", peOffset);
270
+ const coff = peOffset + 4;
271
+ const machine = bytes.readUInt16LE(coff);
272
+ const sectionCount = bytes.readUInt16LE(coff + 2);
273
+ if (sectionCount === 0) throw managedFailure("invalid-directory", "pe.sections", "PE section count must be positive", coff + 2);
274
+ const optionalSize = bytes.readUInt16LE(coff + 16);
275
+ const characteristics = bytes.readUInt16LE(coff + 18);
276
+ return {
277
+ coff,
278
+ machine,
279
+ sectionCount,
280
+ optionalSize,
281
+ characteristics
282
+ };
283
+ };
284
+ readOptionalHeader = (bytes, coff) => {
285
+ const optionalOffset = coff.coff + 20;
286
+ requireRange$2(bytes, optionalOffset, coff.optionalSize, "pe.optional-header");
287
+ if (coff.optionalSize < 96) throw managedFailure("invalid-directory", "pe.optional-header", "PE optional header is too short", optionalOffset);
288
+ const magic = bytes.readUInt16LE(optionalOffset);
289
+ const optionalHeader = magic === 267 ? "pe32" : magic === 523 ? "pe32-plus" : undefined;
290
+ if (optionalHeader === undefined) throw managedFailure("invalid-directory", "pe.optional-header", "PE optional header magic is unsupported", optionalOffset);
291
+ return {
292
+ optionalOffset,
293
+ optionalHeader,
294
+ directoryCountOffset: optionalOffset + (optionalHeader === "pe32" ? 92 : 108),
295
+ directoryOffset: optionalOffset + (optionalHeader === "pe32" ? 96 : 112)
296
+ };
297
+ };
298
+ readSections = (bytes, coff, optional) => {
299
+ const sectionOffset = add(optional.optionalOffset, coff.optionalSize, "pe.sections");
300
+ requireRange$2(bytes, sectionOffset, coff.sectionCount * 40, "pe.sections");
301
+ const sections = [];
302
+ for (let index = 0; index < coff.sectionCount; index += 1) {
303
+ const offset = sectionOffset + index * 40;
304
+ const section = {
305
+ virtualSize: bytes.readUInt32LE(offset + 8),
306
+ virtualAddress: bytes.readUInt32LE(offset + 12),
307
+ rawSize: bytes.readUInt32LE(offset + 16),
308
+ rawOffset: bytes.readUInt32LE(offset + 20)
309
+ };
310
+ if (section.rawSize > 0) requireRange$2(bytes, section.rawOffset, section.rawSize, "pe.section-data");
311
+ sections.push(section);
312
+ }
313
+ return sections;
314
+ };
315
+ readCliDirectory = (bytes, coff, optional) => {
316
+ const countOffset = optional.directoryCountOffset - optional.optionalOffset;
317
+ if (countOffset + 4 > coff.optionalSize) return {
318
+ kind: "unreadable",
319
+ issue: {
320
+ code: "invalid-directory",
321
+ scope: "pe.optional-header",
322
+ detail: "PE optional header does not contain its directory count",
323
+ offset: optional.directoryCountOffset
324
+ }
325
+ };
326
+ const directoryCount = bytes.readUInt32LE(optional.directoryCountOffset);
327
+ if (directoryCount <= 14) return { kind: "absent" };
328
+ const availableDirectoryCount = Math.floor((coff.optionalSize - (optional.directoryOffset - optional.optionalOffset)) / 8);
329
+ if (availableDirectoryCount < 15) return {
330
+ kind: "unreadable",
331
+ issue: {
332
+ code: "invalid-directory",
333
+ scope: "pe.data-directories",
334
+ detail: "PE data-directory count exceeds the optional-header extent",
335
+ offset: optional.directoryCountOffset
336
+ }
337
+ };
338
+ const directory = readDirectory(bytes, optional.directoryOffset + 14 * 8);
339
+ return directory.rva !== 0 || directory.size !== 0 ? {
340
+ kind: "present",
341
+ directory
342
+ } : { kind: "absent" };
343
+ };
344
+ readManagedPeLayout = (bytes) => {
345
+ requireRange$2(bytes, 0, 64, "pe.dos-header");
346
+ if (bytes[0] !== 77 || bytes[1] !== 90) throw managedFailure("invalid-directory", "pe.dos-header", "Artifact does not start with an MZ header", 0);
347
+ const coff = readCoffHeader(bytes);
348
+ const optional = readOptionalHeader(bytes, coff);
349
+ const sections = readSections(bytes, coff, optional);
350
+ const cliDirectoryRead = readCliDirectory(bytes, coff, optional);
351
+ const cliDirectoryState = cliDirectoryRead.kind;
352
+ let cli = null;
353
+ let cliIssue = cliDirectoryRead.kind === "unreadable" ? cliDirectoryRead.issue : null;
354
+ if (cliDirectoryRead.kind === "present") {
355
+ try {
356
+ cli = readCliHeader(bytes, sections, cliDirectoryRead.directory);
357
+ } catch (cause) {
358
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
359
+ cliIssue = cause.issue;
360
+ }
361
+ }
362
+ return {
363
+ machine: coff.machine,
364
+ architecture: architectureFor(coff.machine, cliDirectoryState !== "absent"),
365
+ optionalHeader: optional.optionalHeader,
366
+ sectionCount: coff.sectionCount,
367
+ characteristics: coff.characteristics,
368
+ sections,
369
+ cli,
370
+ cliDirectoryState,
371
+ cliIssue,
372
+ rvaToOffset: (rva, size, scope) => mapRva({
373
+ bytes,
374
+ sections,
375
+ rva,
376
+ size,
377
+ scope
378
+ }),
379
+ rvaAvailableBytes: (rva, scope) => resolveRva({
380
+ bytes,
381
+ sections,
382
+ rva,
383
+ size: 1,
384
+ scope
385
+ }).available
386
+ };
387
+ };
388
+ })))();
389
+ }
390
+
391
+ //#endregion
392
+ //#region dist/dotnet/ManagedMetadataRowSizes.js
393
+ var ROW_SIZE_FACTORIES, computeRowSize;
394
+ function init_ManagedMetadataRowSizes() {
395
+ return (init_ManagedMetadataRowSizes = __esmMin((() => {
396
+ init_ManagedReaderFailure();
397
+ ROW_SIZE_FACTORIES = [
398
+ ({ stringSize: s, guidSize: g }) => 2 + s + g * 3,
399
+ ({ codedSize: c, stringSize: s }) => c("ResolutionScope") + s * 2,
400
+ ({ tableSize: t, codedSize: c, stringSize: s }) => 4 + s * 2 + c("TypeDefOrRef") + Math.max(t(3), t(4)) + Math.max(t(5), t(6)),
401
+ ({ tableSize: t }) => t(4),
402
+ ({ stringSize: s, blobSize: b }) => 2 + s + b,
403
+ ({ tableSize: t }) => t(6),
404
+ ({ tableSize: t, stringSize: s, blobSize: b }) => 8 + s + b + t(8),
405
+ ({ tableSize: t }) => t(8),
406
+ ({ stringSize: s }) => 4 + s,
407
+ ({ tableSize: t, codedSize: c }) => t(2) + c("TypeDefOrRef"),
408
+ ({ codedSize: c, stringSize: s, blobSize: b }) => c("MemberRefParent") + s + b,
409
+ ({ codedSize: c, blobSize: b }) => 2 + c("HasConstant") + b,
410
+ ({ codedSize: c, blobSize: b }) => c("HasCustomAttribute") + c("CustomAttributeType") + b,
411
+ ({ codedSize: c, blobSize: b }) => c("HasFieldMarshal") + b,
412
+ ({ codedSize: c, blobSize: b }) => 2 + c("HasDeclSecurity") + b,
413
+ ({ tableSize: t }) => 6 + t(2),
414
+ ({ tableSize: t }) => 4 + t(4),
415
+ ({ blobSize: b }) => b,
416
+ ({ tableSize: t }) => t(2) + t(20),
417
+ ({ tableSize: t }) => t(20),
418
+ ({ stringSize: s, codedSize: c }) => 2 + s + c("TypeDefOrRef"),
419
+ ({ tableSize: t }) => t(2) + t(23),
420
+ ({ tableSize: t }) => t(23),
421
+ ({ stringSize: s, blobSize: b }) => 2 + s + b,
422
+ ({ tableSize: t, codedSize: c }) => 2 + t(6) + c("HasSemantics"),
423
+ ({ tableSize: t, codedSize: c }) => t(2) + c("MethodDefOrRef") * 2,
424
+ ({ stringSize: s }) => s,
425
+ ({ blobSize: b }) => b,
426
+ ({ tableSize: t, codedSize: c, stringSize: s }) => 2 + c("MemberForwarded") + s + t(26),
427
+ ({ tableSize: t }) => 4 + t(4),
428
+ () => 8,
429
+ () => 4,
430
+ ({ blobSize: b, stringSize: s }) => 16 + b + s * 2,
431
+ () => 4,
432
+ () => 12,
433
+ ({ blobSize: b, stringSize: s }) => 12 + b * 2 + s * 2,
434
+ ({ tableSize: t }) => 4 + t(35),
435
+ ({ tableSize: t }) => 12 + t(35),
436
+ ({ stringSize: s, blobSize: b }) => 4 + s + b,
437
+ ({ stringSize: s, codedSize: c }) => 8 + s * 2 + c("Implementation"),
438
+ ({ stringSize: s, codedSize: c }) => 8 + s + c("Implementation"),
439
+ ({ tableSize: t }) => t(2) * 2,
440
+ ({ stringSize: s, codedSize: c }) => 4 + c("TypeOrMethodDef") + s,
441
+ ({ codedSize: c, blobSize: b }) => c("MethodDefOrRef") + b,
442
+ ({ tableSize: t, codedSize: c }) => t(42) + c("TypeDefOrRef")
443
+ ];
444
+ computeRowSize = (table, context) => {
445
+ const factory = ROW_SIZE_FACTORIES[table];
446
+ if (factory === undefined) throw managedFailure("invalid-tables", "metadata.tables", `Metadata table ${String(table)} is unsupported`);
447
+ return factory(context);
448
+ };
449
+ })))();
450
+ }
451
+
452
+ //#endregion
453
+ //#region dist/dotnet/ManagedMetadataLayout.js
454
+ var METADATA_TABLE_NAMES, CODED_INDEXES, SUPPORTED_TABLE_MASK, requireRange$1, align4, readStreamName, streamByName, requireStream, codedSize, tableSize, readMetadataStreams, readTablesHeader, readRowCounts, buildRowSizeContext, buildMetadataTables, readManagedMetadataLayout, metadataRowOffset;
455
+ function init_ManagedMetadataLayout() {
456
+ return (init_ManagedMetadataLayout = __esmMin((() => {
457
+ init_ManagedDecodeBudget();
458
+ init_ManagedReaderFailure();
459
+ init_ManagedMetadataRowSizes();
460
+ METADATA_TABLE_NAMES = [
461
+ "Module",
462
+ "TypeRef",
463
+ "TypeDef",
464
+ "FieldPtr",
465
+ "Field",
466
+ "MethodPtr",
467
+ "MethodDef",
468
+ "ParamPtr",
469
+ "Param",
470
+ "InterfaceImpl",
471
+ "MemberRef",
472
+ "Constant",
473
+ "CustomAttribute",
474
+ "FieldMarshal",
475
+ "DeclSecurity",
476
+ "ClassLayout",
477
+ "FieldLayout",
478
+ "StandAloneSig",
479
+ "EventMap",
480
+ "EventPtr",
481
+ "Event",
482
+ "PropertyMap",
483
+ "PropertyPtr",
484
+ "Property",
485
+ "MethodSemantics",
486
+ "MethodImpl",
487
+ "ModuleRef",
488
+ "TypeSpec",
489
+ "ImplMap",
490
+ "FieldRVA",
491
+ "ENCLog",
492
+ "ENCMap",
493
+ "Assembly",
494
+ "AssemblyProcessor",
495
+ "AssemblyOS",
496
+ "AssemblyRef",
497
+ "AssemblyRefProcessor",
498
+ "AssemblyRefOS",
499
+ "File",
500
+ "ExportedType",
501
+ "ManifestResource",
502
+ "NestedClass",
503
+ "GenericParam",
504
+ "MethodSpec",
505
+ "GenericParamConstraint"
506
+ ];
507
+ CODED_INDEXES = {
508
+ TypeDefOrRef: {
509
+ bits: 2,
510
+ tables: [
511
+ 2,
512
+ 1,
513
+ 27
514
+ ]
515
+ },
516
+ HasConstant: {
517
+ bits: 2,
518
+ tables: [
519
+ 4,
520
+ 8,
521
+ 23
522
+ ]
523
+ },
524
+ HasCustomAttribute: {
525
+ bits: 5,
526
+ tables: [
527
+ 6,
528
+ 4,
529
+ 1,
530
+ 2,
531
+ 8,
532
+ 9,
533
+ 10,
534
+ 0,
535
+ 14,
536
+ 23,
537
+ 20,
538
+ 17,
539
+ 26,
540
+ 27,
541
+ 32,
542
+ 35,
543
+ 38,
544
+ 39,
545
+ 40,
546
+ 42,
547
+ 44,
548
+ 43
549
+ ]
550
+ },
551
+ HasFieldMarshal: {
552
+ bits: 1,
553
+ tables: [4, 8]
554
+ },
555
+ HasDeclSecurity: {
556
+ bits: 2,
557
+ tables: [
558
+ 2,
559
+ 6,
560
+ 32
561
+ ]
562
+ },
563
+ MemberRefParent: {
564
+ bits: 3,
565
+ tables: [
566
+ 2,
567
+ 1,
568
+ 26,
569
+ 6,
570
+ 27
571
+ ]
572
+ },
573
+ HasSemantics: {
574
+ bits: 1,
575
+ tables: [20, 23]
576
+ },
577
+ MethodDefOrRef: {
578
+ bits: 1,
579
+ tables: [6, 10]
580
+ },
581
+ MemberForwarded: {
582
+ bits: 1,
583
+ tables: [4, 6]
584
+ },
585
+ Implementation: {
586
+ bits: 2,
587
+ tables: [
588
+ 38,
589
+ 35,
590
+ 39
591
+ ]
592
+ },
593
+ CustomAttributeType: {
594
+ bits: 3,
595
+ tables: [6, 10]
596
+ },
597
+ ResolutionScope: {
598
+ bits: 2,
599
+ tables: [
600
+ 0,
601
+ 26,
602
+ 35,
603
+ 1
604
+ ]
605
+ },
606
+ TypeOrMethodDef: {
607
+ bits: 1,
608
+ tables: [2, 6]
609
+ }
610
+ };
611
+ SUPPORTED_TABLE_MASK = (1n << BigInt(METADATA_TABLE_NAMES.length)) - 1n;
612
+ requireRange$1 = (bytes, offset, length, scope) => {
613
+ 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);
614
+ };
615
+ align4 = (value) => Math.ceil(value / 4) * 4;
616
+ readStreamName = (bytes, offset) => {
617
+ const endLimit = Math.min(bytes.length, offset + 32);
618
+ let end = offset;
619
+ while (end < endLimit && bytes[end] !== 0) end += 1;
620
+ if (end === endLimit) throw managedFailure("invalid-stream", "metadata.stream-name", "Metadata stream name is missing a bounded terminator", offset);
621
+ const nameBytes = bytes.subarray(offset, end);
622
+ if (nameBytes.some((byte) => byte < 32 || byte > 126)) throw managedFailure("invalid-stream", "metadata.stream-name", "Metadata stream name is not printable ASCII", offset);
623
+ return {
624
+ name: nameBytes.toString("ascii"),
625
+ next: align4(end + 1)
626
+ };
627
+ };
628
+ streamByName = (streams, names) => {
629
+ for (const name of names) {
630
+ const stream = streams.get(name);
631
+ if (stream !== undefined) return stream;
632
+ }
633
+ return undefined;
634
+ };
635
+ requireStream = (streams, name) => {
636
+ const stream = streams.get(name);
637
+ if (stream === undefined) throw managedFailure("missing-stream", `metadata.${name}`, `Required metadata stream ${name} is absent`);
638
+ return stream;
639
+ };
640
+ codedSize = (name, rowCounts) => {
641
+ const descriptor = CODED_INDEXES[name];
642
+ let maximum = 0;
643
+ for (const table of descriptor.tables) maximum = Math.max(maximum, rowCounts[table] ?? 0);
644
+ return maximum < 2 ** (16 - descriptor.bits) ? 2 : 4;
645
+ };
646
+ tableSize = (index, rows) => (rows[index] ?? 0) < 65536 ? 2 : 4;
647
+ readMetadataStreams = (bytes, rootOffset, budget) => {
648
+ if (bytes.readUInt32LE(0) !== 1112167234) throw managedFailure("invalid-metadata-root", "metadata.signature", "CLI metadata signature is not BSJB", rootOffset);
649
+ const versionLength = bytes.readUInt32LE(12);
650
+ requireRange$1(bytes, 16, versionLength, "metadata.version");
651
+ const versionBytes = bytes.subarray(16, 16 + versionLength);
652
+ const zero = versionBytes.indexOf(0);
653
+ const decodedVersionLength = zero < 0 ? versionBytes.length : zero;
654
+ budget.reserveString(decodedVersionLength, rootOffset + 16);
655
+ const version = versionBytes.subarray(0, decodedVersionLength).toString("utf8");
656
+ let cursor = align4(16 + versionLength);
657
+ requireRange$1(bytes, cursor, 4, "metadata.stream-count");
658
+ const streamCount = bytes.readUInt16LE(cursor + 2);
659
+ if (streamCount === 0 || streamCount > 64) throw managedFailure("invalid-stream", "metadata.stream-count", "Metadata stream count is outside the admitted range", rootOffset + cursor + 2);
660
+ cursor += 4;
661
+ const streams = new Map();
662
+ for (let index = 0; index < streamCount; index += 1) {
663
+ requireRange$1(bytes, cursor, 8, "metadata.stream-header");
664
+ const relativeOffset = bytes.readUInt32LE(cursor);
665
+ const streamSize = bytes.readUInt32LE(cursor + 4);
666
+ const named = readStreamName(bytes, cursor + 8);
667
+ if (streams.has(named.name)) throw managedFailure("invalid-stream", "metadata.stream-header", `Duplicate metadata stream ${named.name}`, rootOffset + cursor);
668
+ requireRange$1(bytes, relativeOffset, streamSize, `metadata.${named.name}`);
669
+ streams.set(named.name, {
670
+ name: named.name,
671
+ offset: rootOffset + relativeOffset,
672
+ size: streamSize
673
+ });
674
+ cursor = named.next;
675
+ }
676
+ return {
677
+ streams,
678
+ version
679
+ };
680
+ };
681
+ readTablesHeader = (bytes, streams) => {
682
+ const tablesStream = streamByName(streams, ["#~", "#-"]);
683
+ if (tablesStream === undefined) throw managedFailure("missing-stream", "metadata.tables", "Required metadata table stream #~ or #- is absent");
684
+ const tableBytes = bytes.subarray(tablesStream.offset, tablesStream.offset + tablesStream.size);
685
+ requireRange$1(tableBytes, 0, 24, "metadata.tables-header");
686
+ const heapSizes = tableBytes[6] ?? 0;
687
+ const heaps = {
688
+ string: (heapSizes & 1) === 0 ? 2 : 4,
689
+ guid: (heapSizes & 2) === 0 ? 2 : 4,
690
+ blob: (heapSizes & 4) === 0 ? 2 : 4
691
+ };
692
+ const valid = tableBytes.readBigUInt64LE(8);
693
+ 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);
694
+ return {
695
+ tableBytes,
696
+ tablesOffset: tablesStream.offset,
697
+ heaps,
698
+ valid
699
+ };
700
+ };
701
+ readRowCounts = (tableBytes, valid) => {
702
+ const rowCounts = Array(METADATA_TABLE_NAMES.length).fill(0);
703
+ let tableCursor = 24;
704
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
705
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
706
+ requireRange$1(tableBytes, tableCursor, 4, "metadata.table-row-count");
707
+ const count = tableBytes.readUInt32LE(tableCursor);
708
+ rowCounts[index] = count;
709
+ tableCursor += 4;
710
+ }
711
+ return rowCounts;
712
+ };
713
+ buildRowSizeContext = (rowCounts, heaps) => ({
714
+ tableSize: (index) => tableSize(index, rowCounts),
715
+ codedSize: (name) => codedSize(name, rowCounts),
716
+ stringSize: heaps.string,
717
+ guidSize: heaps.guid,
718
+ blobSize: heaps.blob
719
+ });
720
+ buildMetadataTables = ({ tableBytes, rowCounts, heaps, valid, tablesOffset }) => {
721
+ const tables = new Map();
722
+ const context = buildRowSizeContext(rowCounts, heaps);
723
+ let tableCursor = 24;
724
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
725
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
726
+ tableCursor += 4;
727
+ }
728
+ if (((tableBytes[6] ?? 0) & 64) !== 0) {
729
+ if (tableCursor > tableBytes.length - 4) throw managedFailure("invalid-metadata-root", "metadata.tables-extra-data", "Metadata tables extra-data word is truncated", tablesOffset + tableCursor);
730
+ tableCursor += 4;
731
+ }
732
+ for (let index = 0; index < METADATA_TABLE_NAMES.length; index += 1) {
733
+ const count = rowCounts[index] ?? 0;
734
+ if ((valid & 1n << BigInt(index)) === 0n) continue;
735
+ const sizeOfRow = computeRowSize(index, context);
736
+ const byteLength = count * sizeOfRow;
737
+ if (!Number.isSafeInteger(byteLength)) throw managedFailure("invalid-tables", "metadata.tables", "Metadata table byte size overflowed", tablesOffset + tableCursor);
738
+ requireRange$1(tableBytes, tableCursor, byteLength, "metadata.table-data");
739
+ tables.set(index, {
740
+ index,
741
+ name: METADATA_TABLE_NAMES[index] ?? `Table${String(index)}`,
742
+ rowCount: count,
743
+ rowSize: sizeOfRow,
744
+ offset: tablesOffset + tableCursor
745
+ });
746
+ tableCursor += byteLength;
747
+ }
748
+ return tables;
749
+ };
750
+ readManagedMetadataLayout = (artifact, rootOffset, size) => {
751
+ 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);
752
+ const bytes = artifact.subarray(rootOffset, rootOffset + size);
753
+ const budget = new ManagedDecodeBudget();
754
+ const { streams, version } = readMetadataStreams(bytes, rootOffset, budget);
755
+ const { tableBytes, tablesOffset, heaps, valid } = readTablesHeader(artifact, streams);
756
+ const rowCounts = readRowCounts(tableBytes, valid);
757
+ const tables = buildMetadataTables({
758
+ tableBytes,
759
+ rowCounts,
760
+ heaps,
761
+ valid,
762
+ tablesOffset
763
+ });
764
+ const layout = {
765
+ rootOffset,
766
+ size,
767
+ version,
768
+ streamNames: [...streams.keys()].sort(),
769
+ strings: requireStream(streams, "#Strings"),
770
+ guid: requireStream(streams, "#GUID"),
771
+ blob: requireStream(streams, "#Blob"),
772
+ tables,
773
+ rowCounts,
774
+ stringIndexSize: heaps.string,
775
+ guidIndexSize: heaps.guid,
776
+ blobIndexSize: heaps.blob,
777
+ table: (index) => tables.get(index),
778
+ tableIndexSize: (index) => tableSize(index, rowCounts),
779
+ codedIndexSize: (name) => codedSize(name, rowCounts)
780
+ };
781
+ attachManagedDecodeBudget(layout, budget);
782
+ return layout;
783
+ };
784
+ metadataRowOffset = (layout, table, row) => {
785
+ const descriptor = layout.table(table);
786
+ 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`);
787
+ return descriptor.offset + (row - 1) * descriptor.rowSize;
788
+ };
789
+ })))();
790
+ }
791
+
792
+ //#endregion
793
+ //#region dist/dotnet/ManagedMetadataHeaps.js
794
+ var requireRange, MetadataRowCursor, compressedLength, readMetadataString, readMetadataBlob, readMetadataGuid, metadataToken, sha256Bytes, metadataRowCursor, metadataCodedToken, metadataCodedTokenInvalidReason;
795
+ function init_ManagedMetadataHeaps() {
796
+ return (init_ManagedMetadataHeaps = __esmMin((() => {
797
+ init_ManagedDecodeBudget();
798
+ init_ManagedMetadataLayout();
799
+ init_ManagedReaderFailure();
800
+ requireRange = (bytes, offset, length, scope) => {
801
+ if (offset < 0 || length < 0 || offset > bytes.length - length) throw managedFailure("invalid-row", scope, `${scope} leaves the artifact byte range`, offset >= 0 ? offset : null);
802
+ };
803
+ MetadataRowCursor = class {
804
+ bytes;
805
+ start;
806
+ end;
807
+ scope;
808
+ #offset;
809
+ constructor(bytes, start, end, scope) {
810
+ this.bytes = bytes;
811
+ this.start = start;
812
+ this.end = end;
813
+ this.scope = scope;
814
+ this.#offset = start;
815
+ }
816
+ get offset() {
817
+ return this.#offset;
818
+ }
819
+ readUInt16() {
820
+ this.require(2);
821
+ const value = this.bytes.readUInt16LE(this.#offset);
822
+ this.#offset += 2;
823
+ return value;
824
+ }
825
+ readUInt32() {
826
+ this.require(4);
827
+ const value = this.bytes.readUInt32LE(this.#offset);
828
+ this.#offset += 4;
829
+ return value;
830
+ }
831
+ readIndex(size) {
832
+ return size === 2 ? this.readUInt16() : this.readUInt32();
833
+ }
834
+ require(length) {
835
+ 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);
836
+ }
837
+ };
838
+ compressedLength = (bytes, offset, scope) => {
839
+ requireRange(bytes, offset, 1, scope);
840
+ const first = bytes[offset] ?? 0;
841
+ if ((first & 128) === 0) return {
842
+ length: first,
843
+ prefix: 1
844
+ };
845
+ if ((first & 192) === 128) {
846
+ requireRange(bytes, offset, 2, scope);
847
+ return {
848
+ length: (first & 63) << 8 | (bytes[offset + 1] ?? 0),
849
+ prefix: 2
850
+ };
851
+ }
852
+ if ((first & 224) === 192) {
853
+ requireRange(bytes, offset, 4, scope);
854
+ return {
855
+ length: (first & 31) * 16777216 + (bytes[offset + 1] ?? 0) * 65536 + (bytes[offset + 2] ?? 0) * 256 + (bytes[offset + 3] ?? 0),
856
+ prefix: 4
857
+ };
858
+ }
859
+ throw managedFailure("invalid-blob", scope, "Metadata blob uses a reserved compressed-length prefix", offset);
860
+ };
861
+ readMetadataString = (bytes, layout, index, heapExtent) => {
862
+ if (index === 0) return "";
863
+ 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));
864
+ const start = layout.strings.offset + index;
865
+ const cached = managedDecodeBudget(layout).cachedString(index);
866
+ if (cached !== undefined && cached.encodedBytes <= heapExtent) {
867
+ managedDecodeBudget(layout).reserveString(cached.encodedBytes, start);
868
+ return cached.value;
869
+ }
870
+ const maximum = Math.min(layout.strings.offset + layout.strings.size, start + heapExtent + 1);
871
+ let end = start;
872
+ while (end < maximum && bytes[end] !== 0) end += 1;
873
+ if (end === maximum) throw managedFailure("invalid-string", "metadata.#Strings", "String heap item has no terminator within #Strings", start);
874
+ managedDecodeBudget(layout).reserveString(end - start, start);
875
+ try {
876
+ const value = new TextDecoder("utf-8", {
877
+ fatal: true,
878
+ ignoreBOM: true
879
+ }).decode(bytes.subarray(start, end));
880
+ managedDecodeBudget(layout).cacheString(index, value, end - start);
881
+ return value;
882
+ } catch (cause) {
883
+ void cause;
884
+ throw managedFailure("invalid-string", "metadata.#Strings", "String heap item is not valid UTF-8", start);
885
+ }
886
+ };
887
+ readMetadataBlob = (bytes, layout, index, heapExtent) => {
888
+ if (index === 0) return Buffer.alloc(0);
889
+ 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));
890
+ const start = layout.blob.offset + index;
891
+ const decoded = compressedLength(bytes, start, "metadata.#Blob");
892
+ if (decoded.length > heapExtent) throw managedFailure("invalid-blob", "metadata.#Blob", "Blob length exceeds the admitted heap extent", start);
893
+ const content = start + decoded.prefix;
894
+ if (content > layout.blob.offset + layout.blob.size - decoded.length) throw managedFailure("invalid-blob", "metadata.#Blob", "Blob heap item leaves #Blob", start);
895
+ return bytes.subarray(content, content + decoded.length);
896
+ };
897
+ readMetadataGuid = (bytes, layout, index) => {
898
+ if (index === 0) return null;
899
+ const relative = (index - 1) * 16;
900
+ 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));
901
+ const offset = layout.guid.offset + relative;
902
+ const part1 = bytes.readUInt32LE(offset).toString(16).padStart(8, "0");
903
+ const part2 = bytes.readUInt16LE(offset + 4).toString(16).padStart(4, "0");
904
+ const part3 = bytes.readUInt16LE(offset + 6).toString(16).padStart(4, "0");
905
+ const part4 = bytes.subarray(offset + 8, offset + 10).toString("hex");
906
+ const part5 = bytes.subarray(offset + 10, offset + 16).toString("hex");
907
+ return `${part1}-${part2}-${part3}-${part4}-${part5}`;
908
+ };
909
+ metadataToken = (table, row) => `0x${(table * 16777216 + row).toString(16).padStart(8, "0")}`;
910
+ sha256Bytes = (bytes) => createHash("sha256").update(bytes).digest("hex");
911
+ metadataRowCursor = (bytes, layout, table, row) => {
912
+ const descriptor = layout.table(table);
913
+ const start = metadataRowOffset(layout, table, row);
914
+ if (descriptor === undefined) throw managedFailure("invalid-row", `metadata.${String(table)}`, "Metadata table is absent", start);
915
+ managedDecodeBudget(layout).reserveRow(table, row, start);
916
+ return new MetadataRowCursor(bytes, start, start + descriptor.rowSize, `metadata.${descriptor.name}`);
917
+ };
918
+ metadataCodedToken = (raw, bits, tables, rowCounts) => {
919
+ if (raw === 0) return null;
920
+ const tag = raw & 2 ** bits - 1;
921
+ const row = Math.floor(raw / 2 ** bits);
922
+ const table = tables[tag];
923
+ return table === undefined || row === 0 || row > (rowCounts[table] ?? 0) ? null : metadataToken(table, row);
924
+ };
925
+ metadataCodedTokenInvalidReason = (raw, bits, tables, rowCounts) => {
926
+ if (raw === 0) return null;
927
+ const tag = raw & 2 ** bits - 1;
928
+ const row = Math.floor(raw / 2 ** bits);
929
+ const table = tables[tag];
930
+ if (table === undefined) return `coded index tag ${tag} is not defined`;
931
+ if (row === 0) return `coded index selects row zero in table ${table}`;
932
+ const count = rowCounts[table] ?? 0;
933
+ return row > count ? `coded index selects row ${row} in table ${table}, which has ${count} rows` : null;
934
+ };
935
+ })))();
936
+ }
937
+
938
+ //#endregion
939
+ //#region dist/dotnet/ManagedMemberPointers.js
940
+ var lookups$1, memberListTable, memberListIndexSize, memberListRowLookup;
941
+ function init_ManagedMemberPointers() {
942
+ return (init_ManagedMemberPointers = __esmMin((() => {
943
+ init_ManagedDecodeBudget();
944
+ init_ManagedReaderFailure();
945
+ lookups$1 = new WeakMap();
946
+ memberListTable = (layout, table) => {
947
+ const pointers = layout.table(table - 1);
948
+ return pointers !== undefined && pointers.rowCount > 0 ? pointers : layout.table(table);
949
+ };
950
+ memberListIndexSize = (layout, table) => layout.tableIndexSize(table - 1) === 4 || layout.tableIndexSize(table) === 4 ? 4 : 2;
951
+ memberListRowLookup = (bytes, layout, table) => {
952
+ const pointers = layout.table(table - 1);
953
+ if (pointers === undefined || pointers.rowCount === 0) return (row) => row;
954
+ let byTable = lookups$1.get(layout);
955
+ const cached = byTable?.get(table);
956
+ if (cached instanceof ManagedReaderFailure) throw cached;
957
+ if (cached !== undefined) return cached;
958
+ const definitionCount = layout.table(table)?.rowCount ?? 0;
959
+ managedDecodeBudget(layout).reserve((definitionCount + 1) * Uint32Array.BYTES_PER_ELEMENT + 256, pointers.offset);
960
+ if (byTable === undefined) {
961
+ byTable = new Map();
962
+ lookups$1.set(layout, byTable);
963
+ }
964
+ const positions = new Uint32Array(definitionCount + 1);
965
+ try {
966
+ const width = layout.tableIndexSize(table);
967
+ for (let row = 1; row <= pointers.rowCount; row += 1) {
968
+ const offset = pointers.offset + (row - 1) * pointers.rowSize;
969
+ const definition = width === 2 ? bytes.readUInt16LE(offset) : bytes.readUInt32LE(offset);
970
+ 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);
971
+ 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);
972
+ positions[definition] = row;
973
+ }
974
+ const lookup = (definition) => {
975
+ const position = positions[definition] ?? 0;
976
+ if (position === 0) throw managedFailure("invalid-row", `metadata.${pointers.name}`, `Definition row ${String(definition)} has no pointer row identifying its declaring type`, pointers.offset);
977
+ return position;
978
+ };
979
+ byTable.set(table, lookup);
980
+ return lookup;
981
+ } catch (cause) {
982
+ if (cause instanceof ManagedReaderFailure) byTable.set(table, cause);
983
+ throw cause;
984
+ }
985
+ };
986
+ })))();
987
+ }
988
+
989
+ //#endregion
990
+ //#region dist/dotnet/ManagedMemberOwnership.js
991
+ var lookups, memberDeclaringTypeRowLookup;
992
+ function init_ManagedMemberOwnership() {
993
+ return (init_ManagedMemberOwnership = __esmMin((() => {
994
+ init_ManagedDecodeBudget();
995
+ init_ManagedMetadataHeaps();
996
+ init_ManagedMemberPointers();
997
+ init_ManagedReaderFailure();
998
+ lookups = new WeakMap();
999
+ memberDeclaringTypeRowLookup = (bytes, layout, table) => {
1000
+ let byTable = lookups.get(layout);
1001
+ const cached = byTable?.get(table);
1002
+ if (cached instanceof ManagedReaderFailure) throw cached;
1003
+ if (cached !== undefined) return cached;
1004
+ if (byTable === undefined) {
1005
+ byTable = new Map();
1006
+ lookups.set(layout, byTable);
1007
+ }
1008
+ try {
1009
+ const positionOf = memberListRowLookup(bytes, layout, table);
1010
+ const positions = memberListTable(layout, table)?.rowCount ?? 0;
1011
+ const types = layout.table(2)?.rowCount ?? 0;
1012
+ managedDecodeBudget(layout).reserve((2 * positions + 3) * Uint32Array.BYTES_PER_ELEMENT + 256, layout.table(2)?.offset ?? null);
1013
+ const owners = new Uint32Array(positions + 1);
1014
+ const next = Uint32Array.from({ length: positions + 2 }, (_, p) => p);
1015
+ const unowned = (position) => {
1016
+ let root = position;
1017
+ while (next[root] !== root) root = next[root] ?? root;
1018
+ for (let p = position; p !== root;) {
1019
+ const following = next[p] ?? root;
1020
+ next[p] = root;
1021
+ p = following;
1022
+ }
1023
+ return root;
1024
+ };
1025
+ const startForType = (row) => {
1026
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1027
+ cursor.readUInt32();
1028
+ cursor.readIndex(layout.stringIndexSize);
1029
+ cursor.readIndex(layout.stringIndexSize);
1030
+ cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1031
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1032
+ return table === 4 ? fieldStart : cursor.readIndex(memberListIndexSize(layout, 6));
1033
+ };
1034
+ let start = types === 0 ? 0 : startForType(1);
1035
+ for (let row = 1; row <= types; row += 1) {
1036
+ const end = row === types ? positions + 1 : startForType(row + 1);
1037
+ const limit = Math.min(end, positions + 1);
1038
+ for (let p = unowned(Math.min(Math.max(start, 1), positions + 1)); p < limit; p = unowned(p + 1)) {
1039
+ owners[p] = row;
1040
+ next[p] = p + 1;
1041
+ }
1042
+ start = end;
1043
+ }
1044
+ const definitions = layout.table(table)?.rowCount ?? 0;
1045
+ const lookup = (definition) => definition < 1 || definition > definitions ? 0 : owners[positionOf(definition)] ?? 0;
1046
+ byTable.set(table, lookup);
1047
+ return lookup;
1048
+ } catch (cause) {
1049
+ if (cause instanceof ManagedReaderFailure) byTable.set(table, cause);
1050
+ throw cause;
1051
+ }
1052
+ };
1053
+ })))();
1054
+ }
1055
+
1056
+ //#endregion
1057
+ //#region dist/dotnet/ManagedMetadataInventoryRows.js
1058
+ var HAS_CUSTOM_ATTRIBUTE_TABLES, CUSTOM_ATTRIBUTE_TYPE_TABLES, publicKeyIdentity, readModule, readAssembly, readAssemblyReference, readTypeName, declaringTypeForMethod, attributeTypeName, decodeCompressedLength, decodeFixedString, readCustomAttribute, readResource;
1059
+ function init_ManagedMetadataInventoryRows() {
1060
+ return (init_ManagedMetadataInventoryRows = __esmMin((() => {
1061
+ init_ManagedDecodeBudget();
1062
+ init_ManagedMemberOwnership();
1063
+ init_ManagedMetadataLayout();
1064
+ init_ManagedMetadataHeaps();
1065
+ init_ManagedReaderFailure();
1066
+ HAS_CUSTOM_ATTRIBUTE_TABLES = [
1067
+ 6,
1068
+ 4,
1069
+ 1,
1070
+ 2,
1071
+ 8,
1072
+ 9,
1073
+ 10,
1074
+ 0,
1075
+ 14,
1076
+ 23,
1077
+ 20,
1078
+ 17,
1079
+ 26,
1080
+ 27,
1081
+ 32,
1082
+ 35,
1083
+ 38,
1084
+ 39,
1085
+ 40,
1086
+ 42,
1087
+ 44,
1088
+ 43
1089
+ ];
1090
+ CUSTOM_ATTRIBUTE_TYPE_TABLES = [
1091
+ undefined,
1092
+ undefined,
1093
+ 6,
1094
+ 10
1095
+ ];
1096
+ publicKeyIdentity = (bytes, kind, layout) => ({
1097
+ kind: bytes.length === 0 ? "none" : kind,
1098
+ byte_length: bytes.length,
1099
+ sha256: bytes.length === 0 ? null : managedDecodeBudget(layout).digest(bytes, "sha256"),
1100
+ 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
1101
+ });
1102
+ readModule = (bytes, layout, heapExtent) => {
1103
+ const table = layout.table(0);
1104
+ if (table === undefined || table.rowCount === 0) return null;
1105
+ const cursor = metadataRowCursor(bytes, layout, 0, 1);
1106
+ const generation = cursor.readUInt16();
1107
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1108
+ const mvid = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1109
+ const encId = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1110
+ const encBaseId = readMetadataGuid(bytes, layout, cursor.readIndex(layout.guidIndexSize));
1111
+ return {
1112
+ name,
1113
+ generation,
1114
+ mvid,
1115
+ enc_id: encId,
1116
+ enc_base_id: encBaseId,
1117
+ token: metadataToken(0, 1),
1118
+ row_offset: table.offset
1119
+ };
1120
+ };
1121
+ readAssembly = (bytes, layout, heapExtent) => {
1122
+ const table = layout.table(32);
1123
+ if (table === undefined || table.rowCount === 0) return null;
1124
+ const cursor = metadataRowCursor(bytes, layout, 32, 1);
1125
+ const hashAlgorithm = cursor.readUInt32();
1126
+ const version = [
1127
+ cursor.readUInt16(),
1128
+ cursor.readUInt16(),
1129
+ cursor.readUInt16(),
1130
+ cursor.readUInt16()
1131
+ ].join(".");
1132
+ const flags = cursor.readUInt32();
1133
+ const key = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1134
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1135
+ const culture = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1136
+ return {
1137
+ name,
1138
+ version,
1139
+ culture: culture.length === 0 ? null : culture,
1140
+ flags,
1141
+ hash_algorithm: hashAlgorithm,
1142
+ public_key: publicKeyIdentity(key, (flags & 1) === 0 ? "public-key-token" : "public-key", layout),
1143
+ token: metadataToken(32, 1),
1144
+ row_offset: table.offset
1145
+ };
1146
+ };
1147
+ readAssemblyReference = (bytes, layout, row, heapExtent) => {
1148
+ const cursor = metadataRowCursor(bytes, layout, 35, row);
1149
+ const version = [
1150
+ cursor.readUInt16(),
1151
+ cursor.readUInt16(),
1152
+ cursor.readUInt16(),
1153
+ cursor.readUInt16()
1154
+ ].join(".");
1155
+ const flags = cursor.readUInt32();
1156
+ const keyOrToken = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1157
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1158
+ const culture = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1159
+ const hashValue = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1160
+ return {
1161
+ name,
1162
+ version,
1163
+ culture: culture.length === 0 ? null : culture,
1164
+ flags,
1165
+ public_key_or_token: publicKeyIdentity(keyOrToken, (flags & 1) === 0 ? "public-key-token" : "public-key", layout),
1166
+ hash_value_sha256: hashValue.length === 0 ? null : managedDecodeBudget(layout).digest(hashValue, "sha256"),
1167
+ hash_value_length: hashValue.length,
1168
+ token: metadataToken(35, row),
1169
+ row_offset: metadataRowOffset(layout, 35, row)
1170
+ };
1171
+ };
1172
+ readTypeName = ({ bytes, layout, table, row, heapExtent }) => {
1173
+ const descriptor = layout.table(table);
1174
+ if (descriptor === undefined || row < 1 || row > descriptor.rowCount) return null;
1175
+ const cursor = metadataRowCursor(bytes, layout, table, row);
1176
+ if (table === 1) cursor.readIndex(layout.codedIndexSize("ResolutionScope"));
1177
+ else cursor.readUInt32();
1178
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1179
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), heapExtent);
1180
+ return namespace.length === 0 ? name : `${namespace}.${name}`;
1181
+ };
1182
+ declaringTypeForMethod = (bytes, layout, methodRow, heapExtent) => {
1183
+ const owner = memberDeclaringTypeRowLookup(bytes, layout, 6)(methodRow);
1184
+ if (owner === 0) return null;
1185
+ return readTypeName({
1186
+ bytes,
1187
+ layout,
1188
+ table: 2,
1189
+ row: owner,
1190
+ heapExtent
1191
+ });
1192
+ };
1193
+ attributeTypeName = (bytes, layout, rawType, heapExtent) => {
1194
+ const tag = rawType & 7;
1195
+ const row = Math.floor(rawType / 8);
1196
+ if (row === 0) return null;
1197
+ if (tag === 2) return declaringTypeForMethod(bytes, layout, row, heapExtent);
1198
+ if (tag !== 3) return null;
1199
+ const memberRefs = layout.table(10);
1200
+ if (memberRefs === undefined || row > memberRefs.rowCount) return null;
1201
+ const cursor = metadataRowCursor(bytes, layout, 10, row);
1202
+ const parent = cursor.readIndex(layout.codedIndexSize("MemberRefParent"));
1203
+ const parentTag = parent & 7;
1204
+ const parentRow = Math.floor(parent / 8);
1205
+ if (parentTag === 0) return readTypeName({
1206
+ bytes,
1207
+ layout,
1208
+ table: 2,
1209
+ row: parentRow,
1210
+ heapExtent
1211
+ });
1212
+ if (parentTag === 1) return readTypeName({
1213
+ bytes,
1214
+ layout,
1215
+ table: 1,
1216
+ row: parentRow,
1217
+ heapExtent
1218
+ });
1219
+ if (parentTag === 3) return declaringTypeForMethod(bytes, layout, parentRow, heapExtent);
1220
+ return null;
1221
+ };
1222
+ decodeCompressedLength = (blob, offset) => {
1223
+ const first = blob[offset];
1224
+ if (first === undefined) return undefined;
1225
+ if ((first & 128) === 0) return {
1226
+ length: first,
1227
+ prefix: 1
1228
+ };
1229
+ if ((first & 192) === 128 && blob[offset + 1] !== undefined) return {
1230
+ length: (first & 63) << 8 | (blob[offset + 1] ?? 0),
1231
+ prefix: 2
1232
+ };
1233
+ if ((first & 224) === 192 && blob[offset + 1] !== undefined && blob[offset + 2] !== undefined && blob[offset + 3] !== undefined) return {
1234
+ length: (first & 31) * 16777216 + (blob[offset + 1] ?? 0) * 65536 + (blob[offset + 2] ?? 0) * 256 + (blob[offset + 3] ?? 0),
1235
+ prefix: 4
1236
+ };
1237
+ return undefined;
1238
+ };
1239
+ decodeFixedString = (blob, layout) => {
1240
+ if (blob.length < 3 || blob.readUInt16LE(0) !== 1 || blob[2] === 255) return null;
1241
+ const length = decodeCompressedLength(blob, 2);
1242
+ if (length === undefined) return null;
1243
+ const start = 2 + length.prefix;
1244
+ if (start > blob.length - length.length) return null;
1245
+ managedDecodeBudget(layout).reserveString(length.length, layout.blob.offset);
1246
+ try {
1247
+ return new TextDecoder("utf-8", {
1248
+ fatal: true,
1249
+ ignoreBOM: true
1250
+ }).decode(blob.subarray(start, start + length.length));
1251
+ } catch (cause) {
1252
+ void cause;
1253
+ return null;
1254
+ }
1255
+ };
1256
+ readCustomAttribute = (bytes, layout, row, heapExtent, issues) => {
1257
+ const cursor = metadataRowCursor(bytes, layout, 12, row);
1258
+ const parentRaw = cursor.readIndex(layout.codedIndexSize("HasCustomAttribute"));
1259
+ const typeOffset = cursor.offset;
1260
+ const typeRaw = cursor.readIndex(layout.codedIndexSize("CustomAttributeType"));
1261
+ const value = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), heapExtent);
1262
+ const parent = metadataCodedToken(parentRaw, 5, HAS_CUSTOM_ATTRIBUTE_TABLES, layout.rowCounts);
1263
+ if (parent === null) {
1264
+ const parentReason = metadataCodedTokenInvalidReason(parentRaw, 5, HAS_CUSTOM_ATTRIBUTE_TABLES, layout.rowCounts);
1265
+ 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);
1266
+ }
1267
+ const constructor = metadataCodedToken(typeRaw, 3, CUSTOM_ATTRIBUTE_TYPE_TABLES, layout.rowCounts);
1268
+ if (constructor === null) {
1269
+ const typeReason = metadataCodedTokenInvalidReason(typeRaw, 3, CUSTOM_ATTRIBUTE_TYPE_TABLES, layout.rowCounts);
1270
+ issues.push({
1271
+ code: "invalid-row",
1272
+ scope: `metadata.CustomAttribute:${metadataToken(12, row)}`,
1273
+ offset: typeOffset,
1274
+ 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}`
1275
+ });
1276
+ }
1277
+ let typeName = null;
1278
+ if (constructor !== null) typeName = readManagedValue(() => attributeTypeName(bytes, layout, typeRaw, heapExtent), issues) ?? null;
1279
+ return {
1280
+ parent_token: parent,
1281
+ constructor_token: constructor,
1282
+ type_name: typeName,
1283
+ value_length: value.length,
1284
+ value_sha256: managedDecodeBudget(layout).digest(value, "sha256"),
1285
+ decoded_fixed_string: typeName === "System.Runtime.Versioning.TargetFrameworkAttribute" ? decodeFixedString(value, layout) : null,
1286
+ token: metadataToken(12, row),
1287
+ row_offset: cursor.start
1288
+ };
1289
+ };
1290
+ readResource = ({ bytes, layout, row, directory, issues }) => {
1291
+ const cursor = metadataRowCursor(bytes, layout, 40, row);
1292
+ const declaredOffset = cursor.readUInt32();
1293
+ const flags = cursor.readUInt32();
1294
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), Math.max(layout.strings.size, layout.blob.size));
1295
+ const implementationOffset = cursor.offset;
1296
+ const implementationRaw = cursor.readIndex(layout.codedIndexSize("Implementation"));
1297
+ const implementationToken = metadataCodedToken(implementationRaw, 2, [
1298
+ 38,
1299
+ 35,
1300
+ 39
1301
+ ], layout.rowCounts);
1302
+ const implementationReason = metadataCodedTokenInvalidReason(implementationRaw, 2, [
1303
+ 38,
1304
+ 35,
1305
+ 39
1306
+ ], layout.rowCounts);
1307
+ if (implementationReason !== null) issues.push({
1308
+ code: "invalid-row",
1309
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1310
+ offset: implementationOffset,
1311
+ detail: `ManifestResource implementation coded index 0x${implementationRaw.toString(16)} is invalid: ${implementationReason}`
1312
+ });
1313
+ let dataLength = null;
1314
+ let dataSha256 = null;
1315
+ if (implementationRaw === 0) {
1316
+ if (directory === null || declaredOffset > directory.size - 4) {
1317
+ issues.push({
1318
+ code: "invalid-resource",
1319
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1320
+ offset: directory?.offset ?? null,
1321
+ detail: "Embedded resource offset leaves the CLI resources directory"
1322
+ });
1323
+ } else {
1324
+ const start = directory.offset + declaredOffset;
1325
+ dataLength = bytes.readUInt32LE(start);
1326
+ if (dataLength > directory.size - declaredOffset - 4) {
1327
+ issues.push({
1328
+ code: "invalid-resource",
1329
+ scope: `metadata.ManifestResource:${metadataToken(40, row)}`,
1330
+ offset: start,
1331
+ detail: "Embedded resource length leaves the CLI resources directory"
1332
+ });
1333
+ } else {
1334
+ dataSha256 = managedDecodeBudget(layout).digest(bytes.subarray(start + 4, start + 4 + dataLength), "sha256");
1335
+ }
1336
+ }
1337
+ }
1338
+ return {
1339
+ name,
1340
+ flags,
1341
+ visibility: (flags & 7) === 1 ? "public" : (flags & 7) === 2 ? "private" : "unknown",
1342
+ implementation_token: implementationToken,
1343
+ embedded: implementationRaw === 0,
1344
+ declared_offset: declaredOffset,
1345
+ data_length: dataLength,
1346
+ data_sha256: dataSha256,
1347
+ token: metadataToken(40, row),
1348
+ row_offset: cursor.start
1349
+ };
1350
+ };
1351
+ })))();
1352
+ }
1353
+
1354
+ //#endregion
1355
+ //#region dist/dotnet/ManagedMetadataInventory.js
1356
+ var readManagedResourceDirectory, readRows, heapExtent, validateIdentityTableCounts, readReferences, readResources, readAttributes, readManagedMetadataInventory, managedTableRowCounts;
1357
+ function init_ManagedMetadataInventory() {
1358
+ return (init_ManagedMetadataInventory = __esmMin((() => {
1359
+ init_ManagedMetadataLayout();
1360
+ init_ManagedMetadataInventoryRows();
1361
+ init_ManagedMetadataHeaps();
1362
+ init_ManagedReaderFailure();
1363
+ readManagedResourceDirectory = (pe, issues) => {
1364
+ const resources = pe.cli?.resources;
1365
+ if (resources === undefined || resources.rva === 0 && resources.size === 0) return null;
1366
+ return readManagedValue(() => ({
1367
+ offset: pe.rvaToOffset(resources.rva, resources.size, "cli.resources"),
1368
+ size: resources.size
1369
+ }), issues) ?? null;
1370
+ };
1371
+ readRows = (descriptor, read) => {
1372
+ const total = descriptor?.rowCount ?? 0;
1373
+ const items = [];
1374
+ for (let index = 0; index < total; index += 1) {
1375
+ const item = read(index + 1);
1376
+ if (item !== undefined) items.push(item);
1377
+ }
1378
+ return items;
1379
+ };
1380
+ heapExtent = (layout) => Math.max(layout.strings.size, layout.blob.size);
1381
+ validateIdentityTableCounts = (layout, issues) => {
1382
+ const moduleRows = layout.table(0)?.rowCount ?? 0;
1383
+ if (moduleRows !== 1) issues.push({
1384
+ code: "invalid-row",
1385
+ scope: "metadata.Module",
1386
+ offset: layout.table(0)?.offset ?? null,
1387
+ detail: `Module table must contain exactly one row; found ${String(moduleRows)}`
1388
+ });
1389
+ const assemblyRows = layout.table(32)?.rowCount ?? 0;
1390
+ if (assemblyRows > 1) issues.push({
1391
+ code: "invalid-row",
1392
+ scope: "metadata.Assembly",
1393
+ offset: layout.table(32)?.offset ?? null,
1394
+ detail: `Assembly table can contain at most one row; found ${String(assemblyRows)}`
1395
+ });
1396
+ };
1397
+ readReferences = (bytes, layout, issues) => {
1398
+ const references = readRows(layout.table(35), (row) => readManagedValue(() => readAssemblyReference(bytes, layout, row, heapExtent(layout)), issues));
1399
+ return {
1400
+ references,
1401
+ referenceNames: [...new Set(references.map(({ name }) => name))].sort()
1402
+ };
1403
+ };
1404
+ readResources = ({ bytes, layout, resourceDirectory, issues }) => readRows(layout.table(40), (row) => readManagedValue(() => readResource({
1405
+ bytes,
1406
+ layout,
1407
+ row,
1408
+ directory: resourceDirectory,
1409
+ issues
1410
+ }), issues));
1411
+ readAttributes = (bytes, layout, issues) => {
1412
+ const attributes = readRows(layout.table(12), (row) => readManagedValue(() => readCustomAttribute(bytes, layout, row, heapExtent(layout), issues), issues));
1413
+ const targetFrameworks = new Set();
1414
+ for (const attribute of attributes) {
1415
+ 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);
1416
+ }
1417
+ return {
1418
+ attributes,
1419
+ targetFrameworks: [...targetFrameworks].sort()
1420
+ };
1421
+ };
1422
+ readManagedMetadataInventory = (bytes, layout, resourceDirectory) => {
1423
+ const issues = [];
1424
+ validateIdentityTableCounts(layout, issues);
1425
+ const module = readManagedValue(() => readModule(bytes, layout, heapExtent(layout)), issues) ?? null;
1426
+ const assembly = readManagedValue(() => readAssembly(bytes, layout, heapExtent(layout)), issues) ?? null;
1427
+ const { references, referenceNames } = readReferences(bytes, layout, issues);
1428
+ const resources = readResources({
1429
+ bytes,
1430
+ layout,
1431
+ resourceDirectory,
1432
+ issues
1433
+ });
1434
+ const { attributes, targetFrameworks } = readAttributes(bytes, layout, issues);
1435
+ return {
1436
+ module,
1437
+ assembly,
1438
+ targetFrameworks,
1439
+ referenceNames,
1440
+ references,
1441
+ resources,
1442
+ attributes,
1443
+ issues: uniqueManagedParseIssues(issues)
1444
+ };
1445
+ };
1446
+ managedTableRowCounts = (layout) => Object.fromEntries([...layout.tables.values()].map(({ index, rowCount }) => [METADATA_TABLE_NAMES[index] ?? `Table${String(index)}`, rowCount]));
1447
+ })))();
1448
+ }
1449
+
1450
+ //#endregion
1451
+ //#region dist/dotnet/ManagedMemberInspectorCore.js
1452
+ 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;
1453
+ function init_ManagedMemberInspectorCore() {
1454
+ return (init_ManagedMemberInspectorCore = __esmMin((() => {
1455
+ init_ManagedReaderFailure();
1456
+ init_ManagedMetadataHeaps();
1457
+ init_ManagedMemberPointers();
1458
+ rowRange = (table, start, nextStart) => {
1459
+ const total = table?.rowCount ?? 0;
1460
+ if (total === 0 || start === 0) return {
1461
+ first: null,
1462
+ last: null,
1463
+ count: 0
1464
+ };
1465
+ const end = Math.min(nextStart === 0 ? total + 1 : nextStart, total + 1);
1466
+ if (start >= end) return {
1467
+ first: null,
1468
+ last: null,
1469
+ count: 0
1470
+ };
1471
+ return {
1472
+ first: start,
1473
+ last: end - 1,
1474
+ count: end - start
1475
+ };
1476
+ };
1477
+ fullName = (namespace, name) => namespace.length === 0 ? name : `${namespace}.${name}`;
1478
+ readTypeRange = (bytes, layout, row, issues) => {
1479
+ const methods = memberListTable(layout, 6);
1480
+ const fields = memberListTable(layout, 4);
1481
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1482
+ cursor.readUInt32();
1483
+ const nameIndex = cursor.readIndex(layout.stringIndexSize);
1484
+ const namespaceIndex = cursor.readIndex(layout.stringIndexSize);
1485
+ const declaredName = readManagedValue(() => fullName(readMetadataString(bytes, layout, namespaceIndex, layout.strings.size), readMetadataString(bytes, layout, nameIndex, layout.strings.size)), issues) ?? null;
1486
+ cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1487
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1488
+ const methodStart = cursor.readIndex(memberListIndexSize(layout, 6));
1489
+ let nextField = (fields?.rowCount ?? 0) + 1;
1490
+ let nextMethod = (methods?.rowCount ?? 0) + 1;
1491
+ const typeTable = layout.table(2);
1492
+ if (typeTable !== undefined && row < typeTable.rowCount) {
1493
+ const next = metadataRowCursor(bytes, layout, 2, row + 1);
1494
+ next.readUInt32();
1495
+ next.readIndex(layout.stringIndexSize);
1496
+ next.readIndex(layout.stringIndexSize);
1497
+ next.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1498
+ nextField = next.readIndex(memberListIndexSize(layout, 4));
1499
+ nextMethod = next.readIndex(memberListIndexSize(layout, 6));
1500
+ }
1501
+ return {
1502
+ token: metadataToken(2, row),
1503
+ fullName: declaredName,
1504
+ fieldStart,
1505
+ fieldEnd: nextField,
1506
+ methodStart,
1507
+ methodEnd: nextMethod
1508
+ };
1509
+ };
1510
+ typeRanges = (bytes, layout, issues) => {
1511
+ const typeTable = layout.table(2);
1512
+ const ranges = [];
1513
+ for (let row = 1; row <= (typeTable?.rowCount ?? 0); row += 1) ranges.push(readTypeRange(bytes, layout, row, issues));
1514
+ return ranges;
1515
+ };
1516
+ parseTypes = (bytes, layout, ranges) => {
1517
+ const typeTable = layout.table(2);
1518
+ const fields = memberListTable(layout, 4);
1519
+ const methods = memberListTable(layout, 6);
1520
+ const items = [];
1521
+ const issues = [];
1522
+ for (let row = 1; row <= (typeTable?.rowCount ?? 0); row += 1) {
1523
+ readManagedValue(() => {
1524
+ const cursor = metadataRowCursor(bytes, layout, 2, row);
1525
+ const flags = cursor.readUInt32();
1526
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
1527
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
1528
+ const extendsOffset = cursor.offset;
1529
+ const extendsRaw = cursor.readIndex(layout.codedIndexSize("TypeDefOrRef"));
1530
+ const fieldStart = cursor.readIndex(memberListIndexSize(layout, 4));
1531
+ const methodStart = cursor.readIndex(memberListIndexSize(layout, 6));
1532
+ const nextRange = ranges[row] ?? null;
1533
+ const fieldRange = rowRange(fields, fieldStart, nextRange?.fieldStart ?? 0);
1534
+ const methodRange = rowRange(methods, methodStart, nextRange?.methodStart ?? 0);
1535
+ const extendsReason = metadataCodedTokenInvalidReason(extendsRaw, 2, [
1536
+ 2,
1537
+ 1,
1538
+ 27
1539
+ ], layout.rowCounts);
1540
+ if (extendsReason !== null) issues.push({
1541
+ code: "invalid-row",
1542
+ scope: `metadata.TypeDef:${metadataToken(2, row)}`,
1543
+ offset: extendsOffset,
1544
+ detail: `TypeDef Extends coded index 0x${extendsRaw.toString(16)} is invalid: ${extendsReason}`
1545
+ });
1546
+ items.push({
1547
+ token: metadataToken(2, row),
1548
+ row_offset: cursor.start,
1549
+ namespace,
1550
+ name,
1551
+ full_name: fullName(namespace, name),
1552
+ flags,
1553
+ extends_token: metadataCodedToken(extendsRaw, 2, [
1554
+ 2,
1555
+ 1,
1556
+ 27
1557
+ ], layout.rowCounts),
1558
+ field_list: {
1559
+ first_row: fieldRange.first,
1560
+ last_row: fieldRange.last,
1561
+ count: fieldRange.count
1562
+ },
1563
+ method_list: {
1564
+ first_row: methodRange.first,
1565
+ last_row: methodRange.last,
1566
+ count: methodRange.count
1567
+ }
1568
+ });
1569
+ }, issues);
1570
+ }
1571
+ return {
1572
+ types: items,
1573
+ issues
1574
+ };
1575
+ };
1576
+ readCompressed = (bytes, offset) => {
1577
+ const first = bytes[offset];
1578
+ if (first === undefined) throw managedFailure("invalid-blob", "signature", "truncated compressed integer", offset);
1579
+ if ((first & 128) === 0) return {
1580
+ value: first,
1581
+ next: offset + 1
1582
+ };
1583
+ const second = bytes[offset + 1];
1584
+ if ((first & 192) === 128 && second !== undefined) return {
1585
+ value: (first & 63) << 8 | second,
1586
+ next: offset + 2
1587
+ };
1588
+ const b1 = bytes[offset + 1];
1589
+ const b2 = bytes[offset + 2];
1590
+ const b3 = bytes[offset + 3];
1591
+ if ((first & 224) === 192 && b1 !== undefined && b2 !== undefined && b3 !== undefined) return {
1592
+ value: (first & 31) * 16777216 + b1 * 65536 + b2 * 256 + b3,
1593
+ next: offset + 4
1594
+ };
1595
+ throw managedFailure("invalid-blob", "signature", "reserved compressed integer", offset);
1596
+ };
1597
+ ELEMENT_TYPES = new Map([
1598
+ [1, "void"],
1599
+ [2, "bool"],
1600
+ [3, "char"],
1601
+ [4, "i1"],
1602
+ [5, "u1"],
1603
+ [6, "i2"],
1604
+ [7, "u2"],
1605
+ [8, "i4"],
1606
+ [9, "u4"],
1607
+ [10, "i8"],
1608
+ [11, "u8"],
1609
+ [12, "r4"],
1610
+ [13, "r8"],
1611
+ [14, "string"],
1612
+ [24, "native-int"],
1613
+ [25, "native-uint"],
1614
+ [28, "object"]
1615
+ ]);
1616
+ readSignedCompressed = (bytes, offset) => {
1617
+ const encoded = readCompressed(bytes, offset);
1618
+ const width = encoded.next - offset === 1 ? 7 : encoded.next - offset === 2 ? 14 : 29;
1619
+ const magnitude = Math.floor(encoded.value / 2);
1620
+ return {
1621
+ value: encoded.value % 2 === 0 ? magnitude : magnitude - 2 ** (width - 1),
1622
+ next: encoded.next
1623
+ };
1624
+ };
1625
+ malformedSignature = (detail, offset) => {
1626
+ throw managedFailure("invalid-blob", "signature", detail, offset);
1627
+ };
1628
+ readMethodSignatureHeader = (blob, offset) => {
1629
+ const first = blob[offset];
1630
+ if (first === undefined) return malformedSignature("truncated method signature", offset);
1631
+ let next = offset + 1;
1632
+ let genericParameterCount = null;
1633
+ if ((first & 16) !== 0) {
1634
+ const generic = readCompressed(blob, next);
1635
+ genericParameterCount = generic.value;
1636
+ next = generic.next;
1637
+ }
1638
+ const parameterCount = readCompressed(blob, next);
1639
+ return {
1640
+ first,
1641
+ genericParameterCount,
1642
+ parameterCount: parameterCount.value,
1643
+ next: parameterCount.next
1644
+ };
1645
+ };
1646
+ MAX_ARRAY_RANK = 32;
1647
+ FUNCTION_POINTER_CONVENTIONS = new Set([
1648
+ 0,
1649
+ 1,
1650
+ 2,
1651
+ 3,
1652
+ 4,
1653
+ 5,
1654
+ 9
1655
+ ]);
1656
+ arrayShape = (blob, offset) => {
1657
+ const rank = readCompressed(blob, offset);
1658
+ if (rank.value === 0) return malformedSignature("array rank is zero", offset);
1659
+ 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);
1660
+ const sizeCount = readCompressed(blob, rank.next);
1661
+ if (sizeCount.value > rank.value) return malformedSignature("array has more sizes than dimensions", offset);
1662
+ const sizes = [];
1663
+ let next = sizeCount.next;
1664
+ for (let index = 0; index < sizeCount.value; index += 1) {
1665
+ const size = readCompressed(blob, next);
1666
+ sizes.push(size.value);
1667
+ next = size.next;
1668
+ }
1669
+ const boundCount = readCompressed(blob, next);
1670
+ if (boundCount.value > rank.value) return malformedSignature("array has more lower bounds than dimensions", offset);
1671
+ const lowerBounds = [];
1672
+ next = boundCount.next;
1673
+ for (let index = 0; index < boundCount.value; index += 1) {
1674
+ const bound = readSignedCompressed(blob, next);
1675
+ lowerBounds.push(bound.value);
1676
+ next = bound.next;
1677
+ }
1678
+ const dimensions = Array.from({ length: rank.value }, (_, index) => {
1679
+ const size = sizes[index];
1680
+ const lower = lowerBounds[index];
1681
+ if (lower !== undefined) return size === undefined ? `${String(lower)}...` : `${String(lower)}...${String(lower + size - 1)}`;
1682
+ if (size !== undefined) return String(size);
1683
+ return rank.value === 1 ? "..." : "";
1684
+ });
1685
+ return {
1686
+ value: `[${dimensions.join(",")}]`,
1687
+ next
1688
+ };
1689
+ };
1690
+ currentPosition = (stack, base) => {
1691
+ const frame = stack.findLast(({ kind }) => kind !== "modifiers");
1692
+ if (frame === undefined) return base;
1693
+ if (frame.kind === "suffix") return frame.suffix === "*" ? "pointee" : "type";
1694
+ if (frame.kind === "list" && frame.signatureItems) return frame.items.length === 0 ? "return" : "parameter";
1695
+ return "type";
1696
+ };
1697
+ POSITION_ELEMENTS = new Map([
1698
+ [1, ["return", "pointee"]],
1699
+ [22, ["return", "parameter"]],
1700
+ [16, [
1701
+ "return",
1702
+ "parameter",
1703
+ "field"
1704
+ ]]
1705
+ ]);
1706
+ readTypeSignature = (blob, offset, base) => {
1707
+ const stack = [];
1708
+ let cursor = offset;
1709
+ for (;;) {
1710
+ let value;
1711
+ const kind = blob[cursor];
1712
+ if (kind === undefined) return malformedSignature("truncated type signature", cursor);
1713
+ const positions = POSITION_ELEMENTS.get(kind);
1714
+ 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);
1715
+ const named = ELEMENT_TYPES.get(kind);
1716
+ if (named !== undefined) {
1717
+ value = named;
1718
+ cursor += 1;
1719
+ } else if (kind === 15 || kind === 16 || kind === 29) {
1720
+ const suffix = kind === 15 ? "*" : kind === 16 ? "&" : "[]";
1721
+ stack.push({
1722
+ kind: "suffix",
1723
+ suffix
1724
+ });
1725
+ cursor += 1;
1726
+ } else if (kind === 31 || kind === 32) {
1727
+ const token = readCompressed(blob, cursor + 1);
1728
+ const modifier = `${kind === 31 ? "modreq" : "modopt"}:${String(token.value)}`;
1729
+ const top = stack.at(-1);
1730
+ if (top?.kind === "modifiers") top.modifiers.push(modifier);
1731
+ else stack.push({
1732
+ kind: "modifiers",
1733
+ modifiers: [modifier]
1734
+ });
1735
+ cursor = token.next;
1736
+ } else if (kind === 17 || kind === 18) {
1737
+ const token = readCompressed(blob, cursor + 1);
1738
+ value = `${kind === 17 ? "valuetype" : "class"}:${String(token.value)}`;
1739
+ cursor = token.next;
1740
+ } else if (kind === 30 || kind === 19) {
1741
+ const variable = readCompressed(blob, cursor + 1);
1742
+ value = `${kind === 30 ? "mvar" : "var"}:${String(variable.value)}`;
1743
+ cursor = variable.next;
1744
+ } else if (kind === 22) {
1745
+ value = "typedbyref";
1746
+ cursor += 1;
1747
+ } else if (kind === 20) {
1748
+ stack.push({ kind: "array" });
1749
+ cursor += 1;
1750
+ } else if (kind === 21) {
1751
+ const generic = blob[cursor + 1];
1752
+ if (generic !== 17 && generic !== 18) return malformedSignature("generic instantiation does not name a class or value type", cursor + 1);
1753
+ const token = readCompressed(blob, cursor + 2);
1754
+ const argumentCount = readCompressed(blob, token.next);
1755
+ if (argumentCount.value === 0) return malformedSignature("generic instantiation has no type arguments", token.next);
1756
+ const head = `${generic === 17 ? "valuetype" : "class"}:${String(token.value)}`;
1757
+ stack.push({
1758
+ kind: "list",
1759
+ remaining: argumentCount.value,
1760
+ items: [],
1761
+ signatureItems: false,
1762
+ render: (items) => `${head}<${items.join(",")}>`
1763
+ });
1764
+ cursor = argumentCount.next;
1765
+ } else if (kind === 27) {
1766
+ const header = readMethodSignatureHeader(blob, cursor + 1);
1767
+ 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);
1768
+ const convention = callingConvention(header.first);
1769
+ const head = header.genericParameterCount === null ? convention : `${convention};${String(header.genericParameterCount)}`;
1770
+ stack.push({
1771
+ kind: "list",
1772
+ remaining: header.parameterCount + 1,
1773
+ items: [],
1774
+ signatureItems: true,
1775
+ render: ([returnType, ...parameters]) => `fnptr[${head}](${parameters.join(",")})->${returnType ?? ""}`
1776
+ });
1777
+ cursor = header.next;
1778
+ } else {
1779
+ throw managedFailure("unsupported-signature", "signature", `unsupported element type 0x${kind.toString(16)}`, cursor);
1780
+ }
1781
+ while (value !== undefined) {
1782
+ const top = stack.pop();
1783
+ if (top === undefined) return {
1784
+ value,
1785
+ next: cursor
1786
+ };
1787
+ if (top.kind === "suffix") value += top.suffix;
1788
+ else if (top.kind === "modifiers") value = `${value} ${top.modifiers.join(" ")}`;
1789
+ else if (top.kind === "array") {
1790
+ const shape = arrayShape(blob, cursor);
1791
+ value += shape.value;
1792
+ cursor = shape.next;
1793
+ } else {
1794
+ top.items.push(value);
1795
+ top.remaining -= 1;
1796
+ if (top.remaining === 0) value = top.render(top.items);
1797
+ else {
1798
+ value = undefined;
1799
+ stack.push(top);
1800
+ }
1801
+ }
1802
+ }
1803
+ }
1804
+ };
1805
+ CALLING_CONVENTION_NAMES = new Map([
1806
+ [0, "default"],
1807
+ [1, "c"],
1808
+ [2, "stdcall"],
1809
+ [3, "thiscall"],
1810
+ [4, "fastcall"],
1811
+ [5, "vararg"],
1812
+ [6, "field"],
1813
+ [9, "unmanaged"]
1814
+ ]);
1815
+ callingConvention = (value) => {
1816
+ const base = value & 15;
1817
+ const flags = [
1818
+ (value & 32) === 0 ? null : "has-this",
1819
+ (value & 64) === 0 ? null : "explicit-this",
1820
+ (value & 16) === 0 ? null : "generic"
1821
+ ].filter((flag) => flag !== null);
1822
+ const name = CALLING_CONVENTION_NAMES.get(base) ?? `unknown:${String(base)}`;
1823
+ return flags.length === 0 ? name : `${name} ${flags.join(" ")}`;
1824
+ };
1825
+ signature = (blob, rawSha256) => {
1826
+ const raw = {
1827
+ raw_length: blob.length,
1828
+ raw_sha256: rawSha256 ?? sha256Bytes(blob)
1829
+ };
1830
+ try {
1831
+ if (blob.length === 0) throw managedFailure("invalid-blob", "signature", "empty signature", 0);
1832
+ const first = blob[0] ?? 0;
1833
+ if ((first & 15) === 6) {
1834
+ const fieldType = readTypeSignature(blob, 1, "field");
1835
+ return {
1836
+ ...raw,
1837
+ kind: "field",
1838
+ parse_status: fieldType.next === blob.length ? "decoded" : "partial",
1839
+ calling_convention: callingConvention(first),
1840
+ generic_parameter_count: null,
1841
+ parameter_count: null,
1842
+ return_type: null,
1843
+ parameter_types: [],
1844
+ field_type: fieldType.value,
1845
+ issue: fieldType.next === blob.length ? null : "Trailing signature data"
1846
+ };
1847
+ }
1848
+ const header = readMethodSignatureHeader(blob, 0);
1849
+ const returnType = readTypeSignature(blob, header.next, "return");
1850
+ let offset = returnType.next;
1851
+ const parameters = [];
1852
+ for (let index = 0; index < header.parameterCount; index += 1) {
1853
+ const parameter = readTypeSignature(blob, offset, "parameter");
1854
+ parameters.push(parameter.value);
1855
+ offset = parameter.next;
1856
+ }
1857
+ return {
1858
+ ...raw,
1859
+ kind: "method",
1860
+ parse_status: offset === blob.length ? "decoded" : "partial",
1861
+ calling_convention: callingConvention(first),
1862
+ generic_parameter_count: header.genericParameterCount,
1863
+ parameter_count: header.parameterCount,
1864
+ return_type: returnType.value,
1865
+ parameter_types: parameters,
1866
+ field_type: null,
1867
+ issue: offset === blob.length ? null : "Trailing signature data"
1868
+ };
1869
+ } catch (cause) {
1870
+ if (!(cause instanceof ManagedReaderFailure)) throw cause;
1871
+ if (cause.issue.code !== "invalid-blob" && cause.issue.code !== "unsupported-signature") throw cause;
1872
+ return {
1873
+ ...raw,
1874
+ kind: "unknown",
1875
+ parse_status: cause.issue.code === "unsupported-signature" ? "unsupported" : "malformed",
1876
+ calling_convention: null,
1877
+ generic_parameter_count: null,
1878
+ parameter_count: null,
1879
+ return_type: null,
1880
+ parameter_types: [],
1881
+ field_type: null,
1882
+ issue: cause.issue.detail
1883
+ };
1884
+ }
1885
+ };
1886
+ })))();
1887
+ }
1888
+
1889
+ //#endregion
1890
+ //#region dist/dotnet/ManagedMemberInstructionDecoder.js
1891
+ var PREFIX_OPCODES, OPCODES, tokenKind, FIXED_OPERAND_READERS, TOKEN_OPERAND_KINDS, readOperand, decodeInstructions, parseExceptionRegions, malformedExceptionRegions, readExceptionClauses;
1892
+ function init_ManagedMemberInstructionDecoder() {
1893
+ return (init_ManagedMemberInstructionDecoder = __esmMin((() => {
1894
+ init_ManagedReaderFailure();
1895
+ PREFIX_OPCODES = new Set([
1896
+ "unaligned.",
1897
+ "volatile.",
1898
+ "tail.",
1899
+ "constrained.",
1900
+ "readonly."
1901
+ ]);
1902
+ OPCODES = new Map([
1903
+ [0, {
1904
+ name: "nop",
1905
+ operand: "none"
1906
+ }],
1907
+ [1, {
1908
+ name: "break",
1909
+ operand: "none"
1910
+ }],
1911
+ [2, {
1912
+ name: "ldarg.0",
1913
+ operand: "none"
1914
+ }],
1915
+ [3, {
1916
+ name: "ldarg.1",
1917
+ operand: "none"
1918
+ }],
1919
+ [4, {
1920
+ name: "ldarg.2",
1921
+ operand: "none"
1922
+ }],
1923
+ [5, {
1924
+ name: "ldarg.3",
1925
+ operand: "none"
1926
+ }],
1927
+ [6, {
1928
+ name: "ldloc.0",
1929
+ operand: "none"
1930
+ }],
1931
+ [7, {
1932
+ name: "ldloc.1",
1933
+ operand: "none"
1934
+ }],
1935
+ [8, {
1936
+ name: "ldloc.2",
1937
+ operand: "none"
1938
+ }],
1939
+ [9, {
1940
+ name: "ldloc.3",
1941
+ operand: "none"
1942
+ }],
1943
+ [10, {
1944
+ name: "stloc.0",
1945
+ operand: "none"
1946
+ }],
1947
+ [11, {
1948
+ name: "stloc.1",
1949
+ operand: "none"
1950
+ }],
1951
+ [12, {
1952
+ name: "stloc.2",
1953
+ operand: "none"
1954
+ }],
1955
+ [13, {
1956
+ name: "stloc.3",
1957
+ operand: "none"
1958
+ }],
1959
+ [14, {
1960
+ name: "ldarg.s",
1961
+ operand: "short-var"
1962
+ }],
1963
+ [15, {
1964
+ name: "ldarga.s",
1965
+ operand: "short-var"
1966
+ }],
1967
+ [16, {
1968
+ name: "starg.s",
1969
+ operand: "short-var"
1970
+ }],
1971
+ [17, {
1972
+ name: "ldloc.s",
1973
+ operand: "short-var"
1974
+ }],
1975
+ [18, {
1976
+ name: "ldloca.s",
1977
+ operand: "short-var"
1978
+ }],
1979
+ [19, {
1980
+ name: "stloc.s",
1981
+ operand: "short-var"
1982
+ }],
1983
+ [20, {
1984
+ name: "ldnull",
1985
+ operand: "none"
1986
+ }],
1987
+ [21, {
1988
+ name: "ldc.i4.m1",
1989
+ operand: "none"
1990
+ }],
1991
+ [22, {
1992
+ name: "ldc.i4.0",
1993
+ operand: "none"
1994
+ }],
1995
+ [23, {
1996
+ name: "ldc.i4.1",
1997
+ operand: "none"
1998
+ }],
1999
+ [24, {
2000
+ name: "ldc.i4.2",
2001
+ operand: "none"
2002
+ }],
2003
+ [25, {
2004
+ name: "ldc.i4.3",
2005
+ operand: "none"
2006
+ }],
2007
+ [26, {
2008
+ name: "ldc.i4.4",
2009
+ operand: "none"
2010
+ }],
2011
+ [27, {
2012
+ name: "ldc.i4.5",
2013
+ operand: "none"
2014
+ }],
2015
+ [28, {
2016
+ name: "ldc.i4.6",
2017
+ operand: "none"
2018
+ }],
2019
+ [29, {
2020
+ name: "ldc.i4.7",
2021
+ operand: "none"
2022
+ }],
2023
+ [30, {
2024
+ name: "ldc.i4.8",
2025
+ operand: "none"
2026
+ }],
2027
+ [31, {
2028
+ name: "ldc.i4.s",
2029
+ operand: "short-i"
2030
+ }],
2031
+ [32, {
2032
+ name: "ldc.i4",
2033
+ operand: "i"
2034
+ }],
2035
+ [33, {
2036
+ name: "ldc.i8",
2037
+ operand: "i8"
2038
+ }],
2039
+ [34, {
2040
+ name: "ldc.r4",
2041
+ operand: "r4"
2042
+ }],
2043
+ [35, {
2044
+ name: "ldc.r8",
2045
+ operand: "r8"
2046
+ }],
2047
+ [37, {
2048
+ name: "dup",
2049
+ operand: "none"
2050
+ }],
2051
+ [38, {
2052
+ name: "pop",
2053
+ operand: "none"
2054
+ }],
2055
+ [39, {
2056
+ name: "jmp",
2057
+ operand: "method"
2058
+ }],
2059
+ [40, {
2060
+ name: "call",
2061
+ operand: "method"
2062
+ }],
2063
+ [41, {
2064
+ name: "calli",
2065
+ operand: "signature"
2066
+ }],
2067
+ [42, {
2068
+ name: "ret",
2069
+ operand: "none"
2070
+ }],
2071
+ [43, {
2072
+ name: "br.s",
2073
+ operand: "short-branch"
2074
+ }],
2075
+ [44, {
2076
+ name: "brfalse.s",
2077
+ operand: "short-branch"
2078
+ }],
2079
+ [45, {
2080
+ name: "brtrue.s",
2081
+ operand: "short-branch"
2082
+ }],
2083
+ [46, {
2084
+ name: "beq.s",
2085
+ operand: "short-branch"
2086
+ }],
2087
+ [47, {
2088
+ name: "bge.s",
2089
+ operand: "short-branch"
2090
+ }],
2091
+ [48, {
2092
+ name: "bgt.s",
2093
+ operand: "short-branch"
2094
+ }],
2095
+ [49, {
2096
+ name: "ble.s",
2097
+ operand: "short-branch"
2098
+ }],
2099
+ [50, {
2100
+ name: "blt.s",
2101
+ operand: "short-branch"
2102
+ }],
2103
+ [51, {
2104
+ name: "bne.un.s",
2105
+ operand: "short-branch"
2106
+ }],
2107
+ [52, {
2108
+ name: "bge.un.s",
2109
+ operand: "short-branch"
2110
+ }],
2111
+ [53, {
2112
+ name: "bgt.un.s",
2113
+ operand: "short-branch"
2114
+ }],
2115
+ [54, {
2116
+ name: "ble.un.s",
2117
+ operand: "short-branch"
2118
+ }],
2119
+ [55, {
2120
+ name: "blt.un.s",
2121
+ operand: "short-branch"
2122
+ }],
2123
+ [56, {
2124
+ name: "br",
2125
+ operand: "branch"
2126
+ }],
2127
+ [57, {
2128
+ name: "brfalse",
2129
+ operand: "branch"
2130
+ }],
2131
+ [58, {
2132
+ name: "brtrue",
2133
+ operand: "branch"
2134
+ }],
2135
+ [59, {
2136
+ name: "beq",
2137
+ operand: "branch"
2138
+ }],
2139
+ [60, {
2140
+ name: "bge",
2141
+ operand: "branch"
2142
+ }],
2143
+ [61, {
2144
+ name: "bgt",
2145
+ operand: "branch"
2146
+ }],
2147
+ [62, {
2148
+ name: "ble",
2149
+ operand: "branch"
2150
+ }],
2151
+ [63, {
2152
+ name: "blt",
2153
+ operand: "branch"
2154
+ }],
2155
+ [64, {
2156
+ name: "bne.un",
2157
+ operand: "branch"
2158
+ }],
2159
+ [65, {
2160
+ name: "bge.un",
2161
+ operand: "branch"
2162
+ }],
2163
+ [66, {
2164
+ name: "bgt.un",
2165
+ operand: "branch"
2166
+ }],
2167
+ [67, {
2168
+ name: "ble.un",
2169
+ operand: "branch"
2170
+ }],
2171
+ [68, {
2172
+ name: "blt.un",
2173
+ operand: "branch"
2174
+ }],
2175
+ [69, {
2176
+ name: "switch",
2177
+ operand: "switch"
2178
+ }],
2179
+ [70, {
2180
+ name: "ldind.i1",
2181
+ operand: "none"
2182
+ }],
2183
+ [71, {
2184
+ name: "ldind.u1",
2185
+ operand: "none"
2186
+ }],
2187
+ [72, {
2188
+ name: "ldind.i2",
2189
+ operand: "none"
2190
+ }],
2191
+ [73, {
2192
+ name: "ldind.u2",
2193
+ operand: "none"
2194
+ }],
2195
+ [74, {
2196
+ name: "ldind.i4",
2197
+ operand: "none"
2198
+ }],
2199
+ [75, {
2200
+ name: "ldind.u4",
2201
+ operand: "none"
2202
+ }],
2203
+ [76, {
2204
+ name: "ldind.i8",
2205
+ operand: "none"
2206
+ }],
2207
+ [77, {
2208
+ name: "ldind.i",
2209
+ operand: "none"
2210
+ }],
2211
+ [78, {
2212
+ name: "ldind.r4",
2213
+ operand: "none"
2214
+ }],
2215
+ [79, {
2216
+ name: "ldind.r8",
2217
+ operand: "none"
2218
+ }],
2219
+ [80, {
2220
+ name: "ldind.ref",
2221
+ operand: "none"
2222
+ }],
2223
+ [81, {
2224
+ name: "stind.ref",
2225
+ operand: "none"
2226
+ }],
2227
+ [82, {
2228
+ name: "stind.i1",
2229
+ operand: "none"
2230
+ }],
2231
+ [83, {
2232
+ name: "stind.i2",
2233
+ operand: "none"
2234
+ }],
2235
+ [84, {
2236
+ name: "stind.i4",
2237
+ operand: "none"
2238
+ }],
2239
+ [85, {
2240
+ name: "stind.i8",
2241
+ operand: "none"
2242
+ }],
2243
+ [86, {
2244
+ name: "stind.r4",
2245
+ operand: "none"
2246
+ }],
2247
+ [87, {
2248
+ name: "stind.r8",
2249
+ operand: "none"
2250
+ }],
2251
+ [88, {
2252
+ name: "add",
2253
+ operand: "none"
2254
+ }],
2255
+ [89, {
2256
+ name: "sub",
2257
+ operand: "none"
2258
+ }],
2259
+ [90, {
2260
+ name: "mul",
2261
+ operand: "none"
2262
+ }],
2263
+ [91, {
2264
+ name: "div",
2265
+ operand: "none"
2266
+ }],
2267
+ [92, {
2268
+ name: "div.un",
2269
+ operand: "none"
2270
+ }],
2271
+ [93, {
2272
+ name: "rem",
2273
+ operand: "none"
2274
+ }],
2275
+ [94, {
2276
+ name: "rem.un",
2277
+ operand: "none"
2278
+ }],
2279
+ [95, {
2280
+ name: "and",
2281
+ operand: "none"
2282
+ }],
2283
+ [96, {
2284
+ name: "or",
2285
+ operand: "none"
2286
+ }],
2287
+ [97, {
2288
+ name: "xor",
2289
+ operand: "none"
2290
+ }],
2291
+ [98, {
2292
+ name: "shl",
2293
+ operand: "none"
2294
+ }],
2295
+ [99, {
2296
+ name: "shr",
2297
+ operand: "none"
2298
+ }],
2299
+ [100, {
2300
+ name: "shr.un",
2301
+ operand: "none"
2302
+ }],
2303
+ [101, {
2304
+ name: "neg",
2305
+ operand: "none"
2306
+ }],
2307
+ [102, {
2308
+ name: "not",
2309
+ operand: "none"
2310
+ }],
2311
+ [103, {
2312
+ name: "conv.i1",
2313
+ operand: "none"
2314
+ }],
2315
+ [104, {
2316
+ name: "conv.i2",
2317
+ operand: "none"
2318
+ }],
2319
+ [105, {
2320
+ name: "conv.i4",
2321
+ operand: "none"
2322
+ }],
2323
+ [106, {
2324
+ name: "conv.i8",
2325
+ operand: "none"
2326
+ }],
2327
+ [107, {
2328
+ name: "conv.r4",
2329
+ operand: "none"
2330
+ }],
2331
+ [108, {
2332
+ name: "conv.r8",
2333
+ operand: "none"
2334
+ }],
2335
+ [109, {
2336
+ name: "conv.u4",
2337
+ operand: "none"
2338
+ }],
2339
+ [110, {
2340
+ name: "conv.u8",
2341
+ operand: "none"
2342
+ }],
2343
+ [111, {
2344
+ name: "callvirt",
2345
+ operand: "method"
2346
+ }],
2347
+ [112, {
2348
+ name: "cpobj",
2349
+ operand: "type"
2350
+ }],
2351
+ [113, {
2352
+ name: "ldobj",
2353
+ operand: "type"
2354
+ }],
2355
+ [114, {
2356
+ name: "ldstr",
2357
+ operand: "string"
2358
+ }],
2359
+ [115, {
2360
+ name: "newobj",
2361
+ operand: "method"
2362
+ }],
2363
+ [116, {
2364
+ name: "castclass",
2365
+ operand: "type"
2366
+ }],
2367
+ [117, {
2368
+ name: "isinst",
2369
+ operand: "type"
2370
+ }],
2371
+ [118, {
2372
+ name: "conv.r.un",
2373
+ operand: "none"
2374
+ }],
2375
+ [121, {
2376
+ name: "unbox",
2377
+ operand: "type"
2378
+ }],
2379
+ [122, {
2380
+ name: "throw",
2381
+ operand: "none"
2382
+ }],
2383
+ [123, {
2384
+ name: "ldfld",
2385
+ operand: "field"
2386
+ }],
2387
+ [124, {
2388
+ name: "ldflda",
2389
+ operand: "field"
2390
+ }],
2391
+ [125, {
2392
+ name: "stfld",
2393
+ operand: "field"
2394
+ }],
2395
+ [126, {
2396
+ name: "ldsfld",
2397
+ operand: "field"
2398
+ }],
2399
+ [127, {
2400
+ name: "ldsflda",
2401
+ operand: "field"
2402
+ }],
2403
+ [128, {
2404
+ name: "stsfld",
2405
+ operand: "field"
2406
+ }],
2407
+ [129, {
2408
+ name: "stobj",
2409
+ operand: "type"
2410
+ }],
2411
+ [130, {
2412
+ name: "conv.ovf.i1.un",
2413
+ operand: "none"
2414
+ }],
2415
+ [131, {
2416
+ name: "conv.ovf.i2.un",
2417
+ operand: "none"
2418
+ }],
2419
+ [132, {
2420
+ name: "conv.ovf.i4.un",
2421
+ operand: "none"
2422
+ }],
2423
+ [133, {
2424
+ name: "conv.ovf.i8.un",
2425
+ operand: "none"
2426
+ }],
2427
+ [134, {
2428
+ name: "conv.ovf.u1.un",
2429
+ operand: "none"
2430
+ }],
2431
+ [135, {
2432
+ name: "conv.ovf.u2.un",
2433
+ operand: "none"
2434
+ }],
2435
+ [136, {
2436
+ name: "conv.ovf.u4.un",
2437
+ operand: "none"
2438
+ }],
2439
+ [137, {
2440
+ name: "conv.ovf.u8.un",
2441
+ operand: "none"
2442
+ }],
2443
+ [138, {
2444
+ name: "conv.ovf.i.un",
2445
+ operand: "none"
2446
+ }],
2447
+ [139, {
2448
+ name: "conv.ovf.u.un",
2449
+ operand: "none"
2450
+ }],
2451
+ [140, {
2452
+ name: "box",
2453
+ operand: "type"
2454
+ }],
2455
+ [141, {
2456
+ name: "newarr",
2457
+ operand: "type"
2458
+ }],
2459
+ [142, {
2460
+ name: "ldlen",
2461
+ operand: "none"
2462
+ }],
2463
+ [143, {
2464
+ name: "ldelema",
2465
+ operand: "type"
2466
+ }],
2467
+ [144, {
2468
+ name: "ldelem.i1",
2469
+ operand: "none"
2470
+ }],
2471
+ [145, {
2472
+ name: "ldelem.u1",
2473
+ operand: "none"
2474
+ }],
2475
+ [146, {
2476
+ name: "ldelem.i2",
2477
+ operand: "none"
2478
+ }],
2479
+ [147, {
2480
+ name: "ldelem.u2",
2481
+ operand: "none"
2482
+ }],
2483
+ [148, {
2484
+ name: "ldelem.i4",
2485
+ operand: "none"
2486
+ }],
2487
+ [149, {
2488
+ name: "ldelem.u4",
2489
+ operand: "none"
2490
+ }],
2491
+ [150, {
2492
+ name: "ldelem.i8",
2493
+ operand: "none"
2494
+ }],
2495
+ [151, {
2496
+ name: "ldelem.i",
2497
+ operand: "none"
2498
+ }],
2499
+ [152, {
2500
+ name: "ldelem.r4",
2501
+ operand: "none"
2502
+ }],
2503
+ [153, {
2504
+ name: "ldelem.r8",
2505
+ operand: "none"
2506
+ }],
2507
+ [154, {
2508
+ name: "ldelem.ref",
2509
+ operand: "none"
2510
+ }],
2511
+ [155, {
2512
+ name: "stelem.i",
2513
+ operand: "none"
2514
+ }],
2515
+ [156, {
2516
+ name: "stelem.i1",
2517
+ operand: "none"
2518
+ }],
2519
+ [157, {
2520
+ name: "stelem.i2",
2521
+ operand: "none"
2522
+ }],
2523
+ [158, {
2524
+ name: "stelem.i4",
2525
+ operand: "none"
2526
+ }],
2527
+ [159, {
2528
+ name: "stelem.i8",
2529
+ operand: "none"
2530
+ }],
2531
+ [160, {
2532
+ name: "stelem.r4",
2533
+ operand: "none"
2534
+ }],
2535
+ [161, {
2536
+ name: "stelem.r8",
2537
+ operand: "none"
2538
+ }],
2539
+ [162, {
2540
+ name: "stelem.ref",
2541
+ operand: "none"
2542
+ }],
2543
+ [163, {
2544
+ name: "ldelem",
2545
+ operand: "type"
2546
+ }],
2547
+ [164, {
2548
+ name: "stelem",
2549
+ operand: "type"
2550
+ }],
2551
+ [165, {
2552
+ name: "unbox.any",
2553
+ operand: "type"
2554
+ }],
2555
+ [179, {
2556
+ name: "conv.ovf.i1",
2557
+ operand: "none"
2558
+ }],
2559
+ [180, {
2560
+ name: "conv.ovf.u1",
2561
+ operand: "none"
2562
+ }],
2563
+ [181, {
2564
+ name: "conv.ovf.i2",
2565
+ operand: "none"
2566
+ }],
2567
+ [182, {
2568
+ name: "conv.ovf.u2",
2569
+ operand: "none"
2570
+ }],
2571
+ [183, {
2572
+ name: "conv.ovf.i4",
2573
+ operand: "none"
2574
+ }],
2575
+ [184, {
2576
+ name: "conv.ovf.u4",
2577
+ operand: "none"
2578
+ }],
2579
+ [185, {
2580
+ name: "conv.ovf.i8",
2581
+ operand: "none"
2582
+ }],
2583
+ [186, {
2584
+ name: "conv.ovf.u8",
2585
+ operand: "none"
2586
+ }],
2587
+ [194, {
2588
+ name: "refanyval",
2589
+ operand: "type"
2590
+ }],
2591
+ [195, {
2592
+ name: "ckfinite",
2593
+ operand: "none"
2594
+ }],
2595
+ [198, {
2596
+ name: "mkrefany",
2597
+ operand: "type"
2598
+ }],
2599
+ [208, {
2600
+ name: "ldtoken",
2601
+ operand: "token"
2602
+ }],
2603
+ [209, {
2604
+ name: "conv.u2",
2605
+ operand: "none"
2606
+ }],
2607
+ [210, {
2608
+ name: "conv.u1",
2609
+ operand: "none"
2610
+ }],
2611
+ [211, {
2612
+ name: "conv.i",
2613
+ operand: "none"
2614
+ }],
2615
+ [212, {
2616
+ name: "conv.ovf.i",
2617
+ operand: "none"
2618
+ }],
2619
+ [213, {
2620
+ name: "conv.ovf.u",
2621
+ operand: "none"
2622
+ }],
2623
+ [214, {
2624
+ name: "add.ovf",
2625
+ operand: "none"
2626
+ }],
2627
+ [215, {
2628
+ name: "add.ovf.un",
2629
+ operand: "none"
2630
+ }],
2631
+ [216, {
2632
+ name: "mul.ovf",
2633
+ operand: "none"
2634
+ }],
2635
+ [217, {
2636
+ name: "mul.ovf.un",
2637
+ operand: "none"
2638
+ }],
2639
+ [218, {
2640
+ name: "sub.ovf",
2641
+ operand: "none"
2642
+ }],
2643
+ [219, {
2644
+ name: "sub.ovf.un",
2645
+ operand: "none"
2646
+ }],
2647
+ [220, {
2648
+ name: "endfinally",
2649
+ operand: "none"
2650
+ }],
2651
+ [221, {
2652
+ name: "leave",
2653
+ operand: "branch"
2654
+ }],
2655
+ [222, {
2656
+ name: "leave.s",
2657
+ operand: "short-branch"
2658
+ }],
2659
+ [223, {
2660
+ name: "stind.i",
2661
+ operand: "none"
2662
+ }],
2663
+ [224, {
2664
+ name: "conv.u",
2665
+ operand: "none"
2666
+ }],
2667
+ [65024, {
2668
+ name: "arglist",
2669
+ operand: "none"
2670
+ }],
2671
+ [65025, {
2672
+ name: "ceq",
2673
+ operand: "none"
2674
+ }],
2675
+ [65026, {
2676
+ name: "cgt",
2677
+ operand: "none"
2678
+ }],
2679
+ [65027, {
2680
+ name: "cgt.un",
2681
+ operand: "none"
2682
+ }],
2683
+ [65028, {
2684
+ name: "clt",
2685
+ operand: "none"
2686
+ }],
2687
+ [65029, {
2688
+ name: "clt.un",
2689
+ operand: "none"
2690
+ }],
2691
+ [65030, {
2692
+ name: "ldftn",
2693
+ operand: "method"
2694
+ }],
2695
+ [65031, {
2696
+ name: "ldvirtftn",
2697
+ operand: "method"
2698
+ }],
2699
+ [65033, {
2700
+ name: "ldarg",
2701
+ operand: "var"
2702
+ }],
2703
+ [65034, {
2704
+ name: "ldarga",
2705
+ operand: "var"
2706
+ }],
2707
+ [65035, {
2708
+ name: "starg",
2709
+ operand: "var"
2710
+ }],
2711
+ [65036, {
2712
+ name: "ldloc",
2713
+ operand: "var"
2714
+ }],
2715
+ [65037, {
2716
+ name: "ldloca",
2717
+ operand: "var"
2718
+ }],
2719
+ [65038, {
2720
+ name: "stloc",
2721
+ operand: "var"
2722
+ }],
2723
+ [65039, {
2724
+ name: "localloc",
2725
+ operand: "none"
2726
+ }],
2727
+ [65041, {
2728
+ name: "endfilter",
2729
+ operand: "none"
2730
+ }],
2731
+ [65042, {
2732
+ name: "unaligned.",
2733
+ operand: "short-i"
2734
+ }],
2735
+ [65043, {
2736
+ name: "volatile.",
2737
+ operand: "none"
2738
+ }],
2739
+ [65044, {
2740
+ name: "tail.",
2741
+ operand: "none"
2742
+ }],
2743
+ [65045, {
2744
+ name: "initobj",
2745
+ operand: "type"
2746
+ }],
2747
+ [65046, {
2748
+ name: "constrained.",
2749
+ operand: "type"
2750
+ }],
2751
+ [65047, {
2752
+ name: "cpblk",
2753
+ operand: "none"
2754
+ }],
2755
+ [65048, {
2756
+ name: "initblk",
2757
+ operand: "none"
2758
+ }],
2759
+ [65050, {
2760
+ name: "rethrow",
2761
+ operand: "none"
2762
+ }],
2763
+ [65052, {
2764
+ name: "sizeof",
2765
+ operand: "type"
2766
+ }],
2767
+ [65053, {
2768
+ name: "refanytype",
2769
+ operand: "none"
2770
+ }],
2771
+ [65054, {
2772
+ name: "readonly.",
2773
+ operand: "none"
2774
+ }]
2775
+ ]);
2776
+ tokenKind = (token) => {
2777
+ if (token.startsWith("0x06") || token.startsWith("0x0a") || token.startsWith("0x2b")) return "method";
2778
+ if (token.startsWith("0x04")) return "field";
2779
+ if (token.startsWith("0x70")) return "string";
2780
+ if (token.startsWith("0x11")) return "signature";
2781
+ if (token.startsWith("0x01") || token.startsWith("0x02") || token.startsWith("0x1b")) return "type";
2782
+ return "token";
2783
+ };
2784
+ FIXED_OPERAND_READERS = new Map([
2785
+ ["none", (_il, offset) => ({
2786
+ next: offset,
2787
+ anchorKind: "none",
2788
+ value: null
2789
+ })],
2790
+ ["short-var", (il, offset) => ({
2791
+ next: offset + 1,
2792
+ anchorKind: "variable",
2793
+ value: String(il.readUInt8(offset))
2794
+ })],
2795
+ ["var", (il, offset) => ({
2796
+ next: offset + 2,
2797
+ anchorKind: "variable",
2798
+ value: String(il.readUInt16LE(offset))
2799
+ })],
2800
+ ["short-i", (il, offset) => ({
2801
+ next: offset + 1,
2802
+ anchorKind: "constant",
2803
+ value: String(il.readInt8(offset))
2804
+ })],
2805
+ ["i", (il, offset) => ({
2806
+ next: offset + 4,
2807
+ anchorKind: "constant",
2808
+ value: String(il.readInt32LE(offset))
2809
+ })],
2810
+ ["i8", (il, offset) => ({
2811
+ next: offset + 8,
2812
+ anchorKind: "constant",
2813
+ value: il.readBigInt64LE(offset).toString()
2814
+ })],
2815
+ ["r4", (il, offset) => ({
2816
+ next: offset + 4,
2817
+ anchorKind: "constant",
2818
+ value: String(il.readFloatLE(offset))
2819
+ })],
2820
+ ["r8", (il, offset) => ({
2821
+ next: offset + 8,
2822
+ anchorKind: "constant",
2823
+ value: String(il.readDoubleLE(offset))
2824
+ })],
2825
+ ["short-branch", (il, offset) => ({
2826
+ next: offset + 1,
2827
+ anchorKind: "branch",
2828
+ value: String(offset + 1 + il.readInt8(offset))
2829
+ })],
2830
+ ["branch", (il, offset) => ({
2831
+ next: offset + 4,
2832
+ anchorKind: "branch",
2833
+ value: String(offset + 4 + il.readInt32LE(offset))
2834
+ })]
2835
+ ]);
2836
+ TOKEN_OPERAND_KINDS = new Map([
2837
+ ["method", "method"],
2838
+ ["field", "field"],
2839
+ ["type", "type"],
2840
+ ["string", "string"],
2841
+ ["signature", "signature"]
2842
+ ]);
2843
+ readOperand = (il, offset, kind) => {
2844
+ const fixed = FIXED_OPERAND_READERS.get(kind);
2845
+ if (fixed !== undefined) return fixed(il, offset);
2846
+ if (kind === "switch") {
2847
+ const count = il.readUInt32LE(offset);
2848
+ return {
2849
+ next: offset + 4 + count * 4,
2850
+ anchorKind: "switch",
2851
+ value: String(count)
2852
+ };
2853
+ }
2854
+ const raw = il.readUInt32LE(offset);
2855
+ const token = `0x${raw.toString(16).padStart(8, "0")}`;
2856
+ const tokenOperandKind = TOKEN_OPERAND_KINDS.get(kind);
2857
+ if (tokenOperandKind !== undefined) return {
2858
+ next: offset + 4,
2859
+ anchorKind: tokenOperandKind,
2860
+ value: token
2861
+ };
2862
+ if (kind === "token") return {
2863
+ next: offset + 4,
2864
+ anchorKind: tokenKind(token),
2865
+ value: token
2866
+ };
2867
+ return {
2868
+ next: offset,
2869
+ anchorKind: "unknown",
2870
+ value: null
2871
+ };
2872
+ };
2873
+ decodeInstructions = (il, admitInstruction) => {
2874
+ const parsed = [];
2875
+ const instructionStarts = [];
2876
+ let offset = 0;
2877
+ let prefixStart = null;
2878
+ let issue = null;
2879
+ try {
2880
+ while (offset < il.length) {
2881
+ const start = offset;
2882
+ const first = il.readUInt8(offset);
2883
+ offset += 1;
2884
+ const code = first === 254 ? 65024 + il.readUInt8(offset++) : first;
2885
+ const descriptor = OPCODES.get(code);
2886
+ if (descriptor === undefined) {
2887
+ issue = `Unsupported CIL opcode 0x${code.toString(16)} at IL offset ${String(start)}`;
2888
+ break;
2889
+ }
2890
+ const operand = readOperand(il, offset, descriptor.operand);
2891
+ if (operand.next < offset || operand.next > il.length) {
2892
+ issue = `Instruction ${descriptor.name} at IL offset ${String(start)} leaves method body`;
2893
+ break;
2894
+ }
2895
+ admitInstruction?.(start);
2896
+ offset = operand.next;
2897
+ if (PREFIX_OPCODES.has(descriptor.name)) {
2898
+ prefixStart ??= start;
2899
+ } else {
2900
+ instructionStarts.push(prefixStart ?? start);
2901
+ prefixStart = null;
2902
+ }
2903
+ parsed.push({
2904
+ offset: start,
2905
+ opcode: descriptor.name,
2906
+ operandKind: operand.anchorKind,
2907
+ operand: operand.value
2908
+ });
2909
+ }
2910
+ } catch (cause) {
2911
+ if (cause instanceof ManagedReaderFailure) throw cause;
2912
+ issue = cause instanceof Error ? cause.message : "Instruction decode failed";
2913
+ }
2914
+ const truncated = offset < il.length && issue === null ? 1 : 0;
2915
+ return {
2916
+ parsed,
2917
+ instructionStarts,
2918
+ count: parsed.length,
2919
+ truncated,
2920
+ issue
2921
+ };
2922
+ };
2923
+ parseExceptionRegions = (bytes, offset, methodEnd, budget) => {
2924
+ const regions = [];
2925
+ let sectionOffset = offset;
2926
+ let hasMoreSections = true;
2927
+ while (hasMoreSections) {
2928
+ if (!Number.isSafeInteger(sectionOffset) || sectionOffset < 0 || sectionOffset > methodEnd - 4 || sectionOffset > bytes.length - 4) return malformedExceptionRegions("Exception section header leaves artifact", regions);
2929
+ const kind = bytes.readUInt8(sectionOffset);
2930
+ if ((kind & 63) !== 1) return malformedExceptionRegions(`Unsupported method data section kind ${String(kind & 63)}`, regions);
2931
+ const fat = (kind & 64) !== 0;
2932
+ const size = fat ? bytes.readUInt8(sectionOffset + 1) | bytes.readUInt8(sectionOffset + 2) << 8 | bytes.readUInt8(sectionOffset + 3) << 16 : bytes.readUInt8(sectionOffset + 1);
2933
+ const clauseSize = fat ? 24 : 12;
2934
+ if (size < 4 || sectionOffset > methodEnd - size || sectionOffset > bytes.length - size) return malformedExceptionRegions("Exception section size leaves artifact", regions);
2935
+ if ((size - 4) % clauseSize !== 0) return malformedExceptionRegions("Exception section size does not contain whole clauses", regions);
2936
+ if (!fat && (bytes[sectionOffset + 2] !== 0 || bytes[sectionOffset + 3] !== 0)) return malformedExceptionRegions("Small exception section reserved bytes are nonzero", regions);
2937
+ const count = (size - 4) / clauseSize;
2938
+ budget?.admitTransient(count * 256, sectionOffset);
2939
+ for (const region of readExceptionClauses(bytes, sectionOffset + 4, count, fat)) regions.push(region);
2940
+ hasMoreSections = (kind & 128) !== 0;
2941
+ sectionOffset += size;
2942
+ }
2943
+ return {
2944
+ status: "complete",
2945
+ regions
2946
+ };
2947
+ };
2948
+ malformedExceptionRegions = (issue, regions = []) => ({
2949
+ status: "malformed",
2950
+ regions,
2951
+ issue
2952
+ });
2953
+ readExceptionClauses = (bytes, start, count, fat) => {
2954
+ const regions = [];
2955
+ const clauseSize = fat ? 24 : 12;
2956
+ for (let index = 0; index < count; index += 1) {
2957
+ const clause = start + index * clauseSize;
2958
+ const flags = fat ? bytes.readUInt32LE(clause) : bytes.readUInt16LE(clause);
2959
+ const extra = bytes.readUInt32LE(clause + (fat ? 20 : 8));
2960
+ regions.push({
2961
+ flags,
2962
+ try_offset: fat ? bytes.readUInt32LE(clause + 4) : bytes.readUInt16LE(clause + 2),
2963
+ try_length: fat ? bytes.readUInt32LE(clause + 8) : bytes.readUInt8(clause + 4),
2964
+ handler_offset: fat ? bytes.readUInt32LE(clause + 12) : bytes.readUInt16LE(clause + 5),
2965
+ handler_length: fat ? bytes.readUInt32LE(clause + 16) : bytes.readUInt8(clause + 7),
2966
+ class_token: flags === 0 ? `0x${extra.toString(16).padStart(8, "0")}` : null,
2967
+ filter_offset: flags === 1 ? extra : null
2968
+ });
2969
+ }
2970
+ return regions;
2971
+ };
2972
+ })))();
2973
+ }
2974
+
2975
+ //#endregion
2976
+ //#region dist/dotnet/ManagedExceptionRegionValidation.js
2977
+ var clauseFlagsIssue, methodExtentIssue, instructionBoundaryIssue, filterOrderingIssue, clauseIssue, validateExceptionRegionRanges;
2978
+ function init_ManagedExceptionRegionValidation() {
2979
+ return (init_ManagedExceptionRegionValidation = __esmMin((() => {
2980
+ clauseFlagsIssue = (region) => [
2981
+ 0,
2982
+ 1,
2983
+ 2,
2984
+ 4
2985
+ ].includes(region.flags) ? null : `Exception clause has unsupported flags 0x${region.flags.toString(16)}`;
2986
+ methodExtentIssue = (start, length, ilSize, name) => start <= ilSize && length <= ilSize - start ? null : `Exception clause ${name} range leaves the method IL body`;
2987
+ instructionBoundaryIssue = (start, length, boundaries, name) => {
2988
+ const end = start + length;
2989
+ return boundaries.has(start) && boundaries.has(end) ? null : `Exception clause ${name} range does not align with CIL instruction boundaries`;
2990
+ };
2991
+ filterOrderingIssue = (region, ilSize) => {
2992
+ if (region.flags !== 1) return null;
2993
+ const offset = region.filter_offset;
2994
+ return offset !== null && offset < ilSize && offset < region.handler_offset ? null : "Exception clause filter must start before its handler within the method IL body";
2995
+ };
2996
+ 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);
2997
+ validateExceptionRegionRanges = (parsed, ilSize, instructionOffsets) => {
2998
+ if (parsed.status === "malformed") return parsed;
2999
+ const boundaries = new Set([...instructionOffsets, ilSize]);
3000
+ for (const region of parsed.regions) {
3001
+ const issue = clauseIssue(region, ilSize, boundaries);
3002
+ if (issue !== null) return {
3003
+ status: "malformed",
3004
+ regions: parsed.regions,
3005
+ issue
3006
+ };
3007
+ }
3008
+ return parsed;
3009
+ };
3010
+ })))();
3011
+ }
3012
+
3013
+ //#endregion
3014
+ //#region dist/dotnet/ManagedMethodBodyReader.js
3015
+ var bodyStatus, readMethodBodyHeader, methodBody, emptyMethodBody;
3016
+ function init_ManagedMethodBodyReader() {
3017
+ return (init_ManagedMethodBodyReader = __esmMin((() => {
3018
+ init_ManagedDecodeBudget();
3019
+ init_ManagedMemberInstructionDecoder();
3020
+ init_ManagedExceptionRegionValidation();
3021
+ init_ManagedMetadataHeaps();
3022
+ init_ManagedReaderFailure();
3023
+ bodyStatus = (decodedIssue, truncatedInstructions, exceptionRegions) => {
3024
+ if (decodedIssue !== null || exceptionRegions?.status === "malformed") return "malformed";
3025
+ if (truncatedInstructions > 0) return "partial";
3026
+ return "present";
3027
+ };
3028
+ readMethodBodyHeader = (bytes, offset) => {
3029
+ const first = bytes.readUInt8(offset);
3030
+ if ((first & 3) === 2) return {
3031
+ format: "tiny",
3032
+ size: 1,
3033
+ flags: 0,
3034
+ maxStack: 8,
3035
+ ilSize: first >> 2,
3036
+ localSig: 0
3037
+ };
3038
+ if ((first & 3) !== 3) throw new RangeError("Unsupported method body header");
3039
+ if (offset > bytes.length - 12) throw new RangeError("Fat method body header leaves artifact");
3040
+ const flagsAndSize = bytes.readUInt16LE(offset);
3041
+ const headerDwords = flagsAndSize >>> 12;
3042
+ if (headerDwords < 3) throw new RangeError("Fat method body header is smaller than 12 bytes");
3043
+ const size = headerDwords * 4;
3044
+ if (offset > bytes.length - size) throw new RangeError("Method body header leaves artifact");
3045
+ return {
3046
+ format: "fat",
3047
+ size,
3048
+ flags: flagsAndSize & 4095,
3049
+ maxStack: bytes.readUInt16LE(offset + 2),
3050
+ ilSize: bytes.readUInt32LE(offset + 4),
3051
+ localSig: bytes.readUInt32LE(offset + 8)
3052
+ };
3053
+ };
3054
+ methodBody = (bytes, pe, rva, implementation = {
3055
+ implFlags: 0,
3056
+ flags: 0
3057
+ }, budget) => {
3058
+ if (rva === 0) return emptyMethodBody(rva, "absent", null);
3059
+ 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");
3060
+ try {
3061
+ const offset = pe.rvaToOffset(rva, 1, "method.body");
3062
+ const methodExtent = pe.rvaAvailableBytes(rva, "method.body");
3063
+ const header = readMethodBodyHeader(bytes, offset);
3064
+ if (header.size > methodExtent || header.ilSize > methodExtent - header.size) throw new RangeError("Method body leaves file-backed PE section data");
3065
+ const ilOffset = offset + header.size;
3066
+ if (ilOffset > bytes.length - header.ilSize) throw new RangeError("Method IL bytes leave artifact");
3067
+ const il = bytes.subarray(ilOffset, ilOffset + header.ilSize);
3068
+ const decoded = decodeInstructions(il, budget === undefined ? undefined : (start) => budget.admitTransient(256, ilOffset + start));
3069
+ const opcodeCounts = {};
3070
+ for (const instruction of decoded.parsed) opcodeCounts[instruction.opcode] = (opcodeCounts[instruction.opcode] ?? 0) + 1;
3071
+ const anchors = decoded.parsed.filter((instruction) => instruction.operandKind !== "none").map((instruction) => ({
3072
+ il_offset: instruction.offset,
3073
+ opcode: instruction.opcode,
3074
+ operand_kind: instruction.operandKind,
3075
+ operand: instruction.operand
3076
+ }));
3077
+ const normalized = Buffer.from(JSON.stringify(decoded.parsed.map(({ opcode, operandKind, operand }) => [
3078
+ opcode,
3079
+ operandKind,
3080
+ operand
3081
+ ])), "utf8");
3082
+ const methodEnd = ilOffset + header.ilSize;
3083
+ const sectionOffset = Math.ceil(methodEnd / 4) * 4;
3084
+ const exceptionRegions = header.format === "fat" && (header.flags & 8) !== 0 ? validateExceptionRegionRanges(parseExceptionRegions(bytes, sectionOffset, offset + methodExtent, budget), header.ilSize, decoded.instructionStarts) : null;
3085
+ const status = bodyStatus(decoded.issue, decoded.truncated, exceptionRegions);
3086
+ const body = {
3087
+ status,
3088
+ header_format: header.format,
3089
+ rva,
3090
+ file_offset: offset,
3091
+ max_stack: header.maxStack,
3092
+ init_locals: (header.flags & 16) !== 0,
3093
+ local_var_sig_token: header.localSig === 0 ? null : `0x${header.localSig.toString(16).padStart(8, "0")}`,
3094
+ il_size: header.ilSize,
3095
+ il_sha256: sha256Bytes(il),
3096
+ normalized_il_sha256: status === "present" ? sha256Bytes(normalized) : null,
3097
+ instruction_count: decoded.count,
3098
+ decoded_instruction_count: decoded.parsed.length,
3099
+ truncated_instructions: decoded.truncated,
3100
+ opcode_counts: opcodeCounts,
3101
+ anchors,
3102
+ exception_regions: exceptionRegions?.regions ?? [],
3103
+ issue: decoded.issue ?? (exceptionRegions?.status === "malformed" ? exceptionRegions.issue : null) ?? (decoded.truncated > 0 ? "Instruction decoding stopped before the end of the method body" : null)
3104
+ };
3105
+ return budget === undefined ? body : admitManagedProjection(body, budget);
3106
+ } catch (cause) {
3107
+ if (cause instanceof ManagedReaderFailure && cause.issue.code === "resource-limit") throw cause;
3108
+ if (!(cause instanceof ManagedReaderFailure) && !(cause instanceof RangeError)) throw cause;
3109
+ return emptyMethodBody(rva, "malformed", cause instanceof Error ? cause.message : "Method body parse failed");
3110
+ } finally {
3111
+ budget?.releaseTransient();
3112
+ }
3113
+ };
3114
+ emptyMethodBody = (rva, status, issue) => ({
3115
+ status,
3116
+ header_format: status === "absent" ? "none" : "unknown",
3117
+ rva,
3118
+ file_offset: null,
3119
+ max_stack: null,
3120
+ init_locals: null,
3121
+ local_var_sig_token: null,
3122
+ il_size: 0,
3123
+ il_sha256: null,
3124
+ normalized_il_sha256: null,
3125
+ instruction_count: 0,
3126
+ decoded_instruction_count: 0,
3127
+ truncated_instructions: 0,
3128
+ opcode_counts: {},
3129
+ anchors: [],
3130
+ exception_regions: [],
3131
+ issue
3132
+ });
3133
+ })))();
3134
+ }
3135
+
3136
+ //#endregion
3137
+ //#region dist/dotnet/ManagedMemberRows.js
3138
+ var isSelected, parseFields, TYPE_FORWARDER_FLAG, parseExportedTypes, parseMemberRefs, parseMethods, targetKind, edges, callerName, callerNameBytes, budgetedSignature;
3139
+ function init_ManagedMemberRows() {
3140
+ return (init_ManagedMemberRows = __esmMin((() => {
3141
+ init_ManagedDecodeBudget();
3142
+ init_ManagedMemberInspectorCore();
3143
+ init_ManagedMetadataHeaps();
3144
+ init_ManagedReaderFailure();
3145
+ init_ManagedMethodBodyReader();
3146
+ init_ManagedMemberOwnership();
3147
+ isSelected = (selected, declared) => selected === null || declared !== undefined && selected.has(declared.token);
3148
+ parseFields = (bytes, layout, ranges, selected = null) => {
3149
+ const fields = [];
3150
+ const core = new Map();
3151
+ const issues = [];
3152
+ const table = layout.table(4);
3153
+ const ownerRow = readManagedValue(() => memberDeclaringTypeRowLookup(bytes, layout, 4), issues);
3154
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3155
+ readManagedValue(() => {
3156
+ const cursor = metadataRowCursor(bytes, layout, 4, row);
3157
+ const flags = cursor.readUInt16();
3158
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3159
+ const owner = ownerRow === undefined ? 0 : readManagedValue(() => ownerRow(row), issues) ?? 0;
3160
+ const declared = ranges[owner - 1];
3161
+ const token = metadataToken(4, row);
3162
+ core.set(token, {
3163
+ token,
3164
+ name
3165
+ });
3166
+ if (!isSelected(selected, declared)) return;
3167
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3168
+ fields.push({
3169
+ token,
3170
+ row_offset: cursor.start,
3171
+ declaring_type_token: declared?.token ?? null,
3172
+ declaring_type: declared?.fullName ?? null,
3173
+ name,
3174
+ flags,
3175
+ signature: budgetedSignature(sig, layout)
3176
+ });
3177
+ }, issues);
3178
+ }
3179
+ return {
3180
+ fields,
3181
+ core,
3182
+ issues
3183
+ };
3184
+ };
3185
+ TYPE_FORWARDER_FLAG = 2097152;
3186
+ parseExportedTypes = (bytes, layout) => {
3187
+ const exportedTypes = [];
3188
+ const issues = [];
3189
+ const table = layout.table(39);
3190
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3191
+ readManagedValue(() => {
3192
+ const cursor = metadataRowCursor(bytes, layout, 39, row);
3193
+ const flags = cursor.readUInt32();
3194
+ const typeDefId = cursor.readUInt32();
3195
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3196
+ const namespace = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3197
+ const implementationOffset = cursor.offset;
3198
+ const implementationRaw = cursor.readIndex(layout.codedIndexSize("Implementation"));
3199
+ const token = metadataToken(39, row);
3200
+ const implementationReason = metadataCodedTokenInvalidReason(implementationRaw, 2, [
3201
+ 38,
3202
+ 35,
3203
+ 39
3204
+ ], layout.rowCounts);
3205
+ if (implementationReason !== null || implementationRaw === 0) issues.push({
3206
+ code: "invalid-row",
3207
+ scope: `metadata.ExportedType:${token}`,
3208
+ offset: implementationOffset,
3209
+ 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}`
3210
+ });
3211
+ exportedTypes.push({
3212
+ token,
3213
+ row_offset: cursor.start,
3214
+ namespace,
3215
+ name,
3216
+ flags,
3217
+ forwarder: (flags & TYPE_FORWARDER_FLAG) !== 0,
3218
+ type_def_id: typeDefId,
3219
+ implementation_token: metadataCodedToken(implementationRaw, 2, [
3220
+ 38,
3221
+ 35,
3222
+ 39
3223
+ ], layout.rowCounts)
3224
+ });
3225
+ }, issues);
3226
+ }
3227
+ return {
3228
+ exportedTypes,
3229
+ issues
3230
+ };
3231
+ };
3232
+ parseMemberRefs = (bytes, layout) => {
3233
+ const refs = [];
3234
+ const core = new Map();
3235
+ const issues = [];
3236
+ const table = layout.table(10);
3237
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3238
+ readManagedValue(() => {
3239
+ const cursor = metadataRowCursor(bytes, layout, 10, row);
3240
+ const parentRaw = cursor.readIndex(layout.codedIndexSize("MemberRefParent"));
3241
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3242
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3243
+ const token = metadataToken(10, row);
3244
+ const parentReason = metadataCodedTokenInvalidReason(parentRaw, 3, [
3245
+ 2,
3246
+ 1,
3247
+ 26,
3248
+ 6,
3249
+ 27
3250
+ ], layout.rowCounts);
3251
+ if (parentReason !== null || parentRaw === 0) issues.push({
3252
+ code: "invalid-row",
3253
+ scope: `metadata.MemberRef:${token}`,
3254
+ offset: cursor.start,
3255
+ 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}`
3256
+ });
3257
+ refs.push({
3258
+ token,
3259
+ row_offset: cursor.start,
3260
+ parent_token: metadataCodedToken(parentRaw, 3, [
3261
+ 2,
3262
+ 1,
3263
+ 26,
3264
+ 6,
3265
+ 27
3266
+ ], layout.rowCounts),
3267
+ name,
3268
+ signature: budgetedSignature(sig, layout)
3269
+ });
3270
+ core.set(token, {
3271
+ token,
3272
+ name
3273
+ });
3274
+ }, issues);
3275
+ }
3276
+ return {
3277
+ refs,
3278
+ core,
3279
+ issues
3280
+ };
3281
+ };
3282
+ parseMethods = ({ bytes, layout, pe, ranges, selected = null }) => {
3283
+ const methods = [];
3284
+ const core = new Map();
3285
+ const issues = [];
3286
+ const table = layout.table(6);
3287
+ const ownerRow = readManagedValue(() => memberDeclaringTypeRowLookup(bytes, layout, 6), issues);
3288
+ for (let row = 1; row <= (table?.rowCount ?? 0); row += 1) {
3289
+ readManagedValue(() => {
3290
+ const cursor = metadataRowCursor(bytes, layout, 6, row);
3291
+ const rva = cursor.readUInt32();
3292
+ const implFlags = cursor.readUInt16();
3293
+ const flags = cursor.readUInt16();
3294
+ const name = readMetadataString(bytes, layout, cursor.readIndex(layout.stringIndexSize), layout.strings.size);
3295
+ const owner = ownerRow === undefined ? 0 : readManagedValue(() => ownerRow(row), issues) ?? 0;
3296
+ const declared = ranges[owner - 1];
3297
+ const token = metadataToken(6, row);
3298
+ core.set(token, {
3299
+ token,
3300
+ name,
3301
+ declaringType: declared?.fullName ?? null
3302
+ });
3303
+ if (!isSelected(selected, declared)) return;
3304
+ const sig = readMetadataBlob(bytes, layout, cursor.readIndex(layout.blobIndexSize), layout.blob.size);
3305
+ cursor.readIndex(layout.tableIndexSize(8));
3306
+ methods.push({
3307
+ token,
3308
+ row_offset: cursor.start,
3309
+ declaring_type_token: declared?.token ?? null,
3310
+ declaring_type: declared?.fullName ?? null,
3311
+ name,
3312
+ rva,
3313
+ impl_flags: implFlags,
3314
+ flags,
3315
+ signature: budgetedSignature(sig, layout),
3316
+ body: methodBody(bytes, pe, rva, {
3317
+ implFlags,
3318
+ flags
3319
+ }, managedDecodeBudget(layout))
3320
+ });
3321
+ }, issues);
3322
+ }
3323
+ return {
3324
+ methods,
3325
+ core,
3326
+ issues
3327
+ };
3328
+ };
3329
+ targetKind = (token) => token.startsWith("0x06") ? "method-def" : token.startsWith("0x0a") ? "member-ref" : token.startsWith("0x2b") ? "method-spec" : "unknown";
3330
+ edges = (methods, methodCore, fieldCore, refCore, budget) => {
3331
+ const callEdges = [];
3332
+ const fieldAccesses = [];
3333
+ for (const method of methods) {
3334
+ const derives = method.body.anchors.some((anchor) => anchor.opcode !== "ldtoken" && anchor.operand !== null && (anchor.operand_kind === "method" || anchor.operand_kind === "field"));
3335
+ if (derives) budget.admitTransient(callerNameBytes(method), null);
3336
+ const caller = derives ? callerName(method) : method.name;
3337
+ for (const anchor of method.body.anchors) {
3338
+ if (anchor.opcode === "ldtoken") continue;
3339
+ if (anchor.operand_kind === "method" && anchor.operand !== null) {
3340
+ const named = methodCore.get(anchor.operand)?.name ?? refCore.get(anchor.operand)?.name ?? null;
3341
+ callEdges.push(admitManagedProjection({
3342
+ caller_token: method.token,
3343
+ caller,
3344
+ opcode: anchor.opcode,
3345
+ target_token: anchor.operand,
3346
+ target_kind: targetKind(anchor.operand),
3347
+ target_name: named
3348
+ }, budget));
3349
+ }
3350
+ if (anchor.operand_kind === "field" && anchor.operand !== null) {
3351
+ fieldAccesses.push(admitManagedProjection({
3352
+ method_token: method.token,
3353
+ method: caller,
3354
+ opcode: anchor.opcode,
3355
+ field_token: anchor.operand,
3356
+ field_name: fieldCore.get(anchor.operand)?.name ?? null
3357
+ }, budget));
3358
+ }
3359
+ }
3360
+ if (derives) budget.releaseTransient();
3361
+ }
3362
+ return {
3363
+ callEdges,
3364
+ fieldAccesses
3365
+ };
3366
+ };
3367
+ callerName = (method) => method.declaring_type === null ? method.name : `${method.declaring_type}.${method.name}`;
3368
+ callerNameBytes = (method) => method.declaring_type === null ? managedJsonStringBytes(method.name) : managedJsonStringBytes(method.declaring_type) + managedJsonStringBytes(method.name) - 1;
3369
+ budgetedSignature = (bytes, layout) => {
3370
+ const budget = managedDecodeBudget(layout);
3371
+ budget.admitTransient(bytes.length * 256, layout.blob.offset);
3372
+ try {
3373
+ return admitManagedProjection(signature(bytes, budget.digest(bytes, "sha256")), budget);
3374
+ } finally {
3375
+ budget.releaseTransient();
3376
+ }
3377
+ };
3378
+ })))();
3379
+ }
3380
+
3381
+ //#endregion
3382
+ //#region dist/dotnet/ManagedMemberInspector.js
3383
+ var unavailable, readMemberInventory, selectTypes, inspectManagedMembersBytes;
3384
+ function init_ManagedMemberInspector() {
3385
+ return (init_ManagedMemberInspector = __esmMin((() => {
3386
+ init_ManagedDecodeBudget();
3387
+ init_managedArtifact();
3388
+ init_ManagedPeReader();
3389
+ init_ManagedMetadataInventory();
3390
+ init_ManagedMetadataLayout();
3391
+ init_ManagedReaderFailure();
3392
+ init_ManagedMemberInspectorCore();
3393
+ init_ManagedMemberRows();
3394
+ unavailable = (target, bytes, issue, typeNames) => managedMemberInspectionSchema.parse(admitManagedProjection({
3395
+ artifact: {
3396
+ path: target.path,
3397
+ sha256: target.sha256,
3398
+ byte_length: bytes.length,
3399
+ format: "pe"
3400
+ },
3401
+ module: null,
3402
+ metadata: {
3403
+ status: issue === null ? "absent" : issue.code === "resource-limit" ? "partial" : "malformed",
3404
+ version: null,
3405
+ table_row_counts: {}
3406
+ },
3407
+ identity_scope: {
3408
+ token_identity: "build-local",
3409
+ requires_artifact_sha256: target.sha256,
3410
+ requires_mvid: null
3411
+ },
3412
+ types: [],
3413
+ exported_types: null,
3414
+ fields: [],
3415
+ methods: [],
3416
+ member_refs: [],
3417
+ call_edges: [],
3418
+ field_accesses: [],
3419
+ selection: typeNames === undefined ? null : {
3420
+ type_names: [...typeNames],
3421
+ unmatched_type_names: []
3422
+ },
3423
+ coverage: {
3424
+ state: "unavailable",
3425
+ issues: issue === null ? [] : [issue]
3426
+ },
3427
+ 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."]
3428
+ }));
3429
+ readMemberInventory = (bytes, pe, issues) => {
3430
+ const cli = pe.cli;
3431
+ if (cli === null) throw new TypeError("Managed inventory requires CLI metadata");
3432
+ const rootOffset = pe.rvaToOffset(cli.metadata.rva, cli.metadata.size, "cli.metadata");
3433
+ const layout = readManagedMetadataLayout(bytes, rootOffset, cli.metadata.size);
3434
+ const inventory = readManagedMetadataInventory(bytes, layout, readManagedResourceDirectory(pe, issues));
3435
+ return {
3436
+ layout,
3437
+ inventory
3438
+ };
3439
+ };
3440
+ selectTypes = (ranges, typeNames) => {
3441
+ if (typeNames === undefined) return {
3442
+ tokens: null,
3443
+ selection: null,
3444
+ unreadableNames: 0
3445
+ };
3446
+ const requested = new Set(typeNames);
3447
+ const tokens = new Set();
3448
+ const matched = new Set();
3449
+ for (const range of ranges) {
3450
+ if (range.fullName === null || !requested.has(range.fullName)) continue;
3451
+ tokens.add(range.token);
3452
+ matched.add(range.fullName);
3453
+ }
3454
+ return {
3455
+ tokens,
3456
+ unreadableNames: ranges.filter(({ fullName }) => fullName === null).length,
3457
+ selection: {
3458
+ type_names: [...typeNames],
3459
+ unmatched_type_names: typeNames.filter((name) => !matched.has(name))
3460
+ }
3461
+ };
3462
+ };
3463
+ inspectManagedMembersBytes = (bytes, target, { typeNames } = {}) => {
3464
+ const pe = readManagedPeLayout(bytes);
3465
+ if (pe.cli === null) return unavailable(target, bytes, pe.cliIssue, typeNames);
3466
+ const issues = [];
3467
+ try {
3468
+ const { layout, inventory } = readMemberInventory(bytes, pe, issues);
3469
+ issues.push(...inventory.issues);
3470
+ const ranges = typeRanges(bytes, layout, issues);
3471
+ const { tokens: selected, selection, unreadableNames } = selectTypes(ranges, typeNames);
3472
+ const parsedTypes = parseTypes(bytes, layout, ranges);
3473
+ issues.push(...parsedTypes.issues);
3474
+ const exportedTypes = parseExportedTypes(bytes, layout);
3475
+ issues.push(...exportedTypes.issues);
3476
+ const fields = parseFields(bytes, layout, ranges, selected);
3477
+ const memberRefs = parseMemberRefs(bytes, layout);
3478
+ issues.push(...memberRefs.issues);
3479
+ const methods = parseMethods({
3480
+ bytes,
3481
+ layout,
3482
+ pe,
3483
+ ranges,
3484
+ selected
3485
+ });
3486
+ issues.push(...fields.issues, ...methods.issues);
3487
+ const coverageIssues = uniqueManagedParseIssues(issues);
3488
+ const incompleteMembers = [
3489
+ ...fields.fields,
3490
+ ...memberRefs.refs,
3491
+ ...methods.methods
3492
+ ].some((member) => member.signature.parse_status !== "decoded") || methods.methods.some((method) => method.body.status === "partial" || method.body.status === "malformed");
3493
+ const related = edges(methods.methods, methods.core, fields.core, memberRefs.core, managedDecodeBudget(layout));
3494
+ return managedMemberInspectionSchema.parse(admitManagedProjection({
3495
+ artifact: {
3496
+ path: target.path,
3497
+ sha256: target.sha256,
3498
+ byte_length: bytes.length,
3499
+ format: "pe"
3500
+ },
3501
+ module: inventory.module,
3502
+ metadata: {
3503
+ status: issues.length === 0 ? "complete" : "partial",
3504
+ version: layout.version,
3505
+ table_row_counts: managedTableRowCounts(layout)
3506
+ },
3507
+ identity_scope: {
3508
+ token_identity: "build-local",
3509
+ requires_artifact_sha256: target.sha256,
3510
+ requires_mvid: inventory.module?.mvid ?? null
3511
+ },
3512
+ types: selected === null ? parsedTypes.types : parsedTypes.types.filter((type) => selected.has(type.token)),
3513
+ exported_types: exportedTypes.exportedTypes,
3514
+ fields: fields.fields,
3515
+ methods: methods.methods,
3516
+ member_refs: memberRefs.refs,
3517
+ call_edges: related.callEdges,
3518
+ field_accesses: related.fieldAccesses,
3519
+ selection,
3520
+ coverage: {
3521
+ state: issues.length === 0 && !incompleteMembers ? "complete" : "partial",
3522
+ issues: coverageIssues
3523
+ },
3524
+ limitations: [
3525
+ "Metadata tokens are build-local coordinates and are only meaningful with the reported artifact SHA-256 and MVID.",
3526
+ "CIL instruction anchors are decoded from file-backed method bodies only; no target assembly is loaded or executed.",
3527
+ "Exported types are reported from ExportedType rows as declared; forwarded types are not resolved in their implementing assemblies.",
3528
+ "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.",
3529
+ ...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."],
3530
+ ...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.`]
3531
+ ]
3532
+ }, managedDecodeBudget(layout)));
3533
+ } catch (cause) {
3534
+ if (cause instanceof ManagedReaderFailure) return unavailable(target, bytes, cause.issue, typeNames);
3535
+ throw cause;
3536
+ }
3537
+ };
3538
+ })))();
3539
+ }
3540
+
3541
+ //#endregion
3542
+ //#region dist/dotnet/ManagedSnapshot.js
3543
+ var MAX_MANAGED_SNAPSHOT_BYTES, managedSnapshotCapacityError, readManagedSnapshot, hashManagedSource, readManagedFile, normalizeManagedReadFailure, managedCleanupError, normalizeReadFailure;
3544
+ function init_ManagedSnapshot() {
3545
+ return (init_ManagedSnapshot = __esmMin((() => {
3546
+ init_InvestigationProviders();
3547
+ init_BinaryTargetResolver();
3548
+ init_RegularFileRead();
3549
+ init_ArtifactReader();
3550
+ init_analysisErrorCleanup();
3551
+ init_analysisErrorBase();
3552
+ init_analysisErrorCore();
3553
+ init_evidenceErrors();
3554
+ init_providerCleanupError();
3555
+ init_RegularFile();
3556
+ init_BoundedFileBytes();
3557
+ MAX_MANAGED_SNAPSHOT_BYTES = 128 * 1024 * 1024;
3558
+ 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 });
3559
+ readManagedSnapshot = async (path, operation, options = {}) => {
3560
+ return readManagedFile(path, operation, async (handle, metadata) => {
3561
+ const signal = options.signal;
3562
+ if (metadata.size > 134217728) throw managedSnapshotCapacityError(operation);
3563
+ const bytes = await readBoundedFileBytes(handle, MAX_MANAGED_SNAPSHOT_BYTES, signal);
3564
+ if (bytes === undefined) throw managedSnapshotCapacityError(operation);
3565
+ signal?.throwIfAborted();
3566
+ return {
3567
+ byteLength: bytes.length,
3568
+ sha256: createHash("sha256").update(bytes).digest("hex"),
3569
+ bytes
3570
+ };
3571
+ }, options);
3572
+ };
3573
+ hashManagedSource = async (path, operation, options = {}) => readManagedFile(path, operation, async (handle, metadata) => {
3574
+ const signal = options.signal;
3575
+ if (metadata.size > 134217728) throw managedSnapshotCapacityError(operation);
3576
+ const digest = createHash("sha256");
3577
+ let byteLength = 0;
3578
+ const stream = handle.createReadStream({
3579
+ autoClose: false,
3580
+ ...signal === undefined ? {} : { signal }
3581
+ });
3582
+ for await (const chunk of stream) {
3583
+ signal?.throwIfAborted();
3584
+ if (!Buffer.isBuffer(chunk)) throw new TypeError("Managed source stream returned non-buffer data");
3585
+ if (chunk.length > 134217728 - byteLength) throw managedSnapshotCapacityError(operation);
3586
+ byteLength += chunk.length;
3587
+ digest.update(chunk);
3588
+ }
3589
+ return {
3590
+ byteLength,
3591
+ sha256: digest.digest("hex")
3592
+ };
3593
+ }, options);
3594
+ readManagedFile = (path, operation, read, options) => withRegularFile(path, read, options).catch((cause) => {
3595
+ throw normalizeManagedReadFailure(cause, path, operation, options.signal);
3596
+ });
3597
+ normalizeManagedReadFailure = (cause, fallbackPath, operation, signal) => {
3598
+ const cleanupError = managedCleanupError(cause, fallbackPath, operation, signal);
3599
+ if (cleanupError !== undefined) return cleanupError;
3600
+ return normalizeReadFailure(cause, fallbackPath, operation, signal);
3601
+ };
3602
+ managedCleanupError = (cause, fallbackPath, operation, signal) => {
3603
+ if (cause instanceof RegularFileCleanupFailure) {
3604
+ const cleanup = new ProviderCleanupError(MANAGED_STATIC_PROVIDER.id, [cause.path], { reason: "A managed input file handle could not be closed" }, {
3605
+ cause,
3606
+ operation
3607
+ });
3608
+ const failure = cause.outcome.kind === "failed" ? normalizeReadFailure(cause.outcome.cause, cause.path, operation, signal) : undefined;
3609
+ return failure instanceof AnalysisError ? analysisErrorWithCleanupFailure(failure, cleanup, operation) : cleanup;
3610
+ }
3611
+ 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 }, {
3612
+ cause,
3613
+ operation
3614
+ });
3615
+ return undefined;
3616
+ };
3617
+ 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);
3618
+ })))();
3619
+ }
3620
+
3621
+ //#endregion
3622
+ export { ManagedReaderFailure, admitManagedProjection, hashManagedSource, init_ManagedDecodeBudget, init_ManagedMemberInspector, init_ManagedMetadataHeaps, init_ManagedMetadataInventory, init_ManagedMetadataLayout, init_ManagedPeReader, init_ManagedReaderFailure, init_ManagedSnapshot, inspectManagedMembersBytes, managedCleanupError, managedDecodeBudget, managedTableRowCounts, metadataCodedToken, metadataCodedTokenInvalidReason, metadataRowCursor, metadataToken, readManagedMetadataInventory, readManagedMetadataLayout, readManagedPeLayout, readManagedResourceDirectory, readManagedSnapshot, readManagedValue, readMetadataString };