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,7 +1,7 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { semanticCapturePosition, semanticEscapeFollowsCapture, semanticBindingPrecedesCapture, } from "./javascriptSemanticMutationInitializers.js";
|
|
3
3
|
import { semanticSlotAtPath } from "./javascriptSemanticSlots.js";
|
|
4
|
-
import { invalidateSemanticEscapedPath,
|
|
4
|
+
import { invalidateSemanticEscapedPath, invalidateSemanticMutationPaths, } from "./javascriptSemanticMutationValues.js";
|
|
5
5
|
import { resolveSemanticBindingState, } from "./javascriptSemanticState.js";
|
|
6
6
|
import { semanticRequireOrigin } from "./javascriptSemanticRequireOrigin.js";
|
|
7
7
|
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
|
|
@@ -91,21 +91,33 @@ const evaluateBinding = (binding, context) => {
|
|
|
91
91
|
const initializer = binding.initializers[0];
|
|
92
92
|
if (initializer === undefined)
|
|
93
93
|
return { status: "unknown", reason: "Missing binding initializer." };
|
|
94
|
-
|
|
95
|
-
let value
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
context.bindings.add(binding.bindingId);
|
|
95
|
+
let value;
|
|
96
|
+
try {
|
|
97
|
+
const nested = nestedContext(context);
|
|
98
|
+
value = projectValue(evaluateExpression(initializer.node, nested), initializer.projection);
|
|
99
|
+
if (!isPrimitive(value)) {
|
|
100
|
+
const captureContext = primitiveCaptureContext(initializer.node, nested);
|
|
101
|
+
if (captureContext !== undefined) {
|
|
102
|
+
const captured = projectValue(evaluateExpression(initializer.node, captureContext), initializer.projection);
|
|
103
|
+
if (isPrimitive(captured))
|
|
104
|
+
value = captured;
|
|
105
|
+
}
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
finally {
|
|
109
|
+
context.bindings.delete(binding.bindingId);
|
|
110
|
+
}
|
|
111
|
+
let projected = invalidateSemanticMutationPaths(value, binding.mutatedPaths);
|
|
112
|
+
for (const escape of binding.escapedPaths) {
|
|
113
|
+
// Escapes only invalidate object references; other lattice values survive.
|
|
114
|
+
if (projected.status !== "object" && projected.status !== "array")
|
|
115
|
+
break;
|
|
116
|
+
if (context.capturePoint !== undefined &&
|
|
117
|
+
semanticEscapeFollowsCapture(binding, context.capturePoint, escape.node, context.state.parentsByNode))
|
|
118
|
+
continue;
|
|
119
|
+
projected = invalidateSemanticEscapedPath(projected, escape.path);
|
|
120
|
+
}
|
|
109
121
|
// Point-local memoization also bounds failed speculative captures. Only a
|
|
110
122
|
// primitive result is allowed back into ordinary value evaluation.
|
|
111
123
|
if (context.capturePoint !== undefined ||
|
|
@@ -395,6 +407,17 @@ const projectValue = (value, projection) => {
|
|
|
395
407
|
};
|
|
396
408
|
};
|
|
397
409
|
const provenanceForBinding = (binding, context) => {
|
|
410
|
+
const provenance = provenanceForBindingValue(binding, context);
|
|
411
|
+
const assigned = binding.definitions.some(({ kind }) => kind === "assignment");
|
|
412
|
+
const conditionallyInitialized = binding.initializers.some(({ node }) => context.state.conditionalInitializers.has(node));
|
|
413
|
+
if (provenance.status !== "module" ||
|
|
414
|
+
(!assigned && !conditionallyInitialized))
|
|
415
|
+
return provenance;
|
|
416
|
+
return semanticAmbiguousProvenance(provenance.origins, assigned
|
|
417
|
+
? `Binding ${binding.name} may be reassigned.`
|
|
418
|
+
: `Binding ${binding.name} is conditionally initialized.`);
|
|
419
|
+
};
|
|
420
|
+
const provenanceForBindingValue = (binding, context) => {
|
|
398
421
|
if (context.bindings.has(binding.bindingId))
|
|
399
422
|
return semanticUnresolvedProvenance("cycle", `Alias cycle at ${binding.name}.`);
|
|
400
423
|
if (binding.directOrigins.length > 0)
|
|
@@ -408,7 +431,14 @@ const provenanceForBinding = (binding, context) => {
|
|
|
408
431
|
return semanticUnresolvedProvenance("unknown", "Missing binding initializer.");
|
|
409
432
|
if (initializer.projection.includes(null))
|
|
410
433
|
return semanticUnresolvedProvenance("unknown", "Dynamic provenance projection.");
|
|
411
|
-
|
|
434
|
+
context.bindings.add(binding.bindingId);
|
|
435
|
+
let resolved;
|
|
436
|
+
try {
|
|
437
|
+
resolved = provenanceForExpression(initializer.node, nestedContext(context));
|
|
438
|
+
}
|
|
439
|
+
finally {
|
|
440
|
+
context.bindings.delete(binding.bindingId);
|
|
441
|
+
}
|
|
412
442
|
if (resolved.status !== "module" || initializer.projection.length === 0)
|
|
413
443
|
return resolved;
|
|
414
444
|
return semanticOriginsProvenance(resolved.origins.map((origin) => ({
|
|
@@ -491,16 +521,14 @@ const mergeValues = (values) => {
|
|
|
491
521
|
? primitiveSet(primitives)
|
|
492
522
|
: { status: "ambiguous", reason: "Branches have incompatible values." };
|
|
493
523
|
};
|
|
494
|
-
const nestedContext = (context
|
|
524
|
+
const nestedContext = (context) => ({
|
|
495
525
|
state: context.state,
|
|
496
526
|
primitiveBindingValues: context.primitiveBindingValues,
|
|
497
527
|
...(context.capturePoint === undefined
|
|
498
528
|
? {}
|
|
499
529
|
: { capturePoint: context.capturePoint }),
|
|
500
530
|
expressionDepth: context.expressionDepth + 1,
|
|
501
|
-
bindings:
|
|
502
|
-
? context.bindings
|
|
503
|
-
: new Set([...context.bindings, bindingId]),
|
|
531
|
+
bindings: context.bindings,
|
|
504
532
|
});
|
|
505
533
|
const isPrimitive = (value) => value.status === "literal" || value.status === "union";
|
|
506
534
|
const primitiveCaptureContext = (node, context) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
import {
|
|
2
|
+
import { ELECTRON_IDENTITY_LIMITATION, ELECTRON_MODULE, } from "./javascriptElectronMemberWrites.js";
|
|
3
|
+
import { completeSemanticSteps, traverseJavaScriptAstSteps, } from "./javascriptSemanticTraversal.js";
|
|
3
4
|
import { inspectElectronStaticNode } from "./electronStaticAnalysis.js";
|
|
4
5
|
import { detectVendors, failedJavaScriptStaticAnalysis, registrationKey, sortedUnique, stringValue, } from "./javascriptStaticAnalysisHelpers.js";
|
|
5
|
-
import { addReference, addSourceMapDirectives, inspectCall, inspectRouteProperty, inspectRoleProperty, } from "./javascriptStaticAnalysisCalls.js";
|
|
6
|
+
import { addReference, addSourceMapDirectives, inspectCall, inspectRouteProperty, inspectRoleProperty, inspectRpcNode, } from "./javascriptStaticAnalysisCalls.js";
|
|
6
7
|
import { inspectBundlerRegistration, inspectEsbuildWrapper, } from "./javascriptStaticAnalysisBundler.js";
|
|
7
8
|
import { finalizeLocatedFindings } from "./javascriptStaticAnalysisFindings.js";
|
|
8
9
|
import { createJavaScriptAnalysisAccumulator, } from "./javascriptStaticAnalysisState.js";
|
|
9
|
-
import { classifyParsedJavaScriptOpenReceivers, } from "./javascriptSemanticAnalysis.js";
|
|
10
|
+
import { classifyParsedJavaScriptElectronBindingsSteps, classifyParsedJavaScriptRpcClientRootsSteps, classifyParsedJavaScriptOpenReceivers, } from "./javascriptSemanticAnalysis.js";
|
|
10
11
|
import { parseJavaScriptSource, } from "./javascriptSourceParser.js";
|
|
12
|
+
import { createJavaScriptRpcScan } from "./javascriptRpcEndpoints.js";
|
|
11
13
|
/** Parse one JavaScript artifact and recover static structure only. */
|
|
12
14
|
export const analyzeJavaScriptStaticSource = (source) => {
|
|
13
15
|
const file = parseJavaScriptSource(source);
|
|
@@ -16,21 +18,31 @@ export const analyzeJavaScriptStaticSource = (source) => {
|
|
|
16
18
|
: analyzeParsedJavaScriptStaticSource(source, file, classifyParsedJavaScriptOpenReceivers(file));
|
|
17
19
|
};
|
|
18
20
|
/** Recover static structure from an already parsed JavaScript artifact. */
|
|
19
|
-
export const analyzeParsedJavaScriptStaticSource = (source, file, openReceiverFacts) =>
|
|
21
|
+
export const analyzeParsedJavaScriptStaticSource = (source, file, openReceiverFacts) => completeSemanticSteps(analyzeParsedJavaScriptStaticSourceSteps(source, file, openReceiverFacts));
|
|
22
|
+
/** Static analysis that yields during its source traversal; results are unchanged. */
|
|
23
|
+
export function* analyzeParsedJavaScriptStaticSourceSteps(source, file, openReceiverFacts) {
|
|
20
24
|
const accumulator = createJavaScriptAnalysisAccumulator(source.length);
|
|
21
|
-
|
|
25
|
+
const electronBindings = yield* classifyParsedJavaScriptElectronBindingsSteps(file);
|
|
26
|
+
const clientRoots = yield* classifyParsedJavaScriptRpcClientRootsSteps(file);
|
|
27
|
+
yield* traverseStaticSourceSteps(file, {
|
|
28
|
+
source,
|
|
29
|
+
accumulator,
|
|
30
|
+
...(openReceiverFacts === undefined ? {} : { openReceiverFacts }),
|
|
31
|
+
electronBindings,
|
|
32
|
+
rpcScan: createJavaScriptRpcScan(source, clientRoots),
|
|
33
|
+
});
|
|
22
34
|
addSourceMapDirectives(source, file.comments ?? [], accumulator);
|
|
23
35
|
return finalizeStaticAnalysis(source, file, accumulator);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
}
|
|
37
|
+
function* traverseStaticSourceSteps(file, findings) {
|
|
38
|
+
yield* traverseJavaScriptAstSteps(file, {
|
|
27
39
|
enter: (node) => {
|
|
28
|
-
accumulator.visitedNodes += 1;
|
|
29
|
-
inspectNode(
|
|
40
|
+
findings.accumulator.visitedNodes += 1;
|
|
41
|
+
inspectNode(node, findings);
|
|
30
42
|
return undefined;
|
|
31
43
|
},
|
|
32
44
|
});
|
|
33
|
-
}
|
|
45
|
+
}
|
|
34
46
|
const finalizeStaticAnalysis = (source, file, accumulator) => {
|
|
35
47
|
const parserErrors = file.errors.length;
|
|
36
48
|
const limitations = [
|
|
@@ -44,6 +56,9 @@ const finalizeStaticAnalysis = (source, file, accumulator) => {
|
|
|
44
56
|
: [
|
|
45
57
|
"One or more static keys, expressions, or Electron boundary values were dynamic and remain unknown.",
|
|
46
58
|
]),
|
|
59
|
+
...(accumulator.references.some(({ value }) => value.specifier !== null && ELECTRON_MODULE.test(value.specifier))
|
|
60
|
+
? [ELECTRON_IDENTITY_LIMITATION]
|
|
61
|
+
: []),
|
|
47
62
|
"JavaScript syntax was parsed as data and was never evaluated.",
|
|
48
63
|
];
|
|
49
64
|
return {
|
|
@@ -70,12 +85,8 @@ const finalizeStaticAnalysis = (source, file, accumulator) => {
|
|
|
70
85
|
limitations,
|
|
71
86
|
};
|
|
72
87
|
};
|
|
73
|
-
const inspectNode = (
|
|
74
|
-
const
|
|
75
|
-
source,
|
|
76
|
-
accumulator,
|
|
77
|
-
...(openReceiverFacts === undefined ? {} : { openReceiverFacts }),
|
|
78
|
-
};
|
|
88
|
+
const inspectNode = (node, findings) => {
|
|
89
|
+
const { source, accumulator } = findings;
|
|
79
90
|
inspectElectronStaticNode(node, findings);
|
|
80
91
|
if (t.isCallExpression(node)) {
|
|
81
92
|
inspectBundlerRegistration(source, node, accumulator);
|
|
@@ -110,4 +121,5 @@ const inspectNode = (source, node, accumulator, openReceiverFacts) => {
|
|
|
110
121
|
inspectRouteProperty(node, findings);
|
|
111
122
|
inspectRoleProperty(node, findings);
|
|
112
123
|
}
|
|
124
|
+
inspectRpcNode(node, findings);
|
|
113
125
|
};
|
|
@@ -15,7 +15,7 @@ export const inspectBundlerRegistration = (source, call, accumulator) => {
|
|
|
15
15
|
const runtimeValue = runtimeMetadata(entry.elements[2]);
|
|
16
16
|
if (!t.isArrayExpression(chunkIds) || !t.isObjectExpression(table))
|
|
17
17
|
return;
|
|
18
|
-
const recovered = recoverBundlerModules(source, table, accumulator);
|
|
18
|
+
const recovered = recoverBundlerModules(source, table, runtime, accumulator);
|
|
19
19
|
const chunkKeys = staticArrayValues(chunkIds);
|
|
20
20
|
accumulator.unknownFindings += chunkKeys.unknown;
|
|
21
21
|
accumulator.unknownFindings +=
|
|
@@ -55,13 +55,14 @@ export const inspectEsbuildWrapper = (source, call, accumulator) => {
|
|
|
55
55
|
const table = call.arguments[0];
|
|
56
56
|
if (wrapperKind === null || !t.isObjectExpression(table))
|
|
57
57
|
return;
|
|
58
|
-
const
|
|
58
|
+
const runtime = `esbuild-${wrapperKind}`;
|
|
59
|
+
const recovered = recoverBundlerModules(source, table, runtime, accumulator);
|
|
59
60
|
if (recovered.modules.length === 0)
|
|
60
61
|
return;
|
|
61
62
|
accumulator.unknownFindings += recovered.unknownAsyncChunkKeys;
|
|
62
63
|
const registration = {
|
|
63
64
|
bundler: "esbuild",
|
|
64
|
-
runtime
|
|
65
|
+
runtime,
|
|
65
66
|
chunk_keys: [`${wrapperKind}@${String(call.start ?? 0)}`],
|
|
66
67
|
unknown_chunk_keys: 0,
|
|
67
68
|
runtime_require_name: null,
|
|
@@ -75,12 +76,12 @@ export const inspectEsbuildWrapper = (source, call, accumulator) => {
|
|
|
75
76
|
};
|
|
76
77
|
addFindingOnce(accumulator, `registration\0${registrationKey(registration)}`, () => accumulator.registrations.push(registration));
|
|
77
78
|
};
|
|
78
|
-
const recoverBundlerModules = (source, table, accumulator) => {
|
|
79
|
+
const recoverBundlerModules = (source, table, runtime, accumulator) => {
|
|
79
80
|
const modules = [];
|
|
80
81
|
const asyncChunkKeys = [];
|
|
81
82
|
let unknownAsyncChunkKeys = 0;
|
|
82
83
|
for (const property of table.properties) {
|
|
83
|
-
const recovered = recoverBundlerModule(source, property, accumulator);
|
|
84
|
+
const recovered = recoverBundlerModule(source, property, runtime, accumulator);
|
|
84
85
|
if (recovered === null)
|
|
85
86
|
continue;
|
|
86
87
|
modules.push(recovered.module);
|
|
@@ -93,7 +94,7 @@ const recoverBundlerModules = (source, table, accumulator) => {
|
|
|
93
94
|
unknownAsyncChunkKeys,
|
|
94
95
|
};
|
|
95
96
|
};
|
|
96
|
-
const recoverBundlerModule = (source, property, accumulator) => {
|
|
97
|
+
const recoverBundlerModule = (source, property, runtime, accumulator) => {
|
|
97
98
|
const factory = moduleFactory(property);
|
|
98
99
|
if (factory === undefined)
|
|
99
100
|
return null;
|
|
@@ -109,6 +110,7 @@ const recoverBundlerModule = (source, property, accumulator) => {
|
|
|
109
110
|
start: factory.start,
|
|
110
111
|
end: factory.end,
|
|
111
112
|
key,
|
|
113
|
+
runtime,
|
|
112
114
|
requireName,
|
|
113
115
|
};
|
|
114
116
|
accumulator.moduleRangeIndex.add(moduleRange);
|
|
@@ -32,6 +32,8 @@ export const inspectCall = (source, node, context) => {
|
|
|
32
32
|
addReference(context, { node, kind: "service-worker", specifier: first });
|
|
33
33
|
inspectEndpointCall(node, name, first, context);
|
|
34
34
|
inspectStorageCall(node, name, first, context);
|
|
35
|
+
if (first === "audio" || first === "video")
|
|
36
|
+
noteMediaElementPreloads(node, accumulator);
|
|
35
37
|
if (name.endsWith("loadFile") && first !== undefined)
|
|
36
38
|
addLocatedFinding(context, {
|
|
37
39
|
collection: accumulator.roles,
|
|
@@ -61,6 +63,18 @@ export const inspectCall = (source, node, context) => {
|
|
|
61
63
|
},
|
|
62
64
|
});
|
|
63
65
|
};
|
|
66
|
+
// Element factories such as jsx("audio", props) and createElement("video",
|
|
67
|
+
// props) carry the HTML media `preload` hint ("none", "metadata", "auto"),
|
|
68
|
+
// which never names an Electron preload script.
|
|
69
|
+
const noteMediaElementPreloads = (node, accumulator) => {
|
|
70
|
+
const props = node.arguments[1];
|
|
71
|
+
if (!t.isObjectExpression(props))
|
|
72
|
+
return;
|
|
73
|
+
for (const property of props.properties)
|
|
74
|
+
if (t.isObjectProperty(property) &&
|
|
75
|
+
semanticStaticPropertyName(property.key, property.computed) === "preload")
|
|
76
|
+
accumulator.mediaElementPreloads.add(property);
|
|
77
|
+
};
|
|
64
78
|
const requireCallSpecifier = (node, name, moduleRequireName) => {
|
|
65
79
|
if (name === "require" || name.endsWith(".require"))
|
|
66
80
|
return { specifier: argumentValue(node.arguments[0]) };
|
|
@@ -114,6 +128,12 @@ const inspectEndpointCall = (node, name, first, context) => {
|
|
|
114
128
|
mechanism: `call:${name}`,
|
|
115
129
|
});
|
|
116
130
|
};
|
|
131
|
+
/** Record tRPC procedures, tRPC link URLs and named GraphQL operations. */
|
|
132
|
+
export const inspectRpcNode = (node, context) => {
|
|
133
|
+
const rpc = context.rpcScan.inspect(node);
|
|
134
|
+
if (rpc !== undefined)
|
|
135
|
+
addEndpoint(context, { node, kind: "network", ...rpc });
|
|
136
|
+
};
|
|
117
137
|
export const inspectRouteProperty = (node, context) => {
|
|
118
138
|
const key = semanticStaticPropertyName(node.key, node.computed);
|
|
119
139
|
if ((key === "path" || key === "route") && t.isStringLiteral(node.value))
|
|
@@ -127,6 +147,8 @@ export const inspectRouteProperty = (node, context) => {
|
|
|
127
147
|
export const inspectRoleProperty = (node, context) => {
|
|
128
148
|
if (semanticStaticPropertyName(node.key, node.computed) !== "preload")
|
|
129
149
|
return;
|
|
150
|
+
if (context.accumulator.mediaElementPreloads.has(node))
|
|
151
|
+
return;
|
|
130
152
|
const path = staticPath(node.value);
|
|
131
153
|
if (path === undefined)
|
|
132
154
|
return;
|
|
@@ -213,13 +235,35 @@ export const addSourceMapDirectives = (source, comments, accumulator) => {
|
|
|
213
235
|
end === undefined ||
|
|
214
236
|
end === null)
|
|
215
237
|
continue;
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
238
|
+
const commentSource = source.slice(start, end);
|
|
239
|
+
if (!(commentSource.startsWith("//") || commentSource.startsWith("/*")) ||
|
|
240
|
+
!(commentSource[2] === "#" || commentSource[2] === "@"))
|
|
241
|
+
continue;
|
|
242
|
+
// Single-class searches avoid regex backtracking over unbounded whitespace
|
|
243
|
+
// or inline URLs, which can exhaust the engine stack on two-byte strings.
|
|
244
|
+
const nameOffset = commentSource.slice(3).search(/\S/u);
|
|
245
|
+
if (nameOffset === -1)
|
|
246
|
+
continue;
|
|
247
|
+
const nameStart = 3 + nameOffset;
|
|
248
|
+
if (!commentSource.startsWith("sourceMappingURL", nameStart))
|
|
249
|
+
continue;
|
|
250
|
+
const nameEnd = nameStart + "sourceMappingURL".length;
|
|
251
|
+
const equalsOffset = commentSource.slice(nameEnd).search(/\S/u);
|
|
252
|
+
if (equalsOffset === -1)
|
|
253
|
+
continue;
|
|
254
|
+
const equalsStart = nameEnd + equalsOffset;
|
|
255
|
+
if (!commentSource.startsWith("=", equalsStart))
|
|
256
|
+
continue;
|
|
257
|
+
const urlOffset = commentSource.slice(equalsStart + 1).search(/\S/u);
|
|
258
|
+
if (urlOffset === -1)
|
|
218
259
|
continue;
|
|
219
|
-
const
|
|
220
|
-
|
|
260
|
+
const declaredStart = equalsStart + 1 + urlOffset;
|
|
261
|
+
const terminator = commentSource.slice(declaredStart).search(/[\s*]/u);
|
|
262
|
+
const declaredEnd = terminator === -1 ? commentSource.length : declaredStart + terminator;
|
|
263
|
+
if (declaredEnd === declaredStart)
|
|
221
264
|
continue;
|
|
222
|
-
const
|
|
265
|
+
const declared = commentSource.slice(declaredStart, declaredEnd);
|
|
266
|
+
const location = rangeForOffsets(source, start, start + declaredEnd);
|
|
223
267
|
addFindingOnce(accumulator, `source-map\0${declared}`, () => accumulator.sourceMaps.push({ declared_url: declared, location }));
|
|
224
268
|
}
|
|
225
269
|
};
|
|
@@ -76,7 +76,11 @@ export const addFindingOnce = (accumulator, key, add) => {
|
|
|
76
76
|
add();
|
|
77
77
|
};
|
|
78
78
|
/** Attach recovered bundle-module ownership to findings after traversal. */
|
|
79
|
-
export const finalizeLocatedFindings = (values, modules) => values.map(({ offset, value }) =>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
export const finalizeLocatedFindings = (values, modules) => values.map(({ offset, value }) => {
|
|
80
|
+
const module = modules.find(offset);
|
|
81
|
+
return {
|
|
82
|
+
...value,
|
|
83
|
+
module_key: module?.key ?? null,
|
|
84
|
+
...(module === undefined ? {} : { module_runtime: module.runtime }),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
@@ -14,6 +14,7 @@ export const createJavaScriptAnalysisAccumulator = (sourceLength) => ({
|
|
|
14
14
|
utilityProcesses: [],
|
|
15
15
|
nativeAddonBindings: [],
|
|
16
16
|
moduleRangeIndex: new JavaScriptModuleRangeIndex(sourceLength),
|
|
17
|
+
mediaElementPreloads: new WeakSet(),
|
|
17
18
|
seen: new Set(),
|
|
18
19
|
visitedNodes: 0,
|
|
19
20
|
unknownFindings: 0,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { localPathStringSchema } from "../localPath.js";
|
|
3
|
+
/**
|
|
4
|
+
* Caller intent for JEB-backed inspection, independent of the engine build.
|
|
5
|
+
*
|
|
6
|
+
* JEB resolves paths on the host running the JEB client that serves MCP; REA
|
|
7
|
+
* never launches the engine or opens the target itself.
|
|
8
|
+
*/
|
|
9
|
+
export const jebInputSchemas = {
|
|
10
|
+
inspect_jeb_client: z.strictObject({}),
|
|
11
|
+
open_jeb_project: z.strictObject({
|
|
12
|
+
path: localPathStringSchema.describe("Artifact file or existing .jdb2 project database, resolved by the running JEB client"),
|
|
13
|
+
}),
|
|
14
|
+
list_jeb_units: z.strictObject({
|
|
15
|
+
filter: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Wildcard filter matched against unit paths; '*' allowed"),
|
|
19
|
+
parent_unit_path: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.optional()
|
|
23
|
+
.describe("Restrict results to descendants of this unit path"),
|
|
24
|
+
index: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.nonnegative()
|
|
28
|
+
.default(0)
|
|
29
|
+
.describe("Zero-based index of the first result to return"),
|
|
30
|
+
count: z
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.min(1)
|
|
34
|
+
.max(100)
|
|
35
|
+
.default(100)
|
|
36
|
+
.describe("Maximum results to return; the engine protocol caps pages at 100"),
|
|
37
|
+
}),
|
|
38
|
+
decompile_jeb_item: z.strictObject({
|
|
39
|
+
unit_path: z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Target code unit; the engine's first code unit in the project when omitted"),
|
|
44
|
+
item_address: z
|
|
45
|
+
.string()
|
|
46
|
+
.min(1)
|
|
47
|
+
.describe("Type or method address within the unit, as listed by the engine"),
|
|
48
|
+
item_kind: z.enum(["type", "method"]).describe("Kind of item to decompile"),
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
/** Validate operation and input together so their types remain correlated. */
|
|
52
|
+
export const jebRequestSchema = z.discriminatedUnion("operation", [
|
|
53
|
+
z.strictObject({
|
|
54
|
+
operation: z.literal("inspect_jeb_client"),
|
|
55
|
+
input: jebInputSchemas.inspect_jeb_client,
|
|
56
|
+
}),
|
|
57
|
+
z.strictObject({
|
|
58
|
+
operation: z.literal("open_jeb_project"),
|
|
59
|
+
input: jebInputSchemas.open_jeb_project,
|
|
60
|
+
}),
|
|
61
|
+
z.strictObject({
|
|
62
|
+
operation: z.literal("list_jeb_units"),
|
|
63
|
+
input: jebInputSchemas.list_jeb_units,
|
|
64
|
+
}),
|
|
65
|
+
z.strictObject({
|
|
66
|
+
operation: z.literal("decompile_jeb_item"),
|
|
67
|
+
input: jebInputSchemas.decompile_jeb_item,
|
|
68
|
+
}),
|
|
69
|
+
]);
|
|
70
|
+
const engine = z.strictObject({
|
|
71
|
+
name: z.string().min(1),
|
|
72
|
+
version: z.string().nullable(),
|
|
73
|
+
endpoint: z.string().min(1),
|
|
74
|
+
gui_client: z.boolean().nullable(),
|
|
75
|
+
});
|
|
76
|
+
const unit = z.strictObject({
|
|
77
|
+
unit_path: z.string(),
|
|
78
|
+
unit_type: z.string(),
|
|
79
|
+
});
|
|
80
|
+
/** Portable JEB observations with explicit identity and coverage limitations. */
|
|
81
|
+
export const jebResultSchemas = {
|
|
82
|
+
inspect_jeb_client: z.strictObject({
|
|
83
|
+
engine,
|
|
84
|
+
startup_ts: z.number().int().nonnegative().nullable(),
|
|
85
|
+
message: z.string().nullable(),
|
|
86
|
+
}),
|
|
87
|
+
open_jeb_project: z.strictObject({
|
|
88
|
+
engine,
|
|
89
|
+
project_name: z.string().nullable(),
|
|
90
|
+
creation_datetime: z.string().nullable(),
|
|
91
|
+
input_files: z.array(z.strictObject({
|
|
92
|
+
file_name: z.string(),
|
|
93
|
+
file_size: z.number().int().nonnegative(),
|
|
94
|
+
contents_sha256_hash: z.string(),
|
|
95
|
+
})),
|
|
96
|
+
units: z.array(unit),
|
|
97
|
+
}),
|
|
98
|
+
list_jeb_units: z.strictObject({
|
|
99
|
+
engine,
|
|
100
|
+
filter: z.string().nullable(),
|
|
101
|
+
parent_unit_path: z.string().nullable(),
|
|
102
|
+
index: z.number().int().nonnegative(),
|
|
103
|
+
count: z.number().int().positive(),
|
|
104
|
+
units: z.array(unit),
|
|
105
|
+
coverage: z.enum(["complete", "partial"]),
|
|
106
|
+
}),
|
|
107
|
+
decompile_jeb_item: z.strictObject({
|
|
108
|
+
engine,
|
|
109
|
+
unit_path: z.string().nullable(),
|
|
110
|
+
item_address: z.string(),
|
|
111
|
+
item_kind: z.enum(["type", "method"]),
|
|
112
|
+
text: z.string(),
|
|
113
|
+
}),
|
|
114
|
+
};
|
package/dist/domain/jsonShape.js
CHANGED
|
@@ -23,6 +23,7 @@ export const jsonShapeSchema = z.object({
|
|
|
23
23
|
observations: z.number().int().min(1),
|
|
24
24
|
})),
|
|
25
25
|
});
|
|
26
|
+
const arrayElementKey = Symbol("array-element");
|
|
26
27
|
/** Parse approved JSON and immediately discard values after iterative shape inference. */
|
|
27
28
|
export const inferJsonShape = (text) => {
|
|
28
29
|
let root;
|
|
@@ -34,8 +35,31 @@ export const inferJsonShape = (text) => {
|
|
|
34
35
|
void cause;
|
|
35
36
|
return null;
|
|
36
37
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
38
|
+
const rootShape = {
|
|
39
|
+
path: [],
|
|
40
|
+
types: new Set(),
|
|
41
|
+
observations: 0,
|
|
42
|
+
};
|
|
43
|
+
// Each structural path owns one accumulator, shared by all matching array rows.
|
|
44
|
+
const childShape = (parent, key) => {
|
|
45
|
+
const children = (parent.children ??= new Map());
|
|
46
|
+
const existing = children.get(key);
|
|
47
|
+
if (existing !== undefined)
|
|
48
|
+
return existing;
|
|
49
|
+
const node = {
|
|
50
|
+
path: [
|
|
51
|
+
...parent.path,
|
|
52
|
+
typeof key === "string"
|
|
53
|
+
? { kind: "property", name: key }
|
|
54
|
+
: { kind: "array-element" },
|
|
55
|
+
],
|
|
56
|
+
types: new Set(),
|
|
57
|
+
observations: 0,
|
|
58
|
+
};
|
|
59
|
+
children.set(key, node);
|
|
60
|
+
return node;
|
|
61
|
+
};
|
|
62
|
+
const pending = [{ value: root, shape: rootShape }];
|
|
39
63
|
let nodeCount = 0;
|
|
40
64
|
let maxDepthObserved = 0;
|
|
41
65
|
while (pending.length > 0) {
|
|
@@ -43,29 +67,15 @@ export const inferJsonShape = (text) => {
|
|
|
43
67
|
if (current === undefined)
|
|
44
68
|
break;
|
|
45
69
|
nodeCount += 1;
|
|
46
|
-
maxDepthObserved = Math.max(maxDepthObserved, current.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const type = jsonValueType(current.value);
|
|
50
|
-
const existing = properties.get(key);
|
|
51
|
-
if (existing === undefined)
|
|
52
|
-
properties.set(key, {
|
|
53
|
-
path: current.path,
|
|
54
|
-
types: new Set([type]),
|
|
55
|
-
observations: 1,
|
|
56
|
-
});
|
|
57
|
-
else {
|
|
58
|
-
existing.types.add(type);
|
|
59
|
-
existing.observations += 1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
70
|
+
maxDepthObserved = Math.max(maxDepthObserved, current.shape.path.length);
|
|
71
|
+
current.shape.types.add(jsonValueType(current.value));
|
|
72
|
+
current.shape.observations += 1;
|
|
62
73
|
if (Array.isArray(current.value)) {
|
|
74
|
+
if (current.value.length === 0)
|
|
75
|
+
continue;
|
|
76
|
+
const shape = childShape(current.shape, arrayElementKey);
|
|
63
77
|
for (let index = current.value.length - 1; index >= 0; index -= 1)
|
|
64
|
-
pending.push({
|
|
65
|
-
value: current.value[index],
|
|
66
|
-
path: [...current.path, { kind: "array-element" }],
|
|
67
|
-
depth: current.depth + 1,
|
|
68
|
-
});
|
|
78
|
+
pending.push({ value: current.value[index], shape });
|
|
69
79
|
continue;
|
|
70
80
|
}
|
|
71
81
|
if (!isRecord(current.value))
|
|
@@ -76,25 +86,31 @@ export const inferJsonShape = (text) => {
|
|
|
76
86
|
if (entry === undefined)
|
|
77
87
|
continue;
|
|
78
88
|
const [name, value] = entry;
|
|
79
|
-
|
|
80
|
-
...current.path,
|
|
81
|
-
{ kind: "property", name },
|
|
82
|
-
];
|
|
83
|
-
pending.push({ value, path, depth: current.depth + 1 });
|
|
89
|
+
pending.push({ value, shape: childShape(current.shape, name) });
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
|
-
|
|
92
|
+
// Preorder over sorted siblings gives canonical paths without repeatedly
|
|
93
|
+
// comparing their shared prefixes. Each returned path owns its segments.
|
|
94
|
+
const properties = [];
|
|
95
|
+
const shapes = orderedChildren(rootShape);
|
|
96
|
+
while (shapes.length > 0) {
|
|
97
|
+
const shape = shapes.pop();
|
|
98
|
+
if (shape === undefined)
|
|
99
|
+
break;
|
|
100
|
+
properties.push({
|
|
101
|
+
path: shape.path.map((segment) => ({ ...segment })),
|
|
102
|
+
types: [...shape.types].sort(),
|
|
103
|
+
observations: shape.observations,
|
|
104
|
+
});
|
|
105
|
+
for (const child of orderedChildren(shape))
|
|
106
|
+
shapes.push(child);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
87
109
|
root_type: jsonValueType(root),
|
|
88
110
|
node_count: nodeCount,
|
|
89
111
|
max_depth_observed: maxDepthObserved,
|
|
90
|
-
properties
|
|
91
|
-
|
|
92
|
-
path: value.path,
|
|
93
|
-
types: [...value.types].sort(),
|
|
94
|
-
observations: value.observations,
|
|
95
|
-
}))
|
|
96
|
-
.sort((left, right) => compareShapePaths(left.path, right.path)),
|
|
97
|
-
});
|
|
112
|
+
properties,
|
|
113
|
+
};
|
|
98
114
|
};
|
|
99
115
|
const jsonValueType = (value) => {
|
|
100
116
|
if (value === null)
|
|
@@ -113,18 +129,13 @@ const jsonValueType = (value) => {
|
|
|
113
129
|
}
|
|
114
130
|
};
|
|
115
131
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (order !== 0)
|
|
127
|
-
return order;
|
|
128
|
-
}
|
|
129
|
-
return left.length - right.length;
|
|
130
|
-
};
|
|
132
|
+
/** Reverse sibling order for the traversal stack; array elements sort first. */
|
|
133
|
+
const orderedChildren = (node) => [...(node.children ?? [])]
|
|
134
|
+
.sort(([left], [right]) => left === right
|
|
135
|
+
? 0
|
|
136
|
+
: left === arrayElementKey
|
|
137
|
+
? 1
|
|
138
|
+
: right === arrayElementKey
|
|
139
|
+
? -1
|
|
140
|
+
: compareUnicodeCodePoints(right, left))
|
|
141
|
+
.map(([, child]) => child);
|
package/dist/domain/jsonValue.js
CHANGED
|
@@ -64,6 +64,9 @@ export function* jsonValueValidationSteps(root) {
|
|
|
64
64
|
return finish(undefined);
|
|
65
65
|
}
|
|
66
66
|
const preserveJsonValue = (value) => {
|
|
67
|
+
const immutableCandidate = value;
|
|
68
|
+
if (isImmutableJsonSnapshot(immutableCandidate))
|
|
69
|
+
return value;
|
|
67
70
|
if (Array.isArray(value))
|
|
68
71
|
return value.map(preserveJsonValue);
|
|
69
72
|
if (value !== null && typeof value === "object")
|