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,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ANALYSIS_VIEW_PROVIDER } from "../InvestigationProviders.js";
|
|
3
3
|
import { resolveEvidenceInput } from "../EvidenceInputResolver.js";
|
|
4
|
+
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
|
|
4
5
|
import { analysisInputErrorFromIssues } from "../../domain/inputIssueProjection.js";
|
|
5
6
|
import { EvidenceIntegrityError } from "../../domain/evidenceErrors.js";
|
|
6
7
|
import { createEvidence, parseEvidence, } from "../../domain/evidence.js";
|
|
@@ -25,6 +26,12 @@ export const inspectAnalysisViewValidated = (input, lookup) => {
|
|
|
25
26
|
operation: parent.operation,
|
|
26
27
|
normalizedResult: parent.normalized_result,
|
|
27
28
|
limitations: parent.limitations,
|
|
29
|
+
artifact: parent.subject === null
|
|
30
|
+
? null
|
|
31
|
+
: {
|
|
32
|
+
path: parent.subject.local_path,
|
|
33
|
+
sha256: parent.subject.digest.sha256,
|
|
34
|
+
},
|
|
28
35
|
}, input.view);
|
|
29
36
|
if (!projected.ok)
|
|
30
37
|
return projected;
|
|
@@ -33,6 +40,25 @@ export const inspectAnalysisViewValidated = (input, lookup) => {
|
|
|
33
40
|
return err(new EvidenceIntegrityError(`Parent subject SHA-256 ${parent.subject.digest.sha256} differs from analysis artifact SHA-256 ${projected.value.artifact.sha256}.`));
|
|
34
41
|
return ok(createAnalysisViewEvidence(input, parent, projected.value));
|
|
35
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Retain complete analysis Evidence in the session, then project its summary
|
|
45
|
+
* view from the retained record. Callers page or select the rest through
|
|
46
|
+
* inspect_analysis_view with the view's parent Evidence ID.
|
|
47
|
+
*/
|
|
48
|
+
export const summarizeRetainedAnalysis = (evidence, retention) => {
|
|
49
|
+
if (retention.recordEvidence === undefined ||
|
|
50
|
+
retention.evidenceById === undefined)
|
|
51
|
+
return err(new AnalysisCapabilityUnavailableError(ANALYSIS_VIEW_PROVIDER.id, evidence.operation, "summary detail requires a server session that retains Evidence for later views", {
|
|
52
|
+
userMessage: "This server does not retain Evidence. Select detail complete to receive the complete analysis inline.",
|
|
53
|
+
}));
|
|
54
|
+
const recorded = retention.recordEvidence(evidence);
|
|
55
|
+
if (!recorded.ok)
|
|
56
|
+
return recorded;
|
|
57
|
+
return inspectAnalysisViewValidated({
|
|
58
|
+
source: { kind: "retained-evidence", evidence_id: evidence.evidence_id },
|
|
59
|
+
view: { kind: "summary" },
|
|
60
|
+
}, retention.evidenceById);
|
|
61
|
+
};
|
|
36
62
|
const resolveAnalysisViewSource = (source, lookup) => {
|
|
37
63
|
if (source.kind === "retained-evidence")
|
|
38
64
|
return resolveEvidenceInput(source, lookup);
|
|
@@ -41,7 +67,10 @@ const resolveAnalysisViewSource = (source, lookup) => {
|
|
|
41
67
|
}
|
|
42
68
|
catch (cause) {
|
|
43
69
|
if (cause instanceof z.ZodError)
|
|
44
|
-
return err(analysisInputErrorFromIssues(INSPECT_ANALYSIS_VIEW_OPERATION, cause.issues
|
|
70
|
+
return err(analysisInputErrorFromIssues(INSPECT_ANALYSIS_VIEW_OPERATION, cause.issues.map((issue) => ({
|
|
71
|
+
...issue,
|
|
72
|
+
path: ["source", "evidence", ...issue.path],
|
|
73
|
+
})), { source }, { cause }));
|
|
45
74
|
if (cause instanceof TypeError)
|
|
46
75
|
return err(new EvidenceIntegrityError(cause.message, cause.message.length > 0 ? { userMessage: cause.message } : undefined));
|
|
47
76
|
throw cause;
|
|
@@ -70,7 +99,16 @@ const createAnalysisViewEvidence = (input, parent, result) => {
|
|
|
70
99
|
confidence: "derived",
|
|
71
100
|
authority: parent.authority,
|
|
72
101
|
limitations: result.limitations,
|
|
73
|
-
locations: [
|
|
102
|
+
locations: [
|
|
103
|
+
...(result.artifact.path.length > 0
|
|
104
|
+
? [{ kind: "artifact-path", path: result.artifact.path }]
|
|
105
|
+
: []),
|
|
106
|
+
...(result.kind === "native" &&
|
|
107
|
+
result.procedure_address !== null &&
|
|
108
|
+
result.procedure_address.length > 0
|
|
109
|
+
? [{ kind: "address", address: result.procedure_address }]
|
|
110
|
+
: []),
|
|
111
|
+
],
|
|
74
112
|
evidenceLinks: [parent.evidence_id],
|
|
75
113
|
});
|
|
76
114
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { apktoolRequestSchema, } from "../../domain/apktool/apktoolResourceAnalysis.js";
|
|
2
|
+
import { executeProviderOperation } from "../ProviderOperationExecution.js";
|
|
3
|
+
/** Shared CLI/MCP admission, execution, and Evidence composition for Apktool. */
|
|
4
|
+
export class ApktoolResourceAnalysisService {
|
|
5
|
+
provider;
|
|
6
|
+
constructor(provider) {
|
|
7
|
+
this.provider = provider;
|
|
8
|
+
}
|
|
9
|
+
/** Run one caller-selected Apktool request and retain target identity inline. */
|
|
10
|
+
async execute(operation, input, options) {
|
|
11
|
+
return executeProviderOperation(operation, input, options, apktoolRequestSchema, this.provider, "observed");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ProviderCleanupError } from "../../domain/providerCleanupError.js";
|
|
2
|
-
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
|
|
3
|
-
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
|
4
2
|
import { err } from "../../domain/result.js";
|
|
5
3
|
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
|
6
4
|
/** Close one provider client and normalize unexpected adapter rejection. */
|
|
@@ -15,25 +13,3 @@ export const closeAnalysisClient = async (client, providerId, options = {}) => {
|
|
|
15
13
|
return err(new ProviderCleanupError(providerId, ["provider-client"], { reason: "provider client close rejected unexpectedly" }, { cause }));
|
|
16
14
|
}
|
|
17
15
|
};
|
|
18
|
-
/** Preserve the original lifecycle failure alongside incomplete cleanup. */
|
|
19
|
-
export const analysisErrorWithCleanupFailure = (primary, cleanup, operation = "close_binary") => {
|
|
20
|
-
const projected = projectAnalysisError(cleanup);
|
|
21
|
-
return new ProviderAdapterError(cleanup instanceof ProviderAdapterError ? cleanup.providerId : "rea", operation, {
|
|
22
|
-
cause: primary,
|
|
23
|
-
userMessage: projectAnalysisError(primary).message,
|
|
24
|
-
...(primary.capturedOutput === undefined
|
|
25
|
-
? {}
|
|
26
|
-
: { capturedOutput: primary.capturedOutput }),
|
|
27
|
-
...(primary.partialObservation === undefined
|
|
28
|
-
? {}
|
|
29
|
-
: { partialObservation: primary.partialObservation }),
|
|
30
|
-
cleanup: {
|
|
31
|
-
reason: projected.message,
|
|
32
|
-
resources: cleanup.cleanupResources,
|
|
33
|
-
},
|
|
34
|
-
diagnostics: {
|
|
35
|
-
primary_error: projectAnalysisError(primary),
|
|
36
|
-
cleanup_error: projected,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
};
|
|
@@ -13,7 +13,8 @@ import { BinarySessionRecords } from "./BinarySessionRecords.js";
|
|
|
13
13
|
import { binarySessionStatus } from "./BinarySessionStatus.js";
|
|
14
14
|
import { resolveSessionOpen, resolveSessionTarget, validateResolvedSessionTarget, } from "./BinarySessionOpen.js";
|
|
15
15
|
import { bindExecutionTarget, commitExecutionProfile, prepareSessionExecution, } from "./BinarySessionExecution.js";
|
|
16
|
-
import {
|
|
16
|
+
import { closeAnalysisClient } from "./AnalysisClientCleanup.js";
|
|
17
|
+
import { analysisErrorWithCleanupFailure } from "../../domain/analysisErrorCleanup.js";
|
|
17
18
|
const OFFICIAL_OPERATIONS = new Set(OFFICIAL_TOOL_CONTRACTS.map(({ name }) => name));
|
|
18
19
|
const ENHANCED_OPERATIONS = new Set(ENHANCED_TOOL_CONTRACTS.map(({ name }) => name));
|
|
19
20
|
/**
|
|
@@ -50,7 +50,8 @@ export class BinaryLayoutService {
|
|
|
50
50
|
operation: OPERATION,
|
|
51
51
|
parameters: input.data,
|
|
52
52
|
result: value,
|
|
53
|
-
|
|
53
|
+
// The decoded report is the only representation; do not repeat it.
|
|
54
|
+
rawResult: null,
|
|
54
55
|
confidence: "observed",
|
|
55
56
|
limitations: value.limitations,
|
|
56
57
|
locations: [{ kind: "artifact-path", path: value.artifact.path }],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { isAbsolute } from "node:path";
|
|
2
|
+
import { AnalysisCancelledError, AnalysisInputError, AnalysisOutputError, } from "../../domain/analysisErrorCore.js";
|
|
3
|
+
import { createEvidence } from "../../domain/evidence.js";
|
|
4
|
+
import { inspectPeResourcesInputSchema, peResourcesSchema, } from "../../domain/native/peResources.js";
|
|
5
|
+
import { analysisInputErrorFromIssues } from "../../domain/inputIssueProjection.js";
|
|
6
|
+
import { err, ok } from "../../domain/result.js";
|
|
7
|
+
/** Shared caller validation, output parsing and Evidence provenance for CLI/MCP. */
|
|
8
|
+
export class PeResourcesService {
|
|
9
|
+
provider;
|
|
10
|
+
constructor(provider) {
|
|
11
|
+
this.provider = provider;
|
|
12
|
+
}
|
|
13
|
+
async inspect(rawInput, options) {
|
|
14
|
+
const operation = "inspect_pe_resources";
|
|
15
|
+
if (options?.signal?.aborted)
|
|
16
|
+
return err(new AnalysisCancelledError(operation));
|
|
17
|
+
const input = inspectPeResourcesInputSchema.safeParse(rawInput);
|
|
18
|
+
if (!input.success)
|
|
19
|
+
return err(analysisInputErrorFromIssues(operation, input.error.issues, rawInput, {
|
|
20
|
+
cause: input.error,
|
|
21
|
+
}));
|
|
22
|
+
if (!isAbsolute(input.data.path))
|
|
23
|
+
return err(new AnalysisInputError(operation, undefined, [
|
|
24
|
+
{
|
|
25
|
+
path: ["path"],
|
|
26
|
+
reason: "invalid_format",
|
|
27
|
+
message: "Expected an absolute filesystem path on this host.",
|
|
28
|
+
},
|
|
29
|
+
]));
|
|
30
|
+
const result = await this.provider.inspect(input.data, options);
|
|
31
|
+
if (!result.ok)
|
|
32
|
+
return result;
|
|
33
|
+
if (options?.signal?.aborted)
|
|
34
|
+
return err(new AnalysisCancelledError(operation));
|
|
35
|
+
const report = peResourcesSchema.safeParse(result.value);
|
|
36
|
+
if (!report.success ||
|
|
37
|
+
report.data.artifact.path !== input.data.path ||
|
|
38
|
+
!validReport(report.data, input.data.max_entries, input.data.max_file_bytes))
|
|
39
|
+
return err(new AnalysisOutputError(operation, "PE resource provider returned malformed output or changed artifact identity."));
|
|
40
|
+
const value = report.data;
|
|
41
|
+
return ok(createEvidence({
|
|
42
|
+
path: value.artifact.path,
|
|
43
|
+
format: "pe",
|
|
44
|
+
sha256: value.artifact.sha256,
|
|
45
|
+
}, this.provider.identity, {
|
|
46
|
+
operation,
|
|
47
|
+
parameters: input.data,
|
|
48
|
+
result: value,
|
|
49
|
+
confidence: "observed",
|
|
50
|
+
limitations: value.limitations,
|
|
51
|
+
locations: [{ kind: "artifact-path", path: value.artifact.path }],
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Check cross-field invariants before provider output becomes public Evidence. */
|
|
56
|
+
const validReport = (report, maxEntries, maxBytes) => {
|
|
57
|
+
const inside = ({ offset, bytes }) => offset <= report.artifact.bytes - bytes;
|
|
58
|
+
if (report.artifact.bytes > maxBytes ||
|
|
59
|
+
report.coverage.resources !== report.resources.length ||
|
|
60
|
+
report.coverage.examined_entries > maxEntries ||
|
|
61
|
+
report.coverage.examined_entries !==
|
|
62
|
+
report.directories.reduce((sum, item) => sum + item.named_entries + item.id_entries, 0))
|
|
63
|
+
return false;
|
|
64
|
+
if (report.directory === null &&
|
|
65
|
+
(report.directories.length > 0 || report.resources.length > 0))
|
|
66
|
+
return false;
|
|
67
|
+
if (report.directory !== null &&
|
|
68
|
+
(!inside(report.directory.location) ||
|
|
69
|
+
!inside(report.directory.data_directory_location)))
|
|
70
|
+
return false;
|
|
71
|
+
if (!report.directories.every((item) => inside(item.location)))
|
|
72
|
+
return false;
|
|
73
|
+
if (!report.resources.every((item, index) => item.index === index &&
|
|
74
|
+
inside(item.data_entry_location) &&
|
|
75
|
+
inside(item.payload.location) &&
|
|
76
|
+
item.entry_locations.every(inside) &&
|
|
77
|
+
[item.type, item.name, item.language].every((identity) => identity.kind === "id" || inside(identity.location))))
|
|
78
|
+
return false;
|
|
79
|
+
return report.icon_groups.every((group) => {
|
|
80
|
+
const resource = report.resources[group.resource_index];
|
|
81
|
+
if (resource === undefined ||
|
|
82
|
+
resource.type.kind !== "id" ||
|
|
83
|
+
resource.type.id !== 14)
|
|
84
|
+
return false;
|
|
85
|
+
return group.images.every((image) => inside(image.location) &&
|
|
86
|
+
image.location.offset >= resource.payload.location.offset &&
|
|
87
|
+
image.location.offset + image.location.bytes <=
|
|
88
|
+
resource.payload.location.offset + resource.payload.location.bytes &&
|
|
89
|
+
image.candidate_resource_indices.every((index) => {
|
|
90
|
+
const icon = report.resources[index];
|
|
91
|
+
return (icon !== undefined &&
|
|
92
|
+
icon.type.kind === "id" &&
|
|
93
|
+
icon.type.id === 3 &&
|
|
94
|
+
icon.name.kind === "id" &&
|
|
95
|
+
icon.name.id === image.resource_id);
|
|
96
|
+
}) &&
|
|
97
|
+
(image.same_language_resource_index === null
|
|
98
|
+
? image.size_matches === null
|
|
99
|
+
: image.candidate_resource_indices.includes(image.same_language_resource_index) &&
|
|
100
|
+
sameIdentity(report.resources[image.same_language_resource_index]?.language, resource.language) &&
|
|
101
|
+
image.size_matches ===
|
|
102
|
+
(report.resources[image.same_language_resource_index]?.payload
|
|
103
|
+
.location.bytes ===
|
|
104
|
+
image.declared_bytes)));
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const sameIdentity = (left, right) => left?.kind === "id" && right.kind === "id"
|
|
108
|
+
? left.id === right.id
|
|
109
|
+
: left?.kind === "name" &&
|
|
110
|
+
right.kind === "name" &&
|
|
111
|
+
left.utf16le_hex === right.utf16le_hex;
|
|
@@ -53,7 +53,8 @@ export class RecordedCrashService {
|
|
|
53
53
|
operation: OPERATION,
|
|
54
54
|
parameters: input.data,
|
|
55
55
|
result: value,
|
|
56
|
-
|
|
56
|
+
// The decoded report is the only representation; do not repeat it.
|
|
57
|
+
rawResult: null,
|
|
57
58
|
confidence: value.debugger.status === "available" ? "derived" : "observed",
|
|
58
59
|
limitations: value.limitations,
|
|
59
60
|
locations: [{ kind: "artifact-path", path: value.artifact.path }],
|
|
@@ -15,6 +15,9 @@ export class EvmInterfaceService {
|
|
|
15
15
|
constructor(provider) {
|
|
16
16
|
this.provider = provider;
|
|
17
17
|
}
|
|
18
|
+
close() {
|
|
19
|
+
return this.provider.close?.() ?? Promise.resolve();
|
|
20
|
+
}
|
|
18
21
|
/** Preserve selected byte identity while clearly labeling recovered ABI candidates as inferences. */
|
|
19
22
|
async inspect(rawInput, options) {
|
|
20
23
|
if (options?.signal?.aborted)
|
|
@@ -9,6 +9,9 @@ export class FirmwareAnalysisService {
|
|
|
9
9
|
constructor(provider) {
|
|
10
10
|
this.provider = provider;
|
|
11
11
|
}
|
|
12
|
+
close() {
|
|
13
|
+
return this.provider.close?.() ?? Promise.resolve();
|
|
14
|
+
}
|
|
12
15
|
/** Execute an explicit inspection or extraction and preserve its producing identity. */
|
|
13
16
|
async execute(operation, input, options) {
|
|
14
17
|
if (options?.signal?.aborted === true)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnalysisInputError } from "../../domain/analysisErrorCore.js";
|
|
2
|
+
import { err, ok } from "../../domain/result.js";
|
|
3
|
+
import { summarizeEvidenceBundle, } from "../../domain/evidenceRecordSummary.js";
|
|
4
|
+
/** Select complete bundle delivery or discovery metadata without analysis payloads. */
|
|
5
|
+
export const inspectEvidenceBundle = (bundle, options) => {
|
|
6
|
+
if (options.detail === "complete" && options.filters !== undefined)
|
|
7
|
+
return err(new AnalysisInputError("get_evidence_bundle", undefined, [
|
|
8
|
+
{
|
|
9
|
+
path: ["filters"],
|
|
10
|
+
reason: "invalid_value",
|
|
11
|
+
message: "Record filters require detail: summary; complete returns the canonical bundle.",
|
|
12
|
+
expected: "detail: summary",
|
|
13
|
+
},
|
|
14
|
+
]));
|
|
15
|
+
return ok(options.detail === "summary"
|
|
16
|
+
? summarizeEvidenceBundle(bundle, options.filters)
|
|
17
|
+
: bundle);
|
|
18
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { sha256Text } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js";
|
|
2
|
+
import { sourceNodeFor, } from "./JavaScriptArtifactGraphContext.js";
|
|
2
3
|
import { astObservationEvidence, staticInferenceEvidence, } from "./JavaScriptArtifactGraphEvidence.js";
|
|
3
4
|
/** Resolve the file or recovered bundle module that owns one finding. */
|
|
4
|
-
export const electronFindingSourceNode = (context, file, moduleKey) => moduleKey === null
|
|
5
|
+
export const electronFindingSourceNode = (context, file, moduleKey, runtime) => moduleKey === null
|
|
5
6
|
? (context.assetNodes.get(file.path) ?? context.fileNodes.get(file.path))
|
|
6
|
-
: context
|
|
7
|
+
: sourceNodeFor(context, file.path, moduleKey, runtime);
|
|
7
8
|
/** Observation-scoped identity shared safely across different artifact files. */
|
|
8
9
|
export const electronObservationIdentity = (context, scope, key) => ({
|
|
9
10
|
strategy: "observation-fingerprint",
|
|
@@ -21,7 +21,7 @@ const addIpcRecord = (state, record) => {
|
|
|
21
21
|
const coverage = coverageFor(context, record.file);
|
|
22
22
|
if (coverage === undefined)
|
|
23
23
|
return;
|
|
24
|
-
const source = electronFindingSourceNode(context, record.file, record.finding.module_key);
|
|
24
|
+
const source = electronFindingSourceNode(context, record.file, record.finding.module_key, record.finding.module_runtime);
|
|
25
25
|
if (source === undefined)
|
|
26
26
|
return;
|
|
27
27
|
state.sources.set(record.key, source);
|
|
@@ -181,7 +181,7 @@ const addValidationObservations = (state) => {
|
|
|
181
181
|
for (const validation of javascript.electron.sender_validations) {
|
|
182
182
|
const handlerRecord = containingHandler(state.records, file, validation);
|
|
183
183
|
const target = handlerRecord === undefined
|
|
184
|
-
? electronFindingSourceNode(state.context, file, validation.module_key)
|
|
184
|
+
? electronFindingSourceNode(state.context, file, validation.module_key, validation.module_runtime)
|
|
185
185
|
: state.handlers.get(handlerRecord.key);
|
|
186
186
|
if (target !== undefined)
|
|
187
187
|
addValidationObservation({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { javascriptAnalysisCoverage, resolveArtifactPath, } from "./JavaScriptArtifactGraphContext.js";
|
|
2
2
|
import { astObservationEvidence } from "./JavaScriptArtifactGraphEvidence.js";
|
|
3
3
|
import { compositeKey } from "../../domain/unicodeCodePointOrder.js";
|
|
4
|
+
import { javascriptDisplayText } from "../../domain/javascript/javascriptAstValues.js";
|
|
4
5
|
import { addElectronInferenceEdge, electronFindingSourceNode, electronObservationIdentity, electronRangeKey, } from "./ElectronBoundaryGraphContext.js";
|
|
5
6
|
/** Project JavaScript-requested native addon binding and re-export surfaces. */
|
|
6
7
|
export const addElectronNativeBoundaries = (context) => {
|
|
@@ -15,24 +16,32 @@ export const addElectronNativeBoundaries = (context) => {
|
|
|
15
16
|
};
|
|
16
17
|
const addNativeBinding = (input) => {
|
|
17
18
|
const { context, file, value, coverage } = input;
|
|
18
|
-
const source = electronFindingSourceNode(context, file, value.module_key);
|
|
19
|
+
const source = electronFindingSourceNode(context, file, value.module_key, value.module_runtime);
|
|
19
20
|
if (source === undefined)
|
|
20
21
|
return;
|
|
21
22
|
const resolved = resolveArtifactPath(value.specifier, file.path, context.filesByPath, value.module_kind);
|
|
22
23
|
const addon = resolved === null ? undefined : context.fileNodes.get(resolved);
|
|
23
24
|
const binding = context.accumulator.addNode({
|
|
24
25
|
kind: "native-export",
|
|
25
|
-
identity: electronObservationIdentity(context, "javascript-requested-native-export",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
identity: electronObservationIdentity(context, "javascript-requested-native-export", compositeKey([
|
|
27
|
+
file.path,
|
|
28
|
+
value.specifier,
|
|
29
|
+
value.binding_kind,
|
|
30
|
+
value.members,
|
|
31
|
+
value.namespace_access ?? null,
|
|
32
|
+
value.dynamic_member_access ?? null,
|
|
33
|
+
electronRangeKey(value.location),
|
|
34
|
+
])),
|
|
29
35
|
observations: [
|
|
30
36
|
{
|
|
31
|
-
label: value.members.join(", ")
|
|
37
|
+
label: value.members.map(javascriptDisplayText).join(", ") ||
|
|
38
|
+
value.specifier,
|
|
32
39
|
properties: {
|
|
33
40
|
specifier: value.specifier,
|
|
34
41
|
binding_kind: value.binding_kind,
|
|
35
42
|
requested_members: value.members,
|
|
43
|
+
namespace_access: value.namespace_access ?? null,
|
|
44
|
+
dynamic_member_access: value.dynamic_member_access ?? null,
|
|
36
45
|
resolved_path: resolved,
|
|
37
46
|
native_export_verification: "not-performed",
|
|
38
47
|
},
|
|
@@ -61,6 +70,8 @@ const addNativeBinding = (input) => {
|
|
|
61
70
|
specifier: value.specifier,
|
|
62
71
|
binding_kind: value.binding_kind,
|
|
63
72
|
requested_members: value.members,
|
|
73
|
+
namespace_access: value.namespace_access ?? null,
|
|
74
|
+
dynamic_member_access: value.dynamic_member_access ?? null,
|
|
64
75
|
},
|
|
65
76
|
limitations: [
|
|
66
77
|
"Requested JavaScript members are not verified native exports.",
|
|
@@ -79,6 +90,8 @@ const addNativeBinding = (input) => {
|
|
|
79
90
|
properties: {
|
|
80
91
|
resolved_path: resolved,
|
|
81
92
|
requested_members: value.members,
|
|
93
|
+
namespace_access: value.namespace_access ?? null,
|
|
94
|
+
dynamic_member_access: value.dynamic_member_access ?? null,
|
|
82
95
|
verified: false,
|
|
83
96
|
},
|
|
84
97
|
confidence: "medium",
|
|
@@ -10,17 +10,17 @@ export const addElectronWindowBoundaries = (context) => {
|
|
|
10
10
|
continue;
|
|
11
11
|
const coverage = javascriptAnalysisCoverage(javascript);
|
|
12
12
|
for (const value of javascript.electron.browser_windows) {
|
|
13
|
-
const source = electronFindingSourceNode(context, file, value.module_key);
|
|
13
|
+
const source = electronFindingSourceNode(context, file, value.module_key, value.module_runtime);
|
|
14
14
|
if (source !== undefined)
|
|
15
15
|
addBrowserWindow({ context, file, source, value, coverage });
|
|
16
16
|
}
|
|
17
17
|
for (const value of javascript.electron.context_bridge_apis) {
|
|
18
|
-
const source = electronFindingSourceNode(context, file, value.module_key);
|
|
18
|
+
const source = electronFindingSourceNode(context, file, value.module_key, value.module_runtime);
|
|
19
19
|
if (source !== undefined)
|
|
20
20
|
addContextBridge({ context, file, source, value, coverage });
|
|
21
21
|
}
|
|
22
22
|
for (const value of javascript.electron.utility_processes) {
|
|
23
|
-
const source = electronFindingSourceNode(context, file, value.module_key);
|
|
23
|
+
const source = electronFindingSourceNode(context, file, value.module_key, value.module_runtime);
|
|
24
24
|
if (source !== undefined)
|
|
25
25
|
addUtilityProcess({ context, file, source, value, coverage });
|
|
26
26
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ArtifactReaderFailure } from "../../artifacts/ArtifactReader.js";
|
|
3
3
|
import { analyzeJavaScriptApplicationInputSchema, parseOwnedJavaScriptApplicationAnalysisSteps, } from "../../domain/javascript/javascriptApplicationAnalysis.js";
|
|
4
|
-
import {
|
|
4
|
+
import { AnalysisOutputError } from "../../domain/analysisErrorCore.js";
|
|
5
5
|
import { ArtifactOperationError } from "../../domain/artifactOperationError.js";
|
|
6
|
-
import {} from "../../domain/analysisErrorBase.js";
|
|
6
|
+
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
|
7
7
|
import { analysisInputErrorFromIssues } from "../../domain/inputIssueProjection.js";
|
|
8
8
|
import { err, ok } from "../../domain/result.js";
|
|
9
9
|
import { ProviderAdapterError } from "../../domain/providerAdapterError.js";
|
|
@@ -13,14 +13,14 @@ import { reconstructJavaScriptArtifact } from "./JavaScriptArtifactReconstructio
|
|
|
13
13
|
import { JAVASCRIPT_APPLICATION_PROVIDER } from "../InvestigationProviders.js";
|
|
14
14
|
const OPERATION = "analyze_javascript_application";
|
|
15
15
|
/** Statically analyze one local JavaScript/Electron application. */
|
|
16
|
-
export const analyzeJavaScriptApplication = async (rawInput, options = {}) => {
|
|
16
|
+
export const analyzeJavaScriptApplication = async (rawInput, scope, options = {}) => {
|
|
17
17
|
const parsed = analyzeJavaScriptApplicationInputSchema.safeParse(rawInput);
|
|
18
18
|
if (!parsed.success)
|
|
19
19
|
return err(analysisInputErrorFromIssues(OPERATION, parsed.error.issues, rawInput));
|
|
20
|
-
return analyzeJavaScriptApplicationValidated(parsed.data, options);
|
|
20
|
+
return analyzeJavaScriptApplicationValidated(parsed.data, scope, options);
|
|
21
21
|
};
|
|
22
22
|
/** Analyze input already parsed by a trusted adapter boundary. */
|
|
23
|
-
export const analyzeJavaScriptApplicationValidated = async (input, options = {}) => {
|
|
23
|
+
export const analyzeJavaScriptApplicationValidated = async (input, scope, options = {}) => {
|
|
24
24
|
try {
|
|
25
25
|
assertJavaScriptAnalysisActive(options.signal);
|
|
26
26
|
await options.progress?.report({
|
|
@@ -34,7 +34,13 @@ export const analyzeJavaScriptApplicationValidated = async (input, options = {})
|
|
|
34
34
|
input_path: input.input_path,
|
|
35
35
|
format: input.format,
|
|
36
36
|
integrity_policy: input.integrity_policy,
|
|
37
|
-
|
|
37
|
+
...(input.max_heap_mb === undefined
|
|
38
|
+
? {}
|
|
39
|
+
: { max_heap_mb: input.max_heap_mb }),
|
|
40
|
+
...(input.analysis_timeout_ms === undefined
|
|
41
|
+
? {}
|
|
42
|
+
: { analysis_timeout_ms: input.analysis_timeout_ms }),
|
|
43
|
+
}, scope, options.signal, options.progress);
|
|
38
44
|
const { electron_summary: summary, ...application } = reconstructed;
|
|
39
45
|
await options.progress?.report({
|
|
40
46
|
phase: "validate_javascript_application_result",
|
|
@@ -68,13 +74,11 @@ export const analyzeJavaScriptApplicationValidated = async (input, options = {})
|
|
|
68
74
|
return ok(evidence);
|
|
69
75
|
}
|
|
70
76
|
catch (cause) {
|
|
71
|
-
//
|
|
72
|
-
if (cause instanceof
|
|
73
|
-
cause instanceof AnalysisUnsupportedTargetError ||
|
|
74
|
-
cause instanceof AnalysisAccessDeniedError)
|
|
77
|
+
// Preserve execution constraints and their completed partial Evidence.
|
|
78
|
+
if (cause instanceof AnalysisError)
|
|
75
79
|
return err(cause);
|
|
76
80
|
if (cause instanceof ArtifactReaderFailure)
|
|
77
|
-
return err(
|
|
81
|
+
return err(artifactFailureToOperationError(cause));
|
|
78
82
|
if (cause instanceof z.ZodError)
|
|
79
83
|
return err(new AnalysisOutputError(OPERATION, describeResultSchemaFailure(cause), {
|
|
80
84
|
cause,
|
|
@@ -98,6 +102,13 @@ export const analyzeJavaScriptApplicationValidated = async (input, options = {})
|
|
|
98
102
|
}));
|
|
99
103
|
}
|
|
100
104
|
};
|
|
105
|
+
const artifactFailureToOperationError = (cause) => new ArtifactOperationError(OPERATION, cause.reason, cause.details, cause.message, {
|
|
106
|
+
cause,
|
|
107
|
+
...(cause.cleanup === undefined ? {} : { cleanup: cause.cleanup }),
|
|
108
|
+
...(cause.partialObservation === undefined
|
|
109
|
+
? {}
|
|
110
|
+
: { partialObservation: cause.partialObservation }),
|
|
111
|
+
});
|
|
101
112
|
const describeResultSchemaFailure = (cause) => {
|
|
102
113
|
const issue = cause.issues[0];
|
|
103
114
|
if (issue === undefined)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createEvidence, } from "../../domain/evidence.js";
|
|
2
|
-
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
|
3
2
|
import { JAVASCRIPT_APPLICATION_WORKFLOW_PROVIDER } from "../InvestigationProviders.js";
|
|
4
3
|
/** Create derived Evidence for one bounded application-graph feature trace. */
|
|
5
4
|
export const createApplicationFeatureTraceEvidence = (parameters, result) => createEvidence(undefined, JAVASCRIPT_APPLICATION_WORKFLOW_PROVIDER, {
|
|
6
5
|
predicateType: "rea.application-feature-trace",
|
|
7
6
|
operation: "trace_application_feature",
|
|
8
7
|
parameters,
|
|
9
|
-
result
|
|
8
|
+
result,
|
|
10
9
|
rawResult: null,
|
|
11
10
|
confidence: "inferred",
|
|
12
11
|
authority: "analyst-inference",
|
|
@@ -19,7 +18,7 @@ export const createJavaScriptSemanticTraceEvidence = (parameters, result) => cre
|
|
|
19
18
|
predicateType: "rea.javascript-semantic-trace",
|
|
20
19
|
operation: "trace_javascript_semantics",
|
|
21
20
|
parameters,
|
|
22
|
-
result
|
|
21
|
+
result,
|
|
23
22
|
rawResult: null,
|
|
24
23
|
confidence: "inferred",
|
|
25
24
|
authority: "analyst-inference",
|
|
@@ -32,7 +31,7 @@ export const createApplicationVersionComparisonEvidence = (parameters, result) =
|
|
|
32
31
|
predicateType: "rea.application-version-comparison",
|
|
33
32
|
operation: "compare_application_versions",
|
|
34
33
|
parameters,
|
|
35
|
-
result
|
|
34
|
+
result,
|
|
36
35
|
rawResult: null,
|
|
37
36
|
confidence: "inferred",
|
|
38
37
|
authority: "analyst-inference",
|
|
@@ -45,7 +44,7 @@ export const createSourceToBundleComparisonEvidence = (parameters, result) => cr
|
|
|
45
44
|
predicateType: "rea.source-to-bundle-comparison",
|
|
46
45
|
operation: "compare_source_to_bundle",
|
|
47
46
|
parameters,
|
|
48
|
-
result
|
|
47
|
+
result,
|
|
49
48
|
rawResult: null,
|
|
50
49
|
confidence: "inferred",
|
|
51
50
|
authority: "analyst-inference",
|
|
@@ -58,7 +57,7 @@ export const createJavaScriptExportShapeComparisonEvidence = (parameters, result
|
|
|
58
57
|
predicateType: "rea.javascript-export-shape-comparison",
|
|
59
58
|
operation: "compare_javascript_export_shapes",
|
|
60
59
|
parameters,
|
|
61
|
-
result
|
|
60
|
+
result,
|
|
62
61
|
rawResult: null,
|
|
63
62
|
confidence: "inferred",
|
|
64
63
|
authority: "analyst-inference",
|