rea-agents 6.3.0 → 6.4.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/README.md +7 -4
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +51 -19
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +22 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +70 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +66 -31
- package/dist/application/DirectAnalysis.js +2 -2
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +1 -1
- package/dist/application/Doctor.js +5 -3
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/JsonFiles.js +6 -5
- package/dist/{cliJsonFile.js → application/JsonInputFile.js} +108 -35
- package/dist/application/LinuxHopper.js +4 -12
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +9 -3
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +93 -7
- package/dist/application/Setup.js +54 -6
- package/dist/application/SetupClientConfiguration.js +116 -16
- package/dist/application/SetupHost.js +102 -24
- package/dist/application/SetupPlan.js +5 -8
- package/dist/application/SetupSkill.js +58 -39
- package/dist/application/SupportedClients.js +290 -65
- package/dist/application/Uninstall.js +158 -10
- package/dist/application/UpdateMaintenance.js +17 -21
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/BinarySession.js +2 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +19 -6
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationService.js +22 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -30
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +67 -19
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +19 -16
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +258 -235
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +115 -26
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +6 -4
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +199 -61
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +20 -15
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +176 -102
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +29 -22
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +32 -13
- package/dist/artifacts/extraction/ArtifactExtraction.js +110 -86
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +110 -43
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +75 -32
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +62 -25
- package/dist/artifacts/inventory/scanReader.js +38 -11
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +15 -9
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +5 -0
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +32 -10
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +60 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +69 -7
- package/dist/browser/PlaywrightScenarioSession.js +127 -54
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +3 -3
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreBinaryCommands.js +0 -5
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +6 -1
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +17 -1
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +11 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/utilityCommands.js +66 -18
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +6 -0
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +2 -2
- package/dist/cliObservationOptions.js +3 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/directAnalysis.js +12 -4
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +10 -10
- package/dist/contracts/javascript/electronToolContracts.js +15 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionToolContracts.js +2 -2
- package/dist/contracts/sessionToolSchemas.js +6 -2
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +5 -3
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -6
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +2 -1
- package/dist/domain/analysisView/analysisView.js +52 -2
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +2 -2
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +35 -7
- package/dist/domain/artifactGraph.js +5 -3
- package/dist/domain/artifactIdentity.js +30 -2
- package/dist/domain/artifactInspection.js +3 -43
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +11 -12
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/evidence.js +2 -1
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +12 -13
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +11 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +70 -40
- package/dist/domain/javascript/electronStaticAnalysisValues.js +16 -0
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +4 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +6 -6
- package/dist/domain/javascript/javascriptApplicationGraph.js +79 -18
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +9 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +58 -31
- package/dist/domain/javascript/javascriptAstValues.js +32 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -1
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +8 -11
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +190 -33
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +42 -41
- package/dist/domain/javascript/javascriptSemanticGraph.js +69 -23
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -10
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +40 -7
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +341 -87
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +7 -1
- package/dist/domain/javascript/javascriptSemanticProjection.js +52 -14
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticQuery.js +27 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +13 -23
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +19 -1
- package/dist/domain/javascript/javascriptSemanticValues.js +47 -19
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +8 -6
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/managed/managedApplicationGraph.js +37 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -22
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureExample.js +24 -0
- package/dist/domain/process/processCaptureValidation.js +79 -0
- package/dist/domain/process/processScenario.js +59 -7
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/referenceSourceGraph.js +25 -16
- package/dist/domain/referenceSourceImportParsing.js +6 -3
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/webBundleAnalyzerInspection.js +14 -2
- package/dist/domain/webCaptureDiff.js +102 -4
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +4 -2
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +55 -24
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +33 -1
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +76 -4
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +1 -1
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +80 -39
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +8 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +3 -1
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/NativeMacOSProvider.js +91 -16
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +96 -39
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +28 -4
- package/dist/process/capture/ProcessCaptureLifecycle.js +350 -59
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessHarness.js +194 -26
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +97 -25
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +49 -18
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +33 -5
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +22 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { analysisErrorWithCleanupFailure } from "../
|
|
1
|
+
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { createAnalysisExecution, } from "../application/AnalysisProvider.js";
|
|
4
|
+
import { ghidraSeedCommitmentSchema, ghidraSeedFailure, ghidraSeedLimitations, } from "./GhidraAnalysisSeeds.js";
|
|
5
|
+
import { ghidraProfileLanguageOverride, sameGhidraLanguageOverride, } from "./GhidraAnalysisProfile.js";
|
|
4
6
|
import { AnalysisCancelledError, AnalysisArtifactChangedError, AnalysisAccessDeniedError, AnalysisCapabilityUnavailableError, AnalysisInputError, AnalysisResourceConstraintError, AnalysisTimeoutError, } from "../domain/analysisErrorCore.js";
|
|
5
7
|
import {} from "../domain/analysisErrorBase.js";
|
|
8
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
6
9
|
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
7
10
|
import { err, ok } from "../domain/result.js";
|
|
8
11
|
import { GhidraClient } from "./GhidraClient.js";
|
|
@@ -12,10 +15,159 @@ import { ghidraInstallationDiagnostics, } from "./GhidraInstallation.js";
|
|
|
12
15
|
import { unverifiedGhidraBuildLimitation } from "./GhidraInstallationPolicy.js";
|
|
13
16
|
import { GhidraHeadlessLauncher } from "./GhidraLauncher.js";
|
|
14
17
|
import { attestGhidraNativeLoadImage } from "./GhidraLoadImageAttest.js";
|
|
18
|
+
import { NATIVE_AOT_MAX_REPORT_BYTES, NATIVE_AOT_MAX_SOURCE_BYTES, nativeAotSnapshotOverCapacity, parseNativeAotPe, } from "../domain/native/nativeAotPe.js";
|
|
19
|
+
import { ABORTED, waitForAbortable, } from "../application/binary/AbortablePromise.js";
|
|
20
|
+
import { nativeLoadImageObservationSchema } from "../domain/native/nativeLoadImage.js";
|
|
15
21
|
import { GHIDRA_PROVIDER_IDENTITY, healthLimitations, windowsP0Limitations, limitationsFor, } from "./GhidraProviderCapabilities.js";
|
|
16
22
|
import { ghidraExtensionFailure } from "./extensions/GhidraExtensionFailures.js";
|
|
17
23
|
import { ghidraExtensionSchema, validateGhidraExtensionProfile, ghidraExtensionLimitations, } from "./extensions/GhidraExtensions.js";
|
|
18
24
|
import { windowsNativeAuthorityUnavailableReason, hasWindowsNativeAuthority, } from "../process/WindowsAuthority.js";
|
|
25
|
+
/** Own one session's captured PE snapshot and immutable NativeAOT derivation. */
|
|
26
|
+
const createNativeAotSnapshotOwner = (input) => {
|
|
27
|
+
const { client, target, startupTimeoutMs } = input;
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
let identity;
|
|
30
|
+
let result;
|
|
31
|
+
let pending;
|
|
32
|
+
let closed = false;
|
|
33
|
+
let identityConflict = false;
|
|
34
|
+
let identityConflictObservation;
|
|
35
|
+
const identityError = (operation, reason, observedBase, observations) => new ProviderAdapterError("ghidra", operation, {
|
|
36
|
+
diagnostics: {
|
|
37
|
+
reason,
|
|
38
|
+
artifact_sha256: target.sha256,
|
|
39
|
+
bound_image_base: identity === undefined
|
|
40
|
+
? null
|
|
41
|
+
: `0x${identity.slice(target.sha256.length + 1)}`,
|
|
42
|
+
observed_image_base: observedBase,
|
|
43
|
+
measured_observation: observations,
|
|
44
|
+
conflicting_image_base: identityConflictObservation?.imageBase ?? null,
|
|
45
|
+
conflicting_observation: identityConflictObservation?.observations ?? null,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const identityConflictFailure = (operation, observedBase, observations) => {
|
|
49
|
+
return err(identityError(operation, "The Ghidra session reported conflicting loaded image bases; reopen the analysis session to establish a new identity.", observedBase, observations));
|
|
50
|
+
};
|
|
51
|
+
const derive = async (imageBase, operation, callerSignal, observations) => {
|
|
52
|
+
if (callerSignal?.aborted || closed)
|
|
53
|
+
return err(new AnalysisCancelledError(operation));
|
|
54
|
+
if (identityConflict)
|
|
55
|
+
return identityConflictFailure(operation, imageBase, observations);
|
|
56
|
+
if (controller.signal.aborted)
|
|
57
|
+
return err(new AnalysisCancelledError(operation));
|
|
58
|
+
let normalizedBase;
|
|
59
|
+
try {
|
|
60
|
+
normalizedBase = BigInt(imageBase).toString(16);
|
|
61
|
+
}
|
|
62
|
+
catch (cause) {
|
|
63
|
+
return err(new ProviderAdapterError("ghidra", operation, {
|
|
64
|
+
diagnostics: {
|
|
65
|
+
reason: "Ghidra returned an invalid loaded image base for NativeAOT identity binding.",
|
|
66
|
+
artifact_sha256: target.sha256,
|
|
67
|
+
observed_image_base: imageBase,
|
|
68
|
+
measured_observation: observations,
|
|
69
|
+
},
|
|
70
|
+
cause,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
const key = `${target.sha256}:${normalizedBase}`;
|
|
74
|
+
if (identity !== undefined && identity !== key) {
|
|
75
|
+
identityConflict = true;
|
|
76
|
+
identityConflictObservation = { imageBase, observations };
|
|
77
|
+
result = undefined;
|
|
78
|
+
controller.abort();
|
|
79
|
+
return err(identityError(operation, "The Ghidra session reported a different loaded image base after NativeAOT metadata was bound to its captured snapshot; reopen the analysis session to establish a new identity.", imageBase, observations));
|
|
80
|
+
}
|
|
81
|
+
identity ??= key;
|
|
82
|
+
if (result !== undefined) {
|
|
83
|
+
const settled = await waitForAbortable(Promise.resolve(ok(result)), callerSignal);
|
|
84
|
+
if (closed)
|
|
85
|
+
return err(new AnalysisCancelledError(operation));
|
|
86
|
+
if (identityConflict)
|
|
87
|
+
return identityConflictFailure(operation, imageBase, observations);
|
|
88
|
+
if (controller.signal.aborted)
|
|
89
|
+
return err(new AnalysisCancelledError(operation));
|
|
90
|
+
return settled === ABORTED
|
|
91
|
+
? err(new AnalysisCancelledError(operation))
|
|
92
|
+
: settled;
|
|
93
|
+
}
|
|
94
|
+
if (pending !== undefined && pending.identity !== key)
|
|
95
|
+
return err(identityError(operation, "A NativeAOT snapshot derivation is already bound to a different loaded image base.", imageBase, observations));
|
|
96
|
+
if (pending === undefined) {
|
|
97
|
+
const promise = (async () => {
|
|
98
|
+
try {
|
|
99
|
+
if (client.readTargetSnapshot === undefined)
|
|
100
|
+
return err(new ProviderAdapterError("ghidra", operation, {
|
|
101
|
+
diagnostics: {
|
|
102
|
+
reason: "The Ghidra client does not expose its immutable target snapshot for NativeAOT metadata inspection.",
|
|
103
|
+
},
|
|
104
|
+
}));
|
|
105
|
+
const snapshot = await client.readTargetSnapshot(NATIVE_AOT_MAX_SOURCE_BYTES, controller.signal);
|
|
106
|
+
if (!snapshot.ok)
|
|
107
|
+
return err(projectSessionError(operation, snapshot.error, startupTimeoutMs));
|
|
108
|
+
if (closed)
|
|
109
|
+
return err(new AnalysisCancelledError(operation));
|
|
110
|
+
if (identityConflict)
|
|
111
|
+
return identityConflictFailure(operation, imageBase, observations);
|
|
112
|
+
if (controller.signal.aborted)
|
|
113
|
+
return err(new AnalysisCancelledError(operation));
|
|
114
|
+
const parsed = snapshot.value.kind === "over-capacity"
|
|
115
|
+
? {
|
|
116
|
+
summary: nativeAotSnapshotOverCapacity(target.sha256, snapshot.value.sourceBytesAtLeast, NATIVE_AOT_MAX_REPORT_BYTES),
|
|
117
|
+
readTypeDetail: () => undefined,
|
|
118
|
+
}
|
|
119
|
+
: parseNativeAotPe(snapshot.value.bytes, target.sha256, NATIVE_AOT_MAX_REPORT_BYTES, imageBase);
|
|
120
|
+
if (closed)
|
|
121
|
+
return err(new AnalysisCancelledError(operation));
|
|
122
|
+
if (identityConflict)
|
|
123
|
+
return identityConflictFailure(operation, imageBase, observations);
|
|
124
|
+
if (controller.signal.aborted)
|
|
125
|
+
return err(new AnalysisCancelledError(operation));
|
|
126
|
+
return ok(parsed);
|
|
127
|
+
}
|
|
128
|
+
catch (cause) {
|
|
129
|
+
return err(new ProviderAdapterError("ghidra", operation, {
|
|
130
|
+
diagnostics: {
|
|
131
|
+
reason: cause instanceof Error
|
|
132
|
+
? cause.message
|
|
133
|
+
: "NativeAOT metadata could not be derived from the captured target snapshot.",
|
|
134
|
+
},
|
|
135
|
+
cause,
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
})();
|
|
139
|
+
const current = { identity: key, promise };
|
|
140
|
+
pending = current;
|
|
141
|
+
void promise.then((settled) => {
|
|
142
|
+
if (pending !== current)
|
|
143
|
+
return;
|
|
144
|
+
pending = undefined;
|
|
145
|
+
if (settled.ok && !closed && !identityConflict)
|
|
146
|
+
result = settled.value;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const settled = await waitForAbortable(pending.promise, callerSignal);
|
|
150
|
+
if (closed)
|
|
151
|
+
return err(new AnalysisCancelledError(operation));
|
|
152
|
+
if (identityConflict)
|
|
153
|
+
return identityConflictFailure(operation, imageBase, observations);
|
|
154
|
+
if (controller.signal.aborted)
|
|
155
|
+
return err(new AnalysisCancelledError(operation));
|
|
156
|
+
return settled === ABORTED
|
|
157
|
+
? err(new AnalysisCancelledError(operation))
|
|
158
|
+
: settled;
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
derive,
|
|
162
|
+
readTypeDetail: (address) => result?.readTypeDetail(address, NATIVE_AOT_MAX_REPORT_BYTES),
|
|
163
|
+
close: () => {
|
|
164
|
+
closed = true;
|
|
165
|
+
controller.abort();
|
|
166
|
+
result = undefined;
|
|
167
|
+
pending = undefined;
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
};
|
|
19
171
|
/** Build one AnalysisClient for an admitted Ghidra target and profile. */
|
|
20
172
|
export const createGhidraProviderClient = (input) => {
|
|
21
173
|
const { config, logger, clientFactory, target, context, installation } = input;
|
|
@@ -35,18 +187,43 @@ export const createGhidraProviderClient = (input) => {
|
|
|
35
187
|
},
|
|
36
188
|
}));
|
|
37
189
|
const extensions = extensionProfile.data;
|
|
190
|
+
const seedProfile = ghidraSeedCommitmentSchema
|
|
191
|
+
.optional()
|
|
192
|
+
.safeParse(committedProfile.parameters.analysis_seeds);
|
|
193
|
+
if (!seedProfile.success ||
|
|
194
|
+
(config.ghidraSeedFile === undefined) !== (seedProfile.data === undefined))
|
|
195
|
+
return unavailableClient(new ProviderAdapterError("ghidra", "open_binary", {
|
|
196
|
+
diagnostics: {
|
|
197
|
+
reason: "Resolve REA_GHIDRA_SEED_FILE into an analysis profile before opening the session.",
|
|
198
|
+
},
|
|
199
|
+
}));
|
|
200
|
+
const seeds = seedProfile.data;
|
|
201
|
+
const languageOverride = ghidraProfileLanguageOverride(committedProfile.parameters);
|
|
202
|
+
if (!sameGhidraLanguageOverride(languageOverride, config.ghidraLanguageOverride))
|
|
203
|
+
return unavailableClient(new ProviderAdapterError("ghidra", "open_binary", {
|
|
204
|
+
diagnostics: {
|
|
205
|
+
reason: "The committed analysis profile and REA_GHIDRA_LANGUAGE_ID/REA_GHIDRA_COMPILER_SPEC_ID differ; reopen the target to resolve a new profile.",
|
|
206
|
+
},
|
|
207
|
+
}));
|
|
38
208
|
const invalidProfile = validateGhidraExtensionProfile(extensions, config, target, installation.platform);
|
|
39
209
|
if (invalidProfile !== null)
|
|
40
210
|
return unavailableClient(new ProviderAdapterError("ghidra", "open_binary", {
|
|
41
211
|
diagnostics: { reason: invalidProfile },
|
|
42
212
|
}));
|
|
43
213
|
let extensionFailure;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
214
|
+
// Replaced by the reported outcome once the session handshake is checked.
|
|
215
|
+
const seedLimitations = [...ghidraSeedLimitations(seeds)];
|
|
216
|
+
const targetLimitations = [
|
|
217
|
+
...(target.format === "dos-mz"
|
|
218
|
+
? [
|
|
219
|
+
"DOS MZ uses 16-bit x86 real mode with the Ghidra load segment 0x1000. Returned addresses are linear byte coordinates; they do not identify a unique segment:offset alias.",
|
|
220
|
+
"Static DOS analysis does not emulate BIOS, DOS interrupts, device ports, or self-modifying unpacking code. Packed targets require a separately identified unpacked artifact for original-program analysis; appended overlays are not the initialized load module.",
|
|
221
|
+
]
|
|
222
|
+
: []),
|
|
223
|
+
...(target.kind === "executable" && target.architecture === "mips"
|
|
224
|
+
? (target.mips.limitations ?? [])
|
|
225
|
+
: []),
|
|
226
|
+
];
|
|
50
227
|
const providerLimitations = installation.platform === "win32"
|
|
51
228
|
? windowsP0Limitations
|
|
52
229
|
: installation.platform === "darwin"
|
|
@@ -64,6 +241,8 @@ export const createGhidraProviderClient = (input) => {
|
|
|
64
241
|
bridgeScriptPath: fileURLToPath(new URL("../../bridge/ghidra/ReaGhidraBridge.java", import.meta.url)),
|
|
65
242
|
...(target.format === "dos-mz" ? { dosMz: true } : {}),
|
|
66
243
|
...(target.format === "dos-com" ? { dosCom: true } : {}),
|
|
244
|
+
...(languageOverride === undefined ? {} : { languageOverride }),
|
|
245
|
+
...(seeds === undefined ? {} : { analysisSeeds: seeds }),
|
|
67
246
|
platform: installation.platform,
|
|
68
247
|
...(extensions.length === 0 ? {} : { analysisExtensions: extensions }),
|
|
69
248
|
}),
|
|
@@ -81,12 +260,22 @@ export const createGhidraProviderClient = (input) => {
|
|
|
81
260
|
expectedLanguageId: "x86:LE:16:Real Mode",
|
|
82
261
|
expectedCompilerSpecId: "default",
|
|
83
262
|
}
|
|
84
|
-
:
|
|
263
|
+
: languageOverride === undefined
|
|
264
|
+
? {}
|
|
265
|
+
: {
|
|
266
|
+
expectedLanguageId: languageOverride.languageId,
|
|
267
|
+
...(languageOverride.compilerSpecId === undefined
|
|
268
|
+
? {}
|
|
269
|
+
: { expectedCompilerSpecId: languageOverride.compilerSpecId }),
|
|
270
|
+
}),
|
|
85
271
|
...(context === undefined ? {} : { runId: context.runId }),
|
|
86
272
|
logger: logger.child({ layer: "ghidra-bridge" }),
|
|
87
273
|
});
|
|
88
274
|
const checkExtensions = async (operation, info) => {
|
|
89
|
-
extensionFailure =
|
|
275
|
+
extensionFailure =
|
|
276
|
+
ghidraExtensionFailure(extensions, info.analysis_extensions ?? [], operation) ?? ghidraSeedFailure(seeds, info.analysis_seeds, operation);
|
|
277
|
+
if (extensionFailure === undefined && info.analysis_seeds !== undefined)
|
|
278
|
+
seedLimitations.splice(0, seedLimitations.length, ...ghidraSeedLimitations(seeds, info.analysis_seeds));
|
|
90
279
|
if (extensionFailure === undefined)
|
|
91
280
|
return undefined;
|
|
92
281
|
const closed = await client.close();
|
|
@@ -95,12 +284,20 @@ export const createGhidraProviderClient = (input) => {
|
|
|
95
284
|
: analysisErrorWithCleanupFailure(extensionFailure, closed.error, operation);
|
|
96
285
|
};
|
|
97
286
|
const releaseLimitation = unverifiedGhidraBuildLimitation(prerequisites.value.providerVersion);
|
|
98
|
-
const sessionLimitations = [
|
|
287
|
+
const sessionLimitations = () => [
|
|
99
288
|
...providerLimitations,
|
|
100
289
|
...targetLimitations,
|
|
101
290
|
...ghidraExtensionLimitations(extensions),
|
|
291
|
+
...seedLimitations,
|
|
102
292
|
...(releaseLimitation === undefined ? [] : [releaseLimitation]),
|
|
103
293
|
];
|
|
294
|
+
const nativeAotOwner = target.format === "pe"
|
|
295
|
+
? createNativeAotSnapshotOwner({
|
|
296
|
+
client,
|
|
297
|
+
target,
|
|
298
|
+
startupTimeoutMs: config.ghidraStartupTimeoutMs,
|
|
299
|
+
})
|
|
300
|
+
: undefined;
|
|
104
301
|
return {
|
|
105
302
|
execute: async (operation, parameters, options) => {
|
|
106
303
|
if (extensionFailure !== undefined)
|
|
@@ -118,7 +315,7 @@ export const createGhidraProviderClient = (input) => {
|
|
|
118
315
|
return err(failed);
|
|
119
316
|
return ok(createAnalysisExecution(started.value, committedProfile.provider, {
|
|
120
317
|
analysisProfile: committedProfile,
|
|
121
|
-
limitations: [...healthLimitations, ...sessionLimitations],
|
|
318
|
+
limitations: [...healthLimitations, ...sessionLimitations()],
|
|
122
319
|
}));
|
|
123
320
|
}
|
|
124
321
|
const input = isGhidraFunctionOperation(operation)
|
|
@@ -126,7 +323,7 @@ export const createGhidraProviderClient = (input) => {
|
|
|
126
323
|
: parseGhidraInventoryInput(operation, parameters);
|
|
127
324
|
if (!input.ok)
|
|
128
325
|
return input;
|
|
129
|
-
if (extensions.length > 0) {
|
|
326
|
+
if (extensions.length > 0 || seeds !== undefined) {
|
|
130
327
|
const started = await client.start(options?.signal);
|
|
131
328
|
if (!started.ok)
|
|
132
329
|
return err(projectSessionError(operation, started.error, config.ghidraStartupTimeoutMs));
|
|
@@ -137,14 +334,71 @@ export const createGhidraProviderClient = (input) => {
|
|
|
137
334
|
const called = await client.callTool(operation, input.value, options?.signal === undefined ? {} : { signal: options.signal });
|
|
138
335
|
if (!called.ok)
|
|
139
336
|
return err(projectSessionError(operation, called.error, config.ghidraStartupTimeoutMs));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
337
|
+
let normalized;
|
|
338
|
+
let observationLimitations = [];
|
|
339
|
+
if (isGhidraFunctionOperation(operation)) {
|
|
340
|
+
const result = parseGhidraFunctionResult(operation, called.value);
|
|
341
|
+
if (!result.ok)
|
|
342
|
+
return result;
|
|
343
|
+
normalized = result.value.value;
|
|
344
|
+
observationLimitations = result.value.limitations;
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
const result = parseGhidraInventoryResult(operation, called.value);
|
|
348
|
+
if (!result.ok)
|
|
349
|
+
return result;
|
|
350
|
+
normalized = result.value;
|
|
351
|
+
}
|
|
352
|
+
if (operation === "inspect_native_data_type") {
|
|
353
|
+
const address = input.value.address;
|
|
354
|
+
if (typeof address === "string") {
|
|
355
|
+
if (target.format === "pe" && nativeAotOwner !== undefined) {
|
|
356
|
+
const started = await client.start(options?.signal);
|
|
357
|
+
if (!started.ok)
|
|
358
|
+
return err(projectSessionError(operation, started.error, config.ghidraStartupTimeoutMs));
|
|
359
|
+
const derived = await nativeAotOwner.derive(started.value.target.image_base, operation, options?.signal, normalized);
|
|
360
|
+
if (!derived.ok)
|
|
361
|
+
return derived;
|
|
362
|
+
}
|
|
363
|
+
let metadata;
|
|
364
|
+
metadata = nativeAotOwner?.readTypeDetail(address);
|
|
365
|
+
if (metadata !== undefined &&
|
|
366
|
+
normalized !== null &&
|
|
367
|
+
typeof normalized === "object" &&
|
|
368
|
+
!Array.isArray(normalized)) {
|
|
369
|
+
const nativeResult = normalized;
|
|
370
|
+
if (nativeResult.metadata_recovery === undefined)
|
|
371
|
+
normalized = jsonValueSchema.parse({
|
|
372
|
+
...nativeResult,
|
|
373
|
+
metadata_recovery: metadata,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
146
378
|
if (operation === "inspect_native_load_image") {
|
|
147
|
-
|
|
379
|
+
let derived;
|
|
380
|
+
if (target.format === "pe") {
|
|
381
|
+
const observations = nativeLoadImageObservationSchema.parse(normalized);
|
|
382
|
+
if (nativeAotOwner === undefined)
|
|
383
|
+
return err(new ProviderAdapterError("ghidra", operation, {
|
|
384
|
+
diagnostics: {
|
|
385
|
+
reason: "The admitted PE session has no read-only NativeAOT snapshot owner.",
|
|
386
|
+
},
|
|
387
|
+
}));
|
|
388
|
+
const result = await nativeAotOwner.derive(observations.image_base, operation, options?.signal, normalized);
|
|
389
|
+
if (!result.ok)
|
|
390
|
+
return result;
|
|
391
|
+
derived = result.value;
|
|
392
|
+
}
|
|
393
|
+
const attested = await attestGhidraNativeLoadImage({
|
|
394
|
+
target,
|
|
395
|
+
operation,
|
|
396
|
+
measured: normalized,
|
|
397
|
+
client,
|
|
398
|
+
mapSessionError: (failure) => projectSessionError(operation, failure, config.ghidraStartupTimeoutMs),
|
|
399
|
+
nativeAotResult: derived,
|
|
400
|
+
signal: options?.signal,
|
|
401
|
+
});
|
|
148
402
|
if (!attested.ok)
|
|
149
403
|
return attested;
|
|
150
404
|
normalized = attested.value;
|
|
@@ -152,7 +406,11 @@ export const createGhidraProviderClient = (input) => {
|
|
|
152
406
|
return ok(createAnalysisExecution(normalized, committedProfile.provider, {
|
|
153
407
|
rawResult: called.value,
|
|
154
408
|
analysisProfile: committedProfile,
|
|
155
|
-
limitations: [
|
|
409
|
+
limitations: [
|
|
410
|
+
...limitationsFor(operation),
|
|
411
|
+
...observationLimitations,
|
|
412
|
+
...sessionLimitations(),
|
|
413
|
+
],
|
|
156
414
|
}));
|
|
157
415
|
},
|
|
158
416
|
runtimeLineageSnapshots: () => {
|
|
@@ -161,7 +419,10 @@ export const createGhidraProviderClient = (input) => {
|
|
|
161
419
|
? []
|
|
162
420
|
: [{ provider: committedProfile.provider, observation }];
|
|
163
421
|
},
|
|
164
|
-
close: () =>
|
|
422
|
+
close: async () => {
|
|
423
|
+
nativeAotOwner?.close();
|
|
424
|
+
return client.close();
|
|
425
|
+
},
|
|
165
426
|
};
|
|
166
427
|
};
|
|
167
428
|
const ghidraClientPrerequisites = (target, profile, installation) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ghidraSeedReportSchema } from "./GhidraAnalysisSeeds.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { err, ok } from "../domain/result.js";
|
|
3
|
-
import { GHIDRA_INVENTORY_OPERATIONS } from "./GhidraInventoryValues.js";
|
|
4
|
+
import { GHIDRA_INVENTORY_OPERATIONS, GHIDRA_NAMING_OPERATIONS, } from "./GhidraInventoryValues.js";
|
|
4
5
|
import { GHIDRA_FUNCTION_OPERATIONS } from "./GhidraFunctionValues.js";
|
|
5
6
|
import { ghidraExtensionResultSchema } from "./extensions/GhidraExtensions.js";
|
|
6
7
|
/** Exact methods proved by the bridge handshake after auto-analysis. */
|
|
@@ -10,6 +11,11 @@ export const GHIDRA_SESSION_CAPABILITIES = [
|
|
|
10
11
|
...GHIDRA_INVENTORY_OPERATIONS,
|
|
11
12
|
...GHIDRA_FUNCTION_OPERATIONS,
|
|
12
13
|
];
|
|
14
|
+
/** Methods that edit the session database; read-only bridges omit them. */
|
|
15
|
+
export const GHIDRA_MUTATING_OPERATIONS = new Set([
|
|
16
|
+
"annotate_native_function",
|
|
17
|
+
...GHIDRA_NAMING_OPERATIONS,
|
|
18
|
+
]);
|
|
13
19
|
const capabilitySchema = z.enum(GHIDRA_SESSION_CAPABILITIES);
|
|
14
20
|
const sessionInfoSchema = z
|
|
15
21
|
.object({
|
|
@@ -26,6 +32,7 @@ const sessionInfoSchema = z
|
|
|
26
32
|
analysis_complete: z.boolean(),
|
|
27
33
|
analysis_timed_out: z.boolean(),
|
|
28
34
|
analysis_extensions: z.array(ghidraExtensionResultSchema).optional(),
|
|
35
|
+
analysis_seeds: ghidraSeedReportSchema.optional(),
|
|
29
36
|
capabilities: z.array(capabilitySchema),
|
|
30
37
|
target: z
|
|
31
38
|
.object({
|
|
@@ -43,7 +50,7 @@ const sessionInfoSchema = z
|
|
|
43
50
|
export const parseGhidraSessionInfo = (value, expected) => {
|
|
44
51
|
const parsed = sessionInfoSchema.safeParse(value);
|
|
45
52
|
const readOnly = expected.expectedReadOnly ?? false;
|
|
46
|
-
const expectedCapabilities = GHIDRA_SESSION_CAPABILITIES.filter((capability) => !readOnly || capability
|
|
53
|
+
const expectedCapabilities = GHIDRA_SESSION_CAPABILITIES.filter((capability) => !readOnly || !GHIDRA_MUTATING_OPERATIONS.has(capability));
|
|
47
54
|
if (!parsed.success ||
|
|
48
55
|
parsed.data.run_id !== expected.runId ||
|
|
49
56
|
parsed.data.read_only !== readOnly ||
|
|
@@ -77,6 +77,8 @@ export const hopperLoaderArgsForTarget = (target, machoContainer) => {
|
|
|
77
77
|
if (target.kind !== "executable")
|
|
78
78
|
return err(new ProviderAdapterError("hopper", "resolve_analysis_profile"));
|
|
79
79
|
const architecture = target.architecture;
|
|
80
|
+
if (architecture === "mips")
|
|
81
|
+
return err(new AnalysisCapabilityUnavailableError("hopper", "resolve_analysis_profile", "REA's Hopper adapter does not admit MIPS targets. Select a verified Ghidra MIPS profile instead."));
|
|
80
82
|
const flag = hopperArchitectureFlag(architecture);
|
|
81
83
|
switch (target.format) {
|
|
82
84
|
case "mach-o":
|
|
@@ -3,7 +3,7 @@ import { access } from "node:fs/promises";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import writeFileAtomic from "write-file-atomic";
|
|
6
|
-
import { analysisErrorWithCleanupFailure } from "../
|
|
6
|
+
import { analysisErrorWithCleanupFailure } from "../domain/analysisErrorCleanup.js";
|
|
7
7
|
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
|
8
8
|
import { HopperCancelledError, HopperProcessError, HopperProtocolError, HopperRemoteError, HopperStartError, HopperTimeoutError, } from "../domain/hopperErrors.js";
|
|
9
9
|
import {} from "../domain/analysisErrorBase.js";
|
|
@@ -13,6 +13,7 @@ import { err, ok } from "../domain/result.js";
|
|
|
13
13
|
import { silentLogger } from "../logger.js";
|
|
14
14
|
import { PrivateRuntimeRoot } from "../process/PrivateRuntimeRoot.js";
|
|
15
15
|
import { ProviderStartupDeadline } from "../process/ProviderDeadline.js";
|
|
16
|
+
import { redactCapturedTransportCredential } from "../process/ProviderDiagnosticRedaction.js";
|
|
16
17
|
import { ProviderRunLineage } from "../process/ProviderRunLineage.js";
|
|
17
18
|
import { ProviderProcessSupervisor, } from "../process/ProviderProcess.js";
|
|
18
19
|
import { hopperOperationStage } from "./HopperOperationStage.js";
|
|
@@ -23,6 +24,8 @@ import { hopperLauncherFailureDiagnostic } from "./HopperProcessDiagnostic.js";
|
|
|
23
24
|
import { HopperRequestQueue, } from "./HopperRequestQueue.js";
|
|
24
25
|
import { HopperResponseStream } from "./HopperResponseStream.js";
|
|
25
26
|
import { responseResult, } from "./protocol.js";
|
|
27
|
+
/** Aggregate in-memory retention budget for this provider's launcher output. */
|
|
28
|
+
export const HOPPER_PROCESS_DIAGNOSTIC_BYTES = 8 * 1024 * 1024;
|
|
26
29
|
const SHUTDOWN_TIMEOUT_MS = 30_000;
|
|
27
30
|
const SESSION_ROOT = process.platform === "darwin" ? "/tmp" : tmpdir();
|
|
28
31
|
/**
|
|
@@ -434,14 +437,19 @@ export class HopperClient {
|
|
|
434
437
|
const token = this.#token;
|
|
435
438
|
if (snapshot === undefined)
|
|
436
439
|
return undefined;
|
|
437
|
-
const redact = (text) => token === undefined
|
|
438
|
-
? text
|
|
439
|
-
: text.replaceAll(token, "[redacted transport credential]");
|
|
440
440
|
return {
|
|
441
441
|
exit_code: snapshot.exitCode ?? null,
|
|
442
442
|
signal: snapshot.signal ?? null,
|
|
443
|
-
stdout: {
|
|
444
|
-
|
|
443
|
+
stdout: {
|
|
444
|
+
text: redactCapturedTransportCredential(snapshot.stdout, token, "[redacted transport credential]"),
|
|
445
|
+
bytes: snapshot.stdout.observedBytes,
|
|
446
|
+
retained_bytes: snapshot.stdout.bytes,
|
|
447
|
+
},
|
|
448
|
+
stderr: {
|
|
449
|
+
text: redactCapturedTransportCredential(snapshot.stderr, token, "[redacted transport credential]"),
|
|
450
|
+
bytes: snapshot.stderr.observedBytes,
|
|
451
|
+
retained_bytes: snapshot.stderr.bytes,
|
|
452
|
+
},
|
|
445
453
|
output_closed: outputClosed,
|
|
446
454
|
diagnostic_truncated: snapshot.diagnosticTruncated === true,
|
|
447
455
|
};
|
|
@@ -524,6 +532,7 @@ export class HopperClient {
|
|
|
524
532
|
}
|
|
525
533
|
#attachLauncher(launch) {
|
|
526
534
|
this.#resources.processSupervisor = new ProviderProcessSupervisor(launch, {
|
|
535
|
+
maxDiagnosticBytes: HOPPER_PROCESS_DIAGNOSTIC_BYTES,
|
|
527
536
|
onDiagnostic: (event) => this.#onLauncherDiagnostic(launch, event),
|
|
528
537
|
});
|
|
529
538
|
}
|
|
@@ -21,6 +21,8 @@ export const resolveHopperMachOImage = async (target, signal) => {
|
|
|
21
21
|
const invalid = (reason, cause) => err(new BinaryTargetError(target.path, reason, cause === undefined ? undefined : { cause }));
|
|
22
22
|
if (signal?.aborted)
|
|
23
23
|
return err(new AnalysisCancelledError("open_binary"));
|
|
24
|
+
if (target.format !== "mach-o")
|
|
25
|
+
return invalid("Hopper FAT64 image preparation requires a Mach-O target");
|
|
24
26
|
let file;
|
|
25
27
|
try {
|
|
26
28
|
file = await open(target.path, "r");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { snapshotEnvironment } from "../process/snapshotEnvironment.js";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { accessSync, constants } from "node:fs";
|
|
3
|
+
import { accessSync, constants, statSync } from "node:fs";
|
|
4
4
|
import { createAnalysisExecution } from "../application/AnalysisProvider.js";
|
|
5
5
|
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
|
6
6
|
import { err, ok } from "../domain/result.js";
|
|
@@ -49,6 +49,9 @@ export class HopperProvider {
|
|
|
49
49
|
};
|
|
50
50
|
try {
|
|
51
51
|
accessSync(this.config.hopperLauncherPath, constants.X_OK);
|
|
52
|
+
// A searchable directory, such as an .app bundle, also passes X_OK.
|
|
53
|
+
if (!statSync(this.config.hopperLauncherPath).isFile())
|
|
54
|
+
throw new TypeError("Hopper launcher is not a regular file");
|
|
52
55
|
return {
|
|
53
56
|
status: "available",
|
|
54
57
|
code: null,
|
|
@@ -87,6 +90,13 @@ export class HopperProvider {
|
|
|
87
90
|
reason: null,
|
|
88
91
|
diagnostics,
|
|
89
92
|
};
|
|
93
|
+
if (target.architecture === "mips")
|
|
94
|
+
return {
|
|
95
|
+
status: "unsupported",
|
|
96
|
+
code: "architecture_unsupported",
|
|
97
|
+
reason: "REA's Hopper adapter does not admit MIPS targets.",
|
|
98
|
+
diagnostics,
|
|
99
|
+
};
|
|
90
100
|
if (target.format === "dos-mz" || target.format === "dos-com")
|
|
91
101
|
return {
|
|
92
102
|
status: "unsupported",
|
|
@@ -183,7 +193,8 @@ export class HopperProvider {
|
|
|
183
193
|
? {
|
|
184
194
|
ok: true,
|
|
185
195
|
value: createAnalysisExecution(mapped.value, executionProvider, {
|
|
186
|
-
|
|
196
|
+
// Only the file-offset mapping differs from Hopper's reply.
|
|
197
|
+
rawResult: mapped === result ? null : result.value,
|
|
187
198
|
...(profile === undefined ? {} : { analysisProfile: profile }),
|
|
188
199
|
limitations: [
|
|
189
200
|
...(preparedImage === undefined
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { analysisSearchInput } from "../contracts/analysisSearchContract.js";
|
|
3
|
-
import { AnalysisInputError, AnalysisProtocolError, } from "../domain/analysisErrorCore.js";
|
|
3
|
+
import { AnalysisInputError, AnalysisCancelledError, AnalysisProtocolError, } from "../domain/analysisErrorCore.js";
|
|
4
4
|
import { functionDossierSchema, functionInstructionWindowSchema, } from "../domain/hopperValues.js";
|
|
5
5
|
import { IDA_LIMITATIONS } from "./IdaProviderCapabilities.js";
|
|
6
6
|
import { disassemblySchema, idaAddressSchema, idaFunctionSchema, legacyCalleesSchema, legacyPageSchema, legacyStringSchema, legacyXrefsSchema, modernCalleesSchema, modernDecompileSchema, modernDisassemblySchema, modernLookupSchema, modernPageSchema, modernStringsSchema, modernXrefsSchema, nextOffset, } from "./IdaProtocolValues.js";
|
|
@@ -20,18 +20,24 @@ export class IdaOperationRunner {
|
|
|
20
20
|
connection;
|
|
21
21
|
protocol;
|
|
22
22
|
database;
|
|
23
|
+
signal;
|
|
23
24
|
raw = [];
|
|
24
25
|
locations = [];
|
|
25
26
|
limitations = [];
|
|
26
|
-
constructor(connection, protocol, database) {
|
|
27
|
+
constructor(connection, protocol, database, signal) {
|
|
27
28
|
this.connection = connection;
|
|
28
29
|
this.protocol = protocol;
|
|
29
30
|
this.database = database;
|
|
31
|
+
this.signal = signal;
|
|
30
32
|
}
|
|
31
33
|
async call(tool, args) {
|
|
34
|
+
if (this.signal?.aborted)
|
|
35
|
+
throw new AnalysisCancelledError(tool);
|
|
32
36
|
const scoped = this.database === undefined ? args : { ...args, database: this.database };
|
|
33
37
|
const result = await this.connection.call(tool, scoped);
|
|
34
38
|
this.raw.push({ tool, arguments: scoped, result });
|
|
39
|
+
if (this.signal?.aborted)
|
|
40
|
+
throw new AnalysisCancelledError(tool);
|
|
35
41
|
return result;
|
|
36
42
|
}
|
|
37
43
|
async functions() {
|
package/dist/ida/IdaProvider.js
CHANGED
|
@@ -70,6 +70,13 @@ export class IdaProvider {
|
|
|
70
70
|
target_kind: target.kind,
|
|
71
71
|
target_format: target.format,
|
|
72
72
|
};
|
|
73
|
+
if (target.kind === "executable" && target.architecture === "mips")
|
|
74
|
+
return {
|
|
75
|
+
status: "unsupported",
|
|
76
|
+
code: "architecture_unsupported",
|
|
77
|
+
reason: "REA's IDA adapter has no verified MIPS lane. Select a supported Ghidra profile instead.",
|
|
78
|
+
diagnostics,
|
|
79
|
+
};
|
|
73
80
|
return target.kind === "executable"
|
|
74
81
|
? { status: "supported", code: null, reason: null, diagnostics }
|
|
75
82
|
: {
|
|
@@ -122,8 +122,10 @@ export class IdaSessionClient {
|
|
|
122
122
|
return this.#health(before);
|
|
123
123
|
if (!isIdaOperation(operation))
|
|
124
124
|
throw new AnalysisProtocolError("IDA operation changed after validation.");
|
|
125
|
-
const runner = new IdaOperationRunner(this.connection, this.config.mode === "attached" ? "legacy" : "modern", this.#database);
|
|
125
|
+
const runner = new IdaOperationRunner(this.connection, this.config.mode === "attached" ? "legacy" : "modern", this.#database, options?.signal);
|
|
126
126
|
const result = await runner.run(operation, parameters);
|
|
127
|
+
if (wasCancelled(options))
|
|
128
|
+
return err(new AnalysisCancelledError(operation));
|
|
127
129
|
const after = await this.#observe();
|
|
128
130
|
if (wasCancelled(options))
|
|
129
131
|
return err(new AnalysisCancelledError(operation));
|
package/dist/ida/IdaWorkspace.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import { createReadStream, constants } from "node:fs";
|
|
3
|
-
import { copyFile } from "node:fs/promises";
|
|
3
|
+
import { copyFile, realpath } from "node:fs/promises";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { basename, join, normalize } from "node:path";
|
|
6
6
|
import { AnalysisProtocolError } from "../domain/analysisErrorCore.js";
|
|
@@ -33,8 +33,10 @@ export class IdaWorkspace {
|
|
|
33
33
|
}
|
|
34
34
|
/** Allocate a protected workspace so its owner can retain it before input preparation. */
|
|
35
35
|
static async allocate(target, root = tmpdir()) {
|
|
36
|
+
// Upstream reports canonical paths (macOS /var -> /private/var), so the
|
|
37
|
+
// private input path must already be canonical for identity checks.
|
|
36
38
|
const runtime = await PrivateRuntimeRoot.create({
|
|
37
|
-
parent: normalize(root),
|
|
39
|
+
parent: await realpath(normalize(root)),
|
|
38
40
|
prefix: "rea-ida-",
|
|
39
41
|
});
|
|
40
42
|
const inputPath = join(runtime.path, basename(target.path));
|