rea-agents 6.4.0 → 6.7.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/README.md +76 -16
- package/THIRD_PARTY_NOTICES.md +135 -0
- package/bridge/android/ReaJadxBridge.java +281 -25
- package/bridge/cutter/rea_bridge.py +825 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraBridge.java +1232 -142
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +49 -0
- package/bridge/hopper_bridge.py +111 -69
- package/bridge/mitmproxy/capture.py +189 -13
- package/bridge/native/rea_lldb_tracer.py +88 -10
- package/bridge/process/ProcessRunTokenReader.swift +76 -34
- package/bridge/pwndbg/core_context.py +15 -2
- package/bridge/pwntools/layout_impl.py +5 -0
- package/bridge/pwntools/recorded_crash_impl.py +31 -10
- package/dist/adb/AdbCommand.js +148 -0
- package/dist/adb/AdbConfiguration.js +41 -7
- package/dist/adb/AdbDeviceOutput.js +59 -37
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbInputSnapshot.js +126 -0
- package/dist/adb/AdbProvider.js +1106 -346
- package/dist/adb/AdbShellOutput.js +146 -77
- package/dist/android/AndroidTargetSnapshot.js +7 -7
- package/dist/android/JadxAnalysis.js +53 -33
- package/dist/android/JadxConfiguration.js +283 -145
- package/dist/android/JadxDoctor.js +123 -0
- package/dist/android/JadxFailure.js +154 -0
- package/dist/android/JadxInterruption.js +13 -0
- package/dist/android/JadxJavaProbe.js +246 -0
- package/dist/android/JadxMcpTransport.js +53 -18
- package/dist/android/JadxProtocol.js +43 -2
- package/dist/android/JadxProvider.js +183 -102
- package/dist/android/JadxRelease.js +17 -2
- package/dist/android/JadxSession.js +35 -14
- package/dist/android/JadxWorkspaceRoot.js +157 -0
- package/dist/apktool/ApktoolCommandCleanup.js +134 -0
- package/dist/apktool/ApktoolCommandOutput.js +22 -0
- package/dist/apktool/ApktoolConfiguration.js +306 -45
- package/dist/apktool/ApktoolDecodeOutput.js +131 -42
- package/dist/apktool/ApktoolDecodedInventory.js +52 -0
- package/dist/apktool/ApktoolProvider.js +296 -340
- package/dist/apktool/ApktoolStringTables.js +178 -0
- package/dist/apktool/ApktoolWorkspace.js +162 -0
- package/dist/application/AnalysisContextQueries.js +5 -8
- package/dist/application/AnalysisDocument.js +19 -4
- package/dist/application/AnalysisProvider.js +36 -18
- package/dist/application/AppBundleExecutable.js +16 -9
- package/dist/application/BinaryTargetResolver.js +204 -40
- package/dist/application/BrowserEvidence.js +1 -1
- package/dist/application/BrowserObservationService.js +54 -9
- package/dist/application/BrowserScenarioCaptureService.js +26 -7
- package/dist/application/CallPathTracing.js +52 -13
- package/dist/application/CapabilityInventory.js +182 -36
- package/dist/application/ClaudeDesktopConfigLocation.js +152 -0
- package/dist/application/ClientConfigurationCleanup.js +73 -0
- package/dist/application/ClientConfigurationDocument.js +270 -151
- package/dist/application/ClientConfigurationFiles.js +51 -14
- package/dist/application/ClientConfigurationPublication.js +167 -0
- package/dist/application/ClientRegistrationEnvironment.js +40 -4
- package/dist/application/ClientRegistrationIdentity.js +112 -32
- package/dist/application/ClientRegistrationStatus.js +280 -84
- package/dist/application/DirectAnalysis.js +98 -30
- package/dist/application/DirectAnalysisCleanup.js +5 -1
- package/dist/application/DirectAnalysisStatus.js +13 -1
- package/dist/application/Doctor.js +192 -37
- package/dist/application/DoctorDiagnostics.js +59 -16
- package/dist/application/DoctorProviderIds.js +8 -0
- package/dist/application/DoctorScope.js +11 -2
- package/dist/application/DshCordisPatch.js +355 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +30 -16
- package/dist/application/EnhancedToolTypes.js +0 -1
- package/dist/application/EnhancedTools.js +154 -56
- package/dist/application/EvidenceBundleCommands.js +30 -7
- package/dist/application/EvidenceBundleFiles.js +29 -7
- package/dist/application/FunctionAnalysisEvidence.js +3 -0
- package/dist/application/GeminiClientSettings.js +25 -13
- package/dist/application/HermesClientHome.js +20 -0
- package/dist/application/HermesConfigurationYaml.js +312 -0
- package/dist/application/HopperDownload.js +11 -3
- package/dist/application/HopperReleaseFeed.js +71 -0
- package/dist/application/InventoryProjectionEvidence.js +0 -1
- package/dist/application/InvestigationProviders.js +14 -3
- package/dist/application/JsonFiles.js +110 -20
- package/dist/application/JsonInputFile.js +220 -62
- package/dist/application/LinuxHopper.js +218 -115
- package/dist/application/LinuxHopperPublisher.js +656 -0
- package/dist/application/MacHopper.js +203 -83
- package/dist/application/MacHopperPaths.js +40 -0
- package/dist/application/{MipsElfAbiFlags.js → MipsElfMetadata.js} +71 -10
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/MipsGnuAttributes.js +90 -0
- package/dist/application/MsixPackageStorage.js +140 -0
- package/dist/application/ProgressReporter.js +1 -1
- package/dist/application/ProviderOperationExecution.js +15 -14
- package/dist/application/ReconstructionCoverageService.js +0 -1
- package/dist/application/ReconstructionObligationCandidates.js +20 -4
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +2 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +19 -33
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -72
- package/dist/application/ReconstructionObligationLedgerService.js +6 -2
- package/dist/application/ReconstructionObligationOriginalCases.js +10 -1
- package/dist/application/ReferenceSourceImport.js +24 -8
- package/dist/application/ReferenceSourceImportEntries.js +180 -37
- package/dist/application/ReferenceSourceImportPolicy.js +5 -3
- package/dist/application/ReferenceSourceImportTypes.js +0 -1
- package/dist/application/ReferenceSourceVcsAdapter.js +36 -17
- package/dist/application/RegularFileRead.js +117 -70
- package/dist/application/Setup.js +59 -21
- package/dist/application/SetupClientConfiguration.js +301 -66
- package/dist/application/SetupClients.js +25 -10
- package/dist/application/SetupHost.js +149 -51
- package/dist/application/SetupInstallFailure.js +58 -3
- package/dist/application/SetupPlan.js +94 -55
- package/dist/application/SetupRecoveryBackup.js +93 -0
- package/dist/application/SetupRegistrationEnvironment.js +14 -1
- package/dist/application/SetupSkill.js +303 -76
- package/dist/application/SourceLimitations.js +35 -0
- package/dist/application/SupportedClients.js +166 -32
- package/dist/application/TypeScriptEmittedSourceCandidates.js +26 -0
- package/dist/application/Uninstall.js +356 -110
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +54 -25
- package/dist/application/UpdateCommandProgress.js +66 -0
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +18 -31
- package/dist/application/UpdateRuntime.js +198 -54
- package/dist/application/WebModuleTraceService.js +42 -22
- package/dist/application/WebNetworkCaptureService.js +24 -12
- package/dist/application/WebRuntimeService.js +41 -8
- package/dist/application/WebScriptExportService.js +6 -4
- package/dist/application/WebSourceLocationService.js +23 -8
- package/dist/application/WindowsCapabilities.js +18 -15
- package/dist/application/WorkflowEvidence.js +31 -1
- package/dist/application/analysisView/AnalysisViewService.js +46 -11
- package/dist/application/android/AndroidAnalysisService.js +5 -4
- package/dist/application/android/AndroidPackageInspection.js +25 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +98 -0
- package/dist/application/artifacts/ArtifactComparisonEvidence.js +32 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +14 -11
- package/dist/application/binary/AnalysisProviderRegistry.js +365 -60
- package/dist/application/binary/AnalysisSnapshotCache.js +41 -20
- package/dist/application/binary/AnalysisSnapshotFiles.js +75 -9
- package/dist/application/binary/BinarySession.js +308 -117
- package/dist/application/binary/BinarySessionExecution.js +5 -4
- package/dist/application/binary/BinarySessionOpen.js +13 -6
- package/dist/application/binary/BinarySessionRecords.js +36 -7
- package/dist/application/binary/BinarySessionStatus.js +96 -27
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +116 -28
- package/dist/application/binary/LazyAnalysisProvider.js +6 -66
- package/dist/application/binary/SessionProviderRouter.js +16 -4
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +14 -5
- package/dist/application/binaryDiagnostics/PeResourcesService.js +25 -5
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +17 -7
- package/dist/application/captures/PacketCaptureService.js +84 -0
- package/dist/application/closeOwnedWebResources.js +37 -0
- package/dist/application/electron/ElectronFusePort.js +1 -0
- package/dist/application/electron/ElectronFuseService.js +45 -0
- package/dist/application/evm/EvmInterfaceEvidence.js +11 -0
- package/dist/application/evm/EvmInterfaceService.js +5 -15
- package/dist/application/firmware/FirmwareAnalysisService.js +4 -3
- package/dist/application/flutter/DartAotInspection.js +26 -0
- package/dist/application/flutter/FlutterBuildAnalysisPort.js +1 -0
- package/dist/application/flutter/FlutterBuildAnalysisService.js +13 -0
- package/dist/application/frida/FridaInstrumentationPort.js +8 -0
- package/dist/application/frida/FridaInstrumentationService.js +310 -0
- package/dist/application/frida/fridaInputErrors.js +17 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +79 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/investigation/EvidenceLedger.js +43 -18
- package/dist/application/investigation/InvestigationRecords.js +12 -21
- package/dist/application/investigation/UnknownEvidence.js +22 -18
- package/dist/application/javascript/ElectronActiveObservationService.js +55 -25
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +17 -3
- package/dist/application/javascript/ElectronBoundaryGraph.js +2 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +144 -0
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +26 -7
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +61 -11
- package/dist/application/javascript/ElectronEvidence.js +1 -2
- package/dist/application/javascript/ElectronObservationService.js +41 -8
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +21 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +29 -14
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +119 -49
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +30 -1
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +51 -21
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +31 -7
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +28 -6
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +25 -14
- package/dist/application/javascript/JavaScriptArtifactGraphEvidence.js +3 -3
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +186 -50
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +173 -14
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +959 -188
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +57 -32
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +2 -0
- package/dist/application/javascript/JavaScriptModuleRelationships.js +34 -12
- package/dist/application/javascript/JavaScriptRecoveryService.js +29 -9
- package/dist/application/javascript/JavaScriptRuntimeObservationEvidence.js +1 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +33 -9
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +0 -1
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +4 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +138 -43
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +13 -4
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +23 -3
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +18 -5
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +67 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +4 -6
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +2 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +5 -8
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +0 -1
- package/dist/application/managed/ManagedApplicationGraphService.js +0 -1
- package/dist/application/managed/ManagedMemberComparisonService.js +72 -54
- package/dist/application/managed/ManagedNativeVerificationService.js +0 -1
- package/dist/application/managed/ManagedReconstructionService.js +0 -1
- package/dist/application/native/NativeCallRoutes.js +78 -41
- package/dist/application/native/NativeDispatchMetadataInspection.js +6 -2
- package/dist/application/native/NativeUiActionTrace.js +43 -22
- package/dist/application/native/NativeValueTrace.js +65 -23
- package/dist/application/pcap/PcapAnalysisPort.js +1 -0
- package/dist/application/pcap/PcapAnalysisService.js +24 -0
- package/dist/application/process/ProcessCli.js +33 -13
- package/dist/application/reverse/ReverseEngineeringCommandPort.js +1 -0
- package/dist/application/reverse/ReverseEngineeringService.js +688 -0
- package/dist/application/rust/RustBinaryPort.js +1 -0
- package/dist/application/rust/RustBinaryService.js +82 -0
- package/dist/application/signals/SignalRecordingService.js +84 -0
- package/dist/application/sqlite/SqliteDatabaseCapability.js +30 -0
- package/dist/application/sqlite/SqliteDatabasePort.js +1 -0
- package/dist/application/sqlite/SqliteDatabaseService.js +76 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +76 -0
- package/dist/application/wasm/WasmInterfaceComparisonService.js +188 -0
- package/dist/artifacts/AnalysisCleanupLease.js +119 -0
- package/dist/artifacts/ArtifactFileOperation.js +150 -0
- package/dist/artifacts/ArtifactHash.js +15 -3
- package/dist/artifacts/ArtifactPaths.js +4 -7
- package/dist/artifacts/ArtifactProvider.js +24 -9
- package/dist/artifacts/ArtifactReader.js +63 -5
- package/dist/artifacts/ArtifactResourceScope.js +92 -9
- package/dist/artifacts/AsarArtifactReader.js +186 -120
- package/dist/artifacts/AsarEntryStream.js +49 -17
- package/dist/artifacts/AsarListing.js +78 -0
- package/dist/artifacts/DirectoryArtifactReader.js +119 -28
- package/dist/artifacts/MachOSliceArtifactReader.js +153 -23
- package/dist/artifacts/NativeDmgArtifactReader.js +264 -62
- package/dist/artifacts/OrderedReads.js +57 -0
- package/dist/artifacts/SafeOutputTree.js +24 -7
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +1 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +10 -16
- package/dist/artifacts/ZipArtifactReader.js +150 -25
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +79 -68
- package/dist/artifacts/apple/DylibFileAccess.js +106 -0
- package/dist/artifacts/apple/DylibResolutionReader.js +72 -157
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +108 -29
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +81 -28
- package/dist/artifacts/apple/KeyedArchiveReader.js +23 -13
- package/dist/artifacts/apple/MachoLoadCommandReader.js +77 -61
- package/dist/artifacts/apple/NibArchive.js +11 -4
- package/dist/artifacts/apple/PlistNumberLiterals.js +106 -118
- package/dist/artifacts/extraction/ArtifactExtraction.js +21 -19
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +139 -41
- package/dist/artifacts/inventory/classify.js +36 -17
- package/dist/artifacts/inventory/hashStableRootArtifact.js +14 -7
- package/dist/artifacts/inventory/reader.js +36 -21
- package/dist/artifacts/inventory/scanCanonical.js +27 -21
- package/dist/artifacts/inventory/scanReader.js +36 -10
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +166 -8
- package/dist/artifacts/readArtifactFileChunks.js +9 -0
- package/dist/artifacts/readStableArtifact.js +13 -11
- package/dist/browser/BrowserProcessStartup.js +20 -9
- package/dist/browser/BrowserScenarioPartialObservation.js +74 -92
- package/dist/browser/BrowserScenarioSecrets.js +176 -46
- package/dist/browser/CdpBrowserProvider.js +124 -102
- package/dist/browser/CdpCaptureDocuments.js +232 -102
- package/dist/browser/CdpCaptureDomSvg.js +80 -76
- package/dist/browser/CdpCaptureEventBodyShapes.js +9 -5
- package/dist/browser/CdpCaptureEventHandlers.js +23 -12
- package/dist/browser/CdpCaptureEvents.js +49 -10
- package/dist/browser/CdpCaptureStorage.js +22 -5
- package/dist/browser/CdpCaptureStorageFingerprints.js +54 -11
- package/dist/browser/CdpCaptureValues.js +12 -1
- package/dist/browser/CdpConnection.js +135 -30
- package/dist/browser/CdpElectronInspection.js +74 -64
- package/dist/browser/CdpElectronProvider.js +63 -6
- package/dist/browser/CdpElectronScriptEvents.js +4 -1
- package/dist/browser/CdpElectronScripts.js +4 -6
- package/dist/browser/CdpElectronWorkers.js +20 -4
- package/dist/browser/CdpEndpoint.js +143 -17
- package/dist/browser/CdpObservationSession.js +24 -8
- package/dist/browser/CdpPageCapture.js +68 -17
- package/dist/browser/CdpPageCaptureScripts.js +18 -13
- package/dist/browser/CdpPageCaptureWorkers.js +46 -11
- package/dist/browser/CdpSafeMetadata.js +32 -24
- package/dist/browser/CdpScreenshot.js +5 -14
- package/dist/browser/CdpSnapshotNodes.js +103 -0
- package/dist/browser/CdpSnapshotStrings.js +15 -0
- package/dist/browser/CdpTargetSession.js +76 -7
- package/dist/browser/CdpTargetSessionOwner.js +198 -0
- package/dist/browser/CdpWebMcpDiscovery.js +23 -6
- package/dist/browser/ElectronCaptureCleanup.js +82 -0
- package/dist/browser/ElectronProcessCleanup.js +91 -0
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +75 -20
- package/dist/browser/PlaywrightElectronActiveActions.js +57 -9
- package/dist/browser/PlaywrightElectronActiveFuses.js +86 -0
- package/dist/browser/PlaywrightElectronActiveProjection.js +21 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +237 -175
- package/dist/browser/PlaywrightExecutionBoundary.js +6 -4
- package/dist/browser/PlaywrightScenarioBrowser.js +240 -91
- package/dist/browser/PlaywrightScenarioEvents.js +287 -38
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +336 -0
- package/dist/browser/PlaywrightScenarioSession.js +151 -46
- package/dist/browser/PlaywrightScenarioStorage.js +15 -7
- package/dist/browser/StructuredFieldToken.js +53 -0
- package/dist/browser/WebArtifactCleanup.js +53 -0
- package/dist/browser/WebSourceMapFetcher.js +181 -89
- package/dist/browser/assets/LocalWebScriptArtifacts.js +24 -3
- package/dist/browser/assets/PublishWebScripts.js +13 -2
- package/dist/browser/assets/ScenarioScriptCapture.js +2 -1
- package/dist/browser/assets/WebArtifactReads.js +15 -3
- package/dist/browser/assets/WebSourceLocationArtifacts.js +47 -3
- package/dist/browser/execution/CdpRuntimeSession.js +36 -7
- package/dist/browser/execution/CdpWebRuntimeProvider.js +22 -4
- package/dist/browser/history/CaptureFailures.js +29 -10
- package/dist/browser/history/CaptureFormatError.js +2 -2
- package/dist/browser/history/{HarJson.js → CaptureJson.js} +14 -4
- package/dist/browser/history/CaptureRedaction.js +16 -3
- package/dist/browser/history/CaptureRelease.js +20 -2
- package/dist/browser/history/HarCapture.js +54 -30
- package/dist/browser/history/HarSchema.js +36 -36
- package/dist/browser/history/HistoricalCaptureDecoder.js +93 -25
- package/dist/browser/history/NodeCaptureAdapter.js +48 -0
- package/dist/browser/history/{HarCaptureProcess.js → NodeCaptureProcess.js} +18 -9
- package/dist/browser/history/QlogCapture.js +385 -0
- package/dist/browser/history/SazCapture.js +130 -0
- package/dist/browser/history/SazHttp.js +61 -0
- package/dist/browser/history/SazMetadata.js +55 -0
- package/dist/browser/history/SazProjection.js +90 -0
- package/dist/browser/modules/NativeModuleResolver.js +248 -131
- package/dist/browser/modules/WebModuleArtifacts.js +49 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +67 -9
- package/dist/browser/network/PlaywrightScenarioNetwork.js +249 -26
- package/dist/captures/TsharkCaptureProvider.js +377 -0
- package/dist/captures/parseFieldDiscovery.js +66 -0
- package/dist/captures/parsePacketOutput.js +21 -0
- package/dist/catalogIdentity.js +58 -42
- package/dist/cli/adbCommands.js +20 -21
- package/dist/cli/analysisViewCommands.js +1 -1
- package/dist/cli/androidCommands.js +13 -16
- package/dist/cli/apktoolCommands.js +14 -25
- package/dist/cli/applicationCommands.js +44 -17
- package/dist/cli/artifactCommands.js +1 -1
- package/dist/cli/binaryDiagnosticsCommands.js +17 -13
- package/dist/cli/browserAdvancedCommands.js +46 -26
- package/dist/cli/browserCommands.js +59 -33
- package/dist/cli/captureCommands.js +72 -0
- package/dist/cli/cliResultOutput.js +274 -0
- package/dist/cli/coreBinaryCommands.js +77 -30
- package/dist/cli/coreNativeCommands.js +53 -31
- package/dist/cli/cutterCommands.js +88 -0
- package/dist/cli/electronCommands.js +76 -13
- package/dist/cli/evmCommands.js +9 -19
- package/dist/cli/finishAnalysisCommand.js +52 -0
- package/dist/cli/firmwareCommands.js +20 -50
- package/dist/cli/flutterCommands.js +53 -0
- package/dist/cli/fridaCommands.js +219 -0
- package/dist/cli/goCommands.js +20 -0
- package/dist/cli/interactiveSetup.js +11 -1
- package/dist/cli/javascriptApplicationAnalysis.js +1 -1
- package/dist/cli/javascriptRecoveryCommands.js +18 -23
- package/dist/cli/jebCommands.js +2 -14
- package/dist/cli/jsonOutput.js +2 -2
- package/dist/cli/managedCommands.js +31 -3
- package/dist/cli/options.js +26 -2
- package/dist/cli/pcapCommands.js +29 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/reverseEngineeringCommands.js +268 -0
- package/dist/cli/rustCommands.js +20 -0
- package/dist/cli/setupCommands.js +41 -12
- package/dist/cli/signalCommands.js +72 -0
- package/dist/cli/sqliteCommands.js +52 -0
- package/dist/cli/utilityCommands.js +116 -74
- package/dist/cli/wasmCommands.js +50 -0
- package/dist/cli/webModuleCommands.js +27 -38
- package/dist/cli/webNetworkCaptureCommands.js +10 -9
- package/dist/cli/webRuntimeCommands.js +15 -6
- package/dist/cli/webSourceLocationCommands.js +14 -33
- package/dist/cli-runtime/AnalysisCleanupLease-CWfTGYKd.js +103 -0
- package/dist/cli-runtime/AnalysisProvider-BGrYaMVo.js +38 -0
- package/dist/cli-runtime/AnalysisSnapshotCache-BjRlXeUS.js +711 -0
- package/dist/cli-runtime/ArtifactFileOperation-Dg4BcoEM.js +122 -0
- package/dist/cli-runtime/ArtifactReader-DMwm42bk.js +78 -0
- package/dist/cli-runtime/ArtifactResourceScope-CokZGcII.js +175 -0
- package/dist/cli-runtime/AsarHeader-BxwU17DJ.js +31 -0
- package/dist/cli-runtime/BinarySessionStatus-DRhjr7Vb.js +212 -0
- package/dist/cli-runtime/BinaryTargetResolver-tuCTjBlQ.js +1238 -0
- package/dist/cli-runtime/BoundedFileBytes-DRtiQNAQ.js +43 -0
- package/dist/cli-runtime/CdpTargetSession-CQ08KHbh.js +925 -0
- package/dist/cli-runtime/ClientConfigPath-Dn-V_GUf.js +255 -0
- package/dist/cli-runtime/ClientConfigurationDocument-C9T8MNGc.js +2021 -0
- package/dist/cli-runtime/ClientRegistrationStatus-PnD29RTX.js +585 -0
- package/dist/cli-runtime/CurrentEntrypointPath-m7QCIVN0.js +14 -0
- package/dist/cli-runtime/DirectAnalysis-C5NyUryV.js +581 -0
- package/dist/cli-runtime/DirectoryArtifactReader-CokAJ8vo.js +448 -0
- package/dist/cli-runtime/Doctor-DrkWsav4.js +668 -0
- package/dist/cli-runtime/ElectronFileScope-AP7VoVr7.js +1109 -0
- package/dist/cli-runtime/ElectronFuseFailures-DsjXR7Xp.js +609 -0
- package/dist/cli-runtime/ExecFileOutput-D6KLYTve.js +119 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-CW1IO3dG.js +298 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-DTH5QAqL.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-CFh4a64d.js +118 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-gOmPB2L6.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-WZgtK_Ok.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-B1bwMM1a.js +86 -0
- package/dist/cli-runtime/JebMcpEndpoint-BEalGZh9.js +710 -0
- package/dist/cli-runtime/JsonFiles-uvd6ZyQi.js +600 -0
- package/dist/cli-runtime/KunaInstallation-P0j3x851.js +1781 -0
- package/dist/cli-runtime/MacCodeSignature-MgYbRK_H.js +24 -0
- package/dist/cli-runtime/MacHopperPaths-bGzqjF1Z.js +34 -0
- package/dist/cli-runtime/MachoLoadCommandReader-CZm6N5vF.js +330 -0
- package/dist/cli-runtime/ManagedSnapshot-CPE9C3OD.js +4481 -0
- package/dist/cli-runtime/OwnedCommandCleanup-BN_V6Erc.js +187 -0
- package/dist/cli-runtime/OwnedRegularFile-D1f5nUCx.js +256 -0
- package/dist/cli-runtime/OwnedStagedOutput-D31dOozz.js +126 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-Cd23u6jd.js +296 -0
- package/dist/cli-runtime/ProcessOwnership-CtrNr6ee.js +545 -0
- package/dist/cli-runtime/ProcessOwnershipObservation-C006iCtZ.js +920 -0
- package/dist/cli-runtime/ProviderDeadline-rSuH4Pm8.js +148 -0
- package/dist/cli-runtime/ProviderOperationExecution-CmU-XrQr.js +38 -0
- package/dist/cli-runtime/ProviderProcess-D87A7ctp.js +770 -0
- package/dist/cli-runtime/RegularFileRead-mbgGYtxe.js +125 -0
- package/dist/cli-runtime/SafeOutputTree-i904hd_2.js +525 -0
- package/dist/cli-runtime/SetupHost-CMPmPraB.js +1268 -0
- package/dist/cli-runtime/SharedStartupAttempt-BxKyf3Uv.js +1424 -0
- package/dist/cli-runtime/StableFileHash-Ame_h3lY.js +61 -0
- package/dist/cli-runtime/SupportedClients-DMafjitv.js +1066 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-DAsASWlE.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/WindowsBatchCommand-Cx9kaVNf.js +97 -0
- package/dist/cli-runtime/WindowsNativeLoader-BqyZO0ZD.js +142 -0
- package/dist/cli-runtime/ZipArtifactReader-Jed69LEL.js +252 -0
- package/dist/cli-runtime/analysisErrorCleanup-COdAmDsb.js +33 -0
- package/dist/cli-runtime/appleArchiveFormat-Bb3G5CCI.js +269 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-F74bu9oy.js +150 -0
- package/dist/cli-runtime/application__EnhancedTools-Bg51b0Yp.js +1820 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-DBWIaYCh.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-AEPNpZqJ.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-Cl9cPEZf.js +828 -0
- package/dist/cli-runtime/application__Setup-DwQzEewK.js +526 -0
- package/dist/cli-runtime/application__Uninstall-BOf9oyvQ.js +468 -0
- package/dist/cli-runtime/application__UpdateRuntime-CzWkRJHa.js +435 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-shW_aKlj.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-DIv6d3wB.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-OIUFVQFV.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-wvCh72hK.js +118 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-SydXPCwM.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-o0uEsjEc.js +12254 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-BAheG_71.js +2336 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-Cnn4GP8q.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-CmvLfV1A.js +299 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-wx2K0F2I.js +2205 -0
- package/dist/cli-runtime/binary-CWVNJhAC.js +19608 -0
- package/dist/cli-runtime/catalogIdentity-DAEEsOdX.js +1112 -0
- package/dist/cli-runtime/cli.js +44469 -0
- package/dist/cli-runtime/cliOutput-CgSuw782.js +163 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/cliResultOutput-10sd6xGx.js +1453 -0
- package/dist/cli-runtime/cliResultOutput.js +6 -0
- package/dist/cli-runtime/composition__browserScenario-BtPb1c1y.js +3414 -0
- package/dist/cli-runtime/composition__electronObservation-Bk8R6DJo.js +614 -0
- package/dist/cli-runtime/composition__electronScenario-BVF0qStH.js +916 -0
- package/dist/cli-runtime/cutterToolContracts-BQtG_Nzo.js +5267 -0
- package/dist/cli-runtime/doctorRuntime-B__SIpm-.js +478 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-DO5Yzcp4.js +5 -0
- package/dist/cli-runtime/errorSchemas-Ixz_q7qt.js +655 -0
- package/dist/cli-runtime/homeDirectory-DC_DeJIg.js +18 -0
- package/dist/cli-runtime/javascriptApplicationAnalysis-Dk6yBV8g.js +2088 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-CObOIiQ6.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-DpwuBenh.js +1244 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-C6ZgWMys.js +1509 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-D6tZKUQs.js +247 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-C7m0b6_w.js +126 -0
- package/dist/cli-runtime/lipo-DPQ6qurH.js +394 -0
- package/dist/cli-runtime/logger-BuDJ9xxO.js +48 -0
- package/dist/cli-runtime/machoContainer-Cy98bkFm.js +352 -0
- package/dist/cli-runtime/managedApplicationGraph-BazVqpJv.js +1136 -0
- package/dist/cli-runtime/managedToolContracts-BuFkMBH5.js +99 -0
- package/dist/cli-runtime/mcpDoctor.js +361 -0
- package/dist/cli-runtime/mcpStartupPolicy-imCbM3qo.js +28 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-DTcRhuGA.js +5502 -0
- package/dist/cli-runtime/officialToolContracts-CzzVLx8I.js +1522 -0
- package/dist/cli-runtime/peMachine-B9ggfSJJ.js +95 -0
- package/dist/cli-runtime/propertyListKeys-D5dSASEy.js +355 -0
- package/dist/cli-runtime/providerCleanupError-BhsJyAhk.js +25 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerStartupTimeout-B2tF2LtZ.js +17 -0
- package/dist/cli-runtime/readArtifactFileChunks-BbTL_PtB.js +129 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-Bi6sect1.js +22156 -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-CcDFUr-w.js +2594 -0
- package/dist/cli-runtime/snapshotEnvironment-Yvx5qwsl.js +196 -0
- package/dist/cli-runtime/toolContracts-CJzEyZ38.js +3795 -0
- package/dist/cli-runtime/toolOutputSchemaGroups-BqdSzySu.js +12249 -0
- package/dist/cli-runtime/workflowInputError-BP8z9Wxl.js +26 -0
- package/dist/cli.js +48 -5
- package/dist/cliBrowserScenarioCommands.js +41 -7
- package/dist/cliCommandNames.js +48 -0
- package/dist/cliEvidenceCommands.js +0 -1
- package/dist/cliJavaScriptRuntimeCommands.js +16 -14
- package/dist/cliJsonInput.js +12 -4
- package/dist/cliLogging.js +66 -15
- package/dist/cliObservationOptions.js +9 -0
- package/dist/cliOutput.js +105 -7
- package/dist/composition/binary.js +19 -2
- package/dist/composition/captures.js +3 -0
- package/dist/composition/directAnalysis.js +36 -11
- package/dist/composition/electronFuses.js +4 -0
- package/dist/composition/evm.js +12 -0
- package/dist/composition/flutter.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +8 -8
- package/dist/composition/jeb.js +45 -5
- package/dist/composition/pcap.js +3 -0
- package/dist/composition/resolveWindowsProviderExecutable.js +61 -0
- package/dist/composition/reverseEngineering.js +29 -0
- package/dist/composition/rust.js +4 -0
- package/dist/composition/signals.js +3 -0
- package/dist/composition/sqlite.js +4 -0
- package/dist/composition/wasm.js +22 -0
- package/dist/composition/webNetworkCaptures.js +7 -2
- package/dist/config/environment.js +79 -4
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/homeDirectory.js +9 -6
- package/dist/config/mcpInputSchemaProfile.js +5 -1
- package/dist/config/mcpOutputSchemaProfile.js +22 -0
- package/dist/config/parseConfig.js +28 -34
- package/dist/config/parsers.js +4 -3
- package/dist/config/{ghidraStartupTimeout.js → providerStartupTimeout.js} +7 -3
- package/dist/contracts/adb/adbToolContracts.js +8 -8
- package/dist/contracts/analysisDetail.js +6 -3
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +65 -3
- package/dist/contracts/android/androidToolContracts.js +17 -8
- package/dist/contracts/apktool/apktoolToolContracts.js +5 -1
- package/dist/contracts/applicationToolContracts.js +17 -2
- package/dist/contracts/artifactComparisonExample.js +18 -14
- package/dist/contracts/artifactToolContracts.js +16 -3
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +13 -1
- package/dist/contracts/captures/captureToolContracts.js +42 -0
- package/dist/contracts/compactInputSchema.js +39 -12
- package/dist/contracts/cutterToolContracts.js +84 -0
- package/dist/contracts/enhancedToolContracts.js +2 -2
- package/dist/contracts/evm/evmToolContracts.js +30 -15
- package/dist/contracts/firmware/firmwareToolContracts.js +1 -1
- package/dist/contracts/flutter/flutterToolContracts.js +47 -0
- package/dist/contracts/fridaRemoteAddress.js +23 -0
- package/dist/contracts/fridaToolContracts.js +274 -0
- package/dist/contracts/functionComparisonExample.js +12 -1
- package/dist/contracts/gdbToolContracts.js +102 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +15 -0
- package/dist/contracts/inputSchemaPresentation.js +199 -38
- package/dist/contracts/investigationExamples.js +1 -0
- package/dist/contracts/javascript/electronToolContracts.js +27 -2
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +1 -0
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +13 -1
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +1 -0
- package/dist/contracts/jsonSchemaKeywords.js +29 -0
- package/dist/contracts/managed/managedToolContracts.js +43 -4
- package/dist/contracts/managed/managedWorkflowExamples.js +10 -1
- package/dist/contracts/managed/managedWorkflowToolContracts.js +4 -30
- package/dist/contracts/mobileApplicationGraphExamples.js +27 -12
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +3 -2
- package/dist/contracts/native/nativeToolContracts.js +10 -6
- package/dist/contracts/officialToolContracts.js +7 -7
- package/dist/contracts/pcap/pcapToolContracts.js +33 -0
- package/dist/contracts/providerSelection.js +1 -0
- package/dist/contracts/reconstructionReadinessExample.js +126 -119
- package/dist/contracts/reverseEngineeringToolContracts.js +52 -0
- package/dist/contracts/rizinDebugToolContracts.js +97 -0
- package/dist/contracts/rust/rustToolContracts.js +20 -0
- package/dist/contracts/sessionLifecycleInputs.js +34 -2
- package/dist/contracts/sessionToolContracts.js +4 -4
- package/dist/contracts/sessionToolSchemas.js +14 -0
- package/dist/contracts/signals/signalToolContracts.js +40 -0
- package/dist/contracts/sqlite/sqliteToolContracts.js +36 -0
- package/dist/contracts/toolContractExamples.js +29 -0
- package/dist/contracts/toolContractTypes.js +2 -0
- package/dist/contracts/toolContracts.js +26 -0
- package/dist/contracts/toolEffects.js +252 -9
- package/dist/contracts/toolOutputSchemaGroups.js +78 -32
- package/dist/contracts/toolOutputSchemaPrimitives.js +118 -10
- package/dist/contracts/toolSchemaMetadata.js +102 -16
- package/dist/contracts/unknownContractExamples.js +1 -1
- package/dist/contracts/wasm/wasmComparisonContracts.js +52 -0
- package/dist/contracts/wasm/wasmToolContracts.js +33 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +15 -4
- package/dist/cutter/CutterBridgeClient.js +760 -0
- package/dist/cutter/CutterBridgeService.js +187 -0
- package/dist/doctorRuntime.js +41 -8
- package/dist/domain/adb/adbDeviceAnalysis.js +45 -5
- package/dist/domain/analysisErrorBase.js +79 -2
- package/dist/domain/analysisErrorCleanup.js +4 -2
- package/dist/domain/analysisErrorCore.js +32 -0
- package/dist/domain/analysisErrorPresentation.js +80 -20
- package/dist/domain/analysisErrorProjection.js +72 -37
- package/dist/domain/analysisProfile.js +7 -3
- package/dist/domain/analysisSearch.js +26 -0
- package/dist/domain/analysisSnapshot.js +312 -185
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +353 -0
- package/dist/domain/analysisView/analysisView.js +391 -44
- package/dist/domain/analysisView/analysisViewCoverage.js +32 -0
- package/dist/domain/analysisView/analysisViewDataAdmission.js +86 -0
- package/dist/domain/analysisView/analysisViewErrors.js +4 -0
- package/dist/domain/analysisView/analysisViewParent.js +12 -0
- package/dist/domain/analysisView/analysisViewText.js +29 -0
- package/dist/domain/analysisView/androidPackageView.js +102 -0
- package/dist/domain/analysisView/artifactInventoryView.js +126 -0
- package/dist/domain/analysisView/binaryLayoutView.js +11 -4
- package/dist/domain/analysisView/dartAotView.js +93 -0
- package/dist/domain/analysisView/evmInterfaceView.js +105 -0
- package/dist/domain/analysisView/interfaceBuilderView.js +182 -0
- package/dist/domain/analysisView/javascriptApplicationCoverage.js +27 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +123 -49
- package/dist/domain/analysisView/javascriptFactsView.js +92 -0
- package/dist/domain/analysisView/javascriptModuleReferences.js +37 -0
- package/dist/domain/analysisView/machoView.js +186 -0
- package/dist/domain/analysisView/managedArtifactView.js +108 -0
- package/dist/domain/analysisView/managedMemberView.js +215 -0
- package/dist/domain/analysisView/nativeFunctionView.js +20 -25
- package/dist/domain/analysisView/pcapCaptureView.js +264 -0
- package/dist/domain/analysisView/qlogCaptureView.js +198 -0
- package/dist/domain/analysisView/wasmArtifactView.js +162 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +123 -0
- package/dist/domain/analysisView/webNetworkCaptureView.js +388 -0
- package/dist/domain/android/androidAnalysis.js +36 -2
- package/dist/domain/android/androidApplication.js +37 -64
- package/dist/domain/apktool/apktoolResourceAnalysis.js +70 -8
- package/dist/domain/apple/appleApplication.js +70 -87
- package/dist/domain/apple/appleArchiveFormat.js +184 -0
- package/dist/domain/apple/appleAssetCatalog.js +15 -0
- package/dist/domain/apple/appleBundleAnatomy.js +57 -69
- package/dist/domain/apple/dyldPaths.js +9 -2
- package/dist/domain/apple/dylibResolution.js +24 -10
- package/dist/domain/apple/dylibResolutionFindings.js +8 -9
- package/dist/domain/apple/interfaceBuilderGraph.js +78 -33
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +39 -12
- package/dist/domain/apple/jvmClassFile.js +226 -0
- package/dist/domain/apple/keyedArchive.js +39 -17
- package/dist/domain/apple/machoContainer.js +123 -8
- package/dist/domain/apple/machoCpuIdentity.js +4 -0
- package/dist/domain/apple/plistNumbers.js +67 -5
- package/dist/domain/apple/plistValue.js +95 -19
- package/dist/domain/artifactComparison.js +116 -37
- package/dist/domain/artifactDecompressionBudget.js +26 -0
- package/dist/domain/artifactGraph.js +18 -9
- package/dist/domain/artifactIdentity.js +4 -1
- package/dist/domain/artifactInspection.js +34 -3
- package/dist/domain/artifactInventoryEvidence.js +146 -40
- package/dist/domain/binaryTarget.js +251 -109
- package/dist/domain/binaryTargetTypes.js +24 -1
- package/dist/domain/browserNetworkEvidence.js +24 -3
- package/dist/domain/browserObservation.js +92 -56
- package/dist/domain/browserObservationError.js +4 -4
- package/dist/domain/browserObservationSchemas.js +4 -1
- package/dist/domain/browserScenarioCapture.js +11 -1
- package/dist/domain/browserScenarioCaptureLimits.js +34 -0
- package/dist/domain/browserScenarioCaptureValues.js +76 -2
- package/dist/domain/browserScenarioDiff.js +120 -11
- package/dist/domain/browserScenarioDiffEvidence.js +44 -13
- package/dist/domain/browserScenarioDiffValues.js +10 -3
- package/dist/domain/browserScenarioNetworkComparison.js +158 -0
- package/dist/domain/browserScenarioNormalization.js +10 -13
- package/dist/domain/browserScenarioValues.js +7 -13
- package/dist/domain/browserSession.js +2 -2
- package/dist/domain/bundleComparison.js +1 -5
- package/dist/domain/callPath.js +40 -3
- package/dist/domain/captures/packetCapture.js +139 -0
- package/dist/domain/captures/packetFields.js +81 -0
- package/dist/domain/changedBehavior.js +43 -41
- package/dist/domain/comparisonSourceEvidence.js +6 -0
- package/dist/domain/dosCom.js +2 -2
- package/dist/domain/dosMz.js +66 -19
- package/dist/domain/electron/electronFuseEvidence.js +42 -0
- package/dist/domain/electron/electronFuses.js +360 -0
- package/dist/domain/elfFixedHeader.js +66 -0
- package/dist/domain/evidence.js +105 -39
- package/dist/domain/evidenceBundle.js +67 -22
- package/dist/domain/evidenceErrors.js +5 -0
- package/dist/domain/evm/evmInterface.js +18 -4
- package/dist/domain/evm/solidityMetadata.js +70 -0
- package/dist/domain/explicitSensitiveFailure.js +44 -23
- package/dist/domain/fileSnapshotObservation.js +25 -0
- package/dist/domain/firmware/firmwareAnalysis.js +29 -0
- package/dist/domain/fixedTupleSchema.js +9 -0
- package/dist/domain/flutter/flutterBuildAnalysis.js +141 -0
- package/dist/domain/functionCallCoverage.js +60 -0
- package/dist/domain/functionComparisonDimensions.js +136 -18
- package/dist/domain/functionComparisonNormalization.js +83 -19
- package/dist/domain/functionComparisonResults.js +7 -6
- package/dist/domain/functionComparisonSchemas.js +14 -3
- package/dist/domain/functionDossierEvidence.js +4 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +156 -0
- package/dist/domain/hopperErrors.js +19 -18
- package/dist/domain/hopperPublisher.js +12 -0
- package/dist/domain/hopperValues.js +135 -34
- package/dist/domain/javascript/electronActiveObservation.js +1 -0
- package/dist/domain/javascript/electronObservation.js +4 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +94 -33
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +3 -1
- package/dist/domain/javascript/electronStaticAnalysisNative.js +19 -5
- package/dist/domain/javascript/electronStaticAnalysisValues.js +14 -28
- package/dist/domain/javascript/electronStaticOptionObjects.js +45 -0
- package/dist/domain/javascript/electronWrappedCallPaths.js +551 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +94 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +37 -1
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +7 -0
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +10 -2
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +1 -1
- package/dist/domain/javascript/javascriptApplicationGraph.js +17 -1
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +8 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +3 -1
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +49 -21
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +31 -18
- package/dist/domain/javascript/javascriptArtifactFiles.js +2 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +89 -24
- package/dist/domain/javascript/javascriptAstValues.js +132 -5
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptBootstrapIntegrity.js +372 -0
- package/dist/domain/javascript/javascriptBuiltinResourceMethods.js +8 -0
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +278 -0
- package/dist/domain/javascript/javascriptCommonJsExportReceivers.js +231 -0
- package/dist/domain/javascript/javascriptContextBridgeExposure.js +23 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +96 -22
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +6 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +1 -1
- package/dist/domain/javascript/javascriptFeatureSeed.js +34 -17
- package/dist/domain/javascript/javascriptFeatureTrace.js +9 -3
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +42 -11
- package/dist/domain/javascript/javascriptGraphqlOperations.js +382 -0
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +132 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +48 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +618 -0
- package/dist/domain/javascript/javascriptModuleResolutionMode.js +18 -0
- package/dist/domain/javascript/javascriptModuleSpecifier.js +5 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +7 -12
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +12 -5
- package/dist/domain/javascript/javascriptRpcEndpoints.js +7 -93
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +16 -0
- package/dist/domain/javascript/javascriptRuntimeObservation.js +4 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +45 -16
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +65 -47
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +113 -11
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +511 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +706 -204
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +54 -54
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +59 -30
- package/dist/domain/javascript/javascriptSemanticCallableStack.js +52 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +10 -15
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +163 -92
- package/dist/domain/javascript/javascriptSemanticCoverage.js +5 -1
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +435 -45
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +46 -29
- package/dist/domain/javascript/javascriptSemanticDependencies.js +69 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +1 -1
- package/dist/domain/javascript/javascriptSemanticEvaluationOrder.js +126 -0
- package/dist/domain/javascript/javascriptSemanticExpressionShapes.js +111 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +11 -14
- package/dist/domain/javascript/javascriptSemanticGetterQueries.js +147 -0
- package/dist/domain/javascript/javascriptSemanticGetterResults.js +264 -0
- package/dist/domain/javascript/javascriptSemanticGraph.js +22 -1
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +13 -1
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +5 -4
- package/dist/domain/javascript/javascriptSemanticMapOperations.js +51 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +421 -154
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +500 -27
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +377 -174
- package/dist/domain/javascript/javascriptSemanticObjects.js +53 -43
- package/dist/domain/javascript/javascriptSemanticOpaqueEffects.js +163 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +11 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +180 -95
- package/dist/domain/javascript/javascriptSemanticPromises.js +6 -9
- package/dist/domain/javascript/javascriptSemanticProvenance.js +5 -1
- package/dist/domain/javascript/javascriptSemanticQuery.js +7 -2
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +2 -1
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +1 -1
- package/dist/domain/javascript/javascriptSemanticReferenceSources.js +25 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +369 -8
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +3 -19
- package/dist/domain/javascript/javascriptSemanticResources.js +33 -44
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +81 -26
- package/dist/domain/javascript/javascriptSemanticReturns.js +37 -30
- package/dist/domain/javascript/javascriptSemanticState.js +225 -39
- package/dist/domain/javascript/javascriptSemanticTraversal.js +6 -4
- package/dist/domain/javascript/javascriptSemanticValues.js +379 -56
- package/dist/domain/javascript/javascriptSourceMapPaths.js +44 -17
- package/dist/domain/javascript/javascriptSourceParser.js +121 -7
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +69 -24
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +97 -23
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +488 -48
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +196 -78
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +4 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +1118 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +44 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +45 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +3 -1
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +2 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +50 -13
- package/dist/domain/jsonValue.js +37 -12
- package/dist/domain/localPath.js +6 -3
- package/dist/domain/managed/managedApplicationGraph.js +5 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +6 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +14 -10
- package/dist/domain/managed/managedArtifact.js +77 -1
- package/dist/domain/managed/managedInspectionEvidence.js +5 -6
- package/dist/domain/managed/managedMemberComparison.js +6 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +36 -3
- package/dist/domain/managed/managedMemberComparisonItems.js +135 -59
- package/dist/domain/managed/managedMemberComparisonMatch.js +237 -42
- package/dist/domain/managed/managedMemberSignatureIdentity.js +40 -0
- package/dist/domain/managed/managedNativeVerificationMatch.js +54 -31
- package/dist/domain/managed/managedNativeVerificationSchemas.js +15 -4
- package/dist/domain/managed/managedReconstruction.js +5 -8
- package/dist/domain/mobileApplicationGraphProjection.js +95 -0
- package/dist/domain/native/addressCoordinate.js +11 -0
- package/dist/domain/native/binaryLayout.js +2 -4
- package/dist/domain/native/bytePattern.js +121 -0
- package/dist/domain/native/nativeAotPe.js +31 -4
- package/dist/domain/native/nativeAotSnapshotObservation.js +18 -0
- package/dist/domain/native/nativeCallPartialObservation.js +14 -12
- package/dist/domain/native/nativeInspection.js +38 -4
- package/dist/domain/native/nativeInstruction.js +17 -2
- package/dist/domain/native/nativeInvestigationGraph.js +9 -5
- package/dist/domain/native/nativeLoadImage.js +32 -1
- package/dist/domain/native/nativeUiObservation.js +5 -6
- package/dist/domain/native/objcSwiftMetadata.js +19 -9
- package/dist/domain/native/peResources.js +14 -4
- package/dist/domain/native/recordedCrash.js +79 -10
- package/dist/domain/offsetDateTime.js +60 -0
- package/dist/domain/pcap/pcapAnalysis.js +91 -0
- package/dist/domain/pcap/pcapEvidence.js +15 -0
- package/dist/domain/peMachine.js +38 -0
- package/dist/domain/pngHeader.js +18 -0
- package/dist/domain/process/processCaptureCoverage.js +26 -3
- package/dist/domain/process/processCaptureExample.js +2 -0
- package/dist/domain/process/processCaptureValidation.js +33 -8
- package/dist/domain/process/processComparison.js +41 -13
- package/dist/domain/process/processScenario.js +7 -0
- package/dist/domain/process/processTraceDimensionProjection.js +1 -1
- package/dist/domain/process/processTraceEvaluation.js +119 -74
- package/dist/domain/process/processTraceSpecification.js +243 -89
- package/dist/domain/propertyListKeys.js +238 -23
- package/dist/domain/propertyListXml.js +149 -0
- package/dist/domain/propertyListXmlText.js +20 -4
- package/dist/domain/providerAdapterError.js +2 -5
- package/dist/domain/providerCleanupError.js +2 -4
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerSelectionError.js +2 -1
- package/dist/domain/qlogCapture.js +62 -0
- package/dist/domain/rawBinary.js +105 -0
- package/dist/domain/reconstructionCoverage.js +40 -24
- package/dist/domain/reconstructionCoverageEvaluation.js +50 -47
- package/dist/domain/reconstructionCoverageEvidence.js +26 -0
- package/dist/domain/reconstructionCoverageVerifierResults.js +35 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +104 -1
- package/dist/domain/reconstructionReadiness.js +4 -8
- package/dist/domain/reconstructionReadinessJourneyFindings.js +4 -1
- package/dist/domain/reconstructionUnknowns.js +9 -1
- package/dist/domain/reconstructionVerification.js +86 -43
- package/dist/domain/recordedTransportUrl.js +59 -0
- package/dist/domain/referenceSourceClassification.js +27 -23
- package/dist/domain/referenceSourceGraph.js +51 -13
- package/dist/domain/referenceSourceImportParsing.js +27 -13
- package/dist/domain/referenceSourcePathIdentity.js +13 -1
- package/dist/domain/referenceSourceRequireBindings.js +40 -108
- package/dist/domain/referenceSourceSummary.js +92 -0
- package/dist/domain/relationshipCoverage.js +43 -0
- package/dist/domain/residualUnknown.js +93 -26
- package/dist/domain/reverseEngineering.js +31 -0
- package/dist/domain/runtimeVersion.js +8 -0
- package/dist/domain/rust/rustBinary.js +200 -0
- package/dist/domain/signals/annotationTextWindow.js +31 -0
- package/dist/domain/signals/signalDecoders.js +69 -0
- package/dist/domain/signals/signalRecording.js +115 -0
- package/dist/domain/sourceMapContents.js +10 -3
- package/dist/domain/sourceMapEnvelope.js +17 -11
- package/dist/domain/sqlite/sqliteDatabase.js +189 -0
- package/dist/domain/staticRuntimeCorrelation.js +7 -9
- package/dist/domain/swiftSymbolClassification.js +17 -0
- package/dist/domain/symbolAnalysis.js +20 -7
- package/dist/domain/urlComponents.js +6 -0
- package/dist/domain/wasm/wasmArtifact.js +119 -0
- package/dist/domain/wasm/wasmInterface.js +89 -0
- package/dist/domain/webBundleAnalysis.js +14 -3
- package/dist/domain/webBundleAnalyzerAst.js +7 -2
- package/dist/domain/webBundleAnalyzerInspection.js +113 -57
- package/dist/domain/webBundleAnalyzerResult.js +18 -6
- package/dist/domain/webCaptureDiff.js +235 -51
- package/dist/domain/webCaptureFrameComparison.js +49 -0
- package/dist/domain/webInventory.js +28 -14
- package/dist/domain/webMcpDiscovery.js +5 -2
- package/dist/domain/webModuleImports.js +22 -27
- package/dist/domain/webModuleTrace.js +25 -8
- package/dist/domain/webNetworkCapture.js +101 -39
- package/dist/domain/webNetworkCaptureCoordinates.js +21 -0
- package/dist/domain/webRuntime.js +0 -1
- package/dist/domain/webScreenshot.js +2 -2
- package/dist/domain/webScriptArtifacts.js +2 -4
- package/dist/domain/webScriptExport.js +6 -8
- package/dist/domain/webScriptExportError.js +2 -3
- package/dist/domain/webScriptExportPlan.js +2 -2
- package/dist/domain/webSourceLocation.js +20 -9
- package/dist/domain/xmlDocument.js +41 -0
- package/dist/domain/zipPackageFormat.js +25 -3
- package/dist/dotnet/ManagedArtifactInspector.js +25 -12
- package/dist/dotnet/ManagedDecodeBudget.js +87 -9
- package/dist/dotnet/ManagedMemberInspector.js +127 -22
- package/dist/dotnet/ManagedMemberInspectorCore.js +408 -141
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +109 -37
- package/dist/dotnet/ManagedMemberOwnership.js +65 -0
- package/dist/dotnet/ManagedMemberPointers.js +69 -0
- package/dist/dotnet/ManagedMemberRows.js +181 -48
- package/dist/dotnet/ManagedMetadataHeaps.js +110 -25
- package/dist/dotnet/ManagedMetadataInventory.js +5 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +36 -52
- package/dist/dotnet/ManagedMetadataLayout.js +26 -16
- package/dist/dotnet/ManagedMetadataRowSizes.js +1 -1
- package/dist/dotnet/ManagedMethodBodyReader.js +29 -11
- package/dist/dotnet/ManagedMethodSpecs.js +78 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +20 -19
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +13 -21
- package/dist/dotnet/ManagedPeReader.js +60 -27
- package/dist/dotnet/ManagedReaderFailure.js +9 -0
- package/dist/dotnet/ManagedSnapshot.js +93 -0
- package/dist/dotnet/ManagedStaticProvider.js +55 -64
- package/dist/dotnet/ManagedTypeMemberLists.js +105 -0
- package/dist/dotnet/ManagedTypeNameDigests.js +177 -0
- package/dist/dotnet/ManagedTypeNames.js +58 -0
- package/dist/dotnet/ManagedTypeNesting.js +25 -0
- package/dist/dotnet/ManagedTypeReferences.js +94 -0
- package/dist/dotnet/ManagedUserStrings.js +75 -0
- package/dist/electron/ElectronFuseFailures.js +105 -0
- package/dist/electron/ElectronFusePath.js +248 -0
- package/dist/electron/ElectronFuseProvider.js +88 -0
- package/dist/electron/ElectronFuseReader.js +333 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +194 -11
- package/dist/evaluation/CodexAgentEval.js +19 -40
- package/dist/evaluation/KnownAnswerEvaluation.js +126 -57
- package/dist/evm/EvmoleFailures.js +20 -14
- package/dist/evm/EvmoleInterfaceAdapter.js +5 -1
- package/dist/evm/EvmoleInterfaceProvider.js +142 -35
- package/dist/evm/EvmoleInterfaceWorker.js +2 -0
- package/dist/evm/SolidityMetadata.js +139 -0
- package/dist/filesystem/OwnedRegularFile.js +116 -0
- package/dist/filesystem/OwnedStagedOutput.js +155 -0
- package/dist/filesystem/RegularFile.js +65 -9
- package/dist/filesystem/StableFileHash.js +56 -38
- package/dist/filesystem/callerPath.js +26 -0
- package/dist/filesystem/readFileHandleChunks.js +72 -13
- package/dist/filesystem/readStableFileBytes.js +85 -0
- package/dist/firmware/FirmwareCommand.js +15 -9
- package/dist/firmware/FirmwareFailures.js +56 -0
- package/dist/firmware/FirmwareFiles.js +136 -110
- package/dist/firmware/FirmwareProvider.js +122 -65
- package/dist/firmware/FirmwarePublication.js +244 -12
- package/dist/firmware/FirmwareReports.js +202 -12
- package/dist/flutter/DartElf.js +445 -0
- package/dist/flutter/ElfBuildId.js +137 -0
- package/dist/flutter/ElfLoadMap.js +91 -0
- package/dist/flutter/FlutterBuildProvider.js +866 -0
- package/dist/flutter/FlutterPayloadScan.js +180 -0
- package/dist/frida/FridaInstrumentationManager.js +1104 -0
- package/dist/gdb/GdbSessionManager.js +1639 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +146 -14
- package/dist/ghidra/GhidraAnalysisSeeds.js +39 -55
- package/dist/ghidra/GhidraBridgeSources.js +12 -0
- package/dist/ghidra/GhidraClient.js +501 -180
- package/dist/ghidra/GhidraClientStartup.js +5 -3
- package/dist/ghidra/GhidraClientWire.js +5 -2
- package/dist/ghidra/GhidraDiagnostics.js +23 -5
- package/dist/ghidra/GhidraDoctor.js +60 -26
- package/dist/ghidra/GhidraDosSnapshot.js +83 -0
- package/dist/ghidra/GhidraExecutableHeader.js +54 -0
- package/dist/ghidra/GhidraFileArtifacts.js +93 -0
- package/dist/ghidra/GhidraFunctionValues.js +50 -2
- package/dist/ghidra/GhidraInstallation.js +305 -108
- package/dist/ghidra/GhidraInstallationPolicy.js +94 -103
- package/dist/ghidra/GhidraInstallationProperties.js +57 -0
- package/dist/ghidra/GhidraInventoryValues.js +52 -6
- package/dist/ghidra/GhidraJavaLaunch.js +99 -11
- package/dist/ghidra/GhidraJavaProbe.js +267 -0
- package/dist/ghidra/GhidraJavaProperties.js +119 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +83 -8
- package/dist/ghidra/GhidraLauncher.js +325 -85
- package/dist/ghidra/GhidraLoadImageAttest.js +82 -65
- package/dist/ghidra/GhidraLoadImageValues.js +109 -27
- package/dist/ghidra/GhidraMipsProfile.js +258 -14
- package/dist/ghidra/GhidraNativeAotSnapshotOwner.js +221 -0
- package/dist/ghidra/GhidraPeProfile.js +91 -0
- package/dist/ghidra/GhidraPowerPcProfile.js +51 -0
- package/dist/ghidra/GhidraProvider.js +267 -42
- package/dist/ghidra/GhidraProviderCapabilities.js +29 -15
- package/dist/ghidra/GhidraProviderClient.js +439 -276
- package/dist/ghidra/GhidraPspExtension.js +210 -0
- package/dist/ghidra/GhidraPspProfile.js +62 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +49 -0
- package/dist/ghidra/GhidraReleasePolicy.js +93 -0
- package/dist/ghidra/GhidraRequestQueue.js +64 -40
- package/dist/ghidra/GhidraRiscvProfile.js +100 -0
- package/dist/ghidra/GhidraSessionError.js +301 -24
- package/dist/ghidra/GhidraSessionValues.js +76 -0
- package/dist/ghidra/GhidraSocketConnection.js +25 -11
- package/dist/ghidra/GhidraTargetSnapshot.js +67 -50
- package/dist/ghidra/GhidraTransport.js +86 -62
- package/dist/ghidra/extensions/GhidraExtensions.js +30 -45
- package/dist/go/GoBinaryContainer.js +140 -0
- package/dist/go/GoBinaryImage.js +210 -0
- package/dist/go/GoBinaryProvider.js +180 -0
- package/dist/go/GoElfImage.js +211 -0
- package/dist/go/GoMachoImage.js +164 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +124 -0
- package/dist/hopper/BridgeLauncher.js +78 -6
- package/dist/hopper/HopperAnalysisProfile.js +23 -11
- package/dist/hopper/HopperCleanup.js +29 -4
- package/dist/hopper/HopperClient.js +317 -93
- package/dist/hopper/HopperMacPublisher.js +29 -0
- package/dist/hopper/HopperMachOImage.js +61 -29
- package/dist/hopper/HopperProcessDiagnostic.js +27 -0
- package/dist/hopper/HopperProvider.js +57 -29
- package/dist/hopper/HopperProviderCapabilities.js +9 -4
- package/dist/hopper/HopperRegexSearch.js +21 -60
- package/dist/hopper/HopperRequestQueue.js +17 -5
- package/dist/hopper/HopperSessionValues.js +10 -1
- package/dist/ida/IdaBusyHealth.js +78 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +7 -2
- package/dist/ida/IdaDiagnosticRedactor.js +199 -0
- package/dist/ida/IdaDiagnosticWriter.js +62 -0
- package/dist/ida/IdaDoctor.js +7 -5
- package/dist/ida/IdaJsonDiagnostic.js +138 -0
- package/dist/ida/IdaMcpConnection.js +308 -32
- package/dist/ida/IdaNativeProtocol.js +85 -0
- package/dist/ida/IdaOperationRunner.js +246 -61
- package/dist/ida/IdaProtocolValues.js +88 -5
- package/dist/ida/IdaProvider.js +45 -10
- package/dist/ida/IdaProviderCapabilities.js +37 -8
- package/dist/ida/IdaSessionClient.js +379 -60
- package/dist/ida/IdaWorkspace.js +54 -6
- package/dist/inspector/V8InspectorCaptureProjection.js +14 -2
- package/dist/inspector/V8InspectorEndpoint.js +15 -13
- package/dist/inspector/V8InspectorProvider.js +43 -7
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +44 -12
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +107 -32
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +7 -4
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +85 -10
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +16 -6
- package/dist/javascript/recovery/RecoveryFiles.js +107 -13
- package/dist/javascript/recovery/WakaruExecution.js +19 -11
- package/dist/javascript/recovery/WakaruProvider.js +12 -9
- package/dist/javascript/recovery/WakaruPublication.js +24 -10
- package/dist/javascript/recovery/WakaruRelease.js +1 -1
- package/dist/javascript/recovery/WakaruReport.js +3 -2
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +2 -16
- package/dist/javascript/sourceMaps/SourceMapCommand.js +22 -4
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +22 -4
- package/dist/javascript/sourceMaps/SourceMapFormat.js +25 -38
- package/dist/javascript/sourceMaps/TraceSourceMap.js +34 -6
- package/dist/jeb/JebMcpConnection.js +148 -82
- package/dist/jeb/JebMcpConnectionOwner.js +116 -0
- package/dist/jeb/JebMcpDeadline.js +46 -0
- package/dist/jeb/JebMcpEndpoint.js +6 -1
- package/dist/jeb/JebProvider.js +82 -58
- package/dist/kuna/KunaAddress.js +11 -0
- package/dist/kuna/KunaCommand.js +217 -0
- package/dist/kuna/KunaConfiguration.js +90 -0
- package/dist/kuna/KunaDoctor.js +198 -0
- package/dist/kuna/KunaInstallation.js +137 -0
- package/dist/kuna/KunaJson.js +23 -0
- package/dist/kuna/KunaJsonStream.js +433 -0
- package/dist/kuna/KunaLimits.js +5 -0
- package/dist/kuna/KunaProjectCache.js +804 -0
- package/dist/kuna/KunaProjectExport.js +202 -0
- package/dist/kuna/KunaProjectFiles.js +191 -0
- package/dist/kuna/KunaProjectReader.js +115 -0
- package/dist/kuna/KunaProvider.js +217 -0
- package/dist/kuna/KunaProviderCapabilities.js +102 -0
- package/dist/kuna/KunaQueryErrors.js +12 -0
- package/dist/kuna/KunaQueryWork.js +113 -0
- package/dist/kuna/KunaReferenceFiles.js +258 -0
- package/dist/kuna/KunaReferenceQueries.js +211 -0
- package/dist/kuna/KunaRelease.js +10 -0
- package/dist/kuna/KunaRunSlots.js +56 -0
- package/dist/kuna/KunaSessionClient.js +1162 -0
- package/dist/kuna/KunaStringInventory.js +145 -0
- package/dist/kuna/KunaStringQueries.js +133 -0
- package/dist/kuna/KunaTargetCommands.js +205 -0
- package/dist/kuna/KunaUnavailable.js +11 -0
- package/dist/logger.js +14 -1
- package/dist/main/processShutdown.js +17 -0
- package/dist/main/shutdown.js +3 -0
- package/dist/main/transport.js +68 -4
- package/dist/main.js +16 -15
- package/dist/mcp/AnalysisProvider-BABWbLoM.js +38 -0
- package/dist/mcp/AnalysisSnapshotFiles-BXz0c37-.js +1423 -0
- package/dist/mcp/ArtifactFileOperation-64cQKI7B.js +1704 -0
- package/dist/mcp/ArtifactProvider-Dx6pmil1.js +2200 -0
- package/dist/mcp/ArtifactProviderMetadata-UCJr2oZW.js +167 -0
- package/dist/mcp/ArtifactReader-BrnwNaKY.js +78 -0
- package/dist/mcp/ArtifactResourceScope-zi3Dkqzy.js +175 -0
- package/dist/mcp/AsarHeader-B_IbppTz.js +31 -0
- package/dist/mcp/BinarySessionStatus-CZ9nnXMt.js +213 -0
- package/dist/mcp/BinaryTargetResolver-BUncASDP.js +1358 -0
- package/dist/mcp/BoundedFileBytes-DYt5q9G2.js +43 -0
- package/dist/mcp/CdpCaptureDocuments-Y2uFcBpl.js +795 -0
- package/dist/mcp/CdpCaptureValues-tNIg-gQK.js +97 -0
- package/dist/mcp/CdpEndpoint-BrhMhpSi.js +641 -0
- package/dist/mcp/CdpOptionalCommand-PZZhlqxv.js +120 -0
- package/dist/mcp/CdpTargetSession-BmmDC3XO.js +290 -0
- package/dist/mcp/DirectAnalysis-B9KuCHTG.js +417 -0
- package/dist/mcp/DirectAnalysisStatus-BgzopkIt.js +44 -0
- package/dist/mcp/ElectronFileScope-FXtK0d6I.js +110 -0
- package/dist/mcp/ElectronFuseFailures-uZ_wOV6T.js +610 -0
- package/dist/mcp/MachoLoadCommandReader-C2VGgHA3.js +330 -0
- package/dist/mcp/ManagedStaticProvider-CZuoPme2.js +5326 -0
- package/dist/mcp/NativeMacOSProvider-CMguKrvN.js +5495 -0
- package/dist/mcp/NativeMacOSProviderMetadata-B_RH4KXF.js +397 -0
- package/dist/mcp/OwnedCommand-BW1jBSt9.js +1241 -0
- package/dist/mcp/ProcedureAddressResolution-H6Qwpb_Y.js +59 -0
- package/dist/mcp/WorkflowEvidence-CO4C7ALz.js +118 -0
- package/dist/mcp/analysisErrorCleanup-Q344SnTO.js +34 -0
- package/dist/mcp/analysisErrorCore-BIEP7tvF.js +509 -0
- package/dist/mcp/analysisErrorProjection-B8teQwwD.js +942 -0
- package/dist/mcp/artifactToolContracts-C9dRDo-D.js +74 -0
- package/dist/mcp/browserObservation-DUraZs62.js +4633 -0
- package/dist/mcp/browserObservationError-C5okJ5el.js +63 -0
- package/dist/mcp/browserObservationSchemas-DwGGxBpu.js +573 -0
- package/dist/mcp/browserScenario-BRUz7yN0.js +3415 -0
- package/dist/mcp/browserScenarioCapture-CiMAsMx8.js +595 -0
- package/dist/mcp/callerPath-CpPnMZyN.js +678 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/electronActiveObservation-DV0Ffy9X.js +227 -0
- package/dist/mcp/electronFuses-D5SS7XXw.js +367 -0
- package/dist/mcp/electronObservation-DsN-NqY1.js +621 -0
- package/dist/mcp/electronObservation-wOYWwqgF.js +112 -0
- package/dist/mcp/electronScenario-CYrt2zBK.js +913 -0
- package/dist/mcp/emptyArraySchema-C0o2Sxwp.js +140 -0
- package/dist/mcp/enhancedInputs-6CCgB3VB.js +56 -0
- package/dist/mcp/javascriptRuntimeObservation-BVbhkO2-.js +693 -0
- package/dist/mcp/javascriptRuntimeObservation-Cu0Yedqq.js +121 -0
- package/dist/mcp/jsonSerialization-V-wWiFRE.js +152 -0
- package/dist/mcp/lipo-DSTgUqL1.js +395 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-BGdGHadX.js +48 -0
- package/dist/mcp/machoContainer-CMSxUBlK.js +605 -0
- package/dist/mcp/main-Cx-Z7m_n.js +80276 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-CSlbKJP-.js +101 -0
- package/dist/mcp/nativeValueTrace-BEZbDieM.js +3601 -0
- package/dist/mcp/officialToolContracts-CauCcSsc.js +1432 -0
- package/dist/mcp/peMachine-aP1iYnHq.js +95 -0
- package/dist/mcp/pngHeader-DQ-ObyY2.js +147 -0
- package/dist/mcp/propertyListKeys-BfCo0k4w.js +356 -0
- package/dist/mcp/providerCleanupError-DIRHxzWo.js +125 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-9DRSGM8N.js +71 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-CF3ATd1V.js +3788 -0
- package/dist/mcp/serverIdentity-BK0Ejd_Y.js +1507 -0
- package/dist/mcp/sourceMapEnvelope-DAaRUIGj.js +94 -0
- package/dist/mcp/toolContracts-BPoHQdlC.js +12414 -0
- package/dist/mcp/toolOutputSchemaGroups-MJ_f-PMK.js +17730 -0
- package/dist/mcp/webContentArtifact-DfGkgDcI.js +269 -0
- package/dist/mcp/webRuntime-ccyhkRru.js +74 -0
- package/dist/mcp/webSourceLocation-DKIum0vJ.js +13167 -0
- package/dist/mcpDoctor.js +95 -70
- package/dist/mcpStartupPolicy.js +20 -2
- package/dist/native/AppleDispatchCoverage.js +57 -17
- package/dist/native/AppleDispatchMetadata.js +82 -29
- package/dist/native/AppleMachoFixups.js +208 -35
- package/dist/native/AppleMachoSelection.js +30 -23
- package/dist/native/AppleObjcCategories.js +13 -3
- package/dist/native/AppleObjcDispatchFacets.js +95 -17
- package/dist/native/AppleObjcProperties.js +61 -17
- package/dist/native/AppleObjcProtocols.js +25 -7
- package/dist/native/AppleSwiftVtables.js +2 -0
- package/dist/native/CommandRunner.js +146 -32
- package/dist/native/LldbCallTracer.js +235 -179
- package/dist/native/LldbReadbackFiles.js +70 -0
- package/dist/native/LldbRetainedObservations.js +28 -56
- package/dist/native/MachoArchitectureSelection.js +50 -0
- package/dist/native/NativeCallObservation.js +55 -53
- package/dist/native/NativeCallTarget.js +95 -0
- package/dist/native/NativeMacOSProvider.js +318 -188
- package/dist/native/NativeMachoInspection.js +155 -81
- package/dist/native/NativePlistSource.js +179 -0
- package/dist/native/NativeUiCleanupError.js +30 -0
- package/dist/native/NativeUiHelperRuntime.js +48 -35
- package/dist/native/NativeUiObservation.js +69 -47
- package/dist/native/SignatureTargetBinding.js +147 -65
- package/dist/native/parsers/codesign.js +27 -10
- package/dist/native/parsers/demangle.js +22 -12
- package/dist/native/parsers/dyldInfo.js +73 -4
- package/dist/native/parsers/lipo.js +53 -19
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +275 -32
- package/dist/native/parsers/plist.js +40 -25
- package/dist/native/pe/PeResourceLayout.js +22 -7
- package/dist/native/pe/PeResourceParser.js +10 -9
- package/dist/native/pe/PeResourcesProvider.js +76 -15
- package/dist/native/pwndbg/CoreFileMappingAuthority.js +51 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +39 -28
- package/dist/native/pwntools/PwntoolsDecoder.js +339 -52
- package/dist/native/pwntools/PwntoolsFailures.js +19 -4
- package/dist/native/pwntools/PwntoolsInputLimit.js +27 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +38 -16
- package/dist/native/pwntools/PwntoolsResourceLimits.js +3 -3
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +12 -8
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +3 -1
- package/dist/objdump/ObjdumpCommand.js +24 -0
- package/dist/pcap/PcapCommand.js +146 -0
- package/dist/pcap/PcapConfiguration.js +93 -0
- package/dist/pcap/PcapNativeBound.js +58 -0
- package/dist/pcap/PcapOutput.js +276 -0
- package/dist/pcap/PcapProvider.js +454 -0
- package/dist/pcap/PcapSnapshot.js +191 -0
- package/dist/process/ArtifactAnalysisResources.js +306 -0
- package/dist/process/BoundedFileBytes.js +8 -3
- package/dist/process/CurrentEntrypointPath.js +8 -0
- package/dist/process/DarwinProcessRunTokenReader.js +276 -61
- package/dist/process/DetachedPgpSignature.js +57 -0
- package/dist/process/ExecFileBoundedOutput.js +44 -0
- package/dist/process/ExecFileOutput.js +44 -17
- package/dist/{hopper/HopperTargetLease.js → process/HopperLease.js} +76 -19
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/LinuxResourceLimits.js +60 -0
- package/dist/process/MacCodeSignature.js +3 -0
- package/dist/process/OwnedCommand.js +144 -25
- package/dist/process/PrivateRuntimeRoot.js +9 -19
- package/dist/process/PrivateRuntimeRootUnavailableError.js +10 -0
- package/dist/process/ProcessOwnership.js +70 -17
- package/dist/process/ProcessOwnershipObservation.js +35 -4
- package/dist/process/ProviderDeadline.js +58 -12
- package/dist/process/ProviderProcess.js +233 -17
- package/dist/process/RegexMatcher.js +96 -0
- package/dist/process/SharedStartupAttempt.js +59 -0
- package/dist/process/WindowsAuthority.js +48 -39
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +63 -11
- package/dist/process/capture/ProcessCaptureClock.js +2 -0
- package/dist/process/capture/ProcessCaptureError.js +64 -7
- package/dist/process/capture/ProcessCaptureJournal.js +2 -1
- package/dist/process/capture/ProcessCaptureLifecycle.js +104 -56
- package/dist/process/capture/ProcessCaptureProgress.js +7 -4
- package/dist/process/capture/ProcessHarness.js +34 -17
- package/dist/process/capture/ProcessNormalization.js +278 -36
- package/dist/process/capture/ProcessSampling.js +3 -2
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +13 -13
- package/dist/process/capture/TerminalRenderer.js +31 -10
- package/dist/process/ownedDebuggerSession.js +203 -0
- package/dist/process/snapshotEnvironment.js +8 -8
- package/dist/{application/binary → providers}/AnalysisClientCleanup.js +3 -3
- package/dist/providers/AnalysisClientCreation.js +193 -0
- package/dist/providers/AnalysisClientFailure.js +191 -0
- package/dist/providers/DeferredAnalysisClient.js +48 -0
- package/dist/providers/OwnedCommandCleanup.js +65 -0
- package/dist/providers/ProviderInspectionScope.js +10 -0
- package/dist/recordedCatalogDigests.js +2 -0
- package/dist/reference/ReferenceSourceReader.js +64 -1
- package/dist/reference/ReferenceSourceReaderEntries.js +79 -56
- package/dist/reference/ReferenceSourceReaderErrors.js +5 -1
- package/dist/reference/ReferenceSourceReaderFile.js +2 -2
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -2
- package/dist/reference/ReferenceSourceReaderValidate.js +0 -1
- package/dist/rizin/RizinCommand.js +14 -0
- package/dist/rizin/RizinDebugSessionManager.js +1111 -0
- package/dist/rust/RustAuditableReader.js +309 -0
- package/dist/rust/RustBinaryImage.js +116 -0
- package/dist/rust/RustBinaryProvider.js +194 -0
- package/dist/server/EvidenceMcpServer.js +160 -37
- package/dist/server/admittedToolOperation.js +7 -2
- package/dist/server/contractToolHandler.js +17 -4
- package/dist/server/createServer.js +179 -30
- package/dist/server/externalMutationAdmission.js +50 -0
- package/dist/server/mcpProgress.js +4 -2
- package/dist/server/promptCompletion.js +43 -28
- package/dist/server/providerEnvironment.js +3 -0
- package/dist/server/registerAnalysisViewTool.js +6 -2
- package/dist/server/registerAndroidTools.js +22 -4
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +8 -1
- package/dist/server/registerArtifactComparisonTool.js +13 -2
- package/dist/server/registerArtifactTools.js +21 -1
- package/dist/server/registerBrowserScenarioTool.js +7 -5
- package/dist/server/registerBrowserTools.js +4 -8
- package/dist/server/registerBundleComparisonTool.js +4 -4
- package/dist/server/registerCaptureTools.js +12 -0
- package/dist/server/registerCutterTools.js +32 -0
- package/dist/server/registerElectronTools.js +13 -21
- package/dist/server/registerEnhancedTools.js +7 -6
- package/dist/server/registerEvidenceTools.js +14 -10
- package/dist/server/registerEvmTools.js +22 -4
- package/dist/server/registerFlutterTools.js +17 -0
- package/dist/server/registerFridaTools.js +201 -0
- package/dist/server/registerFunctionComparisonTool.js +29 -9
- package/dist/server/registerGdbTools.js +64 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +2 -2
- package/dist/server/registerInvestigationTools.js +31 -27
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +3 -9
- package/dist/server/registerManagedTools.js +11 -1
- package/dist/server/registerManagedWorkflowTools/evidence.js +14 -7
- package/dist/server/registerNativeTools.js +14 -0
- package/dist/server/registerOfficialTools.js +5 -0
- package/dist/server/registerPcapTools.js +35 -0
- package/dist/server/registerProcessComparisonTool.js +12 -2
- package/dist/server/registerReverseEngineeringTools.js +86 -0
- package/dist/server/registerRizinDebugTools.js +53 -0
- package/dist/server/registerRustTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +19 -13
- package/dist/server/registerSessionStatusTool.js +33 -8
- package/dist/server/registerSessionTools.js +31 -31
- package/dist/server/registerSignalTools.js +12 -0
- package/dist/server/registerSqliteTools.js +9 -0
- package/dist/server/registerWasmTools.js +46 -0
- package/dist/server/registerWebNetworkCaptureTool.js +24 -10
- package/dist/server/retainedSummaryDelivery.js +28 -0
- package/dist/server/runDerivedOperation.js +2 -0
- package/dist/server/sessionAvailabilityPolicy.js +3 -0
- package/dist/server/toolRegistrationOptions.js +8 -0
- package/dist/server/toolResult.js +52 -19
- package/dist/server/toolResultEncoding.js +36 -3
- package/dist/serverIdentity.js +17 -8
- package/dist/signals/SigrokRecordingProvider.js +346 -0
- package/dist/signals/parseDecoderDiscovery.js +65 -0
- package/dist/sqlite/SqliteDatabaseFailures.js +147 -0
- package/dist/sqlite/SqliteDatabaseInspection.js +436 -0
- package/dist/sqlite/SqliteDatabaseLimits.js +16 -0
- package/dist/sqlite/SqliteDatabaseProvider.js +295 -0
- package/dist/sqlite/SqliteDatabaseSnapshot.js +182 -0
- package/dist/sqlite/SqliteDatabaseWorker.js +46 -0
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +127 -0
- package/dist/wasm/WabtArtifactProvider.js +358 -0
- package/dist/wasm/WabtFailures.js +119 -0
- package/dist/wasm/WabtInterface.js +309 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtRuntime.js +58 -0
- package/dist/wasm/WabtString.js +48 -0
- package/dist/wasm/WabtWat.js +147 -0
- package/dist/wasm/WasmGlueAdapter.js +66 -0
- package/dist/wasm/WasmInterfaceBudget.js +11 -0
- package/dist/windows/WindowsNativeLoader.js +53 -9
- package/dist/windows/WindowsOwnedProcess.js +150 -17
- package/dist/windows/WindowsPrivateRuntime.js +66 -2
- package/install.sh +157 -98
- 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/LGPL-2.0.txt +480 -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 +68 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/frida-17.23.2-COPYING.txt +50 -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/npm-dependencies.txt +3757 -0
- package/licenses/npm-runtime-notices.txt +8722 -0
- package/licenses/upstream-sources.json +72 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +130 -12
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +97 -22
- package/scripts/electron-active-hook-boundaries.cjs +15 -2
- package/scripts/electron-active-hook.cjs +412 -47
- package/scripts/hopper-demo-x11.py +65 -13
- package/scripts/prepack.mjs +5 -0
- package/scripts/rea-android-workspace-guardian.mjs +46 -0
- package/scripts/rea.mjs +89 -26
- package/scripts/verify-windows-native-artifact.mjs +2 -2
- package/skills/reverse-engineer-anything/SKILL.md +146 -11
- package/skills/reverse-engineer-anything/references/android-applications.md +3 -1
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +10 -10
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +23 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +72 -3
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +149 -19
- package/skills/reverse-engineer-anything/references/runtime-observation.md +57 -7
- package/third_party/README.md +1 -1
- package/third_party/wabt/README.md +24 -0
- package/dist/browser/history/HarCaptureAdapter.js +0 -20
- package/dist/cli/streamedJsonOutput.js +0 -135
- package/dist/hopper/HopperRegexWorker.js +0 -27
- /package/dist/{application/binary → process}/AbortablePromise.js +0 -0
|
@@ -0,0 +1,1781 @@
|
|
|
1
|
+
import { __esmMin } from "./rolldown-runtime-DXoylpqc.js";
|
|
2
|
+
import { err, init_binaryTargetTypes, init_result, isMachOFormat, ok } from "./reconstructionObligationLedgerSchemas-Bi6sect1.js";
|
|
3
|
+
import { AnalysisAccessDeniedError, AnalysisArtifactChangedError, AnalysisCancelledError, AnalysisError, AnalysisResourceConstraintError, ConfigurationError, init_analysisErrorBase, init_analysisErrorCore, init_configurationErrors, init_jsonValue, jsonValueSchema } from "./errorSchemas-Ixz_q7qt.js";
|
|
4
|
+
import { NonRegularFileReadError, RegularFileChangedError, RegularFileCleanupFailure, assertRegularFileActive, init_OwnedRegularFile, init_RegularFile, regularFileCancellation, sameRegularFileState, withOwnedRegularFile } from "./OwnedRegularFile-D1f5nUCx.js";
|
|
5
|
+
import { ArtifactReaderFailure, init_ArtifactReader } from "./ArtifactReader-DMwm42bk.js";
|
|
6
|
+
import { AnalysisCleanupLease, init_AnalysisCleanupLease } from "./AnalysisCleanupLease-CWfTGYKd.js";
|
|
7
|
+
import { ArtifactFileCancelled, ArtifactFileCleanupFailure, artifactFileCancellationCause, artifactFilePrimaryFailure, assertArtifactReadActive, bindArtifactFileCleanup, init_ArtifactFileOperation, mapArtifactFileFailure, withArtifactFileHandle, withArtifactRegularFile } from "./ArtifactFileOperation-Dg4BcoEM.js";
|
|
8
|
+
import { ProviderAdapterError, hopperStartupExitCode, init_analysisErrorProjection, init_hopperStartupFailure, init_providerAdapterError, isHopperStartupFailureCode, projectAnalysisError } from "./cliResultOutput-10sd6xGx.js";
|
|
9
|
+
import { analysisErrorWithCleanupFailure, init_analysisErrorCleanup } from "./analysisErrorCleanup-COdAmDsb.js";
|
|
10
|
+
import { ProviderCleanupError, init_providerCleanupError } from "./providerCleanupError-BhsJyAhk.js";
|
|
11
|
+
import { DarwinProcessOwnershipInspectionError, boundedUtf8Text, init_DarwinProcessRunTokenReader, init_boundedUtf8Text } from "./ProcessOwnershipObservation-C006iCtZ.js";
|
|
12
|
+
import { execFileOutput, execFileOutputFailure, init_ExecFileOutput } from "./ExecFileOutput-D6KLYTve.js";
|
|
13
|
+
import { init_providerStartupTimeout, providerStartupTimeoutSchema } from "./providerStartupTimeout-B2tF2LtZ.js";
|
|
14
|
+
import { init_safeJson, safeParseJson } from "./safeJson-DKKACtdy.js";
|
|
15
|
+
import { ProviderProcessSupervisor, init_ProviderProcess, spawnOwnedProviderProcess } from "./ProviderProcess-D87A7ctp.js";
|
|
16
|
+
import { cleanupOwnedProcessGroup, init_ProcessOwnership } from "./ProcessOwnership-CtrNr6ee.js";
|
|
17
|
+
import { OwnedCommandFailure, init_OwnedCommand, init_snapshotEnvironment, prepareOwnedCommand, runOwnedCommand, snapshotEnvironment } from "./snapshotEnvironment-Yvx5qwsl.js";
|
|
18
|
+
import { homeDirectoryFromEnvironment, init_homeDirectory } from "./homeDirectory-DC_DeJIg.js";
|
|
19
|
+
import { hashStableFile, init_StableFileHash, stableFileHashCause } from "./StableFileHash-Ame_h3lY.js";
|
|
20
|
+
import { init_binaryTarget, parseExecutableHeader } from "./BinaryTargetResolver-tuCTjBlQ.js";
|
|
21
|
+
import { analysisClientFailureForOperation, init_AnalysisClientFailure, init_OwnedCommandCleanup, retainOwnedCommandCleanup } from "./OwnedCommandCleanup-BN_V6Erc.js";
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
import { delimiter, dirname, isAbsolute, join, posix, win32 } from "node:path";
|
|
24
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
25
|
+
import { accessSync, constants, readFileSync, realpathSync, statSync } from "node:fs";
|
|
26
|
+
import { access, lstat, open, realpath, stat } from "node:fs/promises";
|
|
27
|
+
|
|
28
|
+
//#region dist/hopper/LinuxPrivateDisplayDiagnostic.js
|
|
29
|
+
var LINUX_PRIVATE_DISPLAY_DIAGNOSTIC_PREFIX, diagnosticContextSchema, failureCodeSchema, diagnosticSchema, parseLinuxPrivateDisplayDiagnostic;
|
|
30
|
+
function init_LinuxPrivateDisplayDiagnostic() {
|
|
31
|
+
return (init_LinuxPrivateDisplayDiagnostic = __esmMin((() => {
|
|
32
|
+
init_hopperStartupFailure();
|
|
33
|
+
init_safeJson();
|
|
34
|
+
LINUX_PRIVATE_DISPLAY_DIAGNOSTIC_PREFIX = "REA_X11_DIAGNOSTIC=";
|
|
35
|
+
diagnosticContextSchema = z.object({
|
|
36
|
+
component: z.literal("hopper_private_display"),
|
|
37
|
+
operation: z.enum(["probe", "launch"]),
|
|
38
|
+
reason: z.string().regex(/^[a-z0-9_]+$/u),
|
|
39
|
+
socket_directory: z.literal("/tmp/.X11-unix"),
|
|
40
|
+
socket_directory_mode: z.string().regex(/^[0-7]{4}$/u).nullable(),
|
|
41
|
+
mount_read_only: z.boolean().nullable(),
|
|
42
|
+
effective_socket_directory_mode: z.string().regex(/^[0-7]{4}$/u).nullable(),
|
|
43
|
+
effective_mount_read_only: z.boolean().nullable(),
|
|
44
|
+
wsl: z.boolean(),
|
|
45
|
+
strategy: z.enum([
|
|
46
|
+
"direct",
|
|
47
|
+
"user-mount-namespace",
|
|
48
|
+
"unavailable"
|
|
49
|
+
]),
|
|
50
|
+
fallback_reason: z.string().regex(/^[a-z0-9_]+$/u).nullable(),
|
|
51
|
+
xvfb_stderr_bytes: z.number().int().nonnegative().safe()
|
|
52
|
+
});
|
|
53
|
+
failureCodeSchema = z.string().transform((value, context) => {
|
|
54
|
+
if (isHopperStartupFailureCode(value)) return value;
|
|
55
|
+
context.addIssue({
|
|
56
|
+
code: "custom",
|
|
57
|
+
message: "Unknown startup failure code"
|
|
58
|
+
});
|
|
59
|
+
return z.NEVER;
|
|
60
|
+
});
|
|
61
|
+
diagnosticSchema = z.discriminatedUnion("status", [diagnosticContextSchema.extend({
|
|
62
|
+
status: z.literal("ready"),
|
|
63
|
+
failure_code: z.null()
|
|
64
|
+
}).strict(), diagnosticContextSchema.extend({
|
|
65
|
+
status: z.literal("error"),
|
|
66
|
+
failure_code: failureCodeSchema
|
|
67
|
+
}).strict()]);
|
|
68
|
+
parseLinuxPrivateDisplayDiagnostic = (stderr) => {
|
|
69
|
+
const records = stderr.split("\n").filter((line) => line.startsWith(LINUX_PRIVATE_DISPLAY_DIAGNOSTIC_PREFIX));
|
|
70
|
+
if (records.length === 0) return {
|
|
71
|
+
ok: false,
|
|
72
|
+
reason: "diagnostic_missing"
|
|
73
|
+
};
|
|
74
|
+
if (records.length !== 1) return {
|
|
75
|
+
ok: false,
|
|
76
|
+
reason: "diagnostic_multiple"
|
|
77
|
+
};
|
|
78
|
+
const record = records[0];
|
|
79
|
+
if (record === undefined) return {
|
|
80
|
+
ok: false,
|
|
81
|
+
reason: "diagnostic_missing"
|
|
82
|
+
};
|
|
83
|
+
const decoded = safeParseJson(record.slice(LINUX_PRIVATE_DISPLAY_DIAGNOSTIC_PREFIX.length));
|
|
84
|
+
if (!decoded.ok) return {
|
|
85
|
+
ok: false,
|
|
86
|
+
reason: "diagnostic_malformed"
|
|
87
|
+
};
|
|
88
|
+
const parsed = diagnosticSchema.safeParse(decoded.value);
|
|
89
|
+
if (!parsed.success) return {
|
|
90
|
+
ok: false,
|
|
91
|
+
reason: "diagnostic_malformed"
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
ok: true,
|
|
95
|
+
value: parsed.data
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
})))();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region dist/hopper/LinuxPrivateDisplayProbe.js
|
|
103
|
+
var PYTHON_PATH, UNSHARE_PATH, DEFAULT_PROBE_TIMEOUT_MS, isAborted, selectLinuxPrivateDisplayStrategy, runLinuxPrivateDisplayProbe, privateDisplayProbeCommand, evaluatedProbe, exitMatchesDiagnostic, syntheticDiagnostic, unavailable, emptyProcessResult, waitForProbeOutputClose;
|
|
104
|
+
function init_LinuxPrivateDisplayProbe() {
|
|
105
|
+
return (init_LinuxPrivateDisplayProbe = __esmMin((() => {
|
|
106
|
+
init_hopperStartupFailure();
|
|
107
|
+
init_ProcessOwnership();
|
|
108
|
+
init_ProviderProcess();
|
|
109
|
+
init_LinuxPrivateDisplayDiagnostic();
|
|
110
|
+
PYTHON_PATH = "/usr/bin/python3";
|
|
111
|
+
UNSHARE_PATH = "/usr/bin/unshare";
|
|
112
|
+
DEFAULT_PROBE_TIMEOUT_MS = 5e3;
|
|
113
|
+
isAborted = (signal) => signal?.aborted === true;
|
|
114
|
+
selectLinuxPrivateDisplayStrategy = async (options) => {
|
|
115
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
116
|
+
const runner = options.runProbe ?? runLinuxPrivateDisplayProbe;
|
|
117
|
+
const direct = await evaluatedProbe("direct", options, timeoutMs, runner);
|
|
118
|
+
if (direct.ok) return direct;
|
|
119
|
+
if (direct.diagnostic.failure_code !== "x11_socket_directory_unusable") return unavailable(direct.diagnostic);
|
|
120
|
+
const isolated = await evaluatedProbe("user-mount-namespace", options, timeoutMs, runner);
|
|
121
|
+
if (!isolated.ok) return unavailable({
|
|
122
|
+
...direct.diagnostic,
|
|
123
|
+
strategy: "unavailable",
|
|
124
|
+
reason: "namespace_unavailable",
|
|
125
|
+
fallback_reason: isolated.diagnostic.reason,
|
|
126
|
+
effective_socket_directory_mode: isolated.diagnostic.effective_socket_directory_mode,
|
|
127
|
+
effective_mount_read_only: isolated.diagnostic.effective_mount_read_only,
|
|
128
|
+
xvfb_stderr_bytes: isolated.diagnostic.xvfb_stderr_bytes
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
ok: true,
|
|
132
|
+
strategy: "user-mount-namespace",
|
|
133
|
+
diagnostic: {
|
|
134
|
+
...isolated.diagnostic,
|
|
135
|
+
socket_directory_mode: direct.diagnostic.socket_directory_mode,
|
|
136
|
+
mount_read_only: direct.diagnostic.mount_read_only,
|
|
137
|
+
fallback_reason: null
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
runLinuxPrivateDisplayProbe = async (strategy, options) => {
|
|
142
|
+
if (isAborted(options.signal)) return emptyProcessResult("cancelled");
|
|
143
|
+
const command = privateDisplayProbeCommand(options.helperPath, strategy);
|
|
144
|
+
let started;
|
|
145
|
+
try {
|
|
146
|
+
started = await spawnOwnedProviderProcess({
|
|
147
|
+
command: command.command,
|
|
148
|
+
arguments: command.arguments,
|
|
149
|
+
runId: randomUUID(),
|
|
150
|
+
expectedCommand: null,
|
|
151
|
+
...options.environment === undefined ? {} : { hostEnvironment: options.environment },
|
|
152
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
153
|
+
});
|
|
154
|
+
} catch (cause) {
|
|
155
|
+
void cause;
|
|
156
|
+
return emptyProcessResult(isAborted(options.signal) ? "cancelled" : "launch-failed");
|
|
157
|
+
}
|
|
158
|
+
const launch = {
|
|
159
|
+
process: started.process,
|
|
160
|
+
ownsProcessLifetime: true,
|
|
161
|
+
cleanup: () => cleanupOwnedProcessGroup(started.ownership)
|
|
162
|
+
};
|
|
163
|
+
const supervisor = new ProviderProcessSupervisor(launch);
|
|
164
|
+
const outcome = await waitForProbeOutputClose(supervisor, options.timeoutMs, options.signal);
|
|
165
|
+
let cleanupIncomplete = false;
|
|
166
|
+
if (outcome !== "exit") {
|
|
167
|
+
const stopped = await supervisor.stop();
|
|
168
|
+
cleanupIncomplete = stopped.status === "incomplete";
|
|
169
|
+
} else supervisor.dispose();
|
|
170
|
+
const snapshot = supervisor.snapshot();
|
|
171
|
+
return {
|
|
172
|
+
outcome: outcome === "exit" ? "exited" : outcome === "timeout" ? "timed-out" : "cancelled",
|
|
173
|
+
exitCode: snapshot.exitCode,
|
|
174
|
+
stderr: snapshot.stderr.text,
|
|
175
|
+
stderrBytes: snapshot.stderr.bytes,
|
|
176
|
+
cleanupIncomplete
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
privateDisplayProbeCommand = (helperPath, strategy) => strategy === "direct" ? {
|
|
180
|
+
command: PYTHON_PATH,
|
|
181
|
+
arguments: [
|
|
182
|
+
helperPath,
|
|
183
|
+
"--probe",
|
|
184
|
+
"--strategy",
|
|
185
|
+
"direct"
|
|
186
|
+
]
|
|
187
|
+
} : {
|
|
188
|
+
command: UNSHARE_PATH,
|
|
189
|
+
arguments: [
|
|
190
|
+
"--user",
|
|
191
|
+
"--map-root-user",
|
|
192
|
+
"--mount",
|
|
193
|
+
"--propagation",
|
|
194
|
+
"private",
|
|
195
|
+
PYTHON_PATH,
|
|
196
|
+
helperPath,
|
|
197
|
+
"--probe",
|
|
198
|
+
"--strategy",
|
|
199
|
+
"user-mount-namespace",
|
|
200
|
+
"--mount-private-x11"
|
|
201
|
+
]
|
|
202
|
+
};
|
|
203
|
+
evaluatedProbe = async (strategy, options, timeoutMs, runner) => {
|
|
204
|
+
let processResult;
|
|
205
|
+
try {
|
|
206
|
+
processResult = await runner(strategy, {
|
|
207
|
+
helperPath: options.helperPath,
|
|
208
|
+
...options.environment === undefined ? {} : { environment: options.environment },
|
|
209
|
+
timeoutMs,
|
|
210
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
211
|
+
});
|
|
212
|
+
} catch (cause) {
|
|
213
|
+
void cause;
|
|
214
|
+
return {
|
|
215
|
+
ok: false,
|
|
216
|
+
diagnostic: syntheticDiagnostic(strategy, "probe_failed")
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
if (processResult.outcome === "cancelled") return {
|
|
220
|
+
ok: false,
|
|
221
|
+
diagnostic: syntheticDiagnostic(strategy, "cancelled")
|
|
222
|
+
};
|
|
223
|
+
if (processResult.outcome === "timed-out") return {
|
|
224
|
+
ok: false,
|
|
225
|
+
diagnostic: syntheticDiagnostic(strategy, "probe_timeout")
|
|
226
|
+
};
|
|
227
|
+
if (processResult.outcome === "launch-failed") return {
|
|
228
|
+
ok: false,
|
|
229
|
+
diagnostic: syntheticDiagnostic(strategy, "probe_failed")
|
|
230
|
+
};
|
|
231
|
+
if (processResult.cleanupIncomplete) return {
|
|
232
|
+
ok: false,
|
|
233
|
+
diagnostic: syntheticDiagnostic(strategy, "cleanup_incomplete")
|
|
234
|
+
};
|
|
235
|
+
const parsed = parseLinuxPrivateDisplayDiagnostic(processResult.stderr);
|
|
236
|
+
if (!parsed.ok) return {
|
|
237
|
+
ok: false,
|
|
238
|
+
diagnostic: syntheticDiagnostic(strategy, parsed.reason)
|
|
239
|
+
};
|
|
240
|
+
const diagnostic = parsed.value;
|
|
241
|
+
if (diagnostic.strategy !== strategy || diagnostic.operation !== "probe" || !exitMatchesDiagnostic(processResult.exitCode, diagnostic)) return {
|
|
242
|
+
ok: false,
|
|
243
|
+
diagnostic: syntheticDiagnostic(strategy, "diagnostic_malformed")
|
|
244
|
+
};
|
|
245
|
+
return diagnostic.status === "ready" ? {
|
|
246
|
+
ok: true,
|
|
247
|
+
strategy,
|
|
248
|
+
diagnostic
|
|
249
|
+
} : {
|
|
250
|
+
ok: false,
|
|
251
|
+
diagnostic
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
exitMatchesDiagnostic = (exitCode, diagnostic) => diagnostic.status === "ready" ? exitCode === 0 : hopperStartupExitCode(diagnostic.failure_code) === exitCode;
|
|
255
|
+
syntheticDiagnostic = (strategy, reason, failureCode = "private_display_unavailable") => ({
|
|
256
|
+
component: "hopper_private_display",
|
|
257
|
+
operation: "probe",
|
|
258
|
+
status: "error",
|
|
259
|
+
failure_code: failureCode,
|
|
260
|
+
reason,
|
|
261
|
+
socket_directory: "/tmp/.X11-unix",
|
|
262
|
+
socket_directory_mode: null,
|
|
263
|
+
mount_read_only: null,
|
|
264
|
+
effective_socket_directory_mode: null,
|
|
265
|
+
effective_mount_read_only: null,
|
|
266
|
+
wsl: false,
|
|
267
|
+
strategy,
|
|
268
|
+
fallback_reason: null,
|
|
269
|
+
xvfb_stderr_bytes: 0
|
|
270
|
+
});
|
|
271
|
+
unavailable = (diagnostic) => ({
|
|
272
|
+
ok: false,
|
|
273
|
+
strategy: "unavailable",
|
|
274
|
+
exitCode: hopperStartupExitCode(diagnostic.failure_code) ?? 70,
|
|
275
|
+
diagnostic: {
|
|
276
|
+
...diagnostic,
|
|
277
|
+
strategy: "unavailable"
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
emptyProcessResult = (outcome) => ({
|
|
281
|
+
outcome,
|
|
282
|
+
exitCode: undefined,
|
|
283
|
+
stderr: "",
|
|
284
|
+
stderrBytes: 0,
|
|
285
|
+
cleanupIncomplete: false
|
|
286
|
+
});
|
|
287
|
+
waitForProbeOutputClose = async (supervisor, timeoutMs, signal) => {
|
|
288
|
+
if (signal?.aborted === true) return "cancelled";
|
|
289
|
+
let releaseAbort;
|
|
290
|
+
const aborted = new Promise((resolve) => {
|
|
291
|
+
if (signal === undefined) return;
|
|
292
|
+
const listener = () => resolve("cancelled");
|
|
293
|
+
signal.addEventListener("abort", listener, { once: true });
|
|
294
|
+
releaseAbort = () => signal.removeEventListener("abort", listener);
|
|
295
|
+
});
|
|
296
|
+
try {
|
|
297
|
+
return await Promise.race([supervisor.waitForOutputClose(Math.max(1, timeoutMs)).then((closed) => closed ? "exit" : "timeout"), aborted]);
|
|
298
|
+
} finally {
|
|
299
|
+
releaseAbort?.();
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
})))();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region dist/filesystem/readStableFileBytes.js
|
|
307
|
+
var RegularFileCapacityError, readStableFileBytes, readStableFilePrefix, readExtent, assertStableIdentity;
|
|
308
|
+
function init_readStableFileBytes() {
|
|
309
|
+
return (init_readStableFileBytes = __esmMin((() => {
|
|
310
|
+
init_RegularFile();
|
|
311
|
+
RegularFileCapacityError = class extends Error {
|
|
312
|
+
path;
|
|
313
|
+
maximumBytes;
|
|
314
|
+
observedBytes;
|
|
315
|
+
_tag = "RegularFileCapacityError";
|
|
316
|
+
constructor(path, maximumBytes, observedBytes) {
|
|
317
|
+
super(`Selected file must be at most ${maximumBytes} bytes: ${path}`);
|
|
318
|
+
this.path = path;
|
|
319
|
+
this.maximumBytes = maximumBytes;
|
|
320
|
+
this.observedBytes = observedBytes;
|
|
321
|
+
this.name = this._tag;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
readStableFileBytes = async (file, path, maximumBytes, options) => {
|
|
325
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 0) throw new RangeError("Maximum file bytes must be a nonnegative safe integer");
|
|
326
|
+
assertRegularFileActive(options.signal);
|
|
327
|
+
const before = await file.stat({ bigint: true });
|
|
328
|
+
if (before.size > BigInt(maximumBytes)) throw new RegularFileCapacityError(path, maximumBytes, before.size);
|
|
329
|
+
const bytes = await readExtent(file, path, Number(before.size), options.signal);
|
|
330
|
+
assertRegularFileActive(options.signal);
|
|
331
|
+
const extra = Buffer.alloc(1);
|
|
332
|
+
if ((await file.read(extra, 0, 1, bytes.length)).bytesRead !== 0) throw new RegularFileChangedError(path);
|
|
333
|
+
await assertStableIdentity(file, path, before, options);
|
|
334
|
+
return bytes;
|
|
335
|
+
};
|
|
336
|
+
readStableFilePrefix = async (file, path, maximumBytes, options) => {
|
|
337
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 0) throw new RangeError("Maximum prefix bytes must be a nonnegative safe integer");
|
|
338
|
+
assertRegularFileActive(options.signal);
|
|
339
|
+
const before = await file.stat({ bigint: true });
|
|
340
|
+
const length = Number(before.size < BigInt(maximumBytes) ? before.size : BigInt(maximumBytes));
|
|
341
|
+
const bytes = await readExtent(file, path, length, options.signal);
|
|
342
|
+
await assertStableIdentity(file, path, before, options);
|
|
343
|
+
return {
|
|
344
|
+
bytes,
|
|
345
|
+
size: before.size
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
readExtent = async (file, path, length, signal) => {
|
|
349
|
+
assertRegularFileActive(signal);
|
|
350
|
+
const bytes = Buffer.alloc(length);
|
|
351
|
+
let offset = 0;
|
|
352
|
+
while (offset < bytes.length) {
|
|
353
|
+
assertRegularFileActive(signal);
|
|
354
|
+
const read = await file.read({
|
|
355
|
+
buffer: bytes,
|
|
356
|
+
offset,
|
|
357
|
+
length: bytes.length - offset,
|
|
358
|
+
position: offset
|
|
359
|
+
});
|
|
360
|
+
if (read.bytesRead === 0) throw new RegularFileChangedError(path);
|
|
361
|
+
offset += read.bytesRead;
|
|
362
|
+
}
|
|
363
|
+
assertRegularFileActive(signal);
|
|
364
|
+
return bytes;
|
|
365
|
+
};
|
|
366
|
+
assertStableIdentity = async (file, path, before, options) => {
|
|
367
|
+
assertRegularFileActive(options.signal);
|
|
368
|
+
const named = async () => {
|
|
369
|
+
try {
|
|
370
|
+
return await (options.symlinks === "follow" ? stat : lstat)(path, { bigint: true });
|
|
371
|
+
} catch (cause) {
|
|
372
|
+
if (cause instanceof Error && "code" in cause && (cause.code === "ENOENT" || cause.code === "ENOTDIR" || cause.code === "ELOOP")) throw new RegularFileChangedError(path, { cause });
|
|
373
|
+
throw cause;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
if (!sameRegularFileState(before, await file.stat({ bigint: true })) || !sameRegularFileState(before, await named())) throw new RegularFileChangedError(path);
|
|
377
|
+
assertRegularFileActive(options.signal);
|
|
378
|
+
};
|
|
379
|
+
})))();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region dist/ghidra/GhidraFileArtifacts.js
|
|
384
|
+
var readGhidraProfileArtifact, writeGhidraProfileArtifact, ghidraFileFailure;
|
|
385
|
+
function init_GhidraFileArtifacts() {
|
|
386
|
+
return (init_GhidraFileArtifacts = __esmMin((() => {
|
|
387
|
+
init_ArtifactReader();
|
|
388
|
+
init_ArtifactFileOperation();
|
|
389
|
+
init_readStableFileBytes();
|
|
390
|
+
init_analysisErrorBase();
|
|
391
|
+
init_analysisErrorCore();
|
|
392
|
+
init_RegularFile();
|
|
393
|
+
init_providerAdapterError();
|
|
394
|
+
init_providerCleanupError();
|
|
395
|
+
init_analysisErrorCleanup();
|
|
396
|
+
readGhidraProfileArtifact = (path, maximumBytes, resources, signal, interpret) => withArtifactRegularFile(path, resources, signal, async (file) => {
|
|
397
|
+
const bytes = await readStableFileBytes(file, path, maximumBytes, {
|
|
398
|
+
symlinks: "reject",
|
|
399
|
+
...signal === undefined ? {} : { signal }
|
|
400
|
+
});
|
|
401
|
+
return interpret(bytes);
|
|
402
|
+
});
|
|
403
|
+
writeGhidraProfileArtifact = async (path, bytes, resources, signal) => {
|
|
404
|
+
assertArtifactReadActive(signal);
|
|
405
|
+
const file = await open(path, "wx", 384);
|
|
406
|
+
await withArtifactFileHandle(path, file, resources, signal, (handle) => handle.writeFile(bytes));
|
|
407
|
+
};
|
|
408
|
+
ghidraFileFailure = (cause, operation, diagnostics = {}) => {
|
|
409
|
+
cause = mapArtifactFileFailure(cause, (primary) => {
|
|
410
|
+
if (primary instanceof RegularFileCapacityError) return new AnalysisResourceConstraintError(operation, "file-size", primary.message, {
|
|
411
|
+
maximum_bytes: primary.maximumBytes,
|
|
412
|
+
observed_bytes: primary.observedBytes.toString()
|
|
413
|
+
}, {
|
|
414
|
+
cause: primary,
|
|
415
|
+
diagnostics,
|
|
416
|
+
retryable: false
|
|
417
|
+
});
|
|
418
|
+
if (primary instanceof RegularFileChangedError) return new AnalysisArtifactChangedError(operation, primary.path, primary.message, {
|
|
419
|
+
cause: primary,
|
|
420
|
+
diagnostics
|
|
421
|
+
});
|
|
422
|
+
if (primary instanceof Error && "code" in primary && (primary.code === "EACCES" || primary.code === "EPERM")) {
|
|
423
|
+
const path = "path" in primary && typeof primary.path === "string" ? primary.path : diagnostics.path;
|
|
424
|
+
if (typeof path === "string") return new AnalysisAccessDeniedError(operation, path, primary.code, {
|
|
425
|
+
cause: primary,
|
|
426
|
+
diagnostics
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return primary;
|
|
430
|
+
});
|
|
431
|
+
if (cause instanceof AnalysisError) return cause;
|
|
432
|
+
const primary = artifactFilePrimaryFailure(cause);
|
|
433
|
+
const reason = primary instanceof Error ? primary.message : String(primary);
|
|
434
|
+
const cleanup = cause instanceof ArtifactReaderFailure ? cause.cleanup : undefined;
|
|
435
|
+
if (primary instanceof AnalysisError) {
|
|
436
|
+
if (cleanup === undefined) return primary;
|
|
437
|
+
const failure = new ProviderCleanupError("ghidra", cleanup.resources, { reason: cleanup.reason }, { cause });
|
|
438
|
+
bindArtifactFileCleanup(cause, failure);
|
|
439
|
+
return analysisErrorWithCleanupFailure(primary, failure, operation).bindCleanupDependencies([...primary.cleanupIncomplete ? [primary] : [], failure]);
|
|
440
|
+
}
|
|
441
|
+
const error = cause instanceof ArtifactReaderFailure && cause.reason === "cancelled" ? new AnalysisCancelledError(operation, {
|
|
442
|
+
cause: artifactFileCancellationCause(cause),
|
|
443
|
+
cleanup,
|
|
444
|
+
diagnostics
|
|
445
|
+
}) : new ProviderAdapterError("ghidra", operation, {
|
|
446
|
+
cause,
|
|
447
|
+
cleanup,
|
|
448
|
+
diagnostics: {
|
|
449
|
+
...diagnostics,
|
|
450
|
+
...primary instanceof Error && "code" in primary && typeof primary.code === "string" ? { system_code: primary.code } : {},
|
|
451
|
+
...primary instanceof Error && "syscall" in primary && typeof primary.syscall === "string" ? { syscall: primary.syscall } : {},
|
|
452
|
+
reason
|
|
453
|
+
},
|
|
454
|
+
userMessage: reason
|
|
455
|
+
});
|
|
456
|
+
bindArtifactFileCleanup(cause, error);
|
|
457
|
+
return error;
|
|
458
|
+
};
|
|
459
|
+
})))();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region dist/ghidra/GhidraJavaProbe.js
|
|
464
|
+
var JAVA_PROBE_MAX_OUTPUT_BYTES, JAVA_DIAGNOSTIC_STREAM_BYTES, capturedProbeOutput, executablePath$1, probeGhidraJava, observeGhidraJava, systemCode, probeFailureError, parseGhidraJavaOutput, javaProperty, javaMajor;
|
|
465
|
+
function init_GhidraJavaProbe() {
|
|
466
|
+
return (init_GhidraJavaProbe = __esmMin((() => {
|
|
467
|
+
init_OwnedCommandCleanup();
|
|
468
|
+
init_AnalysisClientFailure();
|
|
469
|
+
init_analysisErrorBase();
|
|
470
|
+
init_analysisErrorCore();
|
|
471
|
+
init_providerAdapterError();
|
|
472
|
+
init_analysisErrorCleanup();
|
|
473
|
+
init_jsonValue();
|
|
474
|
+
init_DarwinProcessRunTokenReader();
|
|
475
|
+
init_OwnedCommand();
|
|
476
|
+
init_boundedUtf8Text();
|
|
477
|
+
init_result();
|
|
478
|
+
JAVA_PROBE_MAX_OUTPUT_BYTES = 1024 * 1024;
|
|
479
|
+
JAVA_DIAGNOSTIC_STREAM_BYTES = 8192;
|
|
480
|
+
capturedProbeOutput = (observed) => {
|
|
481
|
+
const stdout = boundedUtf8Text(observed.stdout.text, JAVA_DIAGNOSTIC_STREAM_BYTES);
|
|
482
|
+
const stderr = boundedUtf8Text(observed.stderr.text, JAVA_DIAGNOSTIC_STREAM_BYTES);
|
|
483
|
+
return {
|
|
484
|
+
stdout: stdout.text,
|
|
485
|
+
stderr: stderr.text,
|
|
486
|
+
truncated: stdout.truncated || stderr.truncated || observed.diagnosticTruncated === true || observed.outputIncomplete === true,
|
|
487
|
+
stdout_bytes: observed.stdout.observedBytes,
|
|
488
|
+
stderr_bytes: observed.stderr.observedBytes,
|
|
489
|
+
exit_code: observed.exitCode ?? null,
|
|
490
|
+
signal: observed.signal ?? null
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
executablePath$1 = (path) => {
|
|
494
|
+
try {
|
|
495
|
+
accessSync(path, constants.X_OK);
|
|
496
|
+
return statSync(path).isFile();
|
|
497
|
+
} catch {
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
probeGhidraJava = async (command, environment, options) => {
|
|
502
|
+
try {
|
|
503
|
+
return await options.resourceOwner.run(() => observeGhidraJava(command, environment, options));
|
|
504
|
+
} catch (cause) {
|
|
505
|
+
return err(analysisClientFailureForOperation(cause, "ghidra", "ghidra:java"));
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
observeGhidraJava = async (command, environment, options) => {
|
|
509
|
+
let interpreted;
|
|
510
|
+
try {
|
|
511
|
+
await prepareOwnedCommand(options.signal);
|
|
512
|
+
await runOwnedCommand({
|
|
513
|
+
command,
|
|
514
|
+
arguments: [
|
|
515
|
+
"-Dstdout.encoding=UTF-8",
|
|
516
|
+
"-Dstderr.encoding=UTF-8",
|
|
517
|
+
"-Dsun.stdout.encoding=UTF-8",
|
|
518
|
+
"-Dsun.stderr.encoding=UTF-8",
|
|
519
|
+
"-XX:-UsePerfData",
|
|
520
|
+
"-XshowSettings:properties",
|
|
521
|
+
"-version"
|
|
522
|
+
],
|
|
523
|
+
runId: randomUUID(),
|
|
524
|
+
expectedCommand: null,
|
|
525
|
+
hostEnvironment: environment,
|
|
526
|
+
sweepTokenOwnedProcesses: true
|
|
527
|
+
}, {
|
|
528
|
+
timeoutMs: options.timeoutMs ?? 5e3,
|
|
529
|
+
diagnosticBytes: JAVA_PROBE_MAX_OUTPUT_BYTES,
|
|
530
|
+
acceptNonZeroExit: true,
|
|
531
|
+
observeCompleted: (snapshot) => {
|
|
532
|
+
interpreted = parseGhidraJavaOutput(command, snapshot);
|
|
533
|
+
}
|
|
534
|
+
}, {
|
|
535
|
+
signal: options.signal,
|
|
536
|
+
...options.launcher === undefined ? {} : { launcher: options.launcher }
|
|
537
|
+
});
|
|
538
|
+
if (interpreted === undefined) throw new Error("Java command completed without an output observation");
|
|
539
|
+
return interpreted;
|
|
540
|
+
} catch (cause) {
|
|
541
|
+
const commandFailure = cause instanceof OwnedCommandFailure ? cause : undefined;
|
|
542
|
+
const preparation = commandFailure?.preparationFailure ?? (cause instanceof DarwinProcessOwnershipInspectionError ? cause : undefined);
|
|
543
|
+
const output = commandFailure?.snapshot === undefined || commandFailure.snapshot === null ? preparation?.capturedOutput : capturedProbeOutput(commandFailure.snapshot);
|
|
544
|
+
if (interpreted !== undefined && !interpreted.ok && commandFailure?.cancellation !== undefined) Object.defineProperty(interpreted.error, "cancellation", { value: commandFailure.cancellation });
|
|
545
|
+
const cleanups = retainOwnedCommandCleanup(cause, options.resourceOwner, "ghidra", "ghidra:java");
|
|
546
|
+
let primary;
|
|
547
|
+
if (interpreted !== undefined && !interpreted.ok) {
|
|
548
|
+
if (cleanups.length === 0) return interpreted;
|
|
549
|
+
primary = probeFailureError(interpreted.error, cause);
|
|
550
|
+
} else if (commandFailure?.reason === "cancelled" && commandFailure.cancellation !== undefined) {
|
|
551
|
+
primary = new AnalysisCancelledError("ghidra:java", {
|
|
552
|
+
cause: commandFailure.cancellation.reason,
|
|
553
|
+
...output === undefined ? {} : { capturedOutput: output },
|
|
554
|
+
...interpreted?.ok === true ? { diagnostics: { java_observation: jsonValueSchema.parse(interpreted.value) } } : {}
|
|
555
|
+
});
|
|
556
|
+
} else if (interpreted?.ok === true && commandFailure?.cleanupOwner !== undefined) {
|
|
557
|
+
primary = new ProviderAdapterError("ghidra", "ghidra:java", {
|
|
558
|
+
cause,
|
|
559
|
+
...output === undefined ? {} : { capturedOutput: output },
|
|
560
|
+
diagnostics: {
|
|
561
|
+
java_observation: jsonValueSchema.parse(interpreted.value),
|
|
562
|
+
stage: "cleanup",
|
|
563
|
+
...commandFailure.cancellation === undefined ? {} : { cancellation_observed: true }
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
} else if (preparation !== undefined) {
|
|
567
|
+
primary = new ProviderAdapterError("ghidra", "ghidra:java", {
|
|
568
|
+
cause,
|
|
569
|
+
...output === undefined ? {} : { capturedOutput: output },
|
|
570
|
+
diagnostics: {
|
|
571
|
+
stage: "ownership_preparation",
|
|
572
|
+
...preparation.compilerOutcome === undefined ? {} : { compiler_outcome: jsonValueSchema.parse(preparation.compilerOutcome) }
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
} else if (cause instanceof AnalysisError) {
|
|
576
|
+
primary = cause;
|
|
577
|
+
}
|
|
578
|
+
if (primary === undefined) {
|
|
579
|
+
const code = commandFailure?.reason === "timeout" ? "ETIMEDOUT" : commandFailure?.reason === "output-limit" ? "ENOBUFS" : systemCode(commandFailure?.processError ?? cause);
|
|
580
|
+
const failed = {
|
|
581
|
+
_tag: "GhidraJavaProbeFailure",
|
|
582
|
+
code: code === "ENOENT" ? "runtime_missing" : "runtime_unavailable",
|
|
583
|
+
detail: `${command}: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
584
|
+
...code === undefined ? {} : { processErrorCode: code },
|
|
585
|
+
...output === undefined ? {} : { output }
|
|
586
|
+
};
|
|
587
|
+
if (commandFailure?.cancellation !== undefined) Object.defineProperty(failed, "cancellation", { value: commandFailure.cancellation });
|
|
588
|
+
if (cleanups.length === 0) return err(failed);
|
|
589
|
+
primary = probeFailureError(failed, cause);
|
|
590
|
+
}
|
|
591
|
+
for (const cleanup of cleanups) primary = analysisErrorWithCleanupFailure(primary, cleanup, "ghidra:java").bindCleanupDependencies([primary, cleanup]);
|
|
592
|
+
return err(primary);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
systemCode = (cause) => cause instanceof Error && "code" in cause && typeof cause.code === "string" ? cause.code : undefined;
|
|
596
|
+
probeFailureError = (failure, cause) => {
|
|
597
|
+
const { output, ...facts } = failure;
|
|
598
|
+
return new ProviderAdapterError("ghidra", "ghidra:java", {
|
|
599
|
+
cause,
|
|
600
|
+
...output === undefined ? {} : { capturedOutput: output },
|
|
601
|
+
diagnostics: {
|
|
602
|
+
java_probe_failure: jsonValueSchema.parse(facts),
|
|
603
|
+
...failure.cancellation === undefined ? {} : { cancellation_observed: true }
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
};
|
|
607
|
+
parseGhidraJavaOutput = (command, observed) => {
|
|
608
|
+
if (observed.exitCode !== 0 || observed.signal !== null) return err({
|
|
609
|
+
_tag: "GhidraJavaProbeFailure",
|
|
610
|
+
code: "runtime_unavailable",
|
|
611
|
+
detail: `${command}: Java exited ${String(observed.exitCode)}${observed.signal == null ? "" : ` (${observed.signal})`}`,
|
|
612
|
+
output: capturedProbeOutput(observed)
|
|
613
|
+
});
|
|
614
|
+
const output = `${observed.stdout.text}\n${observed.stderr.text}`;
|
|
615
|
+
const version = javaProperty(output, "java.version") || null;
|
|
616
|
+
const home = javaProperty(output, "java.home") || null;
|
|
617
|
+
const vmName = javaProperty(output, "java.vm.name");
|
|
618
|
+
const osArch = javaProperty(output, "os.arch");
|
|
619
|
+
const osName = javaProperty(output, "os.name");
|
|
620
|
+
const reportedBits = javaProperty(output, "sun.arch.data.model");
|
|
621
|
+
const parsedBits = reportedBits !== null && /^\d+$/.test(reportedBits) ? Number(reportedBits) : null;
|
|
622
|
+
const bits = parsedBits !== null && Number.isSafeInteger(parsedBits) ? parsedBits : null;
|
|
623
|
+
const major = version === null ? undefined : javaMajor(version);
|
|
624
|
+
if (version === null || home === null || major === undefined) return err({
|
|
625
|
+
_tag: "GhidraJavaProbeFailure",
|
|
626
|
+
code: "version_unresolved",
|
|
627
|
+
detail: `${command}: successful Java probe did not establish a valid java.version and nonempty java.home`,
|
|
628
|
+
output: capturedProbeOutput(observed),
|
|
629
|
+
properties: {
|
|
630
|
+
version,
|
|
631
|
+
home,
|
|
632
|
+
vmName,
|
|
633
|
+
osArch,
|
|
634
|
+
osName,
|
|
635
|
+
bits
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
return ok({
|
|
639
|
+
version,
|
|
640
|
+
major,
|
|
641
|
+
home,
|
|
642
|
+
...vmName === null ? {} : { vmName },
|
|
643
|
+
...osArch === null ? {} : { osArch },
|
|
644
|
+
...osName === null ? {} : { osName },
|
|
645
|
+
bits,
|
|
646
|
+
...reportedBits === null || bits !== null ? {} : { unparsedBits: reportedBits },
|
|
647
|
+
runtime: executablePath$1((process.platform === "win32" ? win32 : posix).join(home, "bin", process.platform === "win32" ? "javac.exe" : "javac")) ? "jdk" : "jre"
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
javaProperty = (output, name) => new RegExp(`^[ \\t]*${name.replaceAll(".", "\\.")}[ \\t]*=[ \\t]*([^\\r\\n]*?)[ \\t]*\\r?$`, "mu").exec(output)?.[1] ?? null;
|
|
651
|
+
javaMajor = (version) => {
|
|
652
|
+
const legacy = /^1\.([1-8])(?:\.[0-9]+)*(?:_[0-9]+)?(?:-[-a-zA-Z0-9.]+)?$/u.exec(version);
|
|
653
|
+
if (legacy?.[1] !== undefined) return Number(legacy[1]);
|
|
654
|
+
const modern = /^(?<number>[1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:(?:-[a-zA-Z0-9]+)?\+(?<build>0|[1-9][0-9]*)(?:-[-a-zA-Z0-9.]+)?|-[a-zA-Z0-9]+(?:-[-a-zA-Z0-9.]+)?|\+-[-a-zA-Z0-9.]+)?$/u.exec(version);
|
|
655
|
+
const number = modern?.groups?.number;
|
|
656
|
+
if (number === undefined) return undefined;
|
|
657
|
+
const parts = number.split(".").map(Number);
|
|
658
|
+
const build = modern?.groups?.build;
|
|
659
|
+
if ([...parts, ...build === undefined ? [] : [Number(build)]].some((value) => !Number.isSafeInteger(value) || value > 2147483647)) return undefined;
|
|
660
|
+
return parts[0];
|
|
661
|
+
};
|
|
662
|
+
})))();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
//#endregion
|
|
666
|
+
//#region dist/ghidra/GhidraExecutableHeader.js
|
|
667
|
+
var GHIDRA_EXECUTABLE_HEADER_BYTES, readGhidraExecutableHeader;
|
|
668
|
+
function init_GhidraExecutableHeader() {
|
|
669
|
+
return (init_GhidraExecutableHeader = __esmMin((() => {
|
|
670
|
+
init_result();
|
|
671
|
+
init_analysisErrorCore();
|
|
672
|
+
init_ArtifactFileOperation();
|
|
673
|
+
init_readStableFileBytes();
|
|
674
|
+
init_GhidraFileArtifacts();
|
|
675
|
+
GHIDRA_EXECUTABLE_HEADER_BYTES = 4096;
|
|
676
|
+
readGhidraExecutableHeader = async (path, options) => {
|
|
677
|
+
let completedHeader;
|
|
678
|
+
try {
|
|
679
|
+
return ok(await options.resourceOwner.run(() => withArtifactRegularFile(path, { retain: (resource) => options.resourceOwner.retain({ close: () => resource.lease.release() }, resource.resource) }, options.signal, async (file) => {
|
|
680
|
+
const observed = await readStableFilePrefix(file, path, GHIDRA_EXECUTABLE_HEADER_BYTES, {
|
|
681
|
+
symlinks: "follow",
|
|
682
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
683
|
+
});
|
|
684
|
+
if (observed.size > BigInt(Number.MAX_SAFE_INTEGER)) throw new AnalysisResourceConstraintError("ghidra:installation", "file-size", "Executable extent cannot be represented exactly by the header parser", {
|
|
685
|
+
maximum_bytes: Number.MAX_SAFE_INTEGER,
|
|
686
|
+
observed_bytes: observed.size.toString()
|
|
687
|
+
}, {
|
|
688
|
+
diagnostics: {
|
|
689
|
+
path,
|
|
690
|
+
stage: "native_decompiler_header"
|
|
691
|
+
},
|
|
692
|
+
retryable: false
|
|
693
|
+
});
|
|
694
|
+
completedHeader = {
|
|
695
|
+
bytes: observed.bytes,
|
|
696
|
+
size: Number(observed.size)
|
|
697
|
+
};
|
|
698
|
+
return completedHeader;
|
|
699
|
+
}, "follow")));
|
|
700
|
+
} catch (cause) {
|
|
701
|
+
return err(ghidraFileFailure(cause, "ghidra:installation", {
|
|
702
|
+
path,
|
|
703
|
+
stage: "native_decompiler_header",
|
|
704
|
+
...completedHeader === undefined ? {} : { completed_header: {
|
|
705
|
+
file_bytes: completedHeader.size,
|
|
706
|
+
examined_bytes: completedHeader.bytes.length,
|
|
707
|
+
prefix_sha256: createHash("sha256").update(completedHeader.bytes).digest("hex")
|
|
708
|
+
} }
|
|
709
|
+
}));
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
})))();
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
//#endregion
|
|
716
|
+
//#region dist/ghidra/GhidraJavaProperties.js
|
|
717
|
+
/** Join odd-backslash continuations while stripping leading continuation space. */
|
|
718
|
+
function* logicalPropertyLines(content) {
|
|
719
|
+
let physicalStart = 0;
|
|
720
|
+
let logical = "";
|
|
721
|
+
let continuing = false;
|
|
722
|
+
while (physicalStart <= content.length) {
|
|
723
|
+
let physicalEnd = physicalStart;
|
|
724
|
+
while (physicalEnd < content.length && content[physicalEnd] !== "\n" && content[physicalEnd] !== "\r") physicalEnd += 1;
|
|
725
|
+
let line = content.slice(physicalStart, physicalEnd);
|
|
726
|
+
let leading = 0;
|
|
727
|
+
while (isPropertyWhitespace(line[leading])) leading += 1;
|
|
728
|
+
const comment = !continuing && (line[leading] === "#" || line[leading] === "!");
|
|
729
|
+
if (continuing) line = line.slice(leading);
|
|
730
|
+
let continued = false;
|
|
731
|
+
if (!comment) {
|
|
732
|
+
let slashes = 0;
|
|
733
|
+
for (let index = line.length - 1; index >= 0 && line[index] === "\\"; index -= 1) slashes += 1;
|
|
734
|
+
continued = slashes % 2 === 1;
|
|
735
|
+
logical += continued ? line.slice(0, -1) : line;
|
|
736
|
+
}
|
|
737
|
+
if (!continued) {
|
|
738
|
+
yield logical;
|
|
739
|
+
logical = "";
|
|
740
|
+
}
|
|
741
|
+
continuing = continued;
|
|
742
|
+
if (physicalEnd === content.length) break;
|
|
743
|
+
physicalStart = content[physicalEnd] === "\r" && content[physicalEnd + 1] === "\n" ? physicalEnd + 2 : physicalEnd + 1;
|
|
744
|
+
}
|
|
745
|
+
if (continuing) yield logical;
|
|
746
|
+
}
|
|
747
|
+
var parseGhidraJavaProperties, isPropertyWhitespace, decodePropertyEscapes;
|
|
748
|
+
function init_GhidraJavaProperties() {
|
|
749
|
+
return (init_GhidraJavaProperties = __esmMin((() => {
|
|
750
|
+
parseGhidraJavaProperties = (content) => {
|
|
751
|
+
const values = new Map();
|
|
752
|
+
for (const line of logicalPropertyLines(content)) {
|
|
753
|
+
let start = 0;
|
|
754
|
+
while (isPropertyWhitespace(line[start])) start += 1;
|
|
755
|
+
if (start === line.length || line[start] === "#" || line[start] === "!") continue;
|
|
756
|
+
let end = start;
|
|
757
|
+
let escaped = false;
|
|
758
|
+
while (end < line.length) {
|
|
759
|
+
const character = line[end];
|
|
760
|
+
if (!escaped && (character === "=" || character === ":" || isPropertyWhitespace(character))) break;
|
|
761
|
+
if (character === "\\") escaped = !escaped;
|
|
762
|
+
else escaped = false;
|
|
763
|
+
end += 1;
|
|
764
|
+
}
|
|
765
|
+
let valueStart = end;
|
|
766
|
+
while (isPropertyWhitespace(line[valueStart])) valueStart += 1;
|
|
767
|
+
if (line[valueStart] === "=" || line[valueStart] === ":") valueStart += 1;
|
|
768
|
+
while (isPropertyWhitespace(line[valueStart])) valueStart += 1;
|
|
769
|
+
const key = decodePropertyEscapes(line.slice(start, end));
|
|
770
|
+
if (!key.ok) return key;
|
|
771
|
+
const value = decodePropertyEscapes(line.slice(valueStart));
|
|
772
|
+
if (!value.ok) return value;
|
|
773
|
+
values.set(key.value, value.value);
|
|
774
|
+
}
|
|
775
|
+
return {
|
|
776
|
+
ok: true,
|
|
777
|
+
value: values
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
isPropertyWhitespace = (value) => value === " " || value === " " || value === "\f";
|
|
781
|
+
decodePropertyEscapes = (value) => {
|
|
782
|
+
let result = "";
|
|
783
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
784
|
+
const character = value[index];
|
|
785
|
+
if (character !== "\\") {
|
|
786
|
+
result += character;
|
|
787
|
+
continue;
|
|
788
|
+
}
|
|
789
|
+
const escaped = value[++index];
|
|
790
|
+
if (escaped === undefined) return {
|
|
791
|
+
ok: false,
|
|
792
|
+
error: "Trailing escape in Java properties value"
|
|
793
|
+
};
|
|
794
|
+
if (escaped === "t") result += " ";
|
|
795
|
+
else if (escaped === "n") result += "\n";
|
|
796
|
+
else if (escaped === "r") result += "\r";
|
|
797
|
+
else if (escaped === "f") result += "\f";
|
|
798
|
+
else if (escaped === "u") {
|
|
799
|
+
const digits = value.slice(index + 1, index + 5);
|
|
800
|
+
if (digits.length !== 4 || !/^[0-9a-f]{4}$/iu.test(digits)) return {
|
|
801
|
+
ok: false,
|
|
802
|
+
error: "Malformed Unicode escape in Java properties file"
|
|
803
|
+
};
|
|
804
|
+
result += String.fromCharCode(Number.parseInt(digits, 16));
|
|
805
|
+
index += 4;
|
|
806
|
+
} else result += escaped;
|
|
807
|
+
}
|
|
808
|
+
return {
|
|
809
|
+
ok: true,
|
|
810
|
+
value: result
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
})))();
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
//#endregion
|
|
817
|
+
//#region dist/ghidra/GhidraReleasePolicy.js
|
|
818
|
+
var SUPPORTED_GHIDRA_VERSION, SUPPORTED_GHIDRA_JAVA_MAJOR, GHIDRA_RELEASE_PATTERN, ghidraReleaseCompatibility, unverifiedGhidraBuildLimitation, ghidraReleaseLine, ghidraVersionDetail, ghidraReleaseAccepted, verifiedGhidraRelease, parseGhidraRelease, ghidraConfigurationVersion, integerGroup;
|
|
819
|
+
function init_GhidraReleasePolicy() {
|
|
820
|
+
return (init_GhidraReleasePolicy = __esmMin((() => {
|
|
821
|
+
SUPPORTED_GHIDRA_VERSION = "12.1.4";
|
|
822
|
+
SUPPORTED_GHIDRA_JAVA_MAJOR = 21;
|
|
823
|
+
GHIDRA_RELEASE_PATTERN = /^(\d+)\.(\d+)(?:\.(\d+))?([-+].*)?$/u;
|
|
824
|
+
ghidraReleaseCompatibility = (raw) => {
|
|
825
|
+
if (raw === null || raw === undefined) return {
|
|
826
|
+
status: "unresolved",
|
|
827
|
+
raw: null
|
|
828
|
+
};
|
|
829
|
+
const version = parseGhidraRelease(raw);
|
|
830
|
+
if (version === undefined) return {
|
|
831
|
+
status: "unresolved",
|
|
832
|
+
raw
|
|
833
|
+
};
|
|
834
|
+
if (raw === "12.1.4") return {
|
|
835
|
+
status: "verified",
|
|
836
|
+
version,
|
|
837
|
+
raw
|
|
838
|
+
};
|
|
839
|
+
const verified = verifiedGhidraRelease();
|
|
840
|
+
return version.major === verified.major && version.minor === verified.minor ? {
|
|
841
|
+
status: "compatible",
|
|
842
|
+
version,
|
|
843
|
+
raw
|
|
844
|
+
} : {
|
|
845
|
+
status: "unsupported",
|
|
846
|
+
version,
|
|
847
|
+
raw
|
|
848
|
+
};
|
|
849
|
+
};
|
|
850
|
+
unverifiedGhidraBuildLimitation = (providerVersion) => {
|
|
851
|
+
const compatibility = ghidraReleaseCompatibility(providerVersion);
|
|
852
|
+
if (compatibility.status !== "compatible") return undefined;
|
|
853
|
+
return `This session uses Ghidra ${providerVersion}. The bridge is verified against ${SUPPORTED_GHIDRA_VERSION}; other ${ghidraReleaseLine()} builds are accepted and the observed version is reported.`;
|
|
854
|
+
};
|
|
855
|
+
ghidraReleaseLine = () => {
|
|
856
|
+
const verified = verifiedGhidraRelease();
|
|
857
|
+
return `${String(verified.major)}.${String(verified.minor)}.x`;
|
|
858
|
+
};
|
|
859
|
+
ghidraVersionDetail = (raw) => {
|
|
860
|
+
const compatibility = ghidraReleaseCompatibility(raw);
|
|
861
|
+
switch (compatibility.status) {
|
|
862
|
+
case "unresolved": return compatibility.raw ?? "unknown";
|
|
863
|
+
case "verified": return compatibility.raw;
|
|
864
|
+
case "compatible": return `${compatibility.raw}; compatible ${ghidraReleaseLine()} release (verified build ${SUPPORTED_GHIDRA_VERSION})`;
|
|
865
|
+
case "unsupported": return `${compatibility.raw}; accepted releases are ${ghidraReleaseLine()} (verified build ${SUPPORTED_GHIDRA_VERSION})`;
|
|
866
|
+
default: {
|
|
867
|
+
const unreachable = compatibility;
|
|
868
|
+
return unreachable;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
ghidraReleaseAccepted = (raw) => {
|
|
873
|
+
const status = ghidraReleaseCompatibility(raw).status;
|
|
874
|
+
return status === "verified" || status === "compatible";
|
|
875
|
+
};
|
|
876
|
+
verifiedGhidraRelease = () => {
|
|
877
|
+
const version = parseGhidraRelease(SUPPORTED_GHIDRA_VERSION);
|
|
878
|
+
if (version === undefined) throw new TypeError(`SUPPORTED_GHIDRA_VERSION ${SUPPORTED_GHIDRA_VERSION} is not a Ghidra release`);
|
|
879
|
+
return version;
|
|
880
|
+
};
|
|
881
|
+
parseGhidraRelease = (raw) => {
|
|
882
|
+
const match = GHIDRA_RELEASE_PATTERN.exec(raw);
|
|
883
|
+
const major = integerGroup(match?.[1]);
|
|
884
|
+
const minor = integerGroup(match?.[2]);
|
|
885
|
+
if (match === null || major === undefined || minor === undefined) return undefined;
|
|
886
|
+
const patch = match[3] === undefined ? 0 : integerGroup(match[3]);
|
|
887
|
+
return patch === undefined ? undefined : {
|
|
888
|
+
major,
|
|
889
|
+
minor,
|
|
890
|
+
patch,
|
|
891
|
+
suffix: match[4] ?? ""
|
|
892
|
+
};
|
|
893
|
+
};
|
|
894
|
+
ghidraConfigurationVersion = (raw) => {
|
|
895
|
+
const version = parseGhidraRelease(raw);
|
|
896
|
+
if (version === undefined || version.suffix.startsWith("+")) return undefined;
|
|
897
|
+
const patch = version.patch === 0 ? "" : `.${String(version.patch)}`;
|
|
898
|
+
const suffix = version.suffix === "-" ? "" : version.suffix;
|
|
899
|
+
return `${String(version.major)}.${String(version.minor)}${patch}${suffix}`;
|
|
900
|
+
};
|
|
901
|
+
integerGroup = (value) => {
|
|
902
|
+
if (value === undefined) return undefined;
|
|
903
|
+
const parsed = Number(value);
|
|
904
|
+
return Number.isSafeInteger(parsed) ? parsed : undefined;
|
|
905
|
+
};
|
|
906
|
+
})))();
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region dist/ghidra/GhidraInstallationPolicy.js
|
|
911
|
+
var ghidraApplicationProperties, ghidraJavaRequirement, ghidraJavaRangeLabel, ghidraJavaMajorAccepted, parseJavaBound, parseJavaMaximum, parseJavaInteger, javaDecimalDigit, unresolvedJavaRequirement;
|
|
912
|
+
function init_GhidraInstallationPolicy() {
|
|
913
|
+
return (init_GhidraInstallationPolicy = __esmMin((() => {
|
|
914
|
+
init_GhidraJavaProperties();
|
|
915
|
+
init_GhidraReleasePolicy();
|
|
916
|
+
ghidraApplicationProperties = (content) => {
|
|
917
|
+
const parsed = parseGhidraJavaProperties(content);
|
|
918
|
+
if (!parsed.ok) return {
|
|
919
|
+
providerVersion: null,
|
|
920
|
+
configurationDirectoryName: null,
|
|
921
|
+
javaMinimum: {
|
|
922
|
+
status: "unresolved",
|
|
923
|
+
raw: parsed.error
|
|
924
|
+
},
|
|
925
|
+
javaMaximum: {
|
|
926
|
+
status: "unresolved",
|
|
927
|
+
raw: parsed.error
|
|
928
|
+
},
|
|
929
|
+
parseError: parsed.error
|
|
930
|
+
};
|
|
931
|
+
const providerVersion = parsed.value.get("application.version");
|
|
932
|
+
const releaseName = parsed.value.get("application.release.name")?.replaceAll(/[ \t\n\r\f\v]/gu, "").toUpperCase();
|
|
933
|
+
const configurationVersion = providerVersion === undefined ? undefined : ghidraConfigurationVersion(providerVersion);
|
|
934
|
+
const configurationDirectoryName = providerVersion !== undefined && configurationVersion !== undefined && releaseName !== undefined && /^[A-Za-z0-9][A-Za-z0-9._+-]*$/u.test(providerVersion) && /^[A-Za-z0-9][A-Za-z0-9._-]*$/u.test(releaseName) ? `ghidra_${configurationVersion}_${releaseName}` : null;
|
|
935
|
+
const minimum = parsed.value.get("application.java.min");
|
|
936
|
+
const maximum = parsed.value.get("application.java.max");
|
|
937
|
+
return {
|
|
938
|
+
providerVersion: providerVersion ?? null,
|
|
939
|
+
configurationDirectoryName,
|
|
940
|
+
javaMinimum: minimum === undefined ? { status: "absent" } : parseJavaBound(minimum),
|
|
941
|
+
javaMaximum: parseJavaMaximum(maximum),
|
|
942
|
+
parseError: null
|
|
943
|
+
};
|
|
944
|
+
};
|
|
945
|
+
ghidraJavaRequirement = (properties) => {
|
|
946
|
+
if (properties?.parseError !== null && properties?.parseError !== undefined) return unresolvedJavaRequirement(`application.properties parse failed: ${properties.parseError}`);
|
|
947
|
+
if (properties === undefined) return unresolvedJavaRequirement("application.properties is unavailable");
|
|
948
|
+
const minimum = properties.javaMinimum;
|
|
949
|
+
const maximum = properties.javaMaximum;
|
|
950
|
+
if (minimum.status === "unresolved") return unresolvedJavaRequirement(`application.java.min=${minimum.raw}`);
|
|
951
|
+
if (minimum.status === "absent") return unresolvedJavaRequirement("application.java.min is missing");
|
|
952
|
+
if (maximum.status === "unresolved") return unresolvedJavaRequirement(`application.java.max=${maximum.raw}`);
|
|
953
|
+
const minimumMajor = minimum.major;
|
|
954
|
+
const maximumMajor = maximum.status === "major" ? maximum.major : null;
|
|
955
|
+
if (maximumMajor !== null && maximumMajor < minimumMajor) return unresolvedJavaRequirement(`application.java.max=${String(maximumMajor)} is below application.java.min=${String(minimumMajor)}`);
|
|
956
|
+
return {
|
|
957
|
+
minimumMajor,
|
|
958
|
+
maximumMajor,
|
|
959
|
+
unresolved: null
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
ghidraJavaRangeLabel = (requirement) => {
|
|
963
|
+
if (requirement.unresolved !== null) return "a 64-bit full JDK matching the installation's declared Java bounds";
|
|
964
|
+
if (requirement.maximumMajor === null) return `a 64-bit full JDK ${String(requirement.minimumMajor)} or newer`;
|
|
965
|
+
if (requirement.maximumMajor === requirement.minimumMajor) return `a 64-bit full JDK ${String(requirement.minimumMajor)}`;
|
|
966
|
+
return `a 64-bit full JDK ${String(requirement.minimumMajor)} through ${String(requirement.maximumMajor)}`;
|
|
967
|
+
};
|
|
968
|
+
ghidraJavaMajorAccepted = (major, requirement) => requirement.unresolved === null && major >= requirement.minimumMajor && (requirement.maximumMajor === null || major <= requirement.maximumMajor);
|
|
969
|
+
parseJavaBound = (raw) => {
|
|
970
|
+
const major = parseJavaInteger(raw);
|
|
971
|
+
return major === undefined ? {
|
|
972
|
+
status: "unresolved",
|
|
973
|
+
raw
|
|
974
|
+
} : {
|
|
975
|
+
status: "major",
|
|
976
|
+
major
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
parseJavaMaximum = (raw) => {
|
|
980
|
+
if (raw === undefined || raw === "") return { status: "absent" };
|
|
981
|
+
const bound = parseJavaBound(raw);
|
|
982
|
+
return bound.status === "major" && bound.major === 0 ? { status: "absent" } : bound;
|
|
983
|
+
};
|
|
984
|
+
parseJavaInteger = (raw) => {
|
|
985
|
+
let index = 0;
|
|
986
|
+
let sign = 1;
|
|
987
|
+
if (raw[index] === "+" || raw[index] === "-") {
|
|
988
|
+
if (raw[index] === "-") sign = -1;
|
|
989
|
+
index += 1;
|
|
990
|
+
}
|
|
991
|
+
if (index === raw.length) return undefined;
|
|
992
|
+
const limit = sign < 0 ? 2147483648 : 2147483647;
|
|
993
|
+
let value = 0;
|
|
994
|
+
for (; index < raw.length; index += 1) {
|
|
995
|
+
const character = raw[index];
|
|
996
|
+
if (character === undefined) return undefined;
|
|
997
|
+
const digit = javaDecimalDigit(character);
|
|
998
|
+
if (digit === undefined) return undefined;
|
|
999
|
+
if (value > Math.floor((limit - digit) / 10)) return undefined;
|
|
1000
|
+
value = value * 10 + digit;
|
|
1001
|
+
}
|
|
1002
|
+
return sign * value;
|
|
1003
|
+
};
|
|
1004
|
+
javaDecimalDigit = (character) => {
|
|
1005
|
+
const code = character.charCodeAt(0);
|
|
1006
|
+
if (code >= 48 && code <= 57) return code - 48;
|
|
1007
|
+
if (!/^\p{Decimal_Number}$/u.test(character)) return undefined;
|
|
1008
|
+
let blockStart = code;
|
|
1009
|
+
while (blockStart > 0 && /^\p{Decimal_Number}$/u.test(String.fromCharCode(blockStart - 1))) blockStart -= 1;
|
|
1010
|
+
return (code - blockStart) % 10;
|
|
1011
|
+
};
|
|
1012
|
+
unresolvedJavaRequirement = (unresolved) => ({ unresolved });
|
|
1013
|
+
})))();
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
//#endregion
|
|
1017
|
+
//#region dist/ghidra/GhidraInstallationProperties.js
|
|
1018
|
+
var MAX_GHIDRA_INSTALLATION_PROPERTIES_BYTES, readGhidraInstallationProperties;
|
|
1019
|
+
function init_GhidraInstallationProperties() {
|
|
1020
|
+
return (init_GhidraInstallationProperties = __esmMin((() => {
|
|
1021
|
+
init_ArtifactFileOperation();
|
|
1022
|
+
init_jsonValue();
|
|
1023
|
+
init_RegularFile();
|
|
1024
|
+
init_readStableFileBytes();
|
|
1025
|
+
init_GhidraInstallationPolicy();
|
|
1026
|
+
init_GhidraFileArtifacts();
|
|
1027
|
+
MAX_GHIDRA_INSTALLATION_PROPERTIES_BYTES = 1024 * 1024;
|
|
1028
|
+
readGhidraInstallationProperties = async (path, options) => {
|
|
1029
|
+
try {
|
|
1030
|
+
return await options.resourceOwner.run(() => withArtifactRegularFile(path, { retain: (resource) => options.resourceOwner.retain({ close: () => resource.lease.release() }, resource.resource) }, options.signal, async (file) => (await readStableFileBytes(file, path, MAX_GHIDRA_INSTALLATION_PROPERTIES_BYTES, {
|
|
1031
|
+
symlinks: "follow",
|
|
1032
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1033
|
+
})).toString("latin1"), "follow"));
|
|
1034
|
+
} catch (cause) {
|
|
1035
|
+
const physical = artifactFilePrimaryFailure(cause);
|
|
1036
|
+
if (!(cause instanceof ArtifactFileCleanupFailure) && physical instanceof Error && "code" in physical && "syscall" in physical && physical.syscall === "open" && (physical.code === "ENOENT" || physical.code === "ENOTDIR")) return undefined;
|
|
1037
|
+
const completed = cause instanceof ArtifactFileCancelled ? cause.fileCancellation.outcome.value : cause instanceof ArtifactFileCleanupFailure && cause.fileCleanupFailure.outcome.kind === "completed" ? cause.fileCleanupFailure.outcome.value : undefined;
|
|
1038
|
+
const diagnostics = {
|
|
1039
|
+
path,
|
|
1040
|
+
stage: "installation_properties",
|
|
1041
|
+
...physical instanceof NonRegularFileReadError ? { system_code: physical.code } : {},
|
|
1042
|
+
...typeof completed !== "string" ? {} : { completed_properties: {
|
|
1043
|
+
bytes: Buffer.byteLength(completed, "latin1"),
|
|
1044
|
+
sha256: createHash("sha256").update(completed, "latin1").digest("hex"),
|
|
1045
|
+
properties: jsonValueSchema.parse(ghidraApplicationProperties(completed))
|
|
1046
|
+
} }
|
|
1047
|
+
};
|
|
1048
|
+
throw ghidraFileFailure(cause, "ghidra:installation", diagnostics);
|
|
1049
|
+
}
|
|
1050
|
+
};
|
|
1051
|
+
})))();
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
//#endregion
|
|
1055
|
+
//#region dist/ghidra/GhidraInstallation.js
|
|
1056
|
+
var NATIVE_PLATFORMS, NATIVE_TOOL_FORMATS, NATIVE_ARCHITECTURES, assessNativeDecompiler, inspectGhidraInstallation, availableInstallation, installationCoordinates, installationChecks, configurationCheck, ghidraInstallationDiagnostics, ghidraJavaEnvironment, installationCheck, nativeDecompilerCheck, jvmOsNameMatchesPlatform, jvmOsArchNativeDirectory, versionCheck, javaCheck, javaRemediation, systemGhidraInstallationHost, discoverGhidraInstallationOnPath, executablePath;
|
|
1057
|
+
function init_GhidraInstallation() {
|
|
1058
|
+
return (init_GhidraInstallation = __esmMin((() => {
|
|
1059
|
+
init_analysisErrorBase();
|
|
1060
|
+
init_analysisErrorCore();
|
|
1061
|
+
init_GhidraJavaProbe();
|
|
1062
|
+
init_result();
|
|
1063
|
+
init_analysisErrorProjection();
|
|
1064
|
+
init_GhidraExecutableHeader();
|
|
1065
|
+
init_snapshotEnvironment();
|
|
1066
|
+
init_GhidraInstallationProperties();
|
|
1067
|
+
init_binaryTarget();
|
|
1068
|
+
init_binaryTargetTypes();
|
|
1069
|
+
init_GhidraInstallationPolicy();
|
|
1070
|
+
init_GhidraReleasePolicy();
|
|
1071
|
+
NATIVE_PLATFORMS = {
|
|
1072
|
+
linux: {
|
|
1073
|
+
x64: "linux_x86_64",
|
|
1074
|
+
arm64: "linux_arm_64"
|
|
1075
|
+
},
|
|
1076
|
+
darwin: {
|
|
1077
|
+
x64: "mac_x86_64",
|
|
1078
|
+
arm64: "mac_arm_64"
|
|
1079
|
+
},
|
|
1080
|
+
win32: { x64: "win_x86_64" }
|
|
1081
|
+
};
|
|
1082
|
+
NATIVE_TOOL_FORMATS = {
|
|
1083
|
+
linux: "elf",
|
|
1084
|
+
darwin: "mach-o",
|
|
1085
|
+
win32: "pe"
|
|
1086
|
+
};
|
|
1087
|
+
NATIVE_ARCHITECTURES = [
|
|
1088
|
+
{
|
|
1089
|
+
node: "x64",
|
|
1090
|
+
binary: "x86_64"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
node: "ia32",
|
|
1094
|
+
binary: "x86"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
node: "arm",
|
|
1098
|
+
binary: "arm"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
node: "arm64",
|
|
1102
|
+
binary: "arm64"
|
|
1103
|
+
}
|
|
1104
|
+
];
|
|
1105
|
+
assessNativeDecompiler = (path, platform, architecture, probe) => {
|
|
1106
|
+
const expectedFormat = NATIVE_TOOL_FORMATS[platform];
|
|
1107
|
+
const expectedArchitecture = NATIVE_ARCHITECTURES.find(({ node }) => node === architecture)?.binary;
|
|
1108
|
+
if (expectedFormat === undefined || expectedArchitecture === undefined) return {
|
|
1109
|
+
status: "unknown",
|
|
1110
|
+
detail: `${path} is executable, but no native tool format is defined for ${platform}/${architecture}`
|
|
1111
|
+
};
|
|
1112
|
+
let parsed = probe === undefined ? undefined : parseExecutableHeader(probe.bytes, architecture, probe.size);
|
|
1113
|
+
if (probe !== undefined && parsed !== undefined && !parsed.ok) {
|
|
1114
|
+
for (const { node } of NATIVE_ARCHITECTURES) {
|
|
1115
|
+
if (node === architecture) continue;
|
|
1116
|
+
const alternative = parseExecutableHeader(probe.bytes, node, probe.size);
|
|
1117
|
+
if (alternative.ok && !alternative.value.availableArchitectures.some((available) => available === expectedArchitecture)) {
|
|
1118
|
+
parsed = alternative;
|
|
1119
|
+
break;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
if (parsed === undefined || !parsed.ok) return {
|
|
1124
|
+
status: "unknown",
|
|
1125
|
+
detail: `${path} is executable, but its executable format for ${platform}/${architecture} could not be established`
|
|
1126
|
+
};
|
|
1127
|
+
const observed = `${parsed.value.format} ${parsed.value.architecture}`;
|
|
1128
|
+
const expected = `${expectedFormat} ${expectedArchitecture}`;
|
|
1129
|
+
const formatMatches = isMachOFormat(expectedFormat) ? isMachOFormat(parsed.value.format) : parsed.value.format === expectedFormat;
|
|
1130
|
+
if (formatMatches && parsed.value.architecture === expectedArchitecture) return {
|
|
1131
|
+
status: "compatible",
|
|
1132
|
+
detail: `${path} reports ${observed}, which matches ${platform}/${architecture}`
|
|
1133
|
+
};
|
|
1134
|
+
const nativeDirectory = NATIVE_PLATFORMS[platform]?.[architecture];
|
|
1135
|
+
const executable = platform === "win32" ? "decompile.exe" : "decompile";
|
|
1136
|
+
return {
|
|
1137
|
+
status: "incompatible",
|
|
1138
|
+
detail: `${path} reports ${observed}, but ${platform}/${architecture} requires ${expected}`,
|
|
1139
|
+
remediation: `Provide an executable Ghidra/Features/Decompiler/os/${nativeDirectory ?? "<platform>"}/${executable} built for ${expected}, or its build/os equivalent. REA does not build or install native tools.`
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
inspectGhidraInstallation = async (options, host = systemGhidraInstallationHost()) => {
|
|
1143
|
+
if (options.signal?.aborted) throw new AnalysisCancelledError("ghidra:installation", { cause: options.signal.reason });
|
|
1144
|
+
const platform = options.platform ?? process.platform;
|
|
1145
|
+
const architecture = options.architecture ?? process.arch;
|
|
1146
|
+
const coordinates = await installationCoordinates(options, platform, architecture, host);
|
|
1147
|
+
const checks = installationChecks({
|
|
1148
|
+
coordinates,
|
|
1149
|
+
platform,
|
|
1150
|
+
architecture,
|
|
1151
|
+
javaHome: options.javaHome,
|
|
1152
|
+
host
|
|
1153
|
+
});
|
|
1154
|
+
const failed = checks.find((check) => check.status === "failed");
|
|
1155
|
+
const javaObservation = coordinates.java ?? coordinates.javaProbeFailure?.properties;
|
|
1156
|
+
const observation = {
|
|
1157
|
+
platform,
|
|
1158
|
+
architecture,
|
|
1159
|
+
applicationPropertiesPath: coordinates.applicationPropertiesPath,
|
|
1160
|
+
configurationDirectoryName: coordinates.properties?.configurationDirectoryName ?? null,
|
|
1161
|
+
nativeDecompilerPath: coordinates.nativeDecompilerPath,
|
|
1162
|
+
...coordinates.nativeDecompilerHeader.ok ? {} : { nativeDecompilerHeaderFailure: coordinates.nativeDecompilerHeader.error },
|
|
1163
|
+
javaCommand: coordinates.javaCommand,
|
|
1164
|
+
...coordinates.javaProbeFailure === undefined ? {} : { javaProbeFailure: coordinates.javaProbeFailure },
|
|
1165
|
+
...javaObservation?.vmName == null ? {} : { javaVmName: javaObservation.vmName },
|
|
1166
|
+
...javaObservation?.osArch == null ? {} : { javaOsArch: javaObservation.osArch },
|
|
1167
|
+
...javaObservation?.osName == null ? {} : { javaOsName: javaObservation.osName },
|
|
1168
|
+
checks
|
|
1169
|
+
};
|
|
1170
|
+
if (failed !== undefined) return {
|
|
1171
|
+
status: "unavailable",
|
|
1172
|
+
...observation,
|
|
1173
|
+
installDir: coordinates.installDir,
|
|
1174
|
+
analyzeHeadlessPath: coordinates.analyzeHeadlessPath,
|
|
1175
|
+
providerVersion: coordinates.properties?.providerVersion ?? null,
|
|
1176
|
+
javaHome: javaObservation?.home ?? options.javaHome ?? null,
|
|
1177
|
+
javaVersion: javaObservation?.version ?? null,
|
|
1178
|
+
rejection: {
|
|
1179
|
+
code: failed.code,
|
|
1180
|
+
reason: failed.remediation
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
if (options.signal?.aborted) throw new AnalysisCancelledError("ghidra:installation", {
|
|
1184
|
+
cause: options.signal.reason,
|
|
1185
|
+
diagnostics: ghidraInstallationDiagnostics(availableInstallation(coordinates, observation))
|
|
1186
|
+
});
|
|
1187
|
+
return availableInstallation(coordinates, observation);
|
|
1188
|
+
};
|
|
1189
|
+
availableInstallation = (coordinates, observation) => {
|
|
1190
|
+
const providerVersion = coordinates.properties?.providerVersion;
|
|
1191
|
+
if (coordinates.installDir === null || coordinates.applicationPropertiesPath === null || coordinates.analyzeHeadlessPath === null || providerVersion === null || providerVersion === undefined || coordinates.java === undefined) throw new TypeError("Passing Ghidra installation checks produced incomplete coordinates");
|
|
1192
|
+
return {
|
|
1193
|
+
status: "available",
|
|
1194
|
+
...observation,
|
|
1195
|
+
installDir: coordinates.installDir,
|
|
1196
|
+
analyzeHeadlessPath: coordinates.analyzeHeadlessPath,
|
|
1197
|
+
applicationPropertiesPath: coordinates.applicationPropertiesPath,
|
|
1198
|
+
providerVersion,
|
|
1199
|
+
javaHome: coordinates.java.home,
|
|
1200
|
+
javaVersion: coordinates.java.version
|
|
1201
|
+
};
|
|
1202
|
+
};
|
|
1203
|
+
installationCoordinates = async (options, platform, architecture, host) => {
|
|
1204
|
+
const path = platform === "win32" ? win32 : posix;
|
|
1205
|
+
const installDir = options.installDir ?? host.discoverInstallDirOnPath?.(options.environment, platform) ?? null;
|
|
1206
|
+
const applicationPropertiesPath = installDir === null ? null : path.join(installDir, "Ghidra", "application.properties");
|
|
1207
|
+
const analyzeHeadlessPath = installDir === null ? null : path.join(installDir, "support", platform === "win32" ? "analyzeHeadless.bat" : "analyzeHeadless");
|
|
1208
|
+
const decompilerPlatform = NATIVE_PLATFORMS[platform]?.[architecture];
|
|
1209
|
+
const decompilerExecutable = platform === "win32" ? "decompile.exe" : "decompile";
|
|
1210
|
+
const nativeDecompilerPath = installDir === null || decompilerPlatform === undefined ? null : [path.join(installDir, "Ghidra", "Features", "Decompiler", "os", decompilerPlatform, decompilerExecutable), path.join(installDir, "Ghidra", "Features", "Decompiler", "build", "os", decompilerPlatform, decompilerExecutable)].find((candidate) => host.executable(candidate)) ?? null;
|
|
1211
|
+
const properties = applicationPropertiesPath === null ? undefined : await host.readText(applicationPropertiesPath, {
|
|
1212
|
+
resourceOwner: options.resourceOwner,
|
|
1213
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1214
|
+
});
|
|
1215
|
+
const nativeDecompilerHeader = nativeDecompilerPath === null || host.executableHeader === undefined ? ok(undefined) : await host.executableHeader(nativeDecompilerPath, {
|
|
1216
|
+
resourceOwner: options.resourceOwner,
|
|
1217
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1218
|
+
});
|
|
1219
|
+
if (!nativeDecompilerHeader.ok && (nativeDecompilerHeader.error instanceof AnalysisCancelledError || nativeDecompilerHeader.error.cleanupIncomplete)) throw nativeDecompilerHeader.error;
|
|
1220
|
+
const javaCommand = (() => {
|
|
1221
|
+
if (options.javaHome !== undefined) return path.join(options.javaHome, "bin", platform === "win32" ? "java.exe" : "java");
|
|
1222
|
+
if (platform !== "darwin") return platform === "win32" ? "java.exe" : "java";
|
|
1223
|
+
const javaOnPath = options.environment.PATH?.split(":").some((directory) => path.isAbsolute(directory) && host.executable(path.join(directory, "java")));
|
|
1224
|
+
if (javaOnPath) return "java";
|
|
1225
|
+
const prefixes = architecture === "arm64" ? ["/opt/homebrew", "/usr/local"] : ["/usr/local", "/opt/homebrew"];
|
|
1226
|
+
return prefixes.map((prefix) => path.join(prefix, "opt/openjdk/libexec/openjdk.jdk/Contents/Home/bin/java")).find((candidate) => host.executable(candidate)) ?? "java";
|
|
1227
|
+
})();
|
|
1228
|
+
const javaProbe = options.javaHome === undefined || path.isAbsolute(options.javaHome) ? await host.probeJava(javaCommand, ghidraJavaEnvironment(options.javaHome, options.environment, platform), {
|
|
1229
|
+
resourceOwner: options.resourceOwner,
|
|
1230
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1231
|
+
}) : undefined;
|
|
1232
|
+
if (javaProbe !== undefined && !javaProbe.ok && javaProbe.error instanceof AnalysisError) throw javaProbe.error;
|
|
1233
|
+
return {
|
|
1234
|
+
installDir,
|
|
1235
|
+
applicationPropertiesPath,
|
|
1236
|
+
analyzeHeadlessPath,
|
|
1237
|
+
nativeDecompilerPath,
|
|
1238
|
+
nativeDecompilerHeader,
|
|
1239
|
+
properties: properties === undefined ? undefined : ghidraApplicationProperties(properties),
|
|
1240
|
+
javaCommand,
|
|
1241
|
+
java: javaProbe?.ok === true ? javaProbe.value : undefined,
|
|
1242
|
+
javaProbeFailure: javaProbe !== undefined && !javaProbe.ok && !(javaProbe.error instanceof AnalysisError) ? javaProbe.error : undefined
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
installationChecks = ({ coordinates, platform, architecture, javaHome, host }) => [
|
|
1246
|
+
configurationCheck(coordinates.installDir, javaHome, platform),
|
|
1247
|
+
installationCheck({
|
|
1248
|
+
name: "platform",
|
|
1249
|
+
passed: NATIVE_PLATFORMS[platform] !== undefined,
|
|
1250
|
+
code: "unsupported_host",
|
|
1251
|
+
detail: platform,
|
|
1252
|
+
remediation: "Use Linux or macOS x64/arm64, or Windows x64 with matching native Ghidra tools."
|
|
1253
|
+
}),
|
|
1254
|
+
installationCheck({
|
|
1255
|
+
name: "architecture",
|
|
1256
|
+
passed: NATIVE_PLATFORMS[platform]?.[architecture] !== undefined,
|
|
1257
|
+
code: "unsupported_host",
|
|
1258
|
+
detail: architecture,
|
|
1259
|
+
remediation: "Use x64/arm64 on Linux or macOS, or x64 on Windows."
|
|
1260
|
+
}),
|
|
1261
|
+
installationCheck({
|
|
1262
|
+
name: "installation",
|
|
1263
|
+
passed: coordinates.properties !== undefined,
|
|
1264
|
+
code: "executable_missing",
|
|
1265
|
+
detail: coordinates.applicationPropertiesPath ?? "Ghidra application properties unavailable",
|
|
1266
|
+
remediation: "Point GHIDRA_INSTALL_DIR at the root of an extracted official Ghidra release."
|
|
1267
|
+
}),
|
|
1268
|
+
versionCheck(coordinates.properties),
|
|
1269
|
+
installationCheck({
|
|
1270
|
+
name: "headless",
|
|
1271
|
+
passed: coordinates.analyzeHeadlessPath !== null && host.executable(coordinates.analyzeHeadlessPath),
|
|
1272
|
+
code: "executable_missing",
|
|
1273
|
+
detail: coordinates.analyzeHeadlessPath ?? "analyzeHeadless unavailable",
|
|
1274
|
+
remediation: "Restore support/analyzeHeadless or support/analyzeHeadless.bat from the official Ghidra release."
|
|
1275
|
+
}),
|
|
1276
|
+
nativeDecompilerCheck({
|
|
1277
|
+
coordinates,
|
|
1278
|
+
platform,
|
|
1279
|
+
architecture
|
|
1280
|
+
}),
|
|
1281
|
+
javaCheck(coordinates.java, coordinates.javaCommand, javaHome, coordinates.properties, platform, coordinates.javaProbeFailure)
|
|
1282
|
+
];
|
|
1283
|
+
configurationCheck = (installDir, javaHome, platform) => {
|
|
1284
|
+
const { isAbsolute } = platform === "win32" ? win32 : posix;
|
|
1285
|
+
const relative = [...installDir !== null && !isAbsolute(installDir) ? ["GHIDRA_INSTALL_DIR"] : [], ...javaHome !== undefined && !isAbsolute(javaHome) ? ["JAVA_HOME"] : []];
|
|
1286
|
+
if (installDir === null || relative.length === 0) return installationCheck({
|
|
1287
|
+
name: "configuration",
|
|
1288
|
+
passed: installDir !== null,
|
|
1289
|
+
code: "not_configured",
|
|
1290
|
+
detail: installDir ?? "GHIDRA_INSTALL_DIR is not set",
|
|
1291
|
+
remediation: `Set GHIDRA_INSTALL_DIR to an extracted Ghidra ${ghidraReleaseLine()} release directory.`
|
|
1292
|
+
});
|
|
1293
|
+
const settings = relative.join(" and ");
|
|
1294
|
+
return installationCheck({
|
|
1295
|
+
name: "configuration",
|
|
1296
|
+
passed: false,
|
|
1297
|
+
code: "not_configured",
|
|
1298
|
+
detail: `${settings} must be absolute`,
|
|
1299
|
+
remediation: `Set ${settings} to ${relative.length === 1 ? "an absolute path" : "absolute paths"}. REA's analysis and MCP server reject relative paths even when they resolve from the current directory.`
|
|
1300
|
+
});
|
|
1301
|
+
};
|
|
1302
|
+
ghidraInstallationDiagnostics = (inspection) => ({
|
|
1303
|
+
install_dir: inspection.installDir,
|
|
1304
|
+
analyze_headless_path: inspection.analyzeHeadlessPath,
|
|
1305
|
+
native_decompiler_path: inspection.nativeDecompilerPath,
|
|
1306
|
+
...inspection.nativeDecompilerHeaderFailure === undefined ? {} : { native_decompiler_header_failure: projectAnalysisError(inspection.nativeDecompilerHeaderFailure) },
|
|
1307
|
+
application_properties_path: inspection.applicationPropertiesPath,
|
|
1308
|
+
provider_version: inspection.providerVersion,
|
|
1309
|
+
java_command: inspection.javaCommand,
|
|
1310
|
+
...inspection.javaProbeFailure === undefined ? {} : { java_probe_failure: {
|
|
1311
|
+
code: inspection.javaProbeFailure.code,
|
|
1312
|
+
...inspection.javaProbeFailure.processErrorCode === undefined ? {} : { process_error_code: inspection.javaProbeFailure.processErrorCode },
|
|
1313
|
+
detail: inspection.javaProbeFailure.detail,
|
|
1314
|
+
...inspection.javaProbeFailure.cancellation === undefined ? {} : { cancellation_observed: true },
|
|
1315
|
+
...inspection.javaProbeFailure.properties === undefined ? {} : { properties: { ...inspection.javaProbeFailure.properties } },
|
|
1316
|
+
...inspection.javaProbeFailure.output === undefined ? {} : { output: { ...inspection.javaProbeFailure.output } }
|
|
1317
|
+
} },
|
|
1318
|
+
java_home: inspection.javaHome,
|
|
1319
|
+
java_version: inspection.javaVersion,
|
|
1320
|
+
java_vm_name: inspection.javaVmName ?? null,
|
|
1321
|
+
java_os_arch: inspection.javaOsArch ?? null,
|
|
1322
|
+
java_os_name: inspection.javaOsName ?? null,
|
|
1323
|
+
platform: inspection.platform,
|
|
1324
|
+
architecture: inspection.architecture,
|
|
1325
|
+
checks: inspection.checks.map((check) => ({
|
|
1326
|
+
name: check.name,
|
|
1327
|
+
ok: check.status === "passed",
|
|
1328
|
+
code: check.status === "failed" ? check.code : null,
|
|
1329
|
+
detail: check.detail
|
|
1330
|
+
}))
|
|
1331
|
+
});
|
|
1332
|
+
ghidraJavaEnvironment = (javaHome, environment, platform = process.platform) => {
|
|
1333
|
+
const selectedEnvironment = snapshotEnvironment(environment, platform);
|
|
1334
|
+
const boundedEnvironment = {
|
|
1335
|
+
...selectedEnvironment,
|
|
1336
|
+
_JAVA_OPTIONS: "",
|
|
1337
|
+
JAVA_TOOL_OPTIONS: "",
|
|
1338
|
+
JDK_JAVA_OPTIONS: "",
|
|
1339
|
+
GHIDRA_JAVA_OPTIONS: ""
|
|
1340
|
+
};
|
|
1341
|
+
return javaHome === undefined ? boundedEnvironment : {
|
|
1342
|
+
...boundedEnvironment,
|
|
1343
|
+
JAVA_HOME: javaHome,
|
|
1344
|
+
PATH: `${(platform === "win32" ? win32 : posix).join(javaHome, "bin")}${platform === "win32" ? win32.delimiter : posix.delimiter}${selectedEnvironment.PATH ?? ""}`
|
|
1345
|
+
};
|
|
1346
|
+
};
|
|
1347
|
+
installationCheck = (options) => options.passed ? {
|
|
1348
|
+
status: "passed",
|
|
1349
|
+
name: options.name,
|
|
1350
|
+
detail: options.detail
|
|
1351
|
+
} : {
|
|
1352
|
+
status: "failed",
|
|
1353
|
+
name: options.name,
|
|
1354
|
+
code: options.code,
|
|
1355
|
+
detail: options.detail,
|
|
1356
|
+
remediation: options.remediation
|
|
1357
|
+
};
|
|
1358
|
+
nativeDecompilerCheck = ({ coordinates, platform, architecture }) => {
|
|
1359
|
+
const path = coordinates.nativeDecompilerPath;
|
|
1360
|
+
const compatibility = path === null ? undefined : !coordinates.nativeDecompilerHeader.ok ? {
|
|
1361
|
+
status: "unknown",
|
|
1362
|
+
detail: `${path} header is unknown: ${coordinates.nativeDecompilerHeader.error.message}`
|
|
1363
|
+
} : assessNativeDecompiler(path, platform, architecture, coordinates.nativeDecompilerHeader.value);
|
|
1364
|
+
const osArch = coordinates.java?.osArch ?? coordinates.javaProbeFailure?.properties?.osArch ?? undefined;
|
|
1365
|
+
const osName = coordinates.java?.osName ?? coordinates.javaProbeFailure?.properties?.osName ?? undefined;
|
|
1366
|
+
const selectedDirectory = jvmOsArchNativeDirectory(platform, osArch);
|
|
1367
|
+
const validatedDirectory = NATIVE_PLATFORMS[platform]?.[architecture];
|
|
1368
|
+
if (coordinates.java !== undefined) {
|
|
1369
|
+
if (selectedDirectory === undefined) return installationCheck({
|
|
1370
|
+
name: "native_decompiler",
|
|
1371
|
+
passed: false,
|
|
1372
|
+
code: "executable_missing",
|
|
1373
|
+
detail: osArch === undefined ? "The Java probe did not report os.arch; the JVM-selected native decompiler directory is unknown and cannot be matched to the validated host directory" : `JVM reports unrecognized os.arch=${osArch}; its selected native decompiler directory is unknown and cannot be matched to the validated host directory`,
|
|
1374
|
+
remediation: `Point JAVA_HOME at a JDK whose reported architecture maps to the validated Ghidra decompiler (${validatedDirectory ?? "unsupported host"}). REA does not build or install native tools.`
|
|
1375
|
+
});
|
|
1376
|
+
if (validatedDirectory !== undefined && selectedDirectory !== validatedDirectory && path !== null) return installationCheck({
|
|
1377
|
+
name: "native_decompiler",
|
|
1378
|
+
passed: false,
|
|
1379
|
+
code: "executable_missing",
|
|
1380
|
+
detail: `JVM reports os.arch=${osArch}, so Ghidra selects its native decompiler from os/${selectedDirectory}, but the validated decompiler targets ${validatedDirectory} (host ${platform}/${architecture})`,
|
|
1381
|
+
remediation: `Point JAVA_HOME at a JDK whose architecture matches the built decompiler (${validatedDirectory}). REA does not build or install native tools.`
|
|
1382
|
+
});
|
|
1383
|
+
if (osName === undefined) return installationCheck({
|
|
1384
|
+
name: "native_decompiler",
|
|
1385
|
+
passed: false,
|
|
1386
|
+
code: "executable_missing",
|
|
1387
|
+
detail: "The Java probe did not report os.name; the JVM-selected native decompiler OS directory is unknown and cannot be matched to the validated host platform",
|
|
1388
|
+
remediation: `Point JAVA_HOME at a JDK whose reported operating system matches the host platform (${platform}). REA does not build or install native tools.`
|
|
1389
|
+
});
|
|
1390
|
+
if (!jvmOsNameMatchesPlatform(platform, osName) && path !== null) return installationCheck({
|
|
1391
|
+
name: "native_decompiler",
|
|
1392
|
+
passed: false,
|
|
1393
|
+
code: "executable_missing",
|
|
1394
|
+
detail: `JVM reports os.name=${osName}, which does not match the validated host platform ${platform} (host ${platform}/${architecture})`,
|
|
1395
|
+
remediation: `Point JAVA_HOME at a JDK whose reported operating system matches the host platform (${platform}). REA does not build or install native tools.`
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
return installationCheck({
|
|
1399
|
+
name: "native_decompiler",
|
|
1400
|
+
passed: path !== null && compatibility?.status !== "incompatible",
|
|
1401
|
+
code: "executable_missing",
|
|
1402
|
+
detail: compatibility?.detail ?? `Matching native decompiler for ${platform}/${architecture} was not found`,
|
|
1403
|
+
remediation: compatibility?.status === "incompatible" ? compatibility.remediation : `Provide an executable Ghidra/Features/Decompiler/os/${NATIVE_PLATFORMS[platform]?.[architecture] ?? "<platform>"}/${platform === "win32" ? "decompile.exe" : "decompile"}, or its build/os equivalent. REA does not build or install native tools.`
|
|
1404
|
+
});
|
|
1405
|
+
};
|
|
1406
|
+
jvmOsNameMatchesPlatform = (platform, osName) => {
|
|
1407
|
+
const normalized = osName.toLowerCase();
|
|
1408
|
+
if (platform === "win32") return normalized.startsWith("windows");
|
|
1409
|
+
if (platform === "darwin") return normalized.startsWith("mac") || normalized.startsWith("darwin");
|
|
1410
|
+
if (platform === "linux") return normalized.startsWith("linux");
|
|
1411
|
+
return false;
|
|
1412
|
+
};
|
|
1413
|
+
jvmOsArchNativeDirectory = (platform, osArch) => {
|
|
1414
|
+
if (osArch === undefined) return undefined;
|
|
1415
|
+
const normalized = osArch.toLowerCase();
|
|
1416
|
+
const node = normalized === "x86_64" || normalized === "amd64" || normalized === "x64" ? "x64" : normalized === "aarch64" || normalized === "arm64" ? "arm64" : undefined;
|
|
1417
|
+
return node === undefined ? undefined : NATIVE_PLATFORMS[platform]?.[node];
|
|
1418
|
+
};
|
|
1419
|
+
versionCheck = (properties) => {
|
|
1420
|
+
const raw = properties?.providerVersion;
|
|
1421
|
+
const parseError = properties?.parseError;
|
|
1422
|
+
return installationCheck({
|
|
1423
|
+
name: "version",
|
|
1424
|
+
passed: parseError == null && ghidraReleaseAccepted(raw),
|
|
1425
|
+
code: parseError != null ? "version_unresolved" : ghidraReleaseCompatibility(raw).status === "unsupported" ? "unsupported_version" : "version_unresolved",
|
|
1426
|
+
detail: parseError == null ? ghidraVersionDetail(raw) : `application.properties could not be parsed: ${parseError}`,
|
|
1427
|
+
remediation: `Install a Ghidra ${ghidraReleaseLine()} release (verified with ${SUPPORTED_GHIDRA_VERSION}), or update REA for another Ghidra line.`
|
|
1428
|
+
});
|
|
1429
|
+
};
|
|
1430
|
+
javaCheck = (observation, command, configuredHome, properties, platform, failure) => {
|
|
1431
|
+
const requirement = ghidraJavaRequirement(properties);
|
|
1432
|
+
const range = ghidraJavaRangeLabel(requirement);
|
|
1433
|
+
const supported = observation !== undefined && ghidraJavaMajorAccepted(observation.major, requirement) && observation.bits === 64 && observation.runtime === "jdk";
|
|
1434
|
+
const bitness = observation === undefined ? undefined : observation.bits === null ? `bitness unknown${observation.unparsedBits === undefined ? "" : ` (sun.arch.data.model = ${JSON.stringify(observation.unparsedBits)})`}` : `${String(observation.bits)}-bit`;
|
|
1435
|
+
const knownMismatch = observation !== undefined && (!ghidraJavaMajorAccepted(observation.major, requirement) || observation.bits !== null && observation.bits !== 64 || observation.runtime !== "jdk");
|
|
1436
|
+
const detail = observation === undefined ? requirement.unresolved === null ? failure?.detail ?? `${command}: Java probe was not attempted` : `${failure?.detail ?? command}; ${requirement.unresolved}` : `${observation.version}; ${bitness}; ${observation.runtime === "jdk" ? "JDK" : "runtime only"}; ${observation.home}; accepted ${range}`;
|
|
1437
|
+
return installationCheck({
|
|
1438
|
+
name: "java",
|
|
1439
|
+
passed: supported,
|
|
1440
|
+
code: requirement.unresolved !== null ? "version_unresolved" : observation === undefined ? failure?.code ?? "version_unresolved" : knownMismatch ? "unsupported_version" : "version_unresolved",
|
|
1441
|
+
detail,
|
|
1442
|
+
remediation: javaRemediation(requirement, configuredHome, range, platform)
|
|
1443
|
+
});
|
|
1444
|
+
};
|
|
1445
|
+
javaRemediation = (requirement, configuredHome, range, platform) => {
|
|
1446
|
+
if (requirement.unresolved !== null) return `The Ghidra installation's Java bounds could not be read (${requirement.unresolved}). Install a 64-bit full JDK inside the declared application.java.min and application.java.max.`;
|
|
1447
|
+
return configuredHome === undefined ? `Select ${range} on PATH, or set JAVA_HOME to its installation root before starting REA.${platform === "darwin" ? " Homebrew OpenJDK can be keg-only: set JAVA_HOME to the selected formula's libexec/openjdk.jdk/Contents/Home (for example /opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home or /usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home). The installed JDK must satisfy the declared Ghidra Java bounds." : ""}` : `Update JAVA_HOME to the root of ${range} installation.`;
|
|
1448
|
+
};
|
|
1449
|
+
systemGhidraInstallationHost = () => ({
|
|
1450
|
+
readText: readGhidraInstallationProperties,
|
|
1451
|
+
executableHeader: readGhidraExecutableHeader,
|
|
1452
|
+
executable(path) {
|
|
1453
|
+
try {
|
|
1454
|
+
accessSync(path, constants.X_OK);
|
|
1455
|
+
return statSync(path).isFile();
|
|
1456
|
+
} catch (cause) {
|
|
1457
|
+
void cause;
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
probeJava: probeGhidraJava,
|
|
1462
|
+
discoverInstallDirOnPath: discoverGhidraInstallationOnPath
|
|
1463
|
+
});
|
|
1464
|
+
discoverGhidraInstallationOnPath = (environment, platform) => {
|
|
1465
|
+
if (platform !== process.platform) return undefined;
|
|
1466
|
+
const path = platform === "win32" ? win32 : posix;
|
|
1467
|
+
const pathValue = environment.PATH;
|
|
1468
|
+
if (pathValue === undefined || pathValue.length === 0) return undefined;
|
|
1469
|
+
const launchers = platform === "win32" ? [
|
|
1470
|
+
"ghidra.bat",
|
|
1471
|
+
"ghidraRun.bat",
|
|
1472
|
+
"ghidra.exe",
|
|
1473
|
+
"ghidraRun.exe"
|
|
1474
|
+
] : ["ghidra", "ghidraRun"];
|
|
1475
|
+
for (const directory of pathValue.split(delimiter)) {
|
|
1476
|
+
if (directory.length === 0) continue;
|
|
1477
|
+
for (const launcher of launchers) {
|
|
1478
|
+
let resolved;
|
|
1479
|
+
try {
|
|
1480
|
+
const candidate = path.resolve(directory, launcher);
|
|
1481
|
+
if (!executablePath(candidate)) continue;
|
|
1482
|
+
resolved = realpathSync(candidate);
|
|
1483
|
+
} catch (cause) {
|
|
1484
|
+
void cause;
|
|
1485
|
+
continue;
|
|
1486
|
+
}
|
|
1487
|
+
const root = dirname(resolved);
|
|
1488
|
+
const properties = path.join(root, "Ghidra", "application.properties");
|
|
1489
|
+
const headless = path.join(root, "support", platform === "win32" ? "analyzeHeadless.bat" : "analyzeHeadless");
|
|
1490
|
+
try {
|
|
1491
|
+
if (statSync(properties).isFile() && executablePath(headless)) return root;
|
|
1492
|
+
} catch (cause) {
|
|
1493
|
+
void cause;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
return undefined;
|
|
1498
|
+
};
|
|
1499
|
+
executablePath = (path) => {
|
|
1500
|
+
try {
|
|
1501
|
+
accessSync(path, constants.X_OK);
|
|
1502
|
+
return statSync(path).isFile();
|
|
1503
|
+
} catch (cause) {
|
|
1504
|
+
void cause;
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
})))();
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region dist/ida/IdaConfiguration.js
|
|
1513
|
+
var common, registrationSchema, idaProtocol, readIdaConfiguration, idaConfigurationError;
|
|
1514
|
+
function init_IdaConfiguration() {
|
|
1515
|
+
return (init_IdaConfiguration = __esmMin((() => {
|
|
1516
|
+
init_configurationErrors();
|
|
1517
|
+
init_result();
|
|
1518
|
+
common = {
|
|
1519
|
+
mode: z.enum(["attached", "headless"]).default("attached"),
|
|
1520
|
+
protocol: z.literal("native").optional(),
|
|
1521
|
+
timeoutMs: z.number().int().positive().max(2147483647).default(3e5),
|
|
1522
|
+
workspaceRoot: z.string().refine(isAbsolute, "workspaceRoot must be absolute on the REA host").optional()
|
|
1523
|
+
};
|
|
1524
|
+
registrationSchema = z.union([z.object({
|
|
1525
|
+
...common,
|
|
1526
|
+
type: z.literal("stdio").optional(),
|
|
1527
|
+
command: z.string().min(1),
|
|
1528
|
+
args: z.array(z.string()).default([]),
|
|
1529
|
+
env: z.record(z.string(), z.string()).default({})
|
|
1530
|
+
}).strict(), z.object({
|
|
1531
|
+
...common,
|
|
1532
|
+
type: z.literal("http").optional(),
|
|
1533
|
+
url: z.url().refine((value) => {
|
|
1534
|
+
const url = new URL(value);
|
|
1535
|
+
return ["http:", "https:"].includes(url.protocol) && [
|
|
1536
|
+
"localhost",
|
|
1537
|
+
"127.0.0.1",
|
|
1538
|
+
"[::1]"
|
|
1539
|
+
].includes(url.hostname) && url.username === "" && url.password === "";
|
|
1540
|
+
}, "IDA MCP must use a local HTTP endpoint without URL credentials"),
|
|
1541
|
+
headers: z.record(z.string(), z.string()).default({})
|
|
1542
|
+
}).strict()]).refine((config) => config.protocol !== "native" || config.mode === "attached", "The native IDA MCP protocol requires attached mode");
|
|
1543
|
+
idaProtocol = (config) => config.protocol ?? (config.mode === "attached" ? "legacy" : "modern");
|
|
1544
|
+
readIdaConfiguration = (path) => {
|
|
1545
|
+
try {
|
|
1546
|
+
if (statSync(path).size > 65536) return err(idaConfigurationError("REA_IDA_MCP_CONFIG exceeds the 64 KiB registration size."));
|
|
1547
|
+
const input = JSON.parse(readFileSync(path, "utf8"));
|
|
1548
|
+
const envelope = z.object({ mcpServers: z.object({ "ida-pro-mcp": z.unknown() }) }).safeParse(input);
|
|
1549
|
+
const parsed = registrationSchema.safeParse(envelope.success ? envelope.data.mcpServers["ida-pro-mcp"] : input);
|
|
1550
|
+
return parsed.success ? ok(parsed.data) : err(idaConfigurationError("REA_IDA_MCP_CONFIG must contain an IDA MCP command/args or local url registration; see docs/ida-provider.md.", parsed.error));
|
|
1551
|
+
} catch (cause) {
|
|
1552
|
+
return err(idaConfigurationError(`Cannot read IDA MCP registration ${path}; provide a readable JSON configuration.`, cause));
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
idaConfigurationError = (constraint, cause) => new ConfigurationError(constraint, {
|
|
1556
|
+
...cause === undefined ? {} : { cause },
|
|
1557
|
+
settings: [{
|
|
1558
|
+
setting: "REA_IDA_MCP_CONFIG",
|
|
1559
|
+
constraint
|
|
1560
|
+
}]
|
|
1561
|
+
});
|
|
1562
|
+
})))();
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
//#endregion
|
|
1566
|
+
//#region dist/kuna/KunaRelease.js
|
|
1567
|
+
var KUNA_VERIFIED_VERSION, KUNA_PROVIDER_ID, KUNA_COMMAND_REMEDIATION, KUNA_UNSUPPORTED_HOST_REMEDIATION, KUNA_VERSION_PROBE_REMEDIATION;
|
|
1568
|
+
function init_KunaRelease() {
|
|
1569
|
+
return (init_KunaRelease = __esmMin((() => {
|
|
1570
|
+
KUNA_VERIFIED_VERSION = "1.833";
|
|
1571
|
+
KUNA_PROVIDER_ID = "kuna";
|
|
1572
|
+
KUNA_COMMAND_REMEDIATION = `Set REA_KUNA_COMMAND to the absolute path of a caller-supplied kuna executable (verified with ${KUNA_VERIFIED_VERSION}). REA does not download, install or update Kuna.`;
|
|
1573
|
+
KUNA_UNSUPPORTED_HOST_REMEDIATION = "Use Linux or macOS for the Kuna provider. Windows process-tree ownership for Kuna is not verified.";
|
|
1574
|
+
KUNA_VERSION_PROBE_REMEDIATION = "Run the selected executable with --version: it must exit promptly and print `kuna <major>.<minor>`.";
|
|
1575
|
+
})))();
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
//#endregion
|
|
1579
|
+
//#region dist/kuna/KunaConfiguration.js
|
|
1580
|
+
var MAX_KUNA_JOBS, DEFAULT_PROJECT_TIMEOUT_MS, DEFAULT_FUNCTION_TIMEOUT_MS, DEFAULT_JOBS, DEFAULT_CACHE_MAX_BYTES, MIN_CACHE_MAX_BYTES, kunaFunctionDeadline, kunaProjectDeadline, failure$1, positiveInteger, defaultCacheRoot, readKunaConfiguration;
|
|
1581
|
+
function init_KunaConfiguration() {
|
|
1582
|
+
return (init_KunaConfiguration = __esmMin((() => {
|
|
1583
|
+
init_homeDirectory();
|
|
1584
|
+
init_providerStartupTimeout();
|
|
1585
|
+
init_result();
|
|
1586
|
+
init_KunaRelease();
|
|
1587
|
+
MAX_KUNA_JOBS = 32;
|
|
1588
|
+
DEFAULT_PROJECT_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
1589
|
+
DEFAULT_FUNCTION_TIMEOUT_MS = 12e4;
|
|
1590
|
+
DEFAULT_JOBS = 1;
|
|
1591
|
+
DEFAULT_CACHE_MAX_BYTES = 4 * 1024 ** 3;
|
|
1592
|
+
MIN_CACHE_MAX_BYTES = 1024 ** 2;
|
|
1593
|
+
kunaFunctionDeadline = (configuration) => ({
|
|
1594
|
+
setting: "REA_KUNA_TIMEOUT_MS",
|
|
1595
|
+
ms: configuration.functionTimeoutMs
|
|
1596
|
+
});
|
|
1597
|
+
kunaProjectDeadline = (configuration) => ({
|
|
1598
|
+
setting: "REA_KUNA_PROJECT_TIMEOUT_MS",
|
|
1599
|
+
ms: configuration.projectTimeoutMs
|
|
1600
|
+
});
|
|
1601
|
+
failure$1 = (code, reason, setting = null) => err({
|
|
1602
|
+
code,
|
|
1603
|
+
reason,
|
|
1604
|
+
setting
|
|
1605
|
+
});
|
|
1606
|
+
positiveInteger = (value) => /^[1-9]\d*$/u.test(value) && Number.isSafeInteger(Number(value)) ? Number(value) : undefined;
|
|
1607
|
+
defaultCacheRoot = (environment, platform) => {
|
|
1608
|
+
const home = homeDirectoryFromEnvironment(environment, platform);
|
|
1609
|
+
if (platform === "darwin") return join(home, "Library", "Caches", "rea", "kuna");
|
|
1610
|
+
const xdg = environment.XDG_CACHE_HOME;
|
|
1611
|
+
return join(xdg !== undefined && isAbsolute(xdg) ? xdg : join(home, ".cache"), "rea", "kuna");
|
|
1612
|
+
};
|
|
1613
|
+
readKunaConfiguration = (environment, platform = process.platform) => {
|
|
1614
|
+
const command = environment.REA_KUNA_COMMAND;
|
|
1615
|
+
if (command === undefined || command.length === 0) return failure$1("not_configured", KUNA_COMMAND_REMEDIATION);
|
|
1616
|
+
if (!isAbsolute(command)) return failure$1("open_options_invalid", `REA_KUNA_COMMAND must be an absolute path; received ${command}. ${KUNA_COMMAND_REMEDIATION}`, "REA_KUNA_COMMAND");
|
|
1617
|
+
if (platform !== "darwin" && platform !== "linux") return failure$1("unsupported_host", KUNA_UNSUPPORTED_HOST_REMEDIATION);
|
|
1618
|
+
const cacheRoot = environment.REA_KUNA_CACHE_DIR;
|
|
1619
|
+
if (cacheRoot !== undefined && !isAbsolute(cacheRoot)) return failure$1("open_options_invalid", `REA_KUNA_CACHE_DIR must be an absolute directory; received ${cacheRoot}.`, "REA_KUNA_CACHE_DIR");
|
|
1620
|
+
const rawMaxBytes = environment.REA_KUNA_CACHE_MAX_BYTES;
|
|
1621
|
+
const cacheMaxBytes = rawMaxBytes === undefined ? DEFAULT_CACHE_MAX_BYTES : positiveInteger(rawMaxBytes);
|
|
1622
|
+
if (cacheMaxBytes === undefined || cacheMaxBytes < MIN_CACHE_MAX_BYTES) return failure$1("open_options_invalid", `REA_KUNA_CACHE_MAX_BYTES must be a decimal byte count of at least ${String(MIN_CACHE_MAX_BYTES)}; received ${String(rawMaxBytes)}.`, "REA_KUNA_CACHE_MAX_BYTES");
|
|
1623
|
+
const rawTimeout = environment.REA_KUNA_PROJECT_TIMEOUT_MS;
|
|
1624
|
+
const timeout = rawTimeout === undefined ? undefined : providerStartupTimeoutSchema.safeParse(rawTimeout);
|
|
1625
|
+
if (timeout !== undefined && !timeout.success) return failure$1("open_options_invalid", `REA_KUNA_PROJECT_TIMEOUT_MS must be a decimal millisecond count from 1 to 2147483647; received ${String(rawTimeout)}.`, "REA_KUNA_PROJECT_TIMEOUT_MS");
|
|
1626
|
+
const rawFunctionTimeout = environment.REA_KUNA_TIMEOUT_MS;
|
|
1627
|
+
const functionTimeout = rawFunctionTimeout === undefined ? undefined : providerStartupTimeoutSchema.safeParse(rawFunctionTimeout);
|
|
1628
|
+
if (functionTimeout !== undefined && !functionTimeout.success) return failure$1("open_options_invalid", `REA_KUNA_TIMEOUT_MS must be a decimal millisecond count from 1 to 2147483647; received ${String(rawFunctionTimeout)}.`, "REA_KUNA_TIMEOUT_MS");
|
|
1629
|
+
const rawJobs = environment.REA_KUNA_JOBS;
|
|
1630
|
+
const jobs = rawJobs === undefined ? DEFAULT_JOBS : positiveInteger(rawJobs);
|
|
1631
|
+
if (jobs === undefined || jobs > MAX_KUNA_JOBS) return failure$1("open_options_invalid", `REA_KUNA_JOBS must be an integer from 1 to ${String(MAX_KUNA_JOBS)}; received ${String(rawJobs)}.`, "REA_KUNA_JOBS");
|
|
1632
|
+
return ok({
|
|
1633
|
+
command,
|
|
1634
|
+
cacheRoot: cacheRoot ?? defaultCacheRoot(environment, platform),
|
|
1635
|
+
cacheMaxBytes,
|
|
1636
|
+
projectTimeoutMs: timeout?.data ?? DEFAULT_PROJECT_TIMEOUT_MS,
|
|
1637
|
+
functionTimeoutMs: functionTimeout?.data ?? DEFAULT_FUNCTION_TIMEOUT_MS,
|
|
1638
|
+
jobs
|
|
1639
|
+
});
|
|
1640
|
+
};
|
|
1641
|
+
})))();
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
//#endregion
|
|
1645
|
+
//#region dist/kuna/KunaInstallation.js
|
|
1646
|
+
var VERSION_PROBE_TIMEOUT_MS, VERSION_PROBE_MAX_OUTPUT_BYTES, VERSION_LINE, createKunaFileCloseScope, kunaChildEnvironment, failure, message, inspectKunaInstallation, startsWithShebang;
|
|
1647
|
+
function init_KunaInstallation() {
|
|
1648
|
+
return (init_KunaInstallation = __esmMin((() => {
|
|
1649
|
+
init_RegularFile();
|
|
1650
|
+
init_result();
|
|
1651
|
+
init_AnalysisCleanupLease();
|
|
1652
|
+
init_StableFileHash();
|
|
1653
|
+
init_OwnedRegularFile();
|
|
1654
|
+
init_ExecFileOutput();
|
|
1655
|
+
init_KunaConfiguration();
|
|
1656
|
+
init_KunaRelease();
|
|
1657
|
+
VERSION_PROBE_TIMEOUT_MS = 1e4;
|
|
1658
|
+
VERSION_PROBE_MAX_OUTPUT_BYTES = 64 * 1024;
|
|
1659
|
+
VERSION_LINE = /^kuna (\d+\.\d+(?:\.\d+)?)\r?\n?$/u;
|
|
1660
|
+
createKunaFileCloseScope = (parent) => {
|
|
1661
|
+
const leases = new Map();
|
|
1662
|
+
return {
|
|
1663
|
+
owner: {
|
|
1664
|
+
retain: (owner, resource) => {
|
|
1665
|
+
const lease = AnalysisCleanupLease.forCloseOwner(owner, resource);
|
|
1666
|
+
leases.set(owner, lease);
|
|
1667
|
+
parent.retain({
|
|
1668
|
+
close: () => lease.release(),
|
|
1669
|
+
get cleanupResources() {
|
|
1670
|
+
return lease.cleanupResources ?? [resource];
|
|
1671
|
+
}
|
|
1672
|
+
}, resource);
|
|
1673
|
+
},
|
|
1674
|
+
run: (operation) => parent.run(operation)
|
|
1675
|
+
},
|
|
1676
|
+
bindFailure: (failure, error) => leases.get(failure.owner)?.bindCleanupError(error)
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
kunaChildEnvironment = (configuration) => {
|
|
1680
|
+
const home = join(configuration.cacheRoot, "home");
|
|
1681
|
+
return {
|
|
1682
|
+
HOME: home,
|
|
1683
|
+
XDG_CACHE_HOME: join(home, ".cache"),
|
|
1684
|
+
NO_COLOR: "1"
|
|
1685
|
+
};
|
|
1686
|
+
};
|
|
1687
|
+
failure = (code, reason, diagnostics) => err({
|
|
1688
|
+
code,
|
|
1689
|
+
reason,
|
|
1690
|
+
diagnostics
|
|
1691
|
+
});
|
|
1692
|
+
message = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
1693
|
+
inspectKunaInstallation = async (environment, options) => {
|
|
1694
|
+
const configuration = readKunaConfiguration(environment, options.platform);
|
|
1695
|
+
if (!configuration.ok) return failure(configuration.error.code, configuration.error.reason, {
|
|
1696
|
+
configured: configuration.error.code !== "not_configured",
|
|
1697
|
+
...configuration.error.setting === null ? {} : { setting: configuration.error.setting }
|
|
1698
|
+
});
|
|
1699
|
+
const { command } = configuration.value;
|
|
1700
|
+
let executable;
|
|
1701
|
+
try {
|
|
1702
|
+
executable = await realpath(command);
|
|
1703
|
+
await access(executable, constants.X_OK);
|
|
1704
|
+
if (!(await stat(executable)).isFile()) return failure("executable_missing", `REA_KUNA_COMMAND is not a regular file: ${command}. ${KUNA_COMMAND_REMEDIATION}`, { command });
|
|
1705
|
+
} catch (cause) {
|
|
1706
|
+
assertRegularFileActive(options.signal);
|
|
1707
|
+
return failure("executable_missing", `Cannot execute REA_KUNA_COMMAND ${command}: ${message(cause)}. ${KUNA_COMMAND_REMEDIATION}`, { command });
|
|
1708
|
+
}
|
|
1709
|
+
const deadline = options.probeTimeoutMs ?? VERSION_PROBE_TIMEOUT_MS;
|
|
1710
|
+
let stdout;
|
|
1711
|
+
try {
|
|
1712
|
+
({stdout} = await execFileOutput(executable, ["--version"], {
|
|
1713
|
+
env: kunaChildEnvironment(configuration.value),
|
|
1714
|
+
timeout: deadline,
|
|
1715
|
+
maxBuffer: VERSION_PROBE_MAX_OUTPUT_BYTES,
|
|
1716
|
+
stopSignal: "SIGTERM",
|
|
1717
|
+
...options.signal === undefined ? {} : { signal: options.signal }
|
|
1718
|
+
}));
|
|
1719
|
+
} catch (cause) {
|
|
1720
|
+
assertRegularFileActive(options.signal);
|
|
1721
|
+
const output = execFileOutputFailure(cause);
|
|
1722
|
+
return failure("version_unresolved", `${executable} --version failed: ${output?.stderr.trim() || message(cause)}. ${KUNA_VERSION_PROBE_REMEDIATION}`, {
|
|
1723
|
+
command,
|
|
1724
|
+
executable,
|
|
1725
|
+
exit_code: typeof output?.code === "number" ? output.code : null,
|
|
1726
|
+
signal: output?.signal ?? null,
|
|
1727
|
+
killed: output?.killed ?? false,
|
|
1728
|
+
output_truncated: output?.outputTruncated ?? false,
|
|
1729
|
+
deadline_ms: deadline
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
const version = VERSION_LINE.exec(stdout)?.[1];
|
|
1733
|
+
if (version === undefined) return failure("version_unresolved", `${executable} --version printed no recognizable Kuna version. ${KUNA_VERSION_PROBE_REMEDIATION}`, {
|
|
1734
|
+
command,
|
|
1735
|
+
executable,
|
|
1736
|
+
stdout: stdout.slice(0, 256)
|
|
1737
|
+
});
|
|
1738
|
+
let fingerprint;
|
|
1739
|
+
let script;
|
|
1740
|
+
try {
|
|
1741
|
+
({fingerprint, script} = await options.fileCloseResources.run(async () => {
|
|
1742
|
+
const fingerprint = await hashStableFile(executable, {
|
|
1743
|
+
...options.signal === undefined ? {} : { signal: options.signal },
|
|
1744
|
+
retainFailedClose: (owner) => options.fileCloseResources.retain(owner, executable)
|
|
1745
|
+
});
|
|
1746
|
+
const script = await startsWithShebang(executable, options.fileCloseResources);
|
|
1747
|
+
assertRegularFileActive(options.signal);
|
|
1748
|
+
return {
|
|
1749
|
+
fingerprint,
|
|
1750
|
+
script
|
|
1751
|
+
};
|
|
1752
|
+
}));
|
|
1753
|
+
} catch (cause) {
|
|
1754
|
+
if (cause instanceof RegularFileCleanupFailure || regularFileCancellation(cause) !== undefined) throw cause;
|
|
1755
|
+
return failure("executable_missing", `Cannot fingerprint ${executable}: ${message(stableFileHashCause(cause))}`, {
|
|
1756
|
+
command,
|
|
1757
|
+
executable
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
return ok({
|
|
1761
|
+
configuration: configuration.value,
|
|
1762
|
+
executable,
|
|
1763
|
+
version,
|
|
1764
|
+
verified: version === KUNA_VERIFIED_VERSION,
|
|
1765
|
+
...fingerprint,
|
|
1766
|
+
script
|
|
1767
|
+
});
|
|
1768
|
+
};
|
|
1769
|
+
startsWithShebang = (path, fileCloseResources) => withOwnedRegularFile(path, {
|
|
1770
|
+
symlinks: "follow",
|
|
1771
|
+
retainFailedClose: (owner) => fileCloseResources.retain(owner, path)
|
|
1772
|
+
}, async (handle) => {
|
|
1773
|
+
const prefix = Buffer.alloc(2);
|
|
1774
|
+
const { bytesRead } = await handle.read(prefix, 0, 2, 0);
|
|
1775
|
+
return bytesRead === 2 && prefix.toString("latin1") === "#!";
|
|
1776
|
+
});
|
|
1777
|
+
})))();
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
//#endregion
|
|
1781
|
+
export { KUNA_COMMAND_REMEDIATION, KUNA_PROVIDER_ID, KUNA_UNSUPPORTED_HOST_REMEDIATION, KUNA_VERIFIED_VERSION, KUNA_VERSION_PROBE_REMEDIATION, createKunaFileCloseScope, ghidraFileFailure, ghidraInstallationDiagnostics, ghidraJavaEnvironment, idaConfigurationError, idaProtocol, init_GhidraFileArtifacts, init_GhidraInstallation, init_GhidraJavaProperties, init_GhidraReleasePolicy, init_IdaConfiguration, init_KunaConfiguration, init_KunaInstallation, init_KunaRelease, init_LinuxPrivateDisplayDiagnostic, init_LinuxPrivateDisplayProbe, inspectGhidraInstallation, inspectKunaInstallation, kunaChildEnvironment, kunaFunctionDeadline, kunaProjectDeadline, parseGhidraJavaProperties, parseLinuxPrivateDisplayDiagnostic, readGhidraProfileArtifact, readIdaConfiguration, readKunaConfiguration, selectLinuxPrivateDisplayStrategy, unverifiedGhidraBuildLimitation, writeGhidraProfileArtifact };
|