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.
- package/DISCLAIMER.md +136 -0
- package/LICENSE +22 -0
- package/README.md +289 -2
- package/RESPONSIBLE-USE.md +22 -0
- package/THIRD_PARTY_NOTICES.md +130 -0
- package/bin/reverseport.mjs +136 -0
- package/bridge/android/ReaJadxBridge.java +270 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +3858 -0
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraExtensions.java +113 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareCom.java +32 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +36 -0
- package/bridge/hopper_bridge.py +1162 -0
- package/bridge/mitmproxy/capture.py +208 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +171 -0
- package/bridge/native/rea_lldb_tracer.py +839 -0
- package/bridge/process/ProcessRunTokenReader.swift +339 -0
- package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
- package/bridge/pwndbg/core_context.py +101 -0
- package/bridge/pwndbg/launch.py +39 -0
- package/bridge/pwndbg/launch_impl.py +34 -0
- package/bridge/pwntools/decoder_runtime.py +59 -0
- package/bridge/pwntools/layout.py +39 -0
- package/bridge/pwntools/layout_impl.py +314 -0
- package/bridge/pwntools/recorded_crash.py +39 -0
- package/bridge/pwntools/recorded_crash_impl.py +147 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +191 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1227 -0
- package/dist/adb/AdbShellOutput.js +267 -0
- package/dist/android/AndroidTargetSnapshot.js +118 -0
- package/dist/android/JadxAnalysis.js +201 -0
- package/dist/android/JadxConfiguration.js +320 -0
- package/dist/android/JadxMcpTransport.js +188 -0
- package/dist/android/JadxProtocol.js +115 -0
- package/dist/android/JadxProvider.js +337 -0
- package/dist/android/JadxRelease.js +27 -0
- package/dist/android/JadxSession.js +172 -0
- package/dist/apktool/ApktoolConfiguration.js +120 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +522 -0
- package/dist/application/AnalysisContextQueries.js +128 -0
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AnalysisProvider.js +27 -0
- package/dist/application/AppBundleExecutable.js +192 -0
- package/dist/application/BinaryTargetResolver.js +356 -0
- package/dist/application/BrowserEvidence.js +127 -0
- package/dist/application/BrowserObservationPort.js +1 -0
- package/dist/application/BrowserObservationService.js +86 -0
- package/dist/application/BrowserScenarioCapturePort.js +1 -0
- package/dist/application/BrowserScenarioCaptureService.js +17 -0
- package/dist/application/BrowserScenarioEvidence.js +28 -0
- package/dist/application/CallPathTracing.js +182 -0
- package/dist/application/CapabilityClientRequirements.js +17 -0
- package/dist/application/CapabilityInventory.js +525 -0
- package/dist/application/ClientConfigPath.js +35 -0
- package/dist/application/ClientConfigurationDocument.js +1196 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +39 -0
- package/dist/application/ClientRegistrationIdentity.js +80 -0
- package/dist/application/ClientRegistrationStatus.js +233 -0
- package/dist/application/DirectAnalysis.js +371 -0
- package/dist/application/DirectAnalysisCleanup.js +71 -0
- package/dist/application/DirectAnalysisDependencies.js +1 -0
- package/dist/application/DirectAnalysisStatus.js +22 -0
- package/dist/application/Doctor.js +349 -0
- package/dist/application/DoctorDiagnostics.js +169 -0
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +113 -0
- package/dist/application/DshCordisPatch.js +342 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +88 -0
- package/dist/application/EnhancedToolTypes.js +4 -0
- package/dist/application/EnhancedTools.js +428 -0
- package/dist/application/EvidenceBundleCommands.js +70 -0
- package/dist/application/EvidenceBundleFiles.js +79 -0
- package/dist/application/EvidenceInputResolver.js +30 -0
- package/dist/application/FunctionAnalysisEvidence.js +34 -0
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +44 -0
- package/dist/application/InvestigationProviders.js +130 -0
- package/dist/application/JsonFiles.js +225 -0
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +232 -0
- package/dist/application/MacHopper.js +235 -0
- package/dist/application/MipsElfMetadata.js +175 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ProgressReporter.js +30 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/RealHopperAssertions.js +135 -0
- package/dist/application/ReconstructionCoverageService.js +22 -0
- package/dist/application/ReconstructionObligationAuthority.js +72 -0
- package/dist/application/ReconstructionObligationCandidates.js +286 -0
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +47 -0
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +238 -0
- package/dist/application/ReconstructionObligationLedgerProjection.js +15 -0
- package/dist/application/ReconstructionObligationLedgerService.js +54 -0
- package/dist/application/ReconstructionObligationOriginalCases.js +34 -0
- package/dist/application/ReconstructionObligationPolicies.js +132 -0
- package/dist/application/ReferenceSourceImport.js +200 -0
- package/dist/application/ReferenceSourceImportEntries.js +151 -0
- package/dist/application/ReferenceSourceImportPolicy.js +125 -0
- package/dist/application/ReferenceSourceImportTypes.js +47 -0
- package/dist/application/ReferenceSourceVcsAdapter.js +180 -0
- package/dist/application/RegularFileRead.js +120 -0
- package/dist/application/Setup.js +408 -0
- package/dist/application/SetupClientConfiguration.js +314 -0
- package/dist/application/SetupClients.js +44 -0
- package/dist/application/SetupHost.js +203 -0
- package/dist/application/SetupInstallFailure.js +77 -0
- package/dist/application/SetupPlan.js +210 -0
- package/dist/application/SetupRegistrationEnvironment.js +5 -0
- package/dist/application/SetupSkill.js +248 -0
- package/dist/application/SetupTypes.js +17 -0
- package/dist/application/SupportedClients.js +469 -0
- package/dist/application/TypeScriptEmittedSourceCandidates.js +23 -0
- package/dist/application/Uninstall.js +452 -0
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +137 -0
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +111 -0
- package/dist/application/UpdateRuntime.js +264 -0
- package/dist/application/Utf8JsonInput.js +71 -0
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModulePorts.js +1 -0
- package/dist/application/WebModuleTraceService.js +214 -0
- package/dist/application/WebNetworkCapturePort.js +1 -0
- package/dist/application/WebNetworkCaptureService.js +134 -0
- package/dist/application/WebRuntimePort.js +1 -0
- package/dist/application/WebRuntimeService.js +75 -0
- package/dist/application/WebScriptArtifactPort.js +1 -0
- package/dist/application/WebScriptExportService.js +214 -0
- package/dist/application/WebSourceLocationPorts.js +1 -0
- package/dist/application/WebSourceLocationService.js +177 -0
- package/dist/application/WindowsCapabilities.js +87 -0
- package/dist/application/WorkflowEvidence.js +105 -0
- package/dist/application/XrefsAddressResolution.js +45 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +133 -0
- package/dist/application/android/AndroidAnalysisPort.js +1 -0
- package/dist/application/android/AndroidAnalysisService.js +37 -0
- package/dist/application/android/AndroidApplicationService.js +17 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/apple/AppleApplicationService.js +17 -0
- package/dist/application/artifacts/ArtifactExtractionDestination.js +5 -0
- package/dist/application/binary/AbortablePromise.js +28 -0
- package/dist/application/binary/AnalysisClientCleanup.js +15 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +77 -0
- package/dist/application/binary/AnalysisProviderRegistry.js +235 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +232 -0
- package/dist/application/binary/AnalysisSnapshotFiles.js +96 -0
- package/dist/application/binary/BinarySession.js +605 -0
- package/dist/application/binary/BinarySessionComposition.js +9 -0
- package/dist/application/binary/BinarySessionExecution.js +66 -0
- package/dist/application/binary/BinarySessionOpen.js +66 -0
- package/dist/application/binary/BinarySessionPort.js +1 -0
- package/dist/application/binary/BinarySessionRecords.js +216 -0
- package/dist/application/binary/BinarySessionStatus.js +219 -0
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +103 -0
- package/dist/application/binary/LazyAnalysisProvider.js +105 -0
- package/dist/application/binary/SessionProviderRouter.js +118 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +60 -0
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +63 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +67 -0
- package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +38 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +77 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/homebrew.js +67 -0
- package/dist/application/investigation/EvidenceLedger.js +338 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecordPort.js +1 -0
- package/dist/application/investigation/InvestigationRecords.js +65 -0
- package/dist/application/investigation/UnknownEvidence.js +37 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +29 -0
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/javascript/ElectronActiveObservationService.js +51 -0
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +118 -0
- package/dist/application/javascript/ElectronBoundaryGraph.js +11 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +134 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +63 -0
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +261 -0
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +102 -0
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +224 -0
- package/dist/application/javascript/ElectronEvidence.js +37 -0
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/javascript/ElectronObservationService.js +26 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +49 -0
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +173 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +170 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +67 -0
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +431 -0
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +89 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +193 -0
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +229 -0
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +194 -0
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +160 -0
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +85 -0
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +349 -0
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +424 -0
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +836 -0
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +245 -0
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +12 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +40 -0
- package/dist/application/javascript/JavaScriptModuleRelationships.js +304 -0
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +77 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +36 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +28 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationEvidence.js +24 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +52 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +163 -0
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +527 -0
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +165 -0
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +156 -0
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +216 -0
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +61 -0
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +86 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +25 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +183 -0
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +112 -0
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +58 -0
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +136 -0
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +41 -0
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +55 -0
- package/dist/application/managed/ManagedMemberComparisonService.js +125 -0
- package/dist/application/managed/ManagedNativeVerificationService.js +40 -0
- package/dist/application/managed/ManagedReconstructionService.js +59 -0
- package/dist/application/native/NativeApiInspection.js +77 -0
- package/dist/application/native/NativeCallRoutes.js +73 -0
- package/dist/application/native/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/native/NativeUiActionTrace.js +427 -0
- package/dist/application/native/NativeValueTrace.js +340 -0
- package/dist/application/process/ProcessCli.js +190 -0
- package/dist/application/process/ProcessEvidence.js +30 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +72 -0
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactHash.js +29 -0
- package/dist/artifacts/ArtifactPaths.js +167 -0
- package/dist/artifacts/ArtifactProvider.js +280 -0
- package/dist/artifacts/ArtifactProviderMetadata.js +34 -0
- package/dist/artifacts/ArtifactReader.js +77 -0
- package/dist/artifacts/ArtifactResourceScope.js +103 -0
- package/dist/artifacts/AsarArtifactReader.js +518 -0
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +292 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +342 -0
- package/dist/artifacts/NativeDmgArtifactReader.js +508 -0
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +394 -0
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/StreamBytes.js +10 -0
- package/dist/artifacts/ZipArtifactReader.js +222 -0
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +190 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +269 -0
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +500 -0
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +233 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +163 -0
- package/dist/artifacts/apple/MachoLoadCommandReader.js +393 -0
- package/dist/artifacts/apple/NibArchive.js +338 -0
- package/dist/artifacts/apple/NibViewHierarchy.js +157 -0
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/artifacts/extraction/ArtifactExtraction.js +253 -0
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +343 -0
- package/dist/artifacts/inventory/ArtifactInventory.js +16 -0
- package/dist/artifacts/inventory/classify.js +94 -0
- package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
- package/dist/artifacts/inventory/reader.js +40 -0
- package/dist/artifacts/inventory/scanCanonical.js +213 -0
- package/dist/artifacts/inventory/scanReader.js +169 -0
- package/dist/artifacts/inventory/types.js +3 -0
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +317 -0
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +68 -0
- package/dist/browser/BrowserProcessStartup.js +89 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +127 -0
- package/dist/browser/BrowserScenarioSecrets.js +137 -0
- package/dist/browser/BrowserScenarioSessionPort.js +1 -0
- package/dist/browser/CdpAuthorizedMainFrame.js +16 -0
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +276 -0
- package/dist/browser/CdpCaptureCompleteness.js +92 -0
- package/dist/browser/CdpCaptureDocuments.js +375 -0
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +55 -0
- package/dist/browser/CdpCaptureEventHandlers.js +463 -0
- package/dist/browser/CdpCaptureEventHelpers.js +84 -0
- package/dist/browser/CdpCaptureEventState.js +1 -0
- package/dist/browser/CdpCaptureEventTypes.js +5 -0
- package/dist/browser/CdpCaptureEvents.js +199 -0
- package/dist/browser/CdpCaptureStorage.js +86 -0
- package/dist/browser/CdpCaptureStorageFingerprints.js +320 -0
- package/dist/browser/CdpCaptureValues.js +91 -0
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +303 -0
- package/dist/browser/CdpElectronInspection.js +253 -0
- package/dist/browser/CdpElectronProvider.js +115 -0
- package/dist/browser/CdpElectronScriptEvents.js +55 -0
- package/dist/browser/CdpElectronScripts.js +65 -0
- package/dist/browser/CdpElectronWorkers.js +57 -0
- package/dist/browser/CdpEndpoint.js +217 -0
- package/dist/browser/CdpObservationSession.js +332 -0
- package/dist/browser/CdpOptionalCommand.js +14 -0
- package/dist/browser/CdpPageCapture.js +278 -0
- package/dist/browser/CdpPageCaptureScripts.js +79 -0
- package/dist/browser/CdpPageCaptureWorkers.js +46 -0
- package/dist/browser/CdpSafeMetadata.js +284 -0
- package/dist/browser/CdpScreenshot.js +110 -0
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +65 -0
- package/dist/browser/CdpWebMcpDiscovery.js +361 -0
- package/dist/browser/ElectronFileScope.js +135 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +301 -0
- package/dist/browser/PlaywrightElectronActiveActions.js +257 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +293 -0
- package/dist/browser/PlaywrightExecutionBoundary.js +53 -0
- package/dist/browser/PlaywrightScenarioActions.js +58 -0
- package/dist/browser/PlaywrightScenarioArtifacts.js +162 -0
- package/dist/browser/PlaywrightScenarioBrowser.js +412 -0
- package/dist/browser/PlaywrightScenarioEvents.js +253 -0
- package/dist/browser/PlaywrightScenarioSession.js +279 -0
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +380 -0
- package/dist/browser/WebSourceMapFetcher.js +718 -0
- package/dist/browser/assets/LocalWebScriptArtifacts.js +89 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +140 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +73 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +78 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +41 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +45 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/history/CaptureFailures.js +153 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +68 -0
- package/dist/browser/history/CaptureRelease.js +23 -0
- package/dist/browser/history/HarCapture.js +179 -0
- package/dist/browser/history/HarCaptureAdapter.js +23 -0
- package/dist/browser/history/HarCaptureProcess.js +49 -0
- package/dist/browser/history/HarJson.js +92 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +198 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +46 -0
- package/dist/browser/modules/NativeModuleResolver.js +277 -0
- package/dist/browser/modules/WebModuleArtifacts.js +41 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +65 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/analysisViewCommands.js +74 -0
- package/dist/cli/androidCommands.js +91 -0
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/applicationCommands.js +173 -0
- package/dist/cli/artifactCommands.js +160 -0
- package/dist/cli/binaryDiagnosticsCommands.js +57 -0
- package/dist/cli/browserAdvancedCommands.js +189 -0
- package/dist/cli/browserCommands.js +125 -0
- package/dist/cli/commandCancellation.js +24 -0
- package/dist/cli/coreAnalysisCommands.js +7 -0
- package/dist/cli/coreBinaryCommands.js +283 -0
- package/dist/cli/coreNativeCommands.js +269 -0
- package/dist/cli/electronCommands.js +150 -0
- package/dist/cli/evmCommands.js +33 -0
- package/dist/cli/firmwareCommands.js +61 -0
- package/dist/cli/goCommands.js +21 -0
- package/dist/cli/interactiveSetup.js +236 -0
- package/dist/cli/javascriptApplicationAnalysis.js +34 -0
- package/dist/cli/javascriptRecoveryCommands.js +59 -0
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +46 -0
- package/dist/cli/managedCommands.js +129 -0
- package/dist/cli/managedProjectGraphCommand.js +24 -0
- package/dist/cli/nativeCallCommands.js +33 -0
- package/dist/cli/omittableDefaults.js +50 -0
- package/dist/cli/options.js +33 -0
- package/dist/cli/processCommands.js +25 -0
- package/dist/cli/referenceSourceImportStatus.js +22 -0
- package/dist/cli/setupCommands.js +189 -0
- package/dist/cli/streamedJsonOutput.js +134 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/utilityCommands.js +226 -0
- package/dist/cli/wasmCommands.js +44 -0
- package/dist/cli/webModuleCommands.js +60 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +50 -0
- package/dist/cli/webSourceLocationCommands.js +54 -0
- package/dist/cli-runtime/AnalysisProvider-CeyX2u-b.js +25 -0
- package/dist/cli-runtime/AnalysisSnapshotFiles-BuK_ymw5.js +523 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-CZqLEfbb.js +108 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinaryTargetResolver-CKRfFhLj.js +965 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-D0ZqgTCv.js +1522 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DGpwJ4ry.js +422 -0
- package/dist/cli-runtime/DirectAnalysis-DW3MvxW0.js +500 -0
- package/dist/cli-runtime/Doctor-CzwYS9nB.js +862 -0
- package/dist/cli-runtime/ElectronFileScope-C1hUEp36.js +1419 -0
- package/dist/cli-runtime/ExecFileOutput-Czbj-HpV.js +106 -0
- package/dist/cli-runtime/IdaConfiguration-rEjpuRQ1.js +854 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-DT74BY9z.js +225 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-Dt4Og45O.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-D-QCy-4c.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-CODAjVru.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-CCtwSg8r.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-CJeBSMPx.js +83 -0
- package/dist/cli-runtime/JsonFiles-Ce_O5NcH.js +708 -0
- package/dist/cli-runtime/ManagedSnapshot-DthWfmy9.js +3622 -0
- package/dist/cli-runtime/OwnedCommand-CnK8-h3N.js +106 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-KNg6qLwo.js +237 -0
- package/dist/cli-runtime/ProcessOwnership-AOJaszxt.js +1310 -0
- package/dist/cli-runtime/ProviderDeadline-BSbNOmuW.js +89 -0
- package/dist/cli-runtime/RegularFile-CL6meBxi.js +114 -0
- package/dist/cli-runtime/RegularFileRead-BMh5FMXd.js +115 -0
- package/dist/cli-runtime/SafeOutputTree-D8z2Zrnu.js +512 -0
- package/dist/cli-runtime/SetupHost-CzzRF89z.js +842 -0
- package/dist/cli-runtime/SupportedClients-BrZ2qZVg.js +671 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-DF55X_N2.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/WindowsBatchCommand-5gT-d7O4.js +45 -0
- package/dist/cli-runtime/ZipArtifactReader-Db65WuM_.js +380 -0
- package/dist/cli-runtime/analysisErrorCleanup-DaUQNiQd.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DZrKL8kS.js +331 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-OZFIFjZr.js +93 -0
- package/dist/cli-runtime/application__EnhancedTools-C__HAdqG.js +1728 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-fWSgvV74.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DlNt-4TY.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CEpbUv-7.js +813 -0
- package/dist/cli-runtime/application__Setup-BExVGpqG.js +540 -0
- package/dist/cli-runtime/application__Uninstall-BVgWDCPN.js +349 -0
- package/dist/cli-runtime/application__UpdateRuntime-Dj6UIhHQ.js +358 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CyynwW6Z.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-BNPcWeL8.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-W66PwMvx.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-D8VbeCxz.js +85 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-FmXFG4f2.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-D-dVrmAY.js +10467 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-Cb0jmh8J.js +2284 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-D55gO7Gq.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DivM-Ym-.js +298 -0
- package/dist/cli-runtime/artifactOperationError-Wd0PRLIZ.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-B_4h3RAw.js +2091 -0
- package/dist/cli-runtime/binary-9Gt3vJ1P.js +12990 -0
- package/dist/cli-runtime/browserObservationError-D73SM55P.js +40 -0
- package/dist/cli-runtime/browserScenario-CTNr5ISp.js +5543 -0
- package/dist/cli-runtime/catalogIdentity-EYVhBUYJ.js +339 -0
- package/dist/cli-runtime/cli.js +28528 -0
- package/dist/cli-runtime/cliOutput-CoDmWVu5.js +98 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DNr3A_BM.js +2318 -0
- package/dist/cli-runtime/composition__electronObservation-DNw1f38M.js +550 -0
- package/dist/cli-runtime/composition__electronScenario-Cu7PX270.js +586 -0
- package/dist/cli-runtime/configurationErrors-ByuF6gMR.js +49 -0
- package/dist/cli-runtime/doctorRuntime-D5y43lEp.js +162 -0
- package/dist/cli-runtime/dosMz-pwwUuxyC.js +65 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-BSnWggeb.js +5 -0
- package/dist/cli-runtime/enhancedInputs-K8C_o3b4.js +56 -0
- package/dist/cli-runtime/javascriptApplicationGraph-DUWeec4O.js +940 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-BVbnAdOd.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BzSil7ft.js +1153 -0
- package/dist/cli-runtime/javascriptRuntimeObservation-9xTNoKY2.js +1215 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-CneBtMvx.js +1437 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D1Mrb_Y0.js +245 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BHItrqIA.js +126 -0
- package/dist/cli-runtime/lipo-BCA3wVyN.js +365 -0
- package/dist/cli-runtime/logger-CKq3JfbZ.js +34 -0
- package/dist/cli-runtime/machoContainer-DxxkB2b0.js +52 -0
- package/dist/cli-runtime/managedApplicationGraph-BqOr01E6.js +1116 -0
- package/dist/cli-runtime/managedToolContracts-BSy4TRaK.js +80 -0
- package/dist/cli-runtime/mcpDoctor.js +342 -0
- package/dist/cli-runtime/mcpStartupPolicy-Bb7TMLzn.js +18 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-BIG9iCcj.js +4415 -0
- package/dist/cli-runtime/plistValue-KM-SqiXe.js +47 -0
- package/dist/cli-runtime/propertyListKeys-DejfMb-U.js +86 -0
- package/dist/cli-runtime/providerAdapterError-SRSE_gzN.js +27 -0
- package/dist/cli-runtime/providerCleanupError-Do66qCEp.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerOperationHealth-DSTcYPJe.js +577 -0
- package/dist/cli-runtime/providerStartupTimeout-Be8B1Ro8.js +16 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-dvp6PEnZ.js +15839 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-Bi6si9nb.js +2773 -0
- package/dist/cli-runtime/snapshotEnvironment-B5Ai0mha.js +678 -0
- package/dist/cli-runtime/streamedJsonOutput-VYlQZsM7.js +654 -0
- package/dist/cli-runtime/streamedJsonOutput.js +5 -0
- package/dist/cli-runtime/toolContracts-C7pvYKxF.js +4516 -0
- package/dist/cli-runtime/toolEffects-DW31yTSx.js +7004 -0
- package/dist/cli-runtime/workflowInputError-26EGiDpx.js +26 -0
- package/dist/cli.js +91 -0
- package/dist/cliBrowserContext.js +11 -0
- package/dist/cliBrowserScenarioCommands.js +73 -0
- package/dist/cliCommandNames.js +205 -0
- package/dist/cliEvidenceCommands.js +51 -0
- package/dist/cliJavaScriptRuntimeCommands.js +69 -0
- package/dist/cliJsonInput.js +129 -0
- package/dist/cliLogging.js +48 -0
- package/dist/cliObservationOptions.js +73 -0
- package/dist/cliOutput.js +97 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/android.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +35 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/binaryDiagnostics.js +12 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +4 -0
- package/dist/composition/directAnalysis.js +44 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/composition/optionalObservationProviders.js +54 -0
- package/dist/composition/wasm.js +4 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/environment.js +73 -0
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +12 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/mcpResponseBudget.js +30 -0
- package/dist/config/parseConfig.js +93 -0
- package/dist/config/parsers.js +30 -0
- package/dist/config/providerStartupTimeout.js +13 -0
- package/dist/config/types.js +1 -0
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisSearchContract.js +14 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +76 -0
- package/dist/contracts/android/androidToolContracts.js +77 -0
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +261 -0
- package/dist/contracts/artifactComparisonExample.js +86 -0
- package/dist/contracts/artifactToolContracts.js +68 -0
- package/dist/contracts/browserProviderToolContracts.js +7 -0
- package/dist/contracts/browserScenarioToolContracts.js +32 -0
- package/dist/contracts/browserToolContracts.js +256 -0
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/enhancedInputs.js +74 -0
- package/dist/contracts/enhancedToolContracts.js +32 -0
- package/dist/contracts/errorSchemas.js +87 -0
- package/dist/contracts/evidenceInputContracts.js +13 -0
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/firmware/firmwareToolContracts.js +38 -0
- package/dist/contracts/functionComparisonExample.js +51 -0
- package/dist/contracts/functionInstructionContract.js +6 -0
- package/dist/contracts/functionWorkflowToolContracts.js +29 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +19 -0
- package/dist/contracts/inputSchemaPresentation.js +181 -0
- package/dist/contracts/investigationExamples.js +116 -0
- package/dist/contracts/javascript/applicationWorkflowInputContracts.js +52 -0
- package/dist/contracts/javascript/electronToolContracts.js +118 -0
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +85 -0
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +248 -0
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +35 -0
- package/dist/contracts/javascript/javascriptRuntimeObservationToolContracts.js +40 -0
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +242 -0
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +87 -0
- package/dist/contracts/managed/managedWorkflowExamples.js +281 -0
- package/dist/contracts/managed/managedWorkflowToolContracts.js +165 -0
- package/dist/contracts/mobileApplicationGraphExamples.js +117 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +65 -0
- package/dist/contracts/native/nativeToolContracts.js +77 -0
- package/dist/contracts/officialToolContracts.js +69 -0
- package/dist/contracts/promptContracts.js +253 -0
- package/dist/contracts/providerSelection.js +29 -0
- package/dist/contracts/reconstructionReadinessExample.js +438 -0
- package/dist/contracts/sessionLifecycleInputs.js +63 -0
- package/dist/contracts/sessionStatusContract.js +17 -0
- package/dist/contracts/sessionToolContracts.js +61 -0
- package/dist/contracts/sessionToolSchemas.js +51 -0
- package/dist/contracts/toolContractExamples.js +77 -0
- package/dist/contracts/toolContractHelpers.js +22 -0
- package/dist/contracts/toolContractTypes.js +18 -0
- package/dist/contracts/toolContracts.js +60 -0
- package/dist/contracts/toolEffects.js +544 -0
- package/dist/contracts/toolOutputSchemaGroups.js +411 -0
- package/dist/contracts/toolOutputSchemaPrimitives.js +532 -0
- package/dist/contracts/toolSchemaMetadata.js +197 -0
- package/dist/contracts/unknownContractExamples.js +31 -0
- package/dist/contracts/wasm/wasmToolContracts.js +24 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/doctorRuntime.js +53 -0
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorBase.js +58 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +123 -0
- package/dist/domain/analysisErrorPresentation.js +372 -0
- package/dist/domain/analysisErrorProjection.js +454 -0
- package/dist/domain/analysisProfile.js +50 -0
- package/dist/domain/analysisSnapshot.js +538 -0
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +362 -0
- package/dist/domain/analysisView/analysisView.js +340 -0
- package/dist/domain/analysisView/analysisViewCoverage.js +19 -0
- package/dist/domain/analysisView/binaryLayoutView.js +161 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +245 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +108 -0
- package/dist/domain/android/androidAnalysis.js +143 -0
- package/dist/domain/android/androidApplication.js +144 -0
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apktool/apktoolResourceAnalysis.js +75 -0
- package/dist/domain/apple/appleApplication.js +315 -0
- package/dist/domain/apple/appleAssetCatalog.js +127 -0
- package/dist/domain/apple/appleBundleAnatomy.js +303 -0
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dyldPaths.js +89 -0
- package/dist/domain/apple/dylibResolution.js +485 -0
- package/dist/domain/apple/dylibResolutionFindings.js +77 -0
- package/dist/domain/apple/interfaceBuilderGraph.js +403 -0
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +430 -0
- package/dist/domain/apple/keyedArchive.js +214 -0
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactComparison.js +348 -0
- package/dist/domain/artifactGraph.js +213 -0
- package/dist/domain/artifactIdentity.js +57 -0
- package/dist/domain/artifactInspection.js +279 -0
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +166 -0
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +20 -0
- package/dist/domain/artifactPartialObservation.js +1 -0
- package/dist/domain/artifactPathSyntax.js +75 -0
- package/dist/domain/binaryTarget.js +233 -0
- package/dist/domain/binaryTargetTypes.js +10 -0
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCaptureComparison.js +21 -0
- package/dist/domain/browserCompleteness.js +103 -0
- package/dist/domain/browserNetworkEvidence.js +92 -0
- package/dist/domain/browserObservation.js +187 -0
- package/dist/domain/browserObservationError.js +44 -0
- package/dist/domain/browserObservationErrors.js +1 -0
- package/dist/domain/browserObservationSchemas.js +327 -0
- package/dist/domain/browserScenario.js +61 -0
- package/dist/domain/browserScenarioCapture.js +76 -0
- package/dist/domain/browserScenarioCaptureValues.js +292 -0
- package/dist/domain/browserScenarioDiff.js +266 -0
- package/dist/domain/browserScenarioDiffEvidence.js +73 -0
- package/dist/domain/browserScenarioDiffValues.js +140 -0
- package/dist/domain/browserScenarioNormalization.js +40 -0
- package/dist/domain/browserScenarioValues.js +268 -0
- package/dist/domain/browserSession.js +55 -0
- package/dist/domain/bundleComparison.js +243 -0
- package/dist/domain/callPath.js +301 -0
- package/dist/domain/callPathSchemas.js +89 -0
- package/dist/domain/canonicalDigest.js +83 -0
- package/dist/domain/canonicalJsonDigestSteps.js +155 -0
- package/dist/domain/canonicalOrdering.js +3 -0
- package/dist/domain/changedBehavior.js +282 -0
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSemantics.js +12 -0
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/comparisonStatus.js +11 -0
- package/dist/domain/completionLedgerGeneration.js +186 -0
- package/dist/domain/configurationErrors.js +37 -0
- package/dist/domain/conformancePackage.js +200 -0
- package/dist/domain/conformanceReplay.js +132 -0
- package/dist/domain/conformanceTrustGate.js +319 -0
- package/dist/domain/digests.js +27 -0
- package/dist/domain/dosCom.js +8 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/evidence.js +305 -0
- package/dist/domain/evidenceBundle.js +413 -0
- package/dist/domain/evidenceCompletionLedger.js +113 -0
- package/dist/domain/evidenceErrors.js +46 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +61 -0
- package/dist/domain/explicitSensitiveFailure.js +108 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/firmware/firmwareAnalysis.js +128 -0
- package/dist/domain/functionComparison.js +38 -0
- package/dist/domain/functionComparisonDimensions.js +199 -0
- package/dist/domain/functionComparisonNormalization.js +150 -0
- package/dist/domain/functionComparisonResults.js +54 -0
- package/dist/domain/functionComparisonSchemas.js +88 -0
- package/dist/domain/functionDossierEvidence.js +20 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +169 -0
- package/dist/domain/hopperErrors.js +98 -0
- package/dist/domain/hopperStartupFailure.js +64 -0
- package/dist/domain/hopperValues.js +368 -0
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +94 -0
- package/dist/domain/javascript/electronActiveObservation.js +237 -0
- package/dist/domain/javascript/electronObservation.js +122 -0
- package/dist/domain/javascript/electronStaticAnalysis.js +9 -0
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +187 -0
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +197 -0
- package/dist/domain/javascript/electronStaticAnalysisNative.js +199 -0
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/javascript/electronStaticAnalysisValues.js +134 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +399 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +146 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +175 -0
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +400 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +378 -0
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +126 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +104 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +211 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +324 -0
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +199 -0
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/javascript/javascriptAstFingerprint.js +153 -0
- package/dist/domain/javascript/javascriptAstValues.js +99 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +119 -0
- package/dist/domain/javascript/javascriptExportReturnShapeProjection.js +81 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +161 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonIdentity.js +16 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +302 -0
- package/dist/domain/javascript/javascriptExportShapeSelection.js +130 -0
- package/dist/domain/javascript/javascriptExportShapeVariants.js +333 -0
- package/dist/domain/javascript/javascriptFeatureSeed.js +193 -0
- package/dist/domain/javascript/javascriptFeatureTrace.js +177 -0
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +131 -0
- package/dist/domain/javascript/javascriptFeatureTraversal.js +61 -0
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +93 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +617 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +90 -0
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +90 -0
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +98 -0
- package/dist/domain/javascript/javascriptRuntimeObservation.js +136 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +46 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +74 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +163 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +270 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +39 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +126 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +334 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +234 -0
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +206 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +910 -0
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +246 -0
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +127 -0
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +272 -0
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +224 -0
- package/dist/domain/javascript/javascriptSemanticCoverage.js +32 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +182 -0
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +299 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +52 -0
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +187 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +575 -0
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +316 -0
- package/dist/domain/javascript/javascriptSemanticGraphSerialization.js +12 -0
- package/dist/domain/javascript/javascriptSemanticIr.js +31 -0
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +865 -0
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +104 -0
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +164 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +38 -0
- package/dist/domain/javascript/javascriptSemanticProjection.js +571 -0
- package/dist/domain/javascript/javascriptSemanticPromises.js +321 -0
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +29 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +175 -0
- package/dist/domain/javascript/javascriptSemanticQueryAssessment.js +45 -0
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +63 -0
- package/dist/domain/javascript/javascriptSemanticQueryRelations.js +15 -0
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +95 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +34 -0
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticResources.js +129 -0
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +159 -0
- package/dist/domain/javascript/javascriptSemanticSlots.js +72 -0
- package/dist/domain/javascript/javascriptSemanticState.js +116 -0
- package/dist/domain/javascript/javascriptSemanticTraceSchemas.js +15 -0
- package/dist/domain/javascript/javascriptSemanticTraversal.js +80 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +581 -0
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +114 -0
- package/dist/domain/javascript/javascriptSourceParser.js +50 -0
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +142 -0
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +239 -0
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -0
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +86 -0
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +561 -0
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +21 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -0
- package/dist/domain/javascript/javascriptSymbolicBindings.js +795 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +261 -0
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +109 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +231 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonSerialization.js +163 -0
- package/dist/domain/jsonShape.js +141 -0
- package/dist/domain/jsonValue.js +96 -0
- package/dist/domain/localPath.js +24 -0
- package/dist/domain/managed/managedApplicationGraph.js +221 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +48 -0
- package/dist/domain/managed/managedApplicationGraphNodes.js +367 -0
- package/dist/domain/managed/managedArtifact.js +465 -0
- package/dist/domain/managed/managedInspectionEvidence.js +28 -0
- package/dist/domain/managed/managedMemberComparison.js +211 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +71 -0
- package/dist/domain/managed/managedMemberComparisonItems.js +304 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +204 -0
- package/dist/domain/managed/managedNativeVerification.js +35 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +276 -0
- package/dist/domain/managed/managedNativeVerificationSchemas.js +180 -0
- package/dist/domain/managed/managedReconstruction.js +190 -0
- package/dist/domain/mobileApplicationGraphProjection.js +61 -0
- package/dist/domain/native/binaryLayout.js +354 -0
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeApiBoundary.js +140 -0
- package/dist/domain/native/nativeCallObservation.js +186 -0
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/native/nativeDataType.js +53 -0
- package/dist/domain/native/nativeFunctionAnnotations.js +43 -0
- package/dist/domain/native/nativeInspection.js +174 -0
- package/dist/domain/native/nativeInstruction.js +125 -0
- package/dist/domain/native/nativeInvestigationGraph.js +364 -0
- package/dist/domain/native/nativeLoadImage.js +112 -0
- package/dist/domain/native/nativeMetadataRecovery.js +128 -0
- package/dist/domain/native/nativeUiObservation.js +137 -0
- package/dist/domain/native/nativeValueFlow.js +72 -0
- package/dist/domain/native/nativeValueTrace.js +64 -0
- package/dist/domain/native/objcSwiftMetadata.js +419 -0
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +263 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +17 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/process/processCapture.js +412 -0
- package/dist/domain/process/processCaptureCoverage.js +70 -0
- package/dist/domain/process/processCaptureExample.js +132 -0
- package/dist/domain/process/processCaptureParsing.js +21 -0
- package/dist/domain/process/processCaptureValidation.js +246 -0
- package/dist/domain/process/processComparison.js +315 -0
- package/dist/domain/process/processEvidenceProvider.js +11 -0
- package/dist/domain/process/processObservation.js +140 -0
- package/dist/domain/process/processScenario.js +247 -0
- package/dist/domain/process/processTraceComparison.js +34 -0
- package/dist/domain/process/processTraceDimensionProjection.js +35 -0
- package/dist/domain/process/processTraceEvaluation.js +320 -0
- package/dist/domain/process/processTraceSpecification.js +382 -0
- package/dist/domain/propertyListKeys.js +107 -0
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +19 -0
- package/dist/domain/providerCleanupError.js +18 -0
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/providerSelectionError.js +46 -0
- package/dist/domain/rawBinary.js +93 -0
- package/dist/domain/reconstructionCoverage.js +325 -0
- package/dist/domain/reconstructionCoverageEvaluation.js +234 -0
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +347 -0
- package/dist/domain/reconstructionReadiness.js +116 -0
- package/dist/domain/reconstructionReadinessFindingHelpers.js +17 -0
- package/dist/domain/reconstructionReadinessIntegrityFindings.js +118 -0
- package/dist/domain/reconstructionReadinessJourneyFindings.js +193 -0
- package/dist/domain/reconstructionReadinessSchemas.js +268 -0
- package/dist/domain/reconstructionUnknowns.js +91 -0
- package/dist/domain/reconstructionVerification.js +218 -0
- package/dist/domain/reconstructionVerificationSchemas.js +141 -0
- package/dist/domain/recordedTransportUrl.js +51 -0
- package/dist/domain/referenceSourceClassification.js +385 -0
- package/dist/domain/referenceSourceGraph.js +380 -0
- package/dist/domain/referenceSourceImportParsing.js +238 -0
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourcePolicy.js +1 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/relationshipCoverage.js +20 -0
- package/dist/domain/residualUnknown.js +252 -0
- package/dist/domain/result.js +4 -0
- package/dist/domain/runtimeVersion.js +15 -0
- package/dist/domain/safeJson.js +13 -0
- package/dist/domain/sourceMapContents.js +6 -0
- package/dist/domain/sourceMapEnvelope.js +44 -0
- package/dist/domain/staticRuntimeCorrelation.js +334 -0
- package/dist/domain/stringPatterns.js +6 -0
- package/dist/domain/swiftSymbolClassification.js +66 -0
- package/dist/domain/symbolAnalysis.js +122 -0
- package/dist/domain/unicodeCodePointOrder.js +23 -0
- package/dist/domain/unknownRegistryError.js +10 -0
- package/dist/domain/wasm/wasmArtifact.js +105 -0
- package/dist/domain/webBundleAnalysis.js +192 -0
- package/dist/domain/webBundleAnalyzer.js +15 -0
- package/dist/domain/webBundleAnalyzerAst.js +49 -0
- package/dist/domain/webBundleAnalyzerInspection.js +315 -0
- package/dist/domain/webBundleAnalyzerResult.js +142 -0
- package/dist/domain/webCaptureDiff.js +423 -0
- package/dist/domain/webCaptureDiffSchemas.js +84 -0
- package/dist/domain/webContentArtifact.js +38 -0
- package/dist/domain/webEventListeners.js +29 -0
- package/dist/domain/webExecution.js +75 -0
- package/dist/domain/webInventory.js +62 -0
- package/dist/domain/webMcpDiscovery.js +53 -0
- package/dist/domain/webModuleImports.js +99 -0
- package/dist/domain/webModuleTrace.js +101 -0
- package/dist/domain/webNetworkCapture.js +142 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +80 -0
- package/dist/domain/webScreenshot.js +132 -0
- package/dist/domain/webScriptArtifacts.js +37 -0
- package/dist/domain/webScriptExport.js +84 -0
- package/dist/domain/webScriptExportError.js +19 -0
- package/dist/domain/webScriptExportPlan.js +104 -0
- package/dist/domain/webSourceLocation.js +118 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/domain/zipPackageFormat.js +52 -0
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +308 -0
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +173 -0
- package/dist/dotnet/ManagedMemberInspectorCore.js +446 -0
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +468 -0
- package/dist/dotnet/ManagedMemberOwnership.js +71 -0
- package/dist/dotnet/ManagedMemberPointers.js +62 -0
- package/dist/dotnet/ManagedMemberRows.js +227 -0
- package/dist/dotnet/ManagedMetadataHeaps.js +179 -0
- package/dist/dotnet/ManagedMetadataInventory.js +99 -0
- package/dist/dotnet/ManagedMetadataInventoryRows.js +295 -0
- package/dist/dotnet/ManagedMetadataLayout.js +270 -0
- package/dist/dotnet/ManagedMetadataRowSizes.js +54 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +155 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +314 -0
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +128 -0
- package/dist/dotnet/ManagedPeReader.js +233 -0
- package/dist/dotnet/ManagedReaderFailure.js +27 -0
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +158 -0
- package/dist/dotnet/ManagedStaticProviderMetadata.js +33 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +250 -0
- package/dist/evaluation/AgentEvaluationReport.js +32 -0
- package/dist/evaluation/CodexAgentEval.js +188 -0
- package/dist/evaluation/KnownAnswerEvaluation.js +323 -0
- package/dist/evm/EvmBytecodeCarrier.js +21 -0
- package/dist/evm/EvmWorkerLimits.js +40 -0
- package/dist/evm/EvmoleFailures.js +124 -0
- package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
- package/dist/evm/EvmoleInterfaceProvider.js +339 -0
- package/dist/evm/EvmoleInterfaceWorker.js +87 -0
- package/dist/evm/EvmoleRelease.js +16 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +73 -0
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +190 -0
- package/dist/firmware/FirmwareFiles.js +206 -0
- package/dist/firmware/FirmwareProvider.js +388 -0
- package/dist/firmware/FirmwarePublication.js +105 -0
- package/dist/firmware/FirmwareRelease.js +33 -0
- package/dist/firmware/FirmwareReports.js +287 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedPackageMetadata.js +9 -0
- package/dist/ghidra/GhidraAnalysisProfile.js +219 -0
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +725 -0
- package/dist/ghidra/GhidraClientStartup.js +27 -0
- package/dist/ghidra/GhidraClientTypes.js +1 -0
- package/dist/ghidra/GhidraClientWire.js +38 -0
- package/dist/ghidra/GhidraDiagnostics.js +53 -0
- package/dist/ghidra/GhidraDoctor.js +88 -0
- package/dist/ghidra/GhidraFunctionValues.js +328 -0
- package/dist/ghidra/GhidraInstallation.js +443 -0
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +262 -0
- package/dist/ghidra/GhidraJavaLaunch.js +66 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +490 -0
- package/dist/ghidra/GhidraLoadImageAttest.js +103 -0
- package/dist/ghidra/GhidraLoadImageValues.js +260 -0
- package/dist/ghidra/GhidraMipsProfile.js +187 -0
- package/dist/ghidra/GhidraProvider.js +250 -0
- package/dist/ghidra/GhidraProviderCapabilities.js +208 -0
- package/dist/ghidra/GhidraProviderClient.js +613 -0
- package/dist/ghidra/GhidraPspExtension.js +144 -0
- package/dist/ghidra/GhidraPspProfile.js +50 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +18 -0
- package/dist/ghidra/GhidraRequestQueue.js +115 -0
- package/dist/ghidra/GhidraResponseBuffer.js +31 -0
- package/dist/ghidra/GhidraResponseRouter.js +24 -0
- package/dist/ghidra/GhidraSessionError.js +180 -0
- package/dist/ghidra/GhidraSessionRoot.js +39 -0
- package/dist/ghidra/GhidraSessionValues.js +86 -0
- package/dist/ghidra/GhidraSocketConnection.js +83 -0
- package/dist/ghidra/GhidraTargetSnapshot.js +79 -0
- package/dist/ghidra/GhidraTransport.js +101 -0
- package/dist/ghidra/extensions/GhidraExtensionFailures.js +20 -0
- package/dist/ghidra/extensions/GhidraExtensions.js +177 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotAdapter.js +27 -0
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +100 -0
- package/dist/ghidra/protocol.js +46 -0
- package/dist/go/GoBinaryContainer.js +125 -0
- package/dist/go/GoBinaryImage.js +172 -0
- package/dist/go/GoBinaryProvider.js +137 -0
- package/dist/go/GoElfImage.js +149 -0
- package/dist/go/GoMachoImage.js +113 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +102 -0
- package/dist/hopper/BridgeLauncher.js +305 -0
- package/dist/hopper/HopperAnalysisProfile.js +168 -0
- package/dist/hopper/HopperCleanup.js +245 -0
- package/dist/hopper/HopperClient.js +767 -0
- package/dist/hopper/HopperDiagnostics.js +14 -0
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +200 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProcessDiagnostic.js +26 -0
- package/dist/hopper/HopperProvider.js +269 -0
- package/dist/hopper/HopperProviderCapabilities.js +91 -0
- package/dist/hopper/HopperRegexSearch.js +134 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +261 -0
- package/dist/hopper/HopperResponseStream.js +44 -0
- package/dist/hopper/HopperSessionValues.js +30 -0
- package/dist/hopper/HopperSocketConnection.js +31 -0
- package/dist/hopper/HopperTargetLease.js +233 -0
- package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +64 -0
- package/dist/hopper/LinuxPrivateDisplayProbe.js +224 -0
- package/dist/hopper/protocol.js +88 -0
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +61 -0
- package/dist/ida/IdaDoctor.js +53 -0
- package/dist/ida/IdaInput.js +56 -0
- package/dist/ida/IdaMcpConnection.js +115 -0
- package/dist/ida/IdaOperationRunner.js +376 -0
- package/dist/ida/IdaProtocolValues.js +208 -0
- package/dist/ida/IdaProvider.js +136 -0
- package/dist/ida/IdaProviderCapabilities.js +64 -0
- package/dist/ida/IdaSessionClient.js +444 -0
- package/dist/ida/IdaWorkspace.js +55 -0
- package/dist/identity.js +25 -0
- package/dist/inspector/JavaScriptRuntimeScope.js +89 -0
- package/dist/inspector/V8InspectorCaptureProjection.js +197 -0
- package/dist/inspector/V8InspectorEndpoint.js +70 -0
- package/dist/inspector/V8InspectorProvider.js +378 -0
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +574 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +64 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +558 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +121 -0
- package/dist/javascript/recovery/RecoveryFiles.js +175 -0
- package/dist/javascript/recovery/WakaruCommand.js +137 -0
- package/dist/javascript/recovery/WakaruExecution.js +115 -0
- package/dist/javascript/recovery/WakaruProvider.js +218 -0
- package/dist/javascript/recovery/WakaruPublication.js +126 -0
- package/dist/javascript/recovery/WakaruRelease.js +36 -0
- package/dist/javascript/recovery/WakaruReport.js +140 -0
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +223 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +135 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +238 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +152 -0
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -0
- package/dist/main/messages.js +4 -0
- package/dist/main/shutdown.js +102 -0
- package/dist/main/startup.js +21 -0
- package/dist/main/transport.js +72 -0
- package/dist/main/types.js +1 -0
- package/dist/main.js +92 -0
- package/dist/mcp/AnalysisSnapshotFiles-DbgHi36O.js +1225 -0
- package/dist/mcp/ArtifactProvider-BNxKlaKX.js +2090 -0
- package/dist/mcp/ArtifactProviderMetadata--hy-wyJK.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-CBR5q4aK.js +108 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinaryTargetResolver-DbiUzRLh.js +1073 -0
- package/dist/mcp/BoundedFileBytes-CJPW_TzE.js +68 -0
- package/dist/mcp/CdpConnection-CM0tkVfW.js +557 -0
- package/dist/mcp/CdpOptionalCommand-H8_fL7Q_.js +120 -0
- package/dist/mcp/CdpTargetSession-OYD1d6XM.js +647 -0
- package/dist/mcp/DirectAnalysis-BWAu8Ro5.js +395 -0
- package/dist/mcp/DirectAnalysisStatus-DofNPhKd.js +33 -0
- package/dist/mcp/ElectronFileScope-DEayib6K.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-CUrOtfNo.js +401 -0
- package/dist/mcp/ManagedStaticProvider-CXE93Bow.js +4460 -0
- package/dist/mcp/NativeMacOSProvider-BbITFLHW.js +4408 -0
- package/dist/mcp/NativeMacOSProviderMetadata-mxDhaNJf.js +281 -0
- package/dist/mcp/ProcedureAddressResolution-Gnjf9Hya.js +19 -0
- package/dist/mcp/ProcessOwnership-nOFZsmD3.js +1411 -0
- package/dist/mcp/WorkflowEvidence-DJyEy3K0.js +94 -0
- package/dist/mcp/analysisErrorCore-BqyeMw3_.js +201 -0
- package/dist/mcp/analysisErrorProjection-B7pHef2y.js +724 -0
- package/dist/mcp/artifactOperationError-B_jxO8at.js +27 -0
- package/dist/mcp/artifactToolContracts-TXegBBr1.js +159 -0
- package/dist/mcp/browserObservation-BCgaDRyQ.js +4398 -0
- package/dist/mcp/browserObservationError-BKBEX85K.js +40 -0
- package/dist/mcp/browserObservationSchemas-yzRJ90-E.js +573 -0
- package/dist/mcp/browserScenario-z7jveI9P.js +2319 -0
- package/dist/mcp/browserScenarioCapture-BvnKTmtZ.js +460 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-Dugt3H71.js +199 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DjQQYGw4.js +556 -0
- package/dist/mcp/electronObservation-DuhMHCmQ.js +112 -0
- package/dist/mcp/electronScenario-9mLG6h-g.js +586 -0
- package/dist/mcp/emptyArraySchema-DEEefG2V.js +140 -0
- package/dist/mcp/enhancedInputs-CLdEXv88.js +56 -0
- package/dist/mcp/interfaceBuilderGraph-BOKqQzjK.js +2613 -0
- package/dist/mcp/javascriptRuntimeObservation-C_wglsz_.js +661 -0
- package/dist/mcp/javascriptRuntimeObservation-CxQ1UT_y.js +121 -0
- package/dist/mcp/lipo-Do-2eBrl.js +465 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-CZ4Hlc6u.js +34 -0
- package/dist/mcp/machoContainer-9En6pSkd.js +813 -0
- package/dist/mcp/main-WQSCuTNt.js +52791 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-o5LHFwHc.js +81 -0
- package/dist/mcp/plistValue-DsU7z4yF.js +47 -0
- package/dist/mcp/propertyListKeys-cX-BUv2y.js +197 -0
- package/dist/mcp/providerAdapterError-CdPaQ6-Z.js +27 -0
- package/dist/mcp/providerCleanupError-DvE79aUX.js +49 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CUeCJZiP.js +212 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-2GN0h-BE.js +3647 -0
- package/dist/mcp/serverIdentity-rOY69sxc.js +633 -0
- package/dist/mcp/sourceMapEnvelope-D8Zezqyi.js +252 -0
- package/dist/mcp/toolContracts-CrfYDTUz.js +14561 -0
- package/dist/mcp/toolOutputSchemaGroups-ChxVLGoy.js +11114 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-DUBgMzVO.js +185 -0
- package/dist/mcp/webRuntime-C2Tx-fgS.js +74 -0
- package/dist/mcp/webSourceLocation-Dnkpf0R2.js +8532 -0
- package/dist/mcpDoctor.js +360 -0
- package/dist/mcpStartupPolicy.js +14 -0
- package/dist/native/AppleDispatchCoverage.js +112 -0
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +176 -0
- package/dist/native/AppleMachoFixups.js +372 -0
- package/dist/native/AppleMachoSelection.js +234 -0
- package/dist/native/AppleObjcCategories.js +63 -0
- package/dist/native/AppleObjcDispatchFacets.js +260 -0
- package/dist/native/AppleObjcProperties.js +79 -0
- package/dist/native/AppleObjcProtocols.js +89 -0
- package/dist/native/AppleSwiftDispatchFacets.js +156 -0
- package/dist/native/AppleSwiftVtables.js +92 -0
- package/dist/native/CommandRunner.js +240 -0
- package/dist/native/LldbCallTracer.js +713 -0
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +195 -0
- package/dist/native/NativeMacOSProvider.js +701 -0
- package/dist/native/NativeMacOSProviderMetadata.js +46 -0
- package/dist/native/NativeMachoInspection.js +273 -0
- package/dist/native/NativeUiHelperRuntime.js +66 -0
- package/dist/native/NativeUiObservation.js +183 -0
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/codesign.js +93 -0
- package/dist/native/parsers/demangle.js +30 -0
- package/dist/native/parsers/dyldInfo.js +60 -0
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +177 -0
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +379 -0
- package/dist/native/parsers/plist.js +187 -0
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
- package/dist/native/pwntools/PwntoolsDecoder.js +206 -0
- package/dist/native/pwntools/PwntoolsFailures.js +180 -0
- package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
- package/dist/native/pwntools/PwntoolsRelease.js +19 -0
- package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
- package/dist/process/BoundedFileBytes.js +40 -0
- package/dist/process/DarwinProcessRunTokenReader.js +376 -0
- package/dist/process/ExecFileOutput.js +124 -0
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/OwnedCommand.js +131 -0
- package/dist/process/PendingOperations.js +61 -0
- package/dist/process/PrivateRuntimeRoot.js +61 -0
- package/dist/process/ProcessCommandIdentity.js +19 -0
- package/dist/process/ProcessOwnership.js +636 -0
- package/dist/process/ProcessOwnershipIdentity.js +13 -0
- package/dist/process/ProcessOwnershipObservation.js +407 -0
- package/dist/process/ProcessOwnershipProcessTree.js +35 -0
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +91 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +381 -0
- package/dist/process/ProviderRunLineage.js +21 -0
- package/dist/process/WindowsAuthority.js +51 -0
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +268 -0
- package/dist/process/capture/ProcessCaptureCapability.js +65 -0
- package/dist/process/capture/ProcessCaptureEnvironment.js +9 -0
- package/dist/process/capture/ProcessCaptureError.js +74 -0
- package/dist/process/capture/ProcessCaptureJournal.js +61 -0
- package/dist/process/capture/ProcessCaptureLifecycle.js +1050 -0
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessFilesystemEffects.js +81 -0
- package/dist/process/capture/ProcessHarness.js +602 -0
- package/dist/process/capture/ProcessNormalization.js +88 -0
- package/dist/process/capture/ProcessSampling.js +415 -0
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +79 -0
- package/dist/process/capture/ProcessTimer.js +39 -0
- package/dist/process/capture/TerminalRenderer.js +124 -0
- package/dist/process/snapshotEnvironment.js +14 -0
- package/dist/reference/ReferenceSourceReader.js +73 -0
- package/dist/reference/ReferenceSourceReaderEntries.js +273 -0
- package/dist/reference/ReferenceSourceReaderErrors.js +54 -0
- package/dist/reference/ReferenceSourceReaderFile.js +147 -0
- package/dist/reference/ReferenceSourceReaderPaths.js +8 -0
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -0
- package/dist/reference/ReferenceSourceReaderValidate.js +81 -0
- package/dist/server/EvidenceMcpServer.js +216 -0
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +344 -0
- package/dist/server/lifecycleProgress.js +10 -0
- package/dist/server/mcpClientMetadata.js +42 -0
- package/dist/server/mcpProgress.js +26 -0
- package/dist/server/promptCompletion.js +141 -0
- package/dist/server/recordDerivedEvidence.js +10 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +10 -0
- package/dist/server/registerAndroidTools.js +31 -0
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +29 -0
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +29 -0
- package/dist/server/registerApplicationTools/compareVersions.js +34 -0
- package/dist/server/registerApplicationTools/coverage.js +13 -0
- package/dist/server/registerApplicationTools/helpers.js +37 -0
- package/dist/server/registerApplicationTools/obligationLedger.js +23 -0
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +50 -0
- package/dist/server/registerApplicationTools/traceFeature.js +26 -0
- package/dist/server/registerApplicationTools/traceSemantics.js +25 -0
- package/dist/server/registerApplicationTools/types.js +1 -0
- package/dist/server/registerApplicationTools.js +19 -0
- package/dist/server/registerArtifactComparisonTool.js +71 -0
- package/dist/server/registerArtifactTools.js +14 -0
- package/dist/server/registerBinaryDiagnosticsTools.js +26 -0
- package/dist/server/registerBrowserScenarioTool.js +26 -0
- package/dist/server/registerBrowserTools.js +58 -0
- package/dist/server/registerBundleComparisonTool.js +54 -0
- package/dist/server/registerCloseLifecycleTool.js +55 -0
- package/dist/server/registerElectronTools.js +70 -0
- package/dist/server/registerEnhancedTools.js +169 -0
- package/dist/server/registerEvidenceTools.js +68 -0
- package/dist/server/registerEvmTools.js +9 -0
- package/dist/server/registerFirmwareTools.js +11 -0
- package/dist/server/registerFunctionComparisonTool.js +86 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +46 -0
- package/dist/server/registerInvestigationTools/types.js +1 -0
- package/dist/server/registerInvestigationTools.js +168 -0
- package/dist/server/registerJavaScriptRecoveryTool.js +9 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +27 -0
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +40 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +53 -0
- package/dist/server/registerManagedWorkflowTools/contract.js +7 -0
- package/dist/server/registerManagedWorkflowTools/evidence.js +27 -0
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +27 -0
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +41 -0
- package/dist/server/registerManagedWorkflowTools/types.js +1 -0
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +62 -0
- package/dist/server/registerManagedWorkflowTools.js +11 -0
- package/dist/server/registerOfficialTools.js +74 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +156 -0
- package/dist/server/registerPrompts.js +73 -0
- package/dist/server/registerRecordedCrashTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +90 -0
- package/dist/server/registerSessionStatusTool.js +61 -0
- package/dist/server/registerSessionTools.js +217 -0
- package/dist/server/registerWasmTools.js +9 -0
- package/dist/server/registerWebModuleTool.js +9 -0
- package/dist/server/registerWebNetworkCaptureTool.js +20 -0
- package/dist/server/registerWebRuntimeTools.js +27 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +9 -0
- package/dist/server/runDerivedOperation.js +55 -0
- package/dist/server/sessionAvailabilityPolicy.js +29 -0
- package/dist/server/sessionEvidence.js +11 -0
- package/dist/server/toolLogging.js +11 -0
- package/dist/server/toolRegistrationOptions.js +9 -0
- package/dist/server/toolResult.js +119 -0
- package/dist/server/toolResultEncoding.js +34 -0
- package/dist/serverIdentity.js +69 -0
- package/dist/wasm/WabtArtifactProvider.js +313 -0
- package/dist/wasm/WabtFailures.js +62 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtWat.js +184 -0
- package/dist/wasm/WasmGlueAdapter.js +51 -0
- package/dist/windows/WindowsNativeLoader.js +124 -0
- package/dist/windows/WindowsOwnedProcess.js +265 -0
- package/dist/windows/WindowsPrivateRuntime.js +143 -0
- package/hooks/hooks.json +17 -0
- package/install.sh +172 -0
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +54 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/digfox-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +2812 -0
- package/licenses/npm-runtime-notices.txt +6632 -0
- package/licenses/rea-jev-MIT.txt +21 -0
- package/licenses/rea-lab-MIT.txt +21 -0
- package/licenses/upstream-sources.json +62 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +156 -0
- package/native/windows/build/manifest.json +9 -0
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +371 -4
- package/port/cli.mjs +210 -0
- package/port/hooks/guard.mjs +140 -0
- package/port/knowledge/engines.json +67 -0
- package/port/knowledge/footprints.json +189 -0
- package/port/knowledge/maps/godot-godot-csharp.json +38 -0
- package/port/knowledge/maps/godot-threejs.json +42 -0
- package/port/knowledge/maps/godot-unity.json +62 -0
- package/port/knowledge/maps/godot-unreal.json +48 -0
- package/port/knowledge/maps/unity-godot.json +52 -0
- package/port/knowledge/maps/unity-unreal.json +33 -0
- package/port/knowledge/systems.json +1554 -0
- package/port/mcp.mjs +62 -0
- package/port/plugin/mcp-launch.mjs +19 -0
- package/port/server.mjs +129 -0
- package/port/src/agent.mjs +257 -0
- package/port/src/archive.mjs +324 -0
- package/port/src/binary.mjs +606 -0
- package/port/src/blueprint.mjs +225 -0
- package/port/src/compare.mjs +165 -0
- package/port/src/connect.mjs +58 -0
- package/port/src/convert.mjs +134 -0
- package/port/src/formats.mjs +229 -0
- package/port/src/graph.mjs +275 -0
- package/port/src/knowledge.mjs +90 -0
- package/port/src/lookup.mjs +615 -0
- package/port/src/main-module.mjs +10 -0
- package/port/src/plan.mjs +606 -0
- package/port/src/porters.mjs +360 -0
- package/port/src/proofcase.mjs +343 -0
- package/port/src/relay.mjs +493 -0
- package/port/src/scan.mjs +189 -0
- package/port/src/scene.mjs +338 -0
- package/port/src/stashpad.mjs +114 -0
- package/port/src/symbols.mjs +201 -0
- package/port/src/tools.mjs +198 -0
- package/port/src/util.mjs +162 -0
- package/port/src/workspace.mjs +39 -0
- package/port/templates/unity/ReversePortSceneBuilder.cs +258 -0
- package/scripts/electron-active-hook-boundaries.cjs +392 -0
- package/scripts/electron-active-hook.cjs +673 -0
- package/scripts/hopper-demo-x11.py +787 -0
- package/scripts/prepack.mjs +60 -0
- package/scripts/prepare.mjs +28 -0
- package/scripts/rea.mjs +110 -0
- package/scripts/verify-windows-native-artifact.mjs +39 -0
- package/skills/build-inspector/SKILL.md +44 -0
- package/skills/godot-port/SKILL.md +42 -0
- package/skills/port-project/SKILL.md +59 -0
- package/skills/port-verify/SKILL.md +35 -0
- package/skills/proof-case/SKILL.md +52 -0
- package/skills/rebuild/SKILL.md +66 -0
- package/skills/reverse-engineer/SKILL.md +67 -0
- package/skills/reverse-engineer-anything/SKILL.md +204 -0
- package/skills/reverse-engineer-anything/references/android-applications.md +34 -0
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +130 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +54 -0
- package/skills/reverse-engineer-anything/references/godot-source.md +37 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +175 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +252 -0
- package/skills/reverse-engineer-anything/references/porting-and-rebuilds.md +92 -0
- package/skills/reverse-engineer-anything/references/runtime-observation.md +28 -0
- package/skills/reverse-engineer-anything/references/unity-source.md +32 -0
- package/skills/troubleshoot/SKILL.md +27 -0
- package/skills/unity-to-godot/SKILL.md +37 -0
- package/third_party/README.md +60 -0
- package/third_party/evmole/LICENSE +21 -0
- package/third_party/evmole/README.md +22 -0
- package/third_party/pwndbg/LICENSE.md +21 -0
- package/third_party/pwndbg/README.md +23 -0
- package/third_party/pwntools/README.md +40 -0
- 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 };
|