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
|
@@ -9,35 +9,40 @@ import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
|
|
9
9
|
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
10
10
|
import { projectInputIssues } from "../domain/inputIssueProjection.js";
|
|
11
11
|
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
12
|
-
import { parseCliJsonInput } from "../cliJsonInput.js";
|
|
12
|
+
import { parseCliJsonInput, resolveCliJsonPaths } from "../cliJsonInput.js";
|
|
13
13
|
import { electronPageInspectionOptions, javascriptApplicationOptions, } from "../cliObservationOptions.js";
|
|
14
14
|
import { runCliJavaScriptApplicationAnalysis } from "./javascriptApplicationAnalysis.js";
|
|
15
|
+
import { withCommandCancellation } from "./commandCancellation.js";
|
|
15
16
|
/** Register CLI equivalents of the Electron MCP tools. */
|
|
16
|
-
export const registerElectronCommands = (cli, logger) => {
|
|
17
|
+
export const registerElectronCommands = (cli, logger, resultOutput) => {
|
|
17
18
|
registerElectronObservationCommands(cli, logger);
|
|
18
19
|
registerElectronActiveCommand(cli, logger);
|
|
19
|
-
registerJavaScriptApplicationCommand(cli, logger);
|
|
20
|
+
registerJavaScriptApplicationCommand(cli, logger, resultOutput);
|
|
20
21
|
registerJavaScriptRuntimeReconciliationCommand(cli, logger);
|
|
21
22
|
};
|
|
22
23
|
const registerElectronActiveCommand = (cli, logger) => {
|
|
23
24
|
cli.command(CLI_COMMANDS.captureElectronScenario, {
|
|
24
|
-
description: "Run one
|
|
25
|
+
description: "Run one owned Electron scenario with cancellable actions",
|
|
25
26
|
args: z.object({
|
|
26
27
|
inputJson: z
|
|
27
28
|
.string()
|
|
28
29
|
.describe("Inline JSON or a JSON file matching capture_electron_scenario"),
|
|
29
30
|
}),
|
|
30
|
-
run: ({ args }) => logCliCommand(logger, CLI_COMMANDS.captureElectronScenario, async () => {
|
|
31
|
+
run: ({ args }) => withCommandCancellation((signal) => logCliCommand(logger, CLI_COMMANDS.captureElectronScenario, async () => {
|
|
31
32
|
const input = await parseCliJsonInput(args.inputJson, "capture_electron_scenario");
|
|
32
33
|
if (!input.ok)
|
|
33
34
|
return input.error;
|
|
34
|
-
const parsed = electronActiveObservationInputSchema.safeParse(input.value
|
|
35
|
+
const parsed = electronActiveObservationInputSchema.safeParse(resolveCliJsonPaths(input.value, [
|
|
36
|
+
["executable_path"],
|
|
37
|
+
["application_path"],
|
|
38
|
+
["application_root"],
|
|
39
|
+
]));
|
|
35
40
|
if (!parsed.success)
|
|
36
41
|
return inputError("capture_electron_scenario", parsed.error.issues, input.value);
|
|
37
42
|
const { createElectronScenarioProvider } = await import("../composition/electronScenario.js");
|
|
38
|
-
const result = await captureElectronScenario(createElectronScenarioProvider(), parsed.data);
|
|
43
|
+
const result = await captureElectronScenario(createElectronScenarioProvider(), parsed.data, { signal });
|
|
39
44
|
return result.ok ? result.value : cliError(result.error);
|
|
40
|
-
}),
|
|
45
|
+
})),
|
|
41
46
|
});
|
|
42
47
|
};
|
|
43
48
|
const registerJavaScriptRuntimeReconciliationCommand = (cli, logger) => {
|
|
@@ -102,17 +107,20 @@ const registerElectronPageInspection = (cli, logger) => {
|
|
|
102
107
|
}),
|
|
103
108
|
});
|
|
104
109
|
};
|
|
105
|
-
const registerJavaScriptApplicationCommand = (cli, logger) => {
|
|
110
|
+
const registerJavaScriptApplicationCommand = (cli, logger, resultOutput) => {
|
|
106
111
|
cli.command(CLI_COMMANDS.analyzeJavaScriptApplication, {
|
|
107
112
|
description: "Statically reconstruct a local JavaScript/Electron application",
|
|
108
113
|
args: z.object({
|
|
109
114
|
path: z.string().describe("ASAR or extracted application path"),
|
|
110
115
|
}),
|
|
111
116
|
options: javascriptApplicationOptions,
|
|
112
|
-
run: ({ args, options }) => logCliCommand(logger, CLI_COMMANDS.analyzeJavaScriptApplication, () => runCliJavaScriptApplicationAnalysis({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
run: ({ args, options, format }) => withCommandCancellation((signal) => logCliCommand(logger, CLI_COMMANDS.analyzeJavaScriptApplication, () => runCliJavaScriptApplicationAnalysis({ input_path: args.path, format: options.artifactFormat }, resultOutput === undefined
|
|
118
|
+
? undefined
|
|
119
|
+
: {
|
|
120
|
+
output: resultOutput,
|
|
121
|
+
command: CLI_COMMANDS.analyzeJavaScriptApplication,
|
|
122
|
+
format,
|
|
123
|
+
}, signal))),
|
|
116
124
|
});
|
|
117
125
|
};
|
|
118
126
|
const electronObservationContext = async () => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "incur";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { createEvmInterfaceService } from "../composition/evm.js";
|
|
4
|
+
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
5
|
+
import { logCliCommand } from "../cliLogging.js";
|
|
6
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
7
|
+
import { withCommandCancellation } from "./commandCancellation.js";
|
|
8
|
+
/** Resolve operator paths and preserve explicit encoding through the shared workflow. */
|
|
9
|
+
export const registerEvmCommands = (cli, logger, environment) => {
|
|
10
|
+
const service = createEvmInterfaceService(environment);
|
|
11
|
+
cli.command(CLI_COMMANDS.inspectEvmInterface, {
|
|
12
|
+
description: "Infer interface candidates from explicit local EVM bytecode",
|
|
13
|
+
args: z.object({
|
|
14
|
+
path: z.string().describe("Local bytecode carrier"),
|
|
15
|
+
encoding: z
|
|
16
|
+
.enum(["raw", "hex"])
|
|
17
|
+
.describe("Selected carrier representation"),
|
|
18
|
+
}),
|
|
19
|
+
run: ({ args }) => withCommandCancellation((signal) => logCliCommand(logger, CLI_COMMANDS.inspectEvmInterface, async () => {
|
|
20
|
+
const result = await service.inspect({ path: resolve(args.path), encoding: args.encoding }, { signal });
|
|
21
|
+
return result.ok ? result.value : projectAnalysisError(result.error);
|
|
22
|
+
})),
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "incur";
|
|
2
|
+
import { resolve } from "node:path";
|
|
2
3
|
import { FirmwareAnalysisService } from "../application/firmware/FirmwareAnalysisService.js";
|
|
3
4
|
import { createFirmwareAnalysisProvider } from "../composition/firmware.js";
|
|
4
5
|
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
@@ -16,7 +17,9 @@ export const registerFirmwareCommands = (cli, logger, environment) => {
|
|
|
16
17
|
cli.command(CLI_COMMANDS.inspectFirmwareRegions, {
|
|
17
18
|
description: "Inspect firmware signature candidates without extracting them",
|
|
18
19
|
args: z.object({ path }),
|
|
19
|
-
run: ({ args }) => execute(CLI_COMMANDS.inspectFirmwareRegions, "inspect_firmware_regions",
|
|
20
|
+
run: ({ args }) => execute(CLI_COMMANDS.inspectFirmwareRegions, "inspect_firmware_regions",
|
|
21
|
+
// CLI paths are operator-relative; resolve before shared validation.
|
|
22
|
+
{ path: resolve(args.path) }),
|
|
20
23
|
});
|
|
21
24
|
cli.command(CLI_COMMANDS.extractFirmware, {
|
|
22
25
|
description: "Extract selected firmware bytes and return verified files and provenance",
|
|
@@ -56,8 +59,8 @@ export const registerFirmwareCommands = (cli, logger, environment) => {
|
|
|
56
59
|
.describe("Staging entry budget; default 10000"),
|
|
57
60
|
}),
|
|
58
61
|
run: ({ args, options }) => execute(CLI_COMMANDS.extractFirmware, "extract_firmware", {
|
|
59
|
-
path: args.path,
|
|
60
|
-
output_directory: args.outputDirectory,
|
|
62
|
+
path: resolve(args.path),
|
|
63
|
+
output_directory: resolve(args.outputDirectory),
|
|
61
64
|
...(options.offset === undefined && options.length === undefined
|
|
62
65
|
? {}
|
|
63
66
|
: { range: { offset: options.offset, length: options.length } }),
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { analyzeJavaScriptApplication } from "../application/javascript/JavaScriptApplicationService.js";
|
|
2
|
+
import { createProgressReporter } from "../application/ProgressReporter.js";
|
|
2
3
|
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
3
4
|
/** Execute the shared one-shot CLI boundary for static JavaScript analysis. */
|
|
4
|
-
export const runCliJavaScriptApplicationAnalysis = async (input) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
export const runCliJavaScriptApplicationAnalysis = async (input, output, signal) => {
|
|
6
|
+
const started = performance.now();
|
|
7
|
+
const progress = createProgressReporter(async (update) => {
|
|
8
|
+
process.stderr.write(`${JSON.stringify({ rea_progress: update })}\n`);
|
|
9
|
+
}, { minimumIntervalMs: 0 });
|
|
10
|
+
const result = await analyzeJavaScriptApplication(input, {
|
|
11
|
+
progress,
|
|
12
|
+
...(signal === undefined ? {} : { signal }),
|
|
13
|
+
});
|
|
14
|
+
const value = result.ok ? result.value : cliError(result.error);
|
|
15
|
+
if (output !== undefined &&
|
|
16
|
+
(await output.output.write(value, {
|
|
17
|
+
command: output.command,
|
|
18
|
+
format: output.format,
|
|
19
|
+
duration: `${Math.round(performance.now() - started)}ms`,
|
|
20
|
+
})))
|
|
21
|
+
// Keep failures visible to command logging after the stream has handled stdout.
|
|
22
|
+
return result.ok ? undefined : value;
|
|
23
|
+
return value;
|
|
7
24
|
};
|
|
8
25
|
const cliError = (error) => ({
|
|
9
26
|
error: "JavaScript application analysis failed",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { bufferedJsonParts, jsonParts } from "../domain/jsonSerialization.js";
|
|
2
|
+
/** Write ordinary JSON without constructing a document-sized string. */
|
|
3
|
+
export const writeJsonOutput = async (value, destination, format = "json") => {
|
|
4
|
+
for (const part of bufferedJsonParts(documentParts(value, format)))
|
|
5
|
+
await writePart(destination, part);
|
|
6
|
+
};
|
|
7
|
+
const writePart = (destination, part) => new Promise((resolve, reject) => {
|
|
8
|
+
const onError = (cause) => reject(cause);
|
|
9
|
+
destination.once("error", onError);
|
|
10
|
+
try {
|
|
11
|
+
destination.write(part, (cause) => {
|
|
12
|
+
if (cause) {
|
|
13
|
+
// A Writable can emit its error after invoking the write callback.
|
|
14
|
+
setImmediate(() => destination.off("error", onError));
|
|
15
|
+
reject(cause);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
destination.off("error", onError);
|
|
19
|
+
resolve();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
catch (cause) {
|
|
24
|
+
destination.off("error", onError);
|
|
25
|
+
reject(cause);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function* documentParts(value, format) {
|
|
29
|
+
if (format === "jsonl" && Array.isArray(value)) {
|
|
30
|
+
for (const item of value) {
|
|
31
|
+
yield* jsonParts(item);
|
|
32
|
+
yield "\n";
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
yield* jsonParts(value, format === "json");
|
|
37
|
+
yield "\n";
|
|
38
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "incur";
|
|
2
|
+
import { runProviderAnalysis } from "../composition/directAnalysis.js";
|
|
3
|
+
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
4
|
+
import { parseCliJsonInput } from "../cliJsonInput.js";
|
|
5
|
+
import { logCliCommand } from "../cliLogging.js";
|
|
6
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
7
|
+
import { analysisInputErrorFromIssues } from "../domain/inputIssueProjection.js";
|
|
8
|
+
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
9
|
+
import { nativeCallObservationInputSchema } from "../domain/native/nativeCallObservation.js";
|
|
10
|
+
const OPERATION = "observe_native_calls";
|
|
11
|
+
/** `observe-native-calls <path> <input-json>`: the MCP input object as JSON. */
|
|
12
|
+
export const registerNativeCallCommands = (cli, logger) => {
|
|
13
|
+
cli.command(CLI_COMMANDS.observeNativeCalls, {
|
|
14
|
+
description: "Launch a Mach-O under LLDB and record entries into selected functions or Objective-C methods",
|
|
15
|
+
args: z.object({
|
|
16
|
+
path: z.string().describe("Mach-O or app path"),
|
|
17
|
+
inputJson: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("Inline JSON or a JSON file path: breakpoints, arguments, environment, duration_ms, max_events, argument_registers, backtrace_frames"),
|
|
20
|
+
}),
|
|
21
|
+
run: ({ args }) => logCliCommand(logger, CLI_COMMANDS.observeNativeCalls, async () => {
|
|
22
|
+
const input = await parseCliJsonInput(args.inputJson, OPERATION);
|
|
23
|
+
if (!input.ok)
|
|
24
|
+
return input.error;
|
|
25
|
+
const parsed = nativeCallObservationInputSchema.safeParse(input.value);
|
|
26
|
+
if (!parsed.success)
|
|
27
|
+
return {
|
|
28
|
+
error: "Analysis failed",
|
|
29
|
+
...projectAnalysisError(analysisInputErrorFromIssues(OPERATION, parsed.error.issues, input.value)),
|
|
30
|
+
};
|
|
31
|
+
return runProviderAnalysis(args.path, OPERATION, z.record(z.string(), jsonValueSchema).parse(parsed.data), logger);
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cli, z } from "incur";
|
|
2
|
-
import { captureProcessScenarioFile, compareProcessEvidenceFiles, isProcessCliFailure, } from "../application/ProcessCli.js";
|
|
2
|
+
import { captureProcessScenarioFile, compareProcessEvidenceFiles, isProcessCliFailure, } from "../application/process/ProcessCli.js";
|
|
3
3
|
import { logCliCommand } from "../cliLogging.js";
|
|
4
4
|
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
5
5
|
/** Register direct process capture and comparison commands. */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {} from "node:stream";
|
|
2
|
+
import { Filter } from "incur";
|
|
3
|
+
import { parseCliOutputArguments } from "../cliOutput.js";
|
|
4
|
+
import { writeJsonOutput } from "./jsonOutput.js";
|
|
5
|
+
/** Preserve Incur's JSON controls while streaming the complete result. */
|
|
6
|
+
export const createStreamedCliJsonOutput = (arguments_, destination) => {
|
|
7
|
+
const options = parseCliOutputArguments(arguments_);
|
|
8
|
+
if (options.parseError ||
|
|
9
|
+
options.tokenCount ||
|
|
10
|
+
options.tokenWindow ||
|
|
11
|
+
(options.format !== "json" && options.format !== "jsonl"))
|
|
12
|
+
return undefined;
|
|
13
|
+
const format = options.format;
|
|
14
|
+
let handled = false;
|
|
15
|
+
let failed = false;
|
|
16
|
+
return {
|
|
17
|
+
get handled() {
|
|
18
|
+
return handled;
|
|
19
|
+
},
|
|
20
|
+
get failed() {
|
|
21
|
+
return failed;
|
|
22
|
+
},
|
|
23
|
+
async write(value, metadata) {
|
|
24
|
+
if (metadata.format !== format)
|
|
25
|
+
return false;
|
|
26
|
+
const filtered = options.filterOutput
|
|
27
|
+
? Filter.apply(value, Filter.parse(options.filterOutput))
|
|
28
|
+
: value;
|
|
29
|
+
const meta = {
|
|
30
|
+
command: metadata.command,
|
|
31
|
+
duration: metadata.duration,
|
|
32
|
+
};
|
|
33
|
+
const document = options.fullOutput
|
|
34
|
+
? filtered === undefined
|
|
35
|
+
? { ok: true, meta }
|
|
36
|
+
: { ok: true, data: filtered, meta }
|
|
37
|
+
: filtered === undefined ||
|
|
38
|
+
filtered === null ||
|
|
39
|
+
typeof filtered === "function" ||
|
|
40
|
+
typeof filtered === "symbol"
|
|
41
|
+
? {}
|
|
42
|
+
: filtered;
|
|
43
|
+
// Once writing starts, a failed destination must not receive a second
|
|
44
|
+
// document from Incur's error formatter.
|
|
45
|
+
handled = true;
|
|
46
|
+
try {
|
|
47
|
+
await writeJsonOutput(document, destination, format);
|
|
48
|
+
}
|
|
49
|
+
catch (cause) {
|
|
50
|
+
failed = true;
|
|
51
|
+
throw cause;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -13,9 +13,11 @@ import { logCliCommand } from "../cliLogging.js";
|
|
|
13
13
|
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
14
14
|
import { swiftSymbolsSchema } from "../contracts/native/nativeToolContracts.js";
|
|
15
15
|
import { isReferenceSourceImportCliFailure } from "./referenceSourceImportStatus.js";
|
|
16
|
+
import { registerNativeCallCommands } from "./nativeCallCommands.js";
|
|
16
17
|
export const registerUtilityCommands = (cli, logger, environment = process.env) => {
|
|
17
18
|
registerCapabilityCommands(cli, logger);
|
|
18
19
|
registerNativeCommands(cli, logger);
|
|
20
|
+
registerNativeCallCommands(cli, logger);
|
|
19
21
|
for (const [command, operation] of [
|
|
20
22
|
[CLI_COMMANDS.observeNativeUi, "observe_native_ui"],
|
|
21
23
|
[CLI_COMMANDS.captureNativeUiScenario, "capture_native_ui_scenario"],
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "incur";
|
|
2
|
+
import { createWebNetworkCaptureService } from "../composition/webNetworkCaptures.js";
|
|
3
|
+
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
|
4
|
+
import { logCliCommand } from "../cliLogging.js";
|
|
5
|
+
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
6
|
+
import { withCommandCancellation } from "./commandCancellation.js";
|
|
7
|
+
/** Expose offline historical capture inspection with the same selection contract as MCP. */
|
|
8
|
+
export const registerWebNetworkCaptureCommands = (cli, logger, environment) => {
|
|
9
|
+
const service = createWebNetworkCaptureService(environment);
|
|
10
|
+
cli.command(CLI_COMMANDS.inspectWebNetworkCapture, {
|
|
11
|
+
description: "Inspect retained HAR or native mitmproxy records without fetching recorded URLs",
|
|
12
|
+
args: z.object({
|
|
13
|
+
capturePath: z.string().describe("Absolute local capture path"),
|
|
14
|
+
format: z.enum(["har", "mitmproxy"]).describe("Producer capture format"),
|
|
15
|
+
}),
|
|
16
|
+
options: z.object({
|
|
17
|
+
record: z
|
|
18
|
+
.array(z.coerce.number().int().nonnegative())
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Zero-based producer ordinals; repeat to select several"),
|
|
21
|
+
sensitiveValue: z
|
|
22
|
+
.array(z.string().min(1))
|
|
23
|
+
.default([])
|
|
24
|
+
.describe("Literal string values explicitly marked sensitive; repeat as needed"),
|
|
25
|
+
}),
|
|
26
|
+
run: ({ args, options }) => withCommandCancellation((signal) => logCliCommand(logger, CLI_COMMANDS.inspectWebNetworkCapture, async () => {
|
|
27
|
+
const result = await service.inspect({
|
|
28
|
+
capture_path: args.capturePath,
|
|
29
|
+
format: args.format,
|
|
30
|
+
sensitive_values: options.sensitiveValue,
|
|
31
|
+
...(options.record === undefined
|
|
32
|
+
? {}
|
|
33
|
+
: { record_ordinals: options.record }),
|
|
34
|
+
}, { signal });
|
|
35
|
+
return result.ok
|
|
36
|
+
? result.value
|
|
37
|
+
: projectAnalysisError(result.error);
|
|
38
|
+
})),
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -25,15 +25,15 @@ export const registerWebRuntimeCommands = (cli, logger) => {
|
|
|
25
25
|
...browserScopeOptions,
|
|
26
26
|
observationMs: observationDuration(10_000, 1),
|
|
27
27
|
}),
|
|
28
|
-
run: ({ args, options }) => logCliCommand(logger, "observe-web-execution", async () => {
|
|
29
|
-
const result = await
|
|
28
|
+
run: ({ args, options }) => withCommandCancellation((signal) => logCliCommand(logger, "observe-web-execution", async () => {
|
|
29
|
+
const result = await createWebRuntimeService().observe({
|
|
30
30
|
cdp_endpoint: args.endpoint,
|
|
31
31
|
target_id: args.targetId,
|
|
32
32
|
allowed_origins: options.allowedOrigins,
|
|
33
33
|
observation_ms: options.observationMs,
|
|
34
|
-
}, { progress: runtimeProgress, signal })
|
|
34
|
+
}, { progress: runtimeProgress, signal });
|
|
35
35
|
return result.ok ? result.value : browserCliError(result.error);
|
|
36
|
-
}),
|
|
36
|
+
})),
|
|
37
37
|
});
|
|
38
38
|
cli.command(CLI_COMMANDS.inspectWebEventListeners, {
|
|
39
39
|
description: "Inspect native listener source locations on the first main-document CSS match",
|
|
@@ -47,14 +47,14 @@ export const registerWebRuntimeCommands = (cli, logger) => {
|
|
|
47
47
|
.describe("Native CSS selector; inspect the first main-document match"),
|
|
48
48
|
}),
|
|
49
49
|
options: z.object({ ...browserScopeOptions }),
|
|
50
|
-
run: ({ args, options }) => logCliCommand(logger, "inspect-web-event-listeners", async () => {
|
|
51
|
-
const result = await
|
|
50
|
+
run: ({ args, options }) => withCommandCancellation((signal) => logCliCommand(logger, "inspect-web-event-listeners", async () => {
|
|
51
|
+
const result = await createWebRuntimeService().inspect({
|
|
52
52
|
cdp_endpoint: args.endpoint,
|
|
53
53
|
target_id: args.targetId,
|
|
54
54
|
selector: args.selector,
|
|
55
55
|
allowed_origins: options.allowedOrigins,
|
|
56
|
-
}, { signal })
|
|
56
|
+
}, { signal });
|
|
57
57
|
return result.ok ? result.value : browserCliError(result.error);
|
|
58
|
-
}),
|
|
58
|
+
})),
|
|
59
59
|
});
|
|
60
60
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { registerEvmCommands } from "./cli/evmCommands.js";
|
|
2
|
+
import { registerBinaryDiagnosticsCommands } from "./cli/binaryDiagnosticsCommands.js";
|
|
1
3
|
import { Cli } from "incur";
|
|
2
4
|
import { createLogger, parseLogLevel } from "./logger.js";
|
|
3
5
|
import { PRODUCT_IDENTITY } from "./identity.js";
|
|
6
|
+
import { npxRegistrationCommand } from "./application/ClientRegistrationIdentity.js";
|
|
4
7
|
import { registerSetupCommands } from "./cli/setupCommands.js";
|
|
5
8
|
import { registerCoreAnalysisCommands } from "./cli/coreAnalysisCommands.js";
|
|
6
9
|
import { registerUtilityCommands } from "./cli/utilityCommands.js";
|
|
@@ -15,6 +18,7 @@ import { registerWebScriptCommands } from "./cli/webScriptCommands.js";
|
|
|
15
18
|
import { registerWebModuleCommands } from "./cli/webModuleCommands.js";
|
|
16
19
|
import { registerWebSourceLocationCommands } from "./cli/webSourceLocationCommands.js";
|
|
17
20
|
import { registerWebRuntimeCommands } from "./cli/webRuntimeCommands.js";
|
|
21
|
+
import { registerWebNetworkCaptureCommands } from "./cli/webNetworkCaptureCommands.js";
|
|
18
22
|
import { registerJavaScriptRecoveryCommands } from "./cli/javascriptRecoveryCommands.js";
|
|
19
23
|
import { registerAdvancedBrowserCommands } from "./cli/browserAdvancedCommands.js";
|
|
20
24
|
import { registerBrowserScenarioCommands } from "./cliBrowserScenarioCommands.js";
|
|
@@ -26,7 +30,7 @@ import { registerApplicationCommands } from "./cli/applicationCommands.js";
|
|
|
26
30
|
* Analysis commands acquire and close their own sessions; bare `mcp` and
|
|
27
31
|
* `--mcp` are intercepted by the executable dispatcher before this module loads.
|
|
28
32
|
*/
|
|
29
|
-
export const createCli = (environment = process.env) => {
|
|
33
|
+
export const createCli = (environment = process.env, resultOutput) => {
|
|
30
34
|
const logger = createLogger("cli", environment.REA_LOG_LEVEL === undefined
|
|
31
35
|
? "silent"
|
|
32
36
|
: parseLogLevel(environment.REA_LOG_LEVEL));
|
|
@@ -34,18 +38,20 @@ export const createCli = (environment = process.env) => {
|
|
|
34
38
|
version: PRODUCT_IDENTITY.packageVersion,
|
|
35
39
|
description: "Reverse engineer anything from your terminal or agent.",
|
|
36
40
|
mcp: {
|
|
37
|
-
command:
|
|
41
|
+
command: npxRegistrationCommand().join(" "),
|
|
38
42
|
instructions: "Ask what software, artifact, protocol, or behavior the user wants to understand, then choose the available investigation capabilities that can produce evidence.",
|
|
39
43
|
},
|
|
40
44
|
sync: false,
|
|
41
45
|
});
|
|
42
46
|
registerSetupCommands(cli, logger);
|
|
43
|
-
registerCoreAnalysisCommands(cli, logger);
|
|
47
|
+
registerCoreAnalysisCommands(cli, logger, resultOutput);
|
|
44
48
|
registerUtilityCommands(cli, logger, environment);
|
|
49
|
+
registerEvmCommands(cli, logger, environment);
|
|
45
50
|
registerArtifactCommands(cli, logger);
|
|
46
51
|
registerManagedCommands(cli, logger);
|
|
47
52
|
registerAndroidCommands(cli, logger, environment);
|
|
48
53
|
registerFirmwareCommands(cli, logger, environment);
|
|
54
|
+
registerBinaryDiagnosticsCommands(cli, logger, environment);
|
|
49
55
|
registerEvidenceCommands(cli, logger);
|
|
50
56
|
registerProcessCommands(cli, logger, environment);
|
|
51
57
|
registerBrowserCommands(cli, logger);
|
|
@@ -53,10 +59,11 @@ export const createCli = (environment = process.env) => {
|
|
|
53
59
|
registerWebModuleCommands(cli, logger, environment);
|
|
54
60
|
registerWebSourceLocationCommands(cli, logger, environment);
|
|
55
61
|
registerWebRuntimeCommands(cli, logger);
|
|
62
|
+
registerWebNetworkCaptureCommands(cli, logger, environment);
|
|
56
63
|
registerJavaScriptRecoveryCommands(cli, logger, environment);
|
|
57
64
|
registerAdvancedBrowserCommands(cli, logger);
|
|
58
65
|
registerBrowserScenarioCommands(cli, logger);
|
|
59
|
-
registerElectronCommands(cli, logger);
|
|
66
|
+
registerElectronCommands(cli, logger, resultOutput);
|
|
60
67
|
registerJavaScriptRuntimeObservationCommands(cli, logger);
|
|
61
68
|
registerApplicationCommands(cli, logger);
|
|
62
69
|
return cli;
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { captureBrowserScenario } from "./application/BrowserScenarioCaptureService.js";
|
|
4
4
|
import { createBrowserScenarioProvider } from "./composition/browserScenario.js";
|
|
5
5
|
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
|
6
|
-
import { parseCliJsonInput } from "./cliJsonInput.js";
|
|
6
|
+
import { parseCliJsonInput, resolveCliJsonPaths } from "./cliJsonInput.js";
|
|
7
7
|
import { logCliCommand } from "./cliLogging.js";
|
|
8
8
|
import { AnalysisInputError } from "./domain/analysisErrorCore.js";
|
|
9
9
|
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
@@ -23,7 +23,7 @@ export const registerBrowserScenarioCommands = (cli, logger) => {
|
|
|
23
23
|
const input = await parseCliJsonInput(args.inputJson, OPERATION);
|
|
24
24
|
if (!input.ok)
|
|
25
25
|
return input.error;
|
|
26
|
-
const scenario = browserScenarioSchema.safeParse(input.value);
|
|
26
|
+
const scenario = browserScenarioSchema.safeParse(resolveCliJsonPaths(input.value, [["browser", "executable_path"]]));
|
|
27
27
|
if (!scenario.success)
|
|
28
28
|
return cliError(new AnalysisInputError(OPERATION, { cause: scenario.error }, projectInputIssues(scenario.error.issues, input.value)));
|
|
29
29
|
const result = await captureBrowserScenario(createBrowserScenarioProvider(), scenario.data);
|
package/dist/cliCommandNames.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Canonical names used by every one-shot CLI command registration. */
|
|
2
2
|
export const CLI_COMMANDS = Object.freeze({
|
|
3
|
+
inspectEvmInterface: "inspect-evm-interface",
|
|
4
|
+
inspectWebNetworkCapture: "inspect-web-network-capture",
|
|
3
5
|
observeWebExecution: "observe-web-execution",
|
|
4
6
|
inspectWebEventListeners: "inspect-web-event-listeners",
|
|
5
7
|
traceWebSourceLocation: "trace-web-source-location",
|
|
@@ -27,6 +29,7 @@ export const CLI_COMMANDS = Object.freeze({
|
|
|
27
29
|
extractArtifact: "extract-artifact",
|
|
28
30
|
decodeInterfaceBuilder: "decode-interface-builder",
|
|
29
31
|
inspectKeyedArchive: "inspect-keyed-archive",
|
|
32
|
+
traceDylibResolution: "trace-dylib-resolution",
|
|
30
33
|
inspectNativeDataType: "inspect-native-data-type",
|
|
31
34
|
inspectNativeLoadImage: "inspect-native-load-image",
|
|
32
35
|
readBytes: "read-bytes",
|
|
@@ -36,6 +39,8 @@ export const CLI_COMMANDS = Object.freeze({
|
|
|
36
39
|
resolveNativeCallTargets: "resolve-native-call-targets",
|
|
37
40
|
inspectAssetCatalog: "inspect-asset-catalog",
|
|
38
41
|
inspectManagedArtifact: "inspect-managed-artifact",
|
|
42
|
+
inspectRecordedCrash: "inspect-recorded-crash",
|
|
43
|
+
inspectBinaryLayout: "inspect-binary-layout",
|
|
39
44
|
inspectFirmwareRegions: "inspect-firmware-regions",
|
|
40
45
|
extractFirmware: "extract-firmware",
|
|
41
46
|
inspectAndroidPackage: "inspect-android-package",
|
|
@@ -50,6 +55,7 @@ export const CLI_COMMANDS = Object.freeze({
|
|
|
50
55
|
importManagedReconstruction: "import-managed-reconstruction",
|
|
51
56
|
projectManagedApplicationGraph: "project-managed-application-graph",
|
|
52
57
|
observeNativeUi: "observe-native-ui",
|
|
58
|
+
observeNativeCalls: "observe-native-calls",
|
|
53
59
|
captureNativeUiScenario: "capture-native-ui-scenario",
|
|
54
60
|
inspectMacho: "inspect-macho",
|
|
55
61
|
inspectSignature: "inspect-signature",
|
|
@@ -133,7 +139,6 @@ export const MCP_TOOLS_WITHOUT_DEDICATED_CLI = Object.freeze([
|
|
|
133
139
|
"set_addresses_names",
|
|
134
140
|
"set_bookmark",
|
|
135
141
|
"set_comment",
|
|
136
|
-
"set_current_document",
|
|
137
142
|
"set_inline_comment",
|
|
138
143
|
"unset_bookmark",
|
|
139
144
|
"get_objc_classes",
|
package/dist/cliJsonInput.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
2
3
|
import { AnalysisInputError } from "./domain/analysisErrorCore.js";
|
|
3
4
|
import { projectAnalysisError } from "./domain/analysisErrorProjection.js";
|
|
4
5
|
import { safeParseJson } from "./domain/safeJson.js";
|
|
@@ -23,10 +24,43 @@ export const parseCliJsonInput = async (value, operation) => {
|
|
|
23
24
|
return jsonFileError(value, operation, "read-failed", cause);
|
|
24
25
|
}
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Resolve named string fields of CLI-supplied JSON against the operator
|
|
29
|
+
* working directory. Each entry is a key path from the document root; only
|
|
30
|
+
* fields holding nonblank strings are resolved, everything else passes through
|
|
31
|
+
* untouched so shared schemas can reject blank paths. Shared MCP contracts reject
|
|
32
|
+
* relative paths, so CLI workflows resolve operator-relative values before validation.
|
|
33
|
+
*/
|
|
34
|
+
export const resolveCliJsonPaths = (value, paths) => {
|
|
35
|
+
let resolved = value;
|
|
36
|
+
for (const keys of paths)
|
|
37
|
+
resolved = resolveJsonPath(resolved, keys);
|
|
38
|
+
return resolved;
|
|
39
|
+
};
|
|
40
|
+
const resolveJsonPath = (value, keys) => {
|
|
41
|
+
const [head, ...tail] = keys;
|
|
42
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
43
|
+
return value;
|
|
44
|
+
const entries = Object.entries(value).map(([key, entry]) => {
|
|
45
|
+
if (key !== head)
|
|
46
|
+
return [key, entry];
|
|
47
|
+
if (tail.length === 0)
|
|
48
|
+
return [
|
|
49
|
+
key,
|
|
50
|
+
typeof entry === "string" && entry.trim().length > 0
|
|
51
|
+
? resolve(entry)
|
|
52
|
+
: entry,
|
|
53
|
+
];
|
|
54
|
+
return [key, resolveJsonPath(entry, tail)];
|
|
55
|
+
});
|
|
56
|
+
return Object.fromEntries(entries);
|
|
57
|
+
};
|
|
26
58
|
const cannotBeAnExistingFile = (cause) => typeof cause === "object" &&
|
|
27
59
|
cause !== null &&
|
|
28
60
|
"code" in cause &&
|
|
29
|
-
(cause.code === "ENOENT" ||
|
|
61
|
+
(cause.code === "ENOENT" ||
|
|
62
|
+
cause.code === "ENAMETOOLONG" ||
|
|
63
|
+
cause.code === "ENOTDIR");
|
|
30
64
|
const hasExplicitJsonFileExtension = (value) => value.toLowerCase().endsWith(".json");
|
|
31
65
|
const parseJson = (value) => {
|
|
32
66
|
let text;
|
package/dist/cliOutput.js
CHANGED
|
@@ -10,10 +10,21 @@ const validationError = (value) => {
|
|
|
10
10
|
return value.error.code === "VALIDATION_ERROR" ? value.error : undefined;
|
|
11
11
|
return undefined;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
/** Read effective Incur output controls at the executable boundary. */
|
|
14
|
+
export const parseCliOutputArguments = (arguments_) => {
|
|
14
15
|
let format = "toon";
|
|
15
|
-
let filterOutput
|
|
16
|
+
let filterOutput;
|
|
17
|
+
let fullOutput = false;
|
|
18
|
+
let tokenCount = false;
|
|
16
19
|
let tokenWindow = false;
|
|
20
|
+
const parsed = (parseError) => ({
|
|
21
|
+
filterOutput,
|
|
22
|
+
format,
|
|
23
|
+
fullOutput,
|
|
24
|
+
parseError,
|
|
25
|
+
tokenCount,
|
|
26
|
+
tokenWindow: parseError ? false : tokenWindow,
|
|
27
|
+
});
|
|
17
28
|
for (let index = 0; index < arguments_.length; index += 1) {
|
|
18
29
|
const argument = arguments_[index];
|
|
19
30
|
// Incur scans builtins across `--` and accepts only spaced value forms.
|
|
@@ -28,7 +39,7 @@ const parseCliOutputArguments = (arguments_) => {
|
|
|
28
39
|
// Incur stops parsing at an invalid format before applying any later
|
|
29
40
|
// output controls. Let it report that malformed flag itself.
|
|
30
41
|
if (!INCUR_OUTPUT_FORMATS.has(value))
|
|
31
|
-
return
|
|
42
|
+
return parsed(true);
|
|
32
43
|
format = value;
|
|
33
44
|
index += 1;
|
|
34
45
|
}
|
|
@@ -36,7 +47,7 @@ const parseCliOutputArguments = (arguments_) => {
|
|
|
36
47
|
}
|
|
37
48
|
if (argument === "--filter-output") {
|
|
38
49
|
if (arguments_[index + 1]) {
|
|
39
|
-
filterOutput =
|
|
50
|
+
filterOutput = arguments_[index + 1];
|
|
40
51
|
index += 1;
|
|
41
52
|
}
|
|
42
53
|
continue;
|
|
@@ -46,14 +57,18 @@ const parseCliOutputArguments = (arguments_) => {
|
|
|
46
57
|
if (value) {
|
|
47
58
|
const numericValue = Number(value);
|
|
48
59
|
if (!Number.isFinite(numericValue) || value.trim() === "")
|
|
49
|
-
return
|
|
60
|
+
return parsed(true);
|
|
50
61
|
tokenWindow = true;
|
|
51
62
|
index += 1;
|
|
52
63
|
}
|
|
53
64
|
continue;
|
|
54
65
|
}
|
|
66
|
+
if (argument === "--full-output")
|
|
67
|
+
fullOutput = true;
|
|
68
|
+
if (argument === "--token-count")
|
|
69
|
+
tokenCount = true;
|
|
55
70
|
}
|
|
56
|
-
return
|
|
71
|
+
return parsed(false);
|
|
57
72
|
};
|
|
58
73
|
/** Reject text-window controls that would corrupt a structured document. */
|
|
59
74
|
export const validateCliOutputArguments = (arguments_) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RecordedCrashService } from "../application/binaryDiagnostics/RecordedCrashService.js";
|
|
2
|
+
import { PwntoolsRecordedCrashProvider } from "../native/pwntools/PwntoolsRecordedCrashProvider.js";
|
|
3
|
+
import { BinaryLayoutService } from "../application/binaryDiagnostics/BinaryLayoutService.js";
|
|
4
|
+
import { PwntoolsLayoutProvider } from "../native/pwntools/PwntoolsLayoutProvider.js";
|
|
5
|
+
/** Compose the offline adapter without import-time I/O or dependency acquisition. */
|
|
6
|
+
export const createBinaryLayoutService = (environment = process.env) => new BinaryLayoutService(new PwntoolsLayoutProvider(environment));
|
|
7
|
+
/** Compose recorded-core inspection without acquiring a debugger or toolchain. */
|
|
8
|
+
export const createRecordedCrashService = (environment = process.env) => new RecordedCrashService(new PwntoolsRecordedCrashProvider(environment));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EvmInterfaceService } from "../application/evm/EvmInterfaceService.js";
|
|
2
|
+
import { EvmoleInterfaceProvider } from "../evm/EvmoleInterfaceProvider.js";
|
|
3
|
+
/** Compose offline interface analysis without import-time I/O or dependency acquisition. */
|
|
4
|
+
export const createEvmInterfaceService = (environment = process.env) => new EvmInterfaceService(new EvmoleInterfaceProvider(environment));
|