rea-agents 5.0.0 → 6.1.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 +168 -655
- package/bridge/android/ReaJadxBridge.java +14 -5
- package/bridge/ghidra/ReaGhidraBridge.java +173 -47
- package/bridge/hopper_bridge.py +310 -128
- package/bridge/mitmproxy/capture.py +208 -0
- package/bridge/native/rea_lldb_tracer.py +839 -0
- package/bridge/process/ProcessRunTokenReader.swift +297 -0
- package/bridge/process/ProcessRunTokenReaderMain.swift +35 -0
- package/bridge/pwndbg/core_context.py +101 -0
- package/bridge/pwndbg/launch.py +39 -0
- package/bridge/pwndbg/launch_impl.py +34 -0
- package/bridge/pwntools/decoder_runtime.py +59 -0
- package/bridge/pwntools/layout.py +39 -0
- package/bridge/pwntools/layout_impl.py +309 -0
- package/bridge/pwntools/recorded_crash.py +39 -0
- package/bridge/pwntools/recorded_crash_impl.py +147 -0
- package/dist/android/JadxConfiguration.js +196 -33
- package/dist/android/JadxMcpTransport.js +4 -0
- package/dist/android/JadxProtocol.js +6 -0
- package/dist/android/JadxProvider.js +20 -2
- package/dist/android/JadxSession.js +23 -4
- package/dist/application/AnalysisContextQueries.js +8 -35
- package/dist/application/AnalysisDocument.js +32 -0
- package/dist/application/AppBundleExecutable.js +67 -21
- package/dist/application/CallPathTracing.js +19 -3
- package/dist/application/CapabilityInventory.js +27 -3
- package/dist/application/ClientConfigurationDocument.js +871 -6
- package/dist/application/ClientRegistrationIdentity.js +26 -5
- package/dist/application/ClientRegistrationStatus.js +29 -14
- package/dist/application/DirectAnalysis.js +97 -33
- package/dist/application/Doctor.js +4 -2
- package/dist/application/DoctorScope.js +25 -13
- package/dist/application/EnhancedLiteralTracing.js +22 -25
- package/dist/application/EnhancedTools.js +13 -11
- package/dist/application/EvidenceBundleFiles.js +24 -12
- package/dist/application/FunctionAnalysisEvidence.js +2 -3
- package/dist/application/InventoryProjectionEvidence.js +4 -3
- package/dist/application/InvestigationProviders.js +3 -2
- package/dist/application/JsonFiles.js +50 -28
- package/dist/application/ProcedureAddressResolution.js +11 -0
- package/dist/application/ReconstructionCoverageService.js +7 -4
- package/dist/application/ReconstructionObligationCandidates.js +5 -1
- package/dist/application/ReconstructionObligationLedgerService.js +4 -3
- package/dist/application/Setup.js +13 -1
- package/dist/application/SetupClientConfiguration.js +10 -15
- package/dist/application/SetupHost.js +5 -2
- package/dist/application/SetupPlan.js +5 -3
- package/dist/application/SupportedClients.js +34 -1
- package/dist/application/Uninstall.js +4 -3
- package/dist/application/Update.js +18 -3
- package/dist/application/UpdateRuntime.js +46 -25
- package/dist/application/WebModuleTraceService.js +4 -2
- package/dist/application/WebNetworkCapturePort.js +1 -0
- package/dist/application/WebNetworkCaptureService.js +134 -0
- package/dist/application/WebRuntimeService.js +5 -3
- package/dist/application/WebScriptExportService.js +2 -2
- package/dist/application/WebSourceLocationService.js +4 -2
- package/dist/application/WindowsCapabilities.js +1 -1
- package/dist/application/WorkflowEvidence.js +82 -0
- package/dist/application/binary/AnalysisProviderEvaluation.js +21 -5
- package/dist/application/binary/AnalysisProviderRegistry.js +2 -0
- package/dist/application/binary/AnalysisSnapshotCache.js +52 -12
- package/dist/application/binary/BinarySession.js +131 -76
- package/dist/application/binary/BinarySessionOpen.js +19 -6
- package/dist/application/binary/BinarySessionRecords.js +45 -3
- package/dist/application/binary/BinarySessionStatus.js +17 -1
- package/dist/application/binary/CompositeProvider.js +13 -0
- package/dist/application/binary/LazyAnalysisProvider.js +3 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutPort.js +1 -0
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +59 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +62 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +64 -0
- package/dist/application/investigation/EvidenceLedger.js +21 -7
- package/dist/application/investigation/InvestigationRecords.js +8 -0
- package/dist/application/javascript/JavaScriptAnalysisControl.js +34 -0
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +25 -5
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +19 -2
- package/dist/application/javascript/JavaScriptApplicationService.js +34 -14
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +5 -5
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +47 -27
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +39 -7
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +26 -2
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +80 -27
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +33 -12
- package/dist/application/javascript/JavaScriptModuleRelationships.js +37 -8
- package/dist/application/javascript/JavaScriptRecoveryService.js +4 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +3 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +7 -7
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +149 -72
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +14 -15
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +41 -1
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +7 -7
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -9
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +118 -12
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +3 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +27 -5
- package/dist/application/managed/ManagedApplicationGraphService.js +4 -3
- package/dist/application/managed/ManagedMemberComparisonService.js +7 -4
- package/dist/application/managed/ManagedNativeVerificationService.js +4 -3
- package/dist/application/managed/ManagedReconstructionService.js +4 -3
- package/dist/application/{ProcessCli.js → process/ProcessCli.js} +23 -15
- package/dist/application/{ProcessEvidence.js → process/ProcessEvidence.js} +8 -7
- package/dist/application/workflowInputError.js +18 -0
- package/dist/artifacts/ArtifactProvider.js +42 -5
- package/dist/artifacts/ArtifactProviderMetadata.js +2 -1
- package/dist/artifacts/MachOSliceArtifactReader.js +98 -14
- package/dist/artifacts/NativeDmgArtifactReader.js +13 -6
- package/dist/artifacts/ZipArtifactReader.js +3 -0
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +22 -3
- package/dist/artifacts/apple/DylibResolutionReader.js +259 -0
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +176 -56
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +195 -0
- package/dist/artifacts/apple/KeyedArchiveReader.js +36 -22
- package/dist/artifacts/apple/MachoLoadCommandReader.js +355 -0
- package/dist/artifacts/apple/NibArchive.js +81 -14
- package/dist/artifacts/apple/NibViewHierarchy.js +10 -3
- package/dist/artifacts/apple/PlistNumberLiterals.js +164 -0
- package/dist/{application → artifacts/extraction}/ArtifactExtraction.js +10 -10
- package/dist/{application → artifacts/inventory}/ArtifactGraphConstruction.js +16 -11
- package/dist/{application → artifacts/inventory}/ArtifactInventory.js +4 -4
- package/dist/{application/ArtifactInventory → artifacts/inventory}/classify.js +2 -2
- package/dist/{application/ArtifactInventory → artifacts/inventory}/reader.js +5 -5
- package/dist/{application/ArtifactInventory → artifacts/inventory}/scanCanonical.js +14 -17
- package/dist/{application/ArtifactInventory → artifacts/inventory}/scanReader.js +5 -5
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +6 -2
- package/dist/artifacts/readStableArtifact.js +20 -4
- package/dist/browser/CdpCaptureCompleteness.js +2 -0
- package/dist/browser/CdpCaptureEventHandlers.js +165 -12
- package/dist/browser/CdpCaptureEventTypes.js +5 -1
- package/dist/browser/CdpCaptureEvents.js +34 -0
- package/dist/browser/CdpConnection.js +30 -11
- package/dist/browser/CdpOptionalCommand.js +2 -3
- package/dist/browser/CdpPageCapture.js +23 -1
- package/dist/browser/PlaywrightElectronActiveActions.js +32 -23
- package/dist/browser/PlaywrightElectronActiveProjection.js +141 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +130 -122
- package/dist/browser/WebSourceMapFetcher.js +426 -72
- package/dist/browser/assets/LocalWebScriptArtifacts.js +2 -2
- package/dist/browser/history/CaptureFailures.js +137 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +65 -0
- package/dist/browser/history/CaptureRelease.js +17 -0
- package/dist/browser/history/HarCapture.js +165 -0
- package/dist/browser/history/HarCaptureAdapter.js +20 -0
- package/dist/browser/history/HarCaptureProcess.js +57 -0
- package/dist/browser/history/HarJson.js +92 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +188 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +42 -0
- package/dist/cli/analysisSelector.js +23 -0
- package/dist/cli/applicationCommands.js +2 -3
- package/dist/cli/artifactCommands.js +26 -1
- package/dist/cli/binaryDiagnosticsCommands.js +39 -0
- package/dist/cli/coreAnalysisCommands.js +2 -2
- package/dist/cli/coreBinaryCommands.js +78 -20
- package/dist/cli/electronCommands.js +21 -13
- package/dist/cli/evmCommands.js +24 -0
- package/dist/cli/firmwareCommands.js +6 -3
- package/dist/cli/javascriptApplicationAnalysis.js +20 -3
- package/dist/cli/jsonOutput.js +38 -0
- package/dist/cli/nativeCallCommands.js +34 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/streamedJsonOutput.js +56 -0
- package/dist/cli/utilityCommands.js +2 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +8 -8
- package/dist/cli.js +11 -4
- package/dist/cliBrowserScenarioCommands.js +2 -2
- package/dist/cliCommandNames.js +6 -1
- package/dist/cliJsonInput.js +35 -1
- package/dist/cliOutput.js +21 -6
- package/dist/composition/binaryDiagnostics.js +8 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/config/environment.js +4 -0
- package/dist/config/ghidraStartupTimeout.js +17 -0
- package/dist/config/mcpResponseBudget.js +22 -0
- package/dist/config/parseConfig.js +2 -1
- package/dist/contracts/artifactToolContracts.js +6 -0
- package/dist/contracts/browserCaptureToolInputSchema.js +43 -0
- package/dist/contracts/browserToolContracts.js +4 -3
- package/dist/contracts/enhancedInputs.js +5 -3
- package/dist/contracts/enhancedToolContracts.js +3 -3
- package/dist/contracts/errorSchemas.js +8 -1
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +2 -5
- package/dist/contracts/investigationExamples.js +2 -2
- package/dist/contracts/javascript/electronToolContracts.js +1 -1
- package/dist/contracts/managed/managedToolContracts.js +8 -6
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +42 -0
- package/dist/contracts/native/nativeToolContracts.js +21 -3
- package/dist/contracts/officialToolContracts.js +26 -24
- package/dist/contracts/process/processCaptureExample.js +2 -0
- package/dist/contracts/promptContracts.js +3 -3
- package/dist/contracts/sessionLifecycleInputs.js +18 -5
- package/dist/contracts/sessionStatusContract.js +8 -2
- package/dist/contracts/sessionToolContracts.js +8 -3
- package/dist/contracts/sessionToolSchemas.js +8 -4
- package/dist/contracts/toolContractExamples.js +1 -2
- package/dist/contracts/toolContractHelpers.js +4 -1
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +30 -1
- package/dist/contracts/toolOutputSchemaGroups.js +33 -28
- package/dist/contracts/toolOutputSchemaPrimitives.js +19 -1
- package/dist/contracts/toolSchemaMetadata.js +69 -10
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/domain/analysisErrorBase.js +22 -2
- package/dist/domain/analysisErrorCore.js +61 -5
- package/dist/domain/analysisErrorPresentation.js +95 -12
- package/dist/domain/analysisErrorProjection.js +148 -19
- package/dist/domain/analysisSnapshot.js +166 -2
- package/dist/domain/android/androidAnalysis.js +2 -4
- package/dist/domain/android/androidApplication.js +17 -9
- package/dist/domain/apple/appleApplication.js +41 -14
- package/dist/domain/apple/dyldEnvironment.js +73 -0
- package/dist/domain/apple/dyldPaths.js +81 -0
- package/dist/domain/apple/dylibResolution.js +478 -0
- package/dist/domain/apple/dylibResolutionFindings.js +77 -0
- package/dist/domain/apple/interfaceBuilderGraph.js +25 -13
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +13 -3
- package/dist/domain/apple/keyedArchive.js +9 -1
- package/dist/domain/apple/machoContainer.js +54 -0
- package/dist/domain/apple/plistNumbers.js +76 -0
- package/dist/domain/artifactIdentity.js +29 -0
- package/dist/domain/artifactInventoryEvidence.js +19 -24
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/bridgeCandidateProjection.js +71 -0
- package/dist/domain/browserCompleteness.js +1 -0
- package/dist/domain/browserObservation.js +1 -1
- package/dist/domain/browserObservationError.js +24 -5
- package/dist/domain/browserObservationSchemas.js +13 -0
- package/dist/domain/browserScenarioValues.js +5 -2
- package/dist/domain/bundleComparison.js +3 -2
- package/dist/domain/callPathSchemas.js +1 -1
- package/dist/domain/canonicalDigest.js +13 -1
- package/dist/domain/canonicalJsonDigestSteps.js +133 -0
- package/dist/domain/canonicalOrdering.js +9 -5
- package/dist/domain/changedBehavior.js +9 -9
- package/dist/domain/comparisonSourceEvidence.js +40 -0
- package/dist/domain/comparisonStatus.js +2 -30
- package/dist/domain/configurationErrors.js +1 -1
- package/dist/domain/conformanceTrustGate.js +0 -16
- package/dist/domain/evidence.js +78 -11
- package/dist/domain/evidenceBundle.js +42 -1
- package/dist/domain/evidenceErrors.js +12 -1
- package/dist/domain/evm/evmInterface.js +63 -0
- package/dist/domain/explicitSensitiveFailure.js +108 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/firmware/firmwareAnalysis.js +10 -4
- package/dist/domain/hopperErrors.js +23 -2
- package/dist/domain/hopperValues.js +51 -8
- package/dist/domain/immutableJson.js +114 -0
- package/dist/domain/inputIssueProjection.js +3 -0
- package/dist/domain/javascript/electronActiveObservation.js +37 -6
- package/dist/domain/javascript/electronStaticAnalysisValues.js +6 -12
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +71 -23
- package/dist/domain/javascript/javascriptApplicationGraph.js +13 -0
- package/dist/domain/javascript/javascriptAstValues.js +20 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +21 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +0 -10
- package/dist/domain/javascript/javascriptRecovery.js +3 -8
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +97 -2
- package/dist/domain/javascript/javascriptSemanticCoverage.js +6 -5
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +9 -17
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +22 -5
- package/dist/domain/javascript/javascriptSemanticGraph.js +34 -5
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +25 -17
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -4
- package/dist/domain/javascript/javascriptSemanticResourceLimits.js +77 -0
- package/dist/domain/javascript/javascriptSemanticValues.js +83 -11
- package/dist/domain/javascript/javascriptSourceParser.js +6 -2
- package/dist/domain/javascript/javascriptStaticAnalysis.js +22 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +5 -3
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +14 -4
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +66 -7
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +28 -16
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +3 -2
- package/dist/domain/jsonSerialization.js +109 -0
- package/dist/domain/jsonValue.js +91 -3
- package/dist/domain/localPath.js +8 -0
- package/dist/domain/managed/managedApplicationGraph.js +10 -10
- package/dist/domain/managed/managedInspectionEvidence.js +16 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +5 -9
- package/dist/domain/managed/managedNativeVerification.js +3 -9
- package/dist/domain/native/binaryLayout.js +357 -0
- package/dist/domain/native/fileOffsetPartialObservation.js +1 -0
- package/dist/domain/native/nativeCallObservation.js +186 -0
- package/dist/domain/native/nativeCallPartialObservation.js +33 -0
- package/dist/domain/native/objcSwiftMetadata.js +0 -39
- package/dist/domain/native/recordedCrash.js +266 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/{processCapture.js → process/processCapture.js} +143 -2
- package/dist/domain/{processCaptureExample.js → process/processCaptureExample.js} +5 -0
- package/dist/domain/process/processCaptureParsing.js +54 -0
- package/dist/domain/{processCaptureValidation.js → process/processCaptureValidation.js} +18 -2
- package/dist/domain/{processComparison.js → process/processComparison.js} +39 -5
- package/dist/domain/{processObservation.js → process/processObservation.js} +1 -1
- package/dist/domain/{processScenario.js → process/processScenario.js} +11 -10
- package/dist/domain/{processTraceSpecification.js → process/processTraceSpecification.js} +1 -1
- package/dist/domain/propertyListKeys.js +1 -1
- package/dist/domain/propertyListXmlText.js +19 -0
- package/dist/domain/providerAdapterError.js +1 -1
- package/dist/domain/providerOperationHealth.js +54 -0
- package/dist/domain/providerSelectionError.js +4 -2
- package/dist/domain/reconstructionVerification.js +9 -46
- package/dist/domain/reconstructionVerificationSchemas.js +3 -3
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +9 -46
- package/dist/domain/webBundleAnalysis.js +20 -8
- package/dist/domain/webBundleAnalyzerInspection.js +13 -8
- package/dist/domain/webBundleAnalyzerResult.js +41 -2
- package/dist/domain/webCaptureDiff.js +1 -0
- package/dist/domain/webNetworkCapture.js +118 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +19 -5
- package/dist/domain/webSourceLocation.js +1 -0
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +4 -2
- package/dist/dotnet/ManagedMemberInspectorCore.js +38 -32
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +23 -7
- package/dist/dotnet/ManagedMemberRows.js +14 -3
- package/dist/dotnet/ManagedMetadataHeaps.js +20 -2
- package/dist/dotnet/ManagedMetadataInventory.js +38 -28
- package/dist/dotnet/ManagedMetadataInventoryRows.js +24 -10
- package/dist/dotnet/ManagedMethodBodyReader.js +7 -1
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +15 -3
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +3 -1
- package/dist/dotnet/ManagedPeReader.js +11 -0
- package/dist/evm/EvmBytecodeCarrier.js +21 -0
- package/dist/evm/EvmWorkerLimits.js +40 -0
- package/dist/evm/EvmoleFailures.js +126 -0
- package/dist/evm/EvmoleInterfaceAdapter.js +53 -0
- package/dist/evm/EvmoleInterfaceProvider.js +273 -0
- package/dist/evm/EvmoleInterfaceWorker.js +87 -0
- package/dist/evm/EvmoleRelease.js +16 -0
- package/dist/firmware/FirmwareCommand.js +1 -0
- package/dist/firmware/FirmwareFiles.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +5 -0
- package/dist/ghidra/GhidraClient.js +47 -14
- package/dist/ghidra/GhidraDiagnostics.js +7 -7
- package/dist/ghidra/GhidraFunctionValues.js +10 -7
- package/dist/ghidra/GhidraInstallation.js +18 -21
- package/dist/ghidra/GhidraInventoryValues.js +14 -4
- package/dist/ghidra/GhidraJavaLaunch.js +62 -0
- package/dist/ghidra/GhidraLauncher.js +34 -16
- package/dist/ghidra/GhidraProvider.js +2 -2
- package/dist/ghidra/GhidraProviderCapabilities.js +15 -3
- package/dist/ghidra/GhidraProviderClient.js +23 -12
- package/dist/ghidra/GhidraSessionError.js +11 -7
- package/dist/ghidra/GhidraTargetSnapshot.js +47 -12
- package/dist/ghidra/GhidraTransport.js +20 -0
- package/dist/hopper/BridgeLauncher.js +33 -11
- package/dist/hopper/HopperAnalysisProfile.js +62 -4
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +222 -14
- package/dist/hopper/HopperFileOffset.js +237 -0
- package/dist/hopper/HopperMachOImage.js +196 -0
- package/dist/hopper/HopperOperationStage.js +6 -0
- package/dist/hopper/HopperProvider.js +63 -9
- package/dist/hopper/HopperProviderCapabilities.js +19 -1
- package/dist/hopper/HopperRegexSearch.js +137 -0
- package/dist/hopper/HopperRegexWorker.js +27 -0
- package/dist/hopper/HopperRequestQueue.js +68 -19
- package/dist/hopper/HopperTargetLease.js +3 -2
- package/dist/hopper/LinuxPrivateDisplayProbe.js +4 -2
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -1
- package/dist/inspector/V8InspectorCaptureProjection.js +8 -3
- package/dist/inspector/V8InspectorProvider.js +47 -11
- package/dist/javascript/recovery/WakaruCommand.js +3 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +47 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +17 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +79 -31
- package/dist/javascript/sourceMaps/TraceSourceMap.js +14 -28
- package/dist/mcpDoctor.js +62 -2
- package/dist/native/AppleDispatchCoverage.js +47 -6
- package/dist/native/AppleDispatchDecodeFacts.js +6 -0
- package/dist/native/AppleDispatchMetadata.js +6 -3
- package/dist/native/AppleMachoFixups.js +48 -24
- package/dist/native/AppleMachoSelection.js +32 -16
- package/dist/native/AppleObjcCategories.js +6 -2
- package/dist/native/AppleObjcDispatchFacets.js +5 -2
- package/dist/native/AppleObjcProperties.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +27 -21
- package/dist/native/AppleSwiftVtables.js +21 -15
- package/dist/native/CommandRunner.js +82 -84
- package/dist/native/LldbCallTracer.js +541 -0
- package/dist/native/LldbRetainedObservations.js +178 -0
- package/dist/native/NativeCallObservation.js +194 -0
- package/dist/native/NativeMacOSProvider.js +117 -20
- package/dist/native/NativeMacOSProviderMetadata.js +8 -3
- package/dist/native/SignatureTargetBinding.js +155 -0
- package/dist/native/parsers/lipo.js +71 -1
- package/dist/native/pwndbg/PwndbgCoreContext.js +180 -0
- package/dist/native/pwntools/PwntoolsDecoder.js +203 -0
- package/dist/native/pwntools/PwntoolsFailures.js +180 -0
- package/dist/native/pwntools/PwntoolsLayoutProvider.js +36 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +75 -0
- package/dist/native/pwntools/PwntoolsRelease.js +19 -0
- package/dist/native/pwntools/PwntoolsResourceLimits.js +76 -0
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +46 -0
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +103 -0
- package/dist/process/DarwinProcessRunTokenReader.js +293 -0
- package/dist/process/ExecFileOutput.js +20 -0
- package/dist/process/OwnedCommand.js +118 -0
- package/dist/process/ProcessOwnership.js +431 -51
- package/dist/process/ProcessOwnershipObservation.js +209 -27
- package/dist/process/ProviderProcess.js +68 -10
- package/dist/{application → process/capture}/ProcessCaptureCapability.js +15 -0
- package/dist/{application → process/capture}/ProcessCaptureError.js +18 -2
- package/dist/process/capture/ProcessCaptureLifecycle.js +681 -0
- package/dist/{application → process/capture}/ProcessHarness.js +195 -29
- package/dist/{application → process/capture}/ProcessSampling.js +2 -2
- package/dist/server/EvidenceMcpServer.js +146 -0
- package/dist/server/createServer.js +37 -8
- package/dist/server/promptCompletion.js +10 -3
- package/dist/server/registerAndroidTools.js +2 -4
- package/dist/server/registerApplicationTools/helpers.js +2 -4
- package/dist/server/registerArtifactComparisonTool.js +11 -7
- package/dist/server/registerBinaryDiagnosticsTools.js +15 -0
- package/dist/server/registerBrowserScenarioTool.js +2 -4
- package/dist/server/registerBrowserTools.js +2 -4
- package/dist/server/registerBundleComparisonTool.js +2 -3
- package/dist/server/registerCloseLifecycleTool.js +8 -18
- package/dist/server/registerElectronTools.js +2 -4
- package/dist/server/registerEnhancedTools.js +18 -59
- package/dist/server/registerEvidenceTools.js +3 -5
- package/dist/server/registerEvmTools.js +15 -0
- package/dist/server/registerFirmwareTools.js +2 -4
- package/dist/server/registerFunctionComparisonTool.js +10 -6
- package/dist/server/registerInvestigationTools.js +7 -7
- package/dist/server/registerJavaScriptRecoveryTool.js +2 -4
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -4
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +2 -4
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +2 -4
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -4
- package/dist/server/registerOfficialTools.js +2 -4
- package/dist/server/registerProcessComparisonTool.js +72 -46
- package/dist/server/registerRecordedCrashTools.js +15 -0
- package/dist/server/registerSessionRecordTools.js +5 -6
- package/dist/server/registerSessionStatusTool.js +17 -3
- package/dist/server/registerSessionTools.js +13 -5
- package/dist/server/registerWebModuleTool.js +2 -4
- package/dist/server/registerWebNetworkCaptureTool.js +26 -0
- package/dist/server/registerWebRuntimeTools.js +3 -7
- package/dist/server/registerWebScriptTool.js +2 -4
- package/dist/server/registerWebSourceLocationTool.js +2 -4
- package/dist/server/runDerivedOperation.js +15 -3
- package/dist/server/sessionAvailabilityPolicy.js +3 -1
- package/dist/server/sessionToolPolicies.js +1 -1
- package/dist/server/toolRegistrationOptions.js +2 -2
- package/dist/server/toolResult.js +63 -11
- package/dist/server/toolResultEncoding.js +33 -0
- package/install.sh +1 -1
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +42 -9
- package/scripts/electron-active-hook-boundaries.cjs +18 -20
- package/scripts/electron-active-hook.cjs +241 -37
- package/scripts/rea.mjs +11 -3
- package/skills/reverse-engineer-anything/SKILL.md +32 -4
- package/skills/reverse-engineer-anything/references/javascript-applications.md +8 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +29 -0
- package/third_party/README.md +60 -0
- package/third_party/evmole/LICENSE +21 -0
- package/third_party/evmole/README.md +22 -0
- package/third_party/pwndbg/LICENSE.md +21 -0
- package/third_party/pwndbg/README.md +23 -0
- package/third_party/pwntools/README.md +40 -0
- package/dist/application/AuthorizedArtifactInventory.js +0 -7
- package/dist/application/ProcessCaptureLifecycle.js +0 -299
- package/dist/application/StoreFileLock.js +0 -124
- package/dist/contracts/processCaptureExample.js +0 -2
- package/dist/domain/bytecodeProvider.js +0 -178
- package/dist/domain/customProtocolCapture.js +0 -137
- package/dist/domain/eventProcessTree.js +0 -225
- package/dist/domain/mobileApplicationInvestigation.js +0 -159
- package/dist/domain/packageAnalysis.js +0 -123
- package/dist/domain/peInspection.js +0 -197
- package/dist/domain/processCaptureParsing.js +0 -21
- package/dist/domain/protocolCapture.js +0 -217
- package/dist/domain/runtimeIdentification.js +0 -212
- package/dist/generatedMcpToolCatalog.js +0 -37
- package/dist/ghidra/GhidraDefaults.js +0 -2
- /package/dist/application/{ArtifactExtractionDestination.js → artifacts/ArtifactExtractionDestination.js} +0 -0
- /package/dist/{application/ArtifactInventory → artifacts/inventory}/policy.js +0 -0
- /package/dist/{application/ArtifactInventory → artifacts/inventory}/types.js +0 -0
- /package/dist/domain/{processEvidenceProvider.js → process/processEvidenceProvider.js} +0 -0
- /package/dist/domain/{processTraceComparison.js → process/processTraceComparison.js} +0 -0
- /package/dist/domain/{processTraceDimensionProjection.js → process/processTraceDimensionProjection.js} +0 -0
- /package/dist/domain/{processTraceEvaluation.js → process/processTraceEvaluation.js} +0 -0
- /package/dist/{application → process/capture}/FilesystemSnapshot.js +0 -0
- /package/dist/{application → process/capture}/ProcessCaptureEnvironment.js +0 -0
- /package/dist/{application → process/capture}/ProcessCaptureJournal.js +0 -0
- /package/dist/{application → process/capture}/ProcessFilesystemEffects.js +0 -0
- /package/dist/{application → process/capture}/ProcessNormalization.js +0 -0
- /package/dist/{application → process/capture}/ProcessScenarioRuntimeValidation.js +0 -0
- /package/dist/{application → process/capture}/ProcessTimer.js +0 -0
- /package/dist/{application → process/capture}/TerminalRenderer.js +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { AnalysisAccessDeniedError, AnalysisArtifactChangedError, AnalysisInputError, AnalysisOutputError, AnalysisCapabilityUnavailableError, AnalysisResourceConstraintError, } from "./analysisErrorCore.js";
|
|
2
|
+
import { redactExplicitText } from "./explicitSensitiveValues.js";
|
|
3
|
+
import { ProviderAdapterError } from "./providerAdapterError.js";
|
|
4
|
+
import { ProviderCleanupError } from "./providerCleanupError.js";
|
|
5
|
+
/** Keep a real JSON-pointer ancestor when a property identity is explicitly excluded. */
|
|
6
|
+
export const redactExplicitPointer = (pointer, values) => {
|
|
7
|
+
let parent = "";
|
|
8
|
+
for (const segment of pointer.split("/").slice(1)) {
|
|
9
|
+
const decoded = segment.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
10
|
+
const child = `${parent}/${segment}`;
|
|
11
|
+
if (values.some((literal) => decoded.includes(literal) || child.includes(literal)))
|
|
12
|
+
return parent;
|
|
13
|
+
parent = child;
|
|
14
|
+
}
|
|
15
|
+
return parent;
|
|
16
|
+
};
|
|
17
|
+
/** Exclude explicit literals from common acquisition/decoder failures, preserving typed diagnostics. */
|
|
18
|
+
export const redactExplicitFailure = (error, values) => {
|
|
19
|
+
if (values.length === 0)
|
|
20
|
+
return error;
|
|
21
|
+
const text = (value) => redactExplicitText(value, values);
|
|
22
|
+
const path = (parts, ordinaryNames) => {
|
|
23
|
+
const retained = [];
|
|
24
|
+
for (const part of parts) {
|
|
25
|
+
if (typeof part !== "string") {
|
|
26
|
+
retained.push(part);
|
|
27
|
+
}
|
|
28
|
+
else if (!ordinaryNames && part.startsWith("/")) {
|
|
29
|
+
const pointer = redactExplicitPointer(part, values);
|
|
30
|
+
retained.push(pointer);
|
|
31
|
+
if (pointer !== part)
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (values.some((literal) => part.includes(literal)))
|
|
36
|
+
break;
|
|
37
|
+
retained.push(part);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return retained;
|
|
41
|
+
};
|
|
42
|
+
const diagnostics = (value) => Object.fromEntries(Object.entries(value)
|
|
43
|
+
.filter(([key]) => !values.some((literal) => key.includes(literal)))
|
|
44
|
+
.map(([key, item]) => [key, visit(item)]));
|
|
45
|
+
const visit = (value) => {
|
|
46
|
+
if (typeof value === "string")
|
|
47
|
+
return text(value);
|
|
48
|
+
if (Array.isArray(value))
|
|
49
|
+
return value.map(visit);
|
|
50
|
+
if (typeof value === "object" && value !== null)
|
|
51
|
+
return diagnostics(value);
|
|
52
|
+
return value;
|
|
53
|
+
};
|
|
54
|
+
if (error instanceof AnalysisAccessDeniedError)
|
|
55
|
+
return new AnalysisAccessDeniedError(error.operation, text(error.path), error.systemCode, { cause: error });
|
|
56
|
+
if (error instanceof AnalysisArtifactChangedError)
|
|
57
|
+
return new AnalysisArtifactChangedError(error.operation, text(error.path), text(error.reason), { cause: error });
|
|
58
|
+
if (error instanceof AnalysisInputError)
|
|
59
|
+
return new AnalysisInputError(error.operation, { cause: error }, error.issues.map((issue) => ({
|
|
60
|
+
...issue,
|
|
61
|
+
// Unknown-argument paths contain literal field names, including names
|
|
62
|
+
// beginning with '/'; they are not producer JSON-pointer coordinates.
|
|
63
|
+
path: path(issue.path, issue.reason === "unknown_argument"),
|
|
64
|
+
...(issue.message === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: { message: text(issue.message) }),
|
|
67
|
+
...(issue.expected === undefined
|
|
68
|
+
? {}
|
|
69
|
+
: { expected: visit(issue.expected) }),
|
|
70
|
+
})));
|
|
71
|
+
if (error instanceof AnalysisOutputError)
|
|
72
|
+
return new AnalysisOutputError(error.operation, text(error.reason), {
|
|
73
|
+
cause: error,
|
|
74
|
+
});
|
|
75
|
+
if (error instanceof AnalysisCapabilityUnavailableError)
|
|
76
|
+
return new AnalysisCapabilityUnavailableError(error.providerId, error.operation, text(error.reason), {
|
|
77
|
+
cause: error,
|
|
78
|
+
...(error.userMessage === undefined
|
|
79
|
+
? {}
|
|
80
|
+
: { userMessage: text(error.userMessage) }),
|
|
81
|
+
});
|
|
82
|
+
if (error instanceof AnalysisResourceConstraintError)
|
|
83
|
+
return new AnalysisResourceConstraintError(error.operation, error.resource, text(error.reason), error.reportedLimits === null ? null : diagnostics(error.reportedLimits), {
|
|
84
|
+
cause: error,
|
|
85
|
+
...(error.remediationAction === undefined
|
|
86
|
+
? {}
|
|
87
|
+
: { remediationAction: text(error.remediationAction) }),
|
|
88
|
+
...(error.capturedOutput === undefined
|
|
89
|
+
? {}
|
|
90
|
+
: {
|
|
91
|
+
capturedOutput: {
|
|
92
|
+
stdout: text(error.capturedOutput.stdout),
|
|
93
|
+
stderr: text(error.capturedOutput.stderr),
|
|
94
|
+
truncated: error.capturedOutput.truncated,
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
if (error instanceof ProviderCleanupError)
|
|
99
|
+
return new ProviderCleanupError(error.providerId, error.cleanupResources.map(text), diagnostics(error.diagnostics ?? {}), { operation: error.operation, cause: error });
|
|
100
|
+
if (error instanceof ProviderAdapterError)
|
|
101
|
+
return new ProviderAdapterError(error.providerId, error.operation, {
|
|
102
|
+
cause: error,
|
|
103
|
+
...(error.diagnostics === undefined
|
|
104
|
+
? {}
|
|
105
|
+
: { diagnostics: diagnostics(error.diagnostics) }),
|
|
106
|
+
});
|
|
107
|
+
return error;
|
|
108
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Replace caller-declared literal text values without guessing sensitivity from names. */
|
|
2
|
+
export const redactExplicitText = (value, sensitiveValues) => {
|
|
3
|
+
const literals = [...new Set(sensitiveValues)].filter((literal) => literal !== "");
|
|
4
|
+
const replacement = ["[REDACTED]", "…", ""].find((candidate) => literals.every((literal) => !candidate.includes(literal))) ?? "";
|
|
5
|
+
let result = value;
|
|
6
|
+
for (const literal of literals.sort((left, right) => right.length - left.length))
|
|
7
|
+
result = result.replaceAll(literal, replacement);
|
|
8
|
+
// Replacement boundaries can form another declaration; exclude that text.
|
|
9
|
+
return literals.some((literal) => result.includes(literal)) ? "" : result;
|
|
10
|
+
};
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { digestSchema } from "../digests.js";
|
|
3
3
|
import { jsonValueSchema } from "../jsonValue.js";
|
|
4
|
+
import { isAbsoluteLocalPath, localPathStringSchema } from "../localPath.js";
|
|
4
5
|
const bytes = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
5
6
|
const range = z.strictObject({ offset: bytes, length: bytes.positive() });
|
|
6
7
|
const target = {
|
|
7
|
-
path:
|
|
8
|
+
path: localPathStringSchema
|
|
9
|
+
.refine(isAbsoluteLocalPath, {
|
|
10
|
+
message: "path must be an absolute local filesystem path (for example /tmp/firmware.bin or C:\\firmware\\firmware.bin)",
|
|
11
|
+
})
|
|
12
|
+
.describe("Absolute local firmware file; never executed. Relative paths are rejected."),
|
|
8
13
|
};
|
|
9
14
|
/** Explicit firmware inspection and extraction intent, independent of engines. */
|
|
10
15
|
export const firmwareInputSchemas = {
|
|
11
16
|
inspect_firmware_regions: z.strictObject(target),
|
|
12
17
|
extract_firmware: z.strictObject({
|
|
13
18
|
...target,
|
|
14
|
-
output_directory:
|
|
15
|
-
.
|
|
16
|
-
|
|
19
|
+
output_directory: localPathStringSchema
|
|
20
|
+
.refine(isAbsoluteLocalPath, {
|
|
21
|
+
message: "output_directory must be an absolute local filesystem path",
|
|
22
|
+
})
|
|
17
23
|
.describe("Absolute, absent output directory; parent must exist"),
|
|
18
24
|
range: range
|
|
19
25
|
.optional()
|
|
@@ -9,13 +9,19 @@ export class HopperTimeoutError extends HopperError {
|
|
|
9
9
|
operation;
|
|
10
10
|
requestId;
|
|
11
11
|
providerState;
|
|
12
|
+
stage;
|
|
13
|
+
launcherOutcome;
|
|
12
14
|
_tag = "HopperTimeoutError";
|
|
13
|
-
constructor(timeoutMs, operation, requestId, providerState = "not_started"
|
|
15
|
+
constructor(timeoutMs, operation, requestId, providerState = "not_started", stage = operation === undefined
|
|
16
|
+
? "launch"
|
|
17
|
+
: "analysis", launcherOutcome) {
|
|
14
18
|
super(`Hopper ${operation === undefined ? "startup" : operation} timed out after ${String(timeoutMs)}ms`);
|
|
15
19
|
this.timeoutMs = timeoutMs;
|
|
16
20
|
this.operation = operation;
|
|
17
21
|
this.requestId = requestId;
|
|
18
22
|
this.providerState = providerState;
|
|
23
|
+
this.stage = stage;
|
|
24
|
+
this.launcherOutcome = launcherOutcome;
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
/** The caller cancelled a Hopper operation before it completed. */
|
|
@@ -51,18 +57,31 @@ export class HopperProcessError extends HopperError {
|
|
|
51
57
|
diagnostic;
|
|
52
58
|
operation;
|
|
53
59
|
requestId;
|
|
60
|
+
launcherFailure;
|
|
54
61
|
_tag = "HopperProcessError";
|
|
55
62
|
failureCode;
|
|
56
63
|
userMessage;
|
|
57
|
-
|
|
64
|
+
providerState;
|
|
65
|
+
stage;
|
|
66
|
+
constructor(exitCode, diagnostic, operation, requestId, providerState, stage, launcherFailure) {
|
|
58
67
|
super(`Hopper bridge stopped unexpectedly with code ${String(exitCode)}`);
|
|
59
68
|
this.exitCode = exitCode;
|
|
60
69
|
this.diagnostic = diagnostic;
|
|
61
70
|
this.operation = operation;
|
|
62
71
|
this.requestId = requestId;
|
|
72
|
+
this.launcherFailure = launcherFailure;
|
|
63
73
|
const failure = hopperStartupFailure(exitCode);
|
|
74
|
+
this.stage =
|
|
75
|
+
stage ??
|
|
76
|
+
(failure === undefined
|
|
77
|
+
? operation === undefined
|
|
78
|
+
? "connection"
|
|
79
|
+
: "analysis"
|
|
80
|
+
: "launch");
|
|
64
81
|
this.failureCode = failure?.code;
|
|
65
82
|
this.userMessage = failure?.message;
|
|
83
|
+
this.providerState =
|
|
84
|
+
providerState ?? (exitCode === null ? "unknown" : "exited");
|
|
66
85
|
}
|
|
67
86
|
}
|
|
68
87
|
/** Hopper or the repository bridge could not be started. */
|
|
@@ -70,9 +89,11 @@ export class HopperStartError extends HopperError {
|
|
|
70
89
|
_tag = "HopperStartError";
|
|
71
90
|
userMessage;
|
|
72
91
|
ownerRunId;
|
|
92
|
+
launcherFailure;
|
|
73
93
|
constructor(options) {
|
|
74
94
|
super("Hopper application bridge could not be started", options);
|
|
75
95
|
this.userMessage = options?.userMessage;
|
|
76
96
|
this.ownerRunId = options?.ownerRunId;
|
|
97
|
+
this.launcherFailure = options?.launcherFailure;
|
|
77
98
|
}
|
|
78
99
|
}
|
|
@@ -39,6 +39,34 @@ const segmentSchema = z.object({
|
|
|
39
39
|
const unavailableAnalysisFactSchema = z
|
|
40
40
|
.object({ available: z.literal(false), reason: z.string() })
|
|
41
41
|
.strict();
|
|
42
|
+
/** Typed string evidence shared by inventories and referenced function literals. */
|
|
43
|
+
export const analysisStringSchema = z.object({
|
|
44
|
+
address: z.string(),
|
|
45
|
+
value: z.string(),
|
|
46
|
+
provider_value: z
|
|
47
|
+
.string()
|
|
48
|
+
.exactOptional()
|
|
49
|
+
.describe("Original provider display text, which may shorten the typed object."),
|
|
50
|
+
decoding: unavailableAnalysisFactSchema
|
|
51
|
+
.exactOptional()
|
|
52
|
+
.describe("When present, value retains native display text because typed bytes could not be decoded."),
|
|
53
|
+
string: z
|
|
54
|
+
.object({
|
|
55
|
+
encoding: z.string().min(1),
|
|
56
|
+
encoding_status: z
|
|
57
|
+
.enum(["observed", "inferred"])
|
|
58
|
+
.exactOptional()
|
|
59
|
+
.describe("Whether the provider declares the encoding or REA infers it from the typed bytes and native display. This does not establish the original source's intended encoding."),
|
|
60
|
+
termination: z.enum(["missing", "present_or_not_required"]),
|
|
61
|
+
byte_length: z.number().int().min(0),
|
|
62
|
+
})
|
|
63
|
+
.exactOptional(),
|
|
64
|
+
});
|
|
65
|
+
/** An analyzed bookmark retains a missing provider label as null. */
|
|
66
|
+
export const analysisBookmarkSchema = z.strictObject({
|
|
67
|
+
address: z.string(),
|
|
68
|
+
name: z.string().nullable(),
|
|
69
|
+
});
|
|
42
70
|
/** Complete observed function-body ranges; every range endpoint is inclusive. */
|
|
43
71
|
export const functionBodySchema = z.discriminatedUnion("available", [
|
|
44
72
|
unavailableAnalysisFactSchema,
|
|
@@ -163,6 +191,13 @@ export const localVariableSchema = z
|
|
|
163
191
|
.object({
|
|
164
192
|
description: z.string(),
|
|
165
193
|
provenance: z.string().min(1),
|
|
194
|
+
name: z.string().nullable().exactOptional(),
|
|
195
|
+
stack_displacement: z
|
|
196
|
+
.string()
|
|
197
|
+
.regex(/^-?\d+$/u)
|
|
198
|
+
.nullable()
|
|
199
|
+
.exactOptional()
|
|
200
|
+
.describe("Observed signed stack byte displacement, encoded as decimal to preserve precision."),
|
|
166
201
|
})
|
|
167
202
|
.strict();
|
|
168
203
|
/** Provider-neutral complete raw-instruction list for one analyzed function. */
|
|
@@ -197,13 +232,26 @@ export const referenceKindSchema = z.discriminatedUnion("available", [
|
|
|
197
232
|
unavailableAnalysisFactSchema,
|
|
198
233
|
availableReferenceKindSchema,
|
|
199
234
|
]);
|
|
200
|
-
|
|
235
|
+
/** Reported call sites without resolved targets; unreported dispatch stays unknown. */
|
|
236
|
+
export const unresolvedCallSchema = z.strictObject({
|
|
237
|
+
address: z.string(),
|
|
238
|
+
reason: z.string(),
|
|
239
|
+
});
|
|
240
|
+
/** Observed endpoints with complete or partial reference classification evidence. */
|
|
241
|
+
export const referenceEdgeSchema = z
|
|
201
242
|
.object({
|
|
202
243
|
source_address: z.string(),
|
|
203
244
|
target_address: z.string(),
|
|
204
245
|
source_procedure: procedureIdentitySchema.nullable(),
|
|
205
246
|
target_procedure: procedureIdentitySchema.nullable(),
|
|
206
247
|
kind: referenceKindSchema,
|
|
248
|
+
call: z
|
|
249
|
+
.strictObject({
|
|
250
|
+
classification: z.enum(["none", "unknown", "direct", "objective_c"]),
|
|
251
|
+
provider_type: z.number().int(),
|
|
252
|
+
provenance: z.string().min(1),
|
|
253
|
+
})
|
|
254
|
+
.exactOptional(),
|
|
207
255
|
})
|
|
208
256
|
.strict();
|
|
209
257
|
export const functionDossierSchema = z
|
|
@@ -225,13 +273,8 @@ export const functionDossierSchema = z
|
|
|
225
273
|
callees: z.array(procedureIdentitySchema),
|
|
226
274
|
incoming_references: z.array(referenceEdgeSchema),
|
|
227
275
|
outgoing_references: z.array(referenceEdgeSchema),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
address: z.string(),
|
|
231
|
-
value: z.string(),
|
|
232
|
-
source_address: z.string(),
|
|
233
|
-
})
|
|
234
|
-
.strict()),
|
|
276
|
+
unresolved_calls: z.array(unresolvedCallSchema).exactOptional(),
|
|
277
|
+
referenced_strings: z.array(analysisStringSchema.extend({ source_address: z.string() })),
|
|
235
278
|
referenced_names: z.array(z
|
|
236
279
|
.object({
|
|
237
280
|
address: z.string(),
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
const immutableSnapshots = new WeakSet();
|
|
2
|
+
/** Recognize an owned JSON snapshot sealed by this module, or an immutable scalar. */
|
|
3
|
+
export const isImmutableJsonSnapshot = (value) => value === null ||
|
|
4
|
+
typeof value === "string" ||
|
|
5
|
+
typeof value === "boolean" ||
|
|
6
|
+
(typeof value === "number" && Number.isFinite(value)) ||
|
|
7
|
+
(typeof value === "object" && immutableSnapshots.has(value));
|
|
8
|
+
/** Seal an already parsed, owned JSON snapshot for immutable zero-copy reuse. */
|
|
9
|
+
export const freezeJsonSnapshot = (value) => {
|
|
10
|
+
const pending = [{ value, exiting: false }];
|
|
11
|
+
// These sets exist only during traversal, while the owned root already
|
|
12
|
+
// retains every child. Strong sets avoid per-node ephemeron GC work.
|
|
13
|
+
const visited = new Set();
|
|
14
|
+
const ancestors = new Set();
|
|
15
|
+
const objects = [];
|
|
16
|
+
while (pending.length > 0) {
|
|
17
|
+
const entry = pending.pop();
|
|
18
|
+
if (entry === undefined)
|
|
19
|
+
break;
|
|
20
|
+
const item = entry.value;
|
|
21
|
+
if (entry.exiting && typeof item === "object" && item !== null) {
|
|
22
|
+
ancestors.delete(item);
|
|
23
|
+
visited.add(item);
|
|
24
|
+
objects.push(item);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (isImmutableJsonSnapshot(item))
|
|
28
|
+
continue;
|
|
29
|
+
if (typeof item !== "object" || item === null)
|
|
30
|
+
throw new TypeError("Immutable JSON snapshots require JSON values");
|
|
31
|
+
if (ancestors.has(item))
|
|
32
|
+
throw new TypeError("Immutable JSON snapshots cannot contain circular references");
|
|
33
|
+
if (visited.has(item))
|
|
34
|
+
continue;
|
|
35
|
+
ancestors.add(item);
|
|
36
|
+
pending.push({ value: item, exiting: true });
|
|
37
|
+
pushSnapshotChildren(item, pending);
|
|
38
|
+
}
|
|
39
|
+
// Register only after every value is checked and every object is frozen.
|
|
40
|
+
// An arbitrary Object.freeze call cannot forge this snapshot identity.
|
|
41
|
+
for (const item of objects)
|
|
42
|
+
Object.freeze(item);
|
|
43
|
+
// Register the requested root, rather than retaining weak entries for every
|
|
44
|
+
// nested object. Sealing an Evidence or bundle skips previously sealed roots.
|
|
45
|
+
if (typeof value === "object" && value !== null)
|
|
46
|
+
immutableSnapshots.add(value);
|
|
47
|
+
return value;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Seal exclusively owned JSON in bounded steps, authenticating only completion.
|
|
51
|
+
* Abandonment or failure can leave the provisional input partly frozen.
|
|
52
|
+
*/
|
|
53
|
+
export function* freezeOwnedJsonSnapshotSteps(value) {
|
|
54
|
+
const pending = [{ value, exiting: false }];
|
|
55
|
+
const visited = new Set();
|
|
56
|
+
const ancestors = new Set();
|
|
57
|
+
let examined = 0;
|
|
58
|
+
try {
|
|
59
|
+
while (pending.length > 0) {
|
|
60
|
+
if (examined++ === 4096) {
|
|
61
|
+
examined = 0;
|
|
62
|
+
yield;
|
|
63
|
+
}
|
|
64
|
+
const entry = pending.pop();
|
|
65
|
+
if (entry === undefined)
|
|
66
|
+
break;
|
|
67
|
+
const item = entry.value;
|
|
68
|
+
if (entry.exiting && typeof item === "object" && item !== null) {
|
|
69
|
+
ancestors.delete(item);
|
|
70
|
+
visited.add(item);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (isImmutableJsonSnapshot(item))
|
|
74
|
+
continue;
|
|
75
|
+
if (typeof item !== "object" || item === null)
|
|
76
|
+
throw new TypeError("Immutable JSON snapshots require JSON values");
|
|
77
|
+
if (ancestors.has(item))
|
|
78
|
+
throw new TypeError("Immutable JSON snapshots cannot contain circular references");
|
|
79
|
+
if (visited.has(item))
|
|
80
|
+
continue;
|
|
81
|
+
ancestors.add(item);
|
|
82
|
+
pending.push({ value: item, exiting: true });
|
|
83
|
+
pushSnapshotChildren(item, pending);
|
|
84
|
+
// Lock every inspected edge before the scheduler can release control.
|
|
85
|
+
Object.freeze(item);
|
|
86
|
+
}
|
|
87
|
+
if (typeof value === "object" && value !== null)
|
|
88
|
+
immutableSnapshots.add(value);
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
pending.length = 0;
|
|
93
|
+
visited.clear();
|
|
94
|
+
ancestors.clear();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const pushSnapshotChildren = (item, pending) => {
|
|
98
|
+
const prototype = Object.getPrototypeOf(item);
|
|
99
|
+
if (!Array.isArray(item) &&
|
|
100
|
+
prototype !== Object.prototype &&
|
|
101
|
+
prototype !== null)
|
|
102
|
+
throw new TypeError("Immutable JSON snapshots require ordinary objects");
|
|
103
|
+
if (Array.isArray(item))
|
|
104
|
+
for (let index = 0; index < item.length; index += 1)
|
|
105
|
+
if (!Object.hasOwn(item, index))
|
|
106
|
+
throw new TypeError("Immutable JSON snapshots cannot contain sparse arrays");
|
|
107
|
+
for (const key of Object.getOwnPropertyNames(item)) {
|
|
108
|
+
const descriptor = Object.getOwnPropertyDescriptor(item, key);
|
|
109
|
+
if (descriptor === undefined || !Object.hasOwn(descriptor, "value"))
|
|
110
|
+
throw new TypeError("Immutable JSON snapshots cannot contain accessors");
|
|
111
|
+
const child = descriptor.value;
|
|
112
|
+
pending.push({ value: child, exiting: false });
|
|
113
|
+
}
|
|
114
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { AnalysisInputError, } from "./analysisErrorCore.js";
|
|
2
|
+
/** Build the standard application input error while retaining schema causes and extra semantic issues. */
|
|
3
|
+
export const analysisInputErrorFromIssues = (operation, issues, input, options = {}) => new AnalysisInputError(operation, options.cause === undefined ? undefined : { cause: options.cause }, [...projectInputIssues(issues, input), ...(options.additionalIssues ?? [])]);
|
|
1
4
|
/** Project Zod failures to secret-safe caller correction metadata. */
|
|
2
5
|
export const projectInputIssues = (issues, input) => issues.flatMap((issue) => projectIssue(issue, input));
|
|
3
6
|
const projectIssue = (issue, input) => {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
import { isAbsoluteLocalPath, localPathStringSchema } from "../localPath.js";
|
|
3
|
+
const pathInputSchema = localPathStringSchema.refine(isAbsoluteLocalPath, {
|
|
4
|
+
message: "Electron executable, application, and root paths must be absolute local filesystem paths (for example /Applications/Electron.app/Contents/MacOS/Electron)",
|
|
5
|
+
});
|
|
3
6
|
const absolutePathSchema = z
|
|
4
7
|
.string()
|
|
5
8
|
.min(1)
|
|
@@ -52,10 +55,14 @@ const actionSchema = z.discriminatedUnion("kind", [
|
|
|
52
55
|
]);
|
|
53
56
|
/** Input for one explicit, provider-owned Electron runtime experiment. */
|
|
54
57
|
export const electronActiveObservationInputSchema = z.strictObject({
|
|
55
|
-
executable_path: pathInputSchema,
|
|
56
|
-
application_path: pathInputSchema,
|
|
57
|
-
application_root: pathInputSchema
|
|
58
|
-
|
|
58
|
+
executable_path: pathInputSchema.describe("Absolute local filesystem path for the Electron executable; relative paths are rejected."),
|
|
59
|
+
application_path: pathInputSchema.describe("Absolute local filesystem path for the Electron application; relative paths are rejected."),
|
|
60
|
+
application_root: pathInputSchema
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Absolute local filesystem root for application-relative paths; omit to derive it from the application path. Relative paths are rejected."),
|
|
63
|
+
args: z
|
|
64
|
+
.array(z.string().regex(/^[^\0]*$/u, "Electron arguments must not contain NUL"))
|
|
65
|
+
.default([]),
|
|
59
66
|
actions: z.array(actionSchema).default([]),
|
|
60
67
|
});
|
|
61
68
|
const ipcEventSchema = z.strictObject({
|
|
@@ -230,13 +237,37 @@ export const electronActiveObservationResultSchema = z.strictObject({
|
|
|
230
237
|
ipc: z.strictObject({
|
|
231
238
|
events: z.array(ipcEventSchema),
|
|
232
239
|
observed: z.number().int().min(0),
|
|
240
|
+
dropped: z.number().int().min(0).nullable().default(null),
|
|
233
241
|
}),
|
|
234
242
|
timeline: z
|
|
235
243
|
.strictObject({
|
|
236
244
|
events: z.array(timelineEventSchema),
|
|
237
245
|
observed: z.number().int().min(0),
|
|
246
|
+
dropped: z.number().int().min(0).nullable().default(null),
|
|
247
|
+
})
|
|
248
|
+
.default({ events: [], observed: 0, dropped: null }),
|
|
249
|
+
retention: z
|
|
250
|
+
.strictObject({
|
|
251
|
+
budget_bytes: z.number().int().min(0),
|
|
252
|
+
estimated_retained_bytes: z.number().int().min(0),
|
|
253
|
+
event_serialized_byte_upper_bound: z.number().int().min(0),
|
|
254
|
+
retained: z.number().int().min(0),
|
|
255
|
+
dropped: z.number().int().min(0),
|
|
256
|
+
dropped_event_families: z.array(z.strictObject({
|
|
257
|
+
family: z.string().min(1),
|
|
258
|
+
count: z.number().int().min(1),
|
|
259
|
+
})),
|
|
260
|
+
dropped_event_roles: z.array(z.strictObject({
|
|
261
|
+
role: z.string().min(1),
|
|
262
|
+
count: z.number().int().min(1),
|
|
263
|
+
})),
|
|
264
|
+
observed_ipc: z.number().int().min(0),
|
|
265
|
+
dropped_ipc: z.number().int().min(0),
|
|
266
|
+
observed_runtime: z.number().int().min(0),
|
|
267
|
+
dropped_runtime: z.number().int().min(0),
|
|
238
268
|
})
|
|
239
|
-
.
|
|
269
|
+
.nullable()
|
|
270
|
+
.default(null),
|
|
240
271
|
coverage: coverageSchema.default({
|
|
241
272
|
status: "partial_attach",
|
|
242
273
|
observed_event_families: [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { compareCodePoints } from "../canonicalOrdering.js";
|
|
3
|
-
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
|
|
3
|
+
import { readExactJavaScriptLiteral, semanticStaticPropertyName, } from "./javascriptAstValues.js";
|
|
4
4
|
import { sourceSlice } from "./javascriptStaticAnalysisHelpers.js";
|
|
5
5
|
/** Preserve one literal value or the exact inert expression. */
|
|
6
6
|
export const electronStaticValue = (source, node) => {
|
|
@@ -101,17 +101,11 @@ const collectMembersAt = (object, prefix, depth, state) => {
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
const literalValue = (node) => {
|
|
104
|
-
if (
|
|
105
|
-
return { found:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return { found: true, value: null };
|
|
110
|
-
if (t.isTemplateLiteral(node) && node.expressions.length === 0)
|
|
111
|
-
return {
|
|
112
|
-
found: true,
|
|
113
|
-
value: node.quasis[0]?.value.cooked ?? node.quasis[0]?.value.raw ?? "",
|
|
114
|
-
};
|
|
104
|
+
if (node === null || node === undefined)
|
|
105
|
+
return { found: false };
|
|
106
|
+
const literal = readExactJavaScriptLiteral(node);
|
|
107
|
+
if (literal.found)
|
|
108
|
+
return literal;
|
|
115
109
|
if (t.isUnaryExpression(node, { operator: "-" }) &&
|
|
116
110
|
t.isNumericLiteral(node.argument))
|
|
117
111
|
return { found: true, value: -node.argument.value };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defaultTreeAdapter, parse, } from "parse5";
|
|
2
|
+
/** Extract inert HTML script references and the first document base href. */
|
|
3
|
+
export const htmlArtifactReferences = (text) => {
|
|
4
|
+
const pending = [
|
|
5
|
+
parse(text, { sourceCodeLocationInfo: true }),
|
|
6
|
+
];
|
|
7
|
+
const scripts = [];
|
|
8
|
+
let baseHref = null;
|
|
9
|
+
while (pending.length > 0) {
|
|
10
|
+
const node = pending.pop();
|
|
11
|
+
if (node === undefined)
|
|
12
|
+
continue;
|
|
13
|
+
if (defaultTreeAdapter.isElementNode(node) &&
|
|
14
|
+
node.namespaceURI === "http://www.w3.org/1999/xhtml") {
|
|
15
|
+
if (node.tagName === "base" && baseHref === null) {
|
|
16
|
+
const href = node.attrs.find(({ name }) => name === "href");
|
|
17
|
+
if (href !== undefined)
|
|
18
|
+
baseHref = href.value;
|
|
19
|
+
}
|
|
20
|
+
if (node.tagName === "script") {
|
|
21
|
+
const src = node.attrs.find(({ name }) => name === "src");
|
|
22
|
+
const location = node.sourceCodeLocation?.startTag;
|
|
23
|
+
if (src !== undefined && src.value !== "" && location !== undefined) {
|
|
24
|
+
scripts.push({
|
|
25
|
+
scriptPath: src.value,
|
|
26
|
+
startOffset: location.startOffset,
|
|
27
|
+
endOffset: location.endOffset,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Template content belongs to a separate inert document fragment. Only
|
|
33
|
+
// traverse the actual document children, without recursion on deep input.
|
|
34
|
+
if ("childNodes" in node) {
|
|
35
|
+
for (const child of node.childNodes.toReversed())
|
|
36
|
+
pending.push(child);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { baseHref, scripts };
|
|
40
|
+
};
|