rea-agents 4.1.0 → 6.0.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 +173 -568
- package/bridge/android/ReaJadxBridge.java +247 -0
- package/bridge/mitmproxy/capture.py +210 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +30 -16
- package/bridge/native/rea_lldb_tracer.py +303 -0
- package/bridge/process/ProcessRunTokenReader.swift +263 -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 +143 -0
- package/dist/android/AndroidTargetSnapshot.js +5 -3
- package/dist/android/JadxAnalysis.js +8 -6
- package/dist/android/JadxConfiguration.js +19 -3
- package/dist/android/JadxMcpTransport.js +43 -16
- package/dist/android/JadxProtocol.js +8 -0
- package/dist/android/JadxProvider.js +118 -28
- package/dist/android/JadxRelease.js +8 -0
- package/dist/android/JadxSession.js +32 -18
- package/dist/application/AppBundleExecutable.js +141 -0
- package/dist/application/BinaryTargetResolver.js +9 -64
- package/dist/application/CapabilityInventory.js +82 -3
- package/dist/application/ClientConfigurationDocument.js +72 -12
- package/dist/application/ClientRegistrationStatus.js +7 -8
- package/dist/application/DirectAnalysis.js +109 -37
- package/dist/application/DirectAnalysisStatus.js +4 -5
- package/dist/application/DoctorDiagnostics.js +3 -3
- package/dist/application/EnhancedTools.js +4 -4
- package/dist/application/EvidenceBundleCommands.js +1 -1
- package/dist/application/EvidenceBundleFiles.js +1 -1
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/LinuxHopper.js +8 -2
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ReconstructionCoverageService.js +2 -6
- package/dist/application/ReconstructionObligationCandidates.js +10 -3
- package/dist/application/ReferenceSourceImport.js +2 -0
- package/dist/application/ReferenceSourceImportEntries.js +20 -3
- package/dist/application/ReferenceSourceImportTypes.js +5 -0
- package/dist/application/Setup.js +10 -2
- package/dist/application/SetupClientConfiguration.js +19 -16
- package/dist/application/SetupHost.js +18 -3
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/Uninstall.js +23 -17
- package/dist/application/UpdateMaintenance.js +3 -3
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModuleTraceService.js +209 -0
- package/dist/application/WebNetworkCaptureService.js +132 -0
- package/dist/application/WebRuntimeService.js +73 -0
- package/dist/application/WebScriptExportService.js +115 -0
- package/dist/application/WebSourceLocationService.js +160 -0
- package/dist/application/WindowsCapabilities.js +1 -1
- package/dist/application/{AndroidAnalysisService.js → android/AndroidAnalysisService.js} +6 -6
- package/dist/application/{AndroidApplicationService.js → android/AndroidApplicationService.js} +3 -3
- package/dist/application/{AppleApplicationService.js → apple/AppleApplicationService.js} +5 -5
- package/dist/application/{AnalysisClientCleanup.js → binary/AnalysisClientCleanup.js} +2 -2
- package/dist/application/{AnalysisProviderEvaluation.js → binary/AnalysisProviderEvaluation.js} +4 -4
- package/dist/application/{AnalysisProviderRegistry.js → binary/AnalysisProviderRegistry.js} +5 -5
- package/dist/application/{AnalysisSnapshotCache.js → binary/AnalysisSnapshotCache.js} +55 -14
- package/dist/application/{AnalysisSnapshotFiles.js → binary/AnalysisSnapshotFiles.js} +4 -4
- package/dist/application/{BinarySession.js → binary/BinarySession.js} +50 -20
- package/dist/application/{BinarySessionComposition.js → binary/BinarySessionComposition.js} +2 -1
- package/dist/application/{BinarySessionExecution.js → binary/BinarySessionExecution.js} +9 -7
- package/dist/application/{BinarySessionOpen.js → binary/BinarySessionOpen.js} +22 -9
- package/dist/application/{BinarySessionRecords.js → binary/BinarySessionRecords.js} +48 -40
- package/dist/application/{CompositeProvider.js → binary/CompositeProvider.js} +2 -2
- package/dist/application/{LazyAnalysisProvider.js → binary/LazyAnalysisProvider.js} +6 -6
- package/dist/application/{SessionProviderRouter.js → binary/SessionProviderRouter.js} +7 -7
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +57 -0
- package/dist/application/binaryDiagnostics/RecordedCrashPort.js +1 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +60 -0
- package/dist/application/evm/EvmInterfacePort.js +1 -0
- package/dist/application/evm/EvmInterfaceService.js +62 -0
- package/dist/application/firmware/FirmwareAnalysisPort.js +1 -0
- package/dist/application/{FirmwareAnalysisService.js → firmware/FirmwareAnalysisService.js} +5 -5
- package/dist/application/{EvidenceLedger.js → investigation/EvidenceLedger.js} +44 -7
- package/dist/application/investigation/InvestigationRecordPort.js +1 -0
- package/dist/application/investigation/InvestigationRecords.js +69 -0
- package/dist/application/{UnknownEvidence.js → investigation/UnknownEvidence.js} +1 -1
- package/dist/application/{ElectronActiveEvidence.js → javascript/ElectronActiveEvidence.js} +3 -3
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/{ElectronActiveObservationService.js → javascript/ElectronActiveObservationService.js} +3 -3
- package/dist/application/{ElectronBoundaryAnalysis.js → javascript/ElectronBoundaryAnalysis.js} +1 -1
- package/dist/application/{ElectronBoundaryGraphContext.js → javascript/ElectronBoundaryGraphContext.js} +1 -1
- package/dist/application/{ElectronEvidence.js → javascript/ElectronEvidence.js} +2 -2
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/{ElectronObservationService.js → javascript/ElectronObservationService.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidence.js → javascript/JavaScriptApplicationEvidence.js} +3 -4
- package/dist/application/{JavaScriptApplicationEvidenceGraph.js → javascript/JavaScriptApplicationEvidenceGraph.js} +5 -5
- package/dist/application/{JavaScriptApplicationService.js → javascript/JavaScriptApplicationService.js} +25 -12
- package/dist/application/{JavaScriptApplicationWorkflowEvidence.js → javascript/JavaScriptApplicationWorkflowEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationWorkflowService.js → javascript/JavaScriptApplicationWorkflowService.js} +12 -12
- package/dist/application/{JavaScriptArtifactAnalysis.js → javascript/JavaScriptArtifactAnalysis.js} +50 -47
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/{JavaScriptArtifactGraphAccumulator.js → javascript/JavaScriptArtifactGraphAccumulator.js} +16 -2
- package/dist/application/{JavaScriptArtifactGraphBuilder.js → javascript/JavaScriptArtifactGraphBuilder.js} +2 -2
- package/dist/application/{JavaScriptArtifactGraphContext.js → javascript/JavaScriptArtifactGraphContext.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphDocuments.js → javascript/JavaScriptArtifactGraphDocuments.js} +27 -3
- package/dist/application/{JavaScriptArtifactGraphFindings.js → javascript/JavaScriptArtifactGraphFindings.js} +20 -7
- package/dist/application/{JavaScriptArtifactGraphStructure.js → javascript/JavaScriptArtifactGraphStructure.js} +1 -1
- package/dist/application/{JavaScriptArtifactPathResolution.js → javascript/JavaScriptArtifactPathResolution.js} +80 -36
- package/dist/application/{JavaScriptArtifactReconstruction.js → javascript/JavaScriptArtifactReconstruction.js} +26 -17
- package/dist/application/{JavaScriptJsonModules.js → javascript/JavaScriptJsonModules.js} +1 -1
- package/dist/application/{JavaScriptModuleRelationships.js → javascript/JavaScriptModuleRelationships.js} +2 -2
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +52 -0
- package/dist/application/{JavaScriptReturnShapeProjection.js → javascript/JavaScriptReturnShapeProjection.js} +3 -3
- package/dist/application/{JavaScriptRuntimeObservationEvidence.js → javascript/JavaScriptRuntimeObservationEvidence.js} +2 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/{JavaScriptRuntimeObservationService.js → javascript/JavaScriptRuntimeObservationService.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationEvidence.js → javascript/JavaScriptRuntimeReconciliationEvidence.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationService.js → javascript/JavaScriptRuntimeReconciliationService.js} +6 -6
- package/dist/application/{JavaScriptSemanticGraphAsyncProjection.js → javascript/JavaScriptSemanticGraphAsyncProjection.js} +8 -8
- package/dist/application/{JavaScriptSemanticGraphBuilder.js → javascript/JavaScriptSemanticGraphBuilder.js} +150 -73
- package/dist/application/{JavaScriptSemanticGraphChildProcessProjection.js → javascript/JavaScriptSemanticGraphChildProcessProjection.js} +15 -16
- package/dist/application/{JavaScriptSemanticGraphConstruction.js → javascript/JavaScriptSemanticGraphConstruction.js} +43 -2
- package/dist/application/{JavaScriptSemanticGraphDataProjection.js → javascript/JavaScriptSemanticGraphDataProjection.js} +8 -8
- package/dist/application/{JavaScriptSemanticGraphFingerprintProjection.js → javascript/JavaScriptSemanticGraphFingerprintProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFlowProjection.js → javascript/JavaScriptSemanticGraphFlowProjection.js} +7 -11
- package/dist/application/{JavaScriptSemanticGraphObjectProjection.js → javascript/JavaScriptSemanticGraphObjectProjection.js} +4 -4
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +144 -0
- package/dist/application/{JavaScriptSemanticGraphResourceProjection.js → javascript/JavaScriptSemanticGraphResourceProjection.js} +4 -4
- package/dist/application/{JavaScriptSemanticGraphValueProjection.js → javascript/JavaScriptSemanticGraphValueProjection.js} +5 -5
- package/dist/application/{JavaScriptSemanticTraceService.js → javascript/JavaScriptSemanticTraceService.js} +6 -6
- package/dist/application/{ManagedApplicationGraphService.js → managed/ManagedApplicationGraphService.js} +7 -7
- package/dist/application/{ManagedMemberComparisonService.js → managed/ManagedMemberComparisonService.js} +10 -10
- package/dist/application/{ManagedNativeVerificationService.js → managed/ManagedNativeVerificationService.js} +7 -7
- package/dist/application/{ManagedReconstructionService.js → managed/ManagedReconstructionService.js} +7 -7
- package/dist/application/{NativeApiInspection.js → native/NativeApiInspection.js} +1 -1
- package/dist/application/{NativeCallRoutes.js → native/NativeCallRoutes.js} +3 -3
- package/dist/application/{NativeDispatchMetadataInspection.js → native/NativeDispatchMetadataInspection.js} +4 -4
- package/dist/application/{NativeUiActionTrace.js → native/NativeUiActionTrace.js} +7 -7
- package/dist/application/{NativeValueTrace.js → native/NativeValueTrace.js} +6 -6
- package/dist/application/{ProcessCli.js → process/ProcessCli.js} +15 -11
- package/dist/application/{ProcessEvidence.js → process/ProcessEvidence.js} +4 -4
- package/dist/{application/ArtifactInventory/hash.js → artifacts/ArtifactHash.js} +4 -2
- package/dist/artifacts/ArtifactPaths.js +3 -3
- package/dist/artifacts/ArtifactProvider.js +37 -40
- package/dist/artifacts/ArtifactProviderMetadata.js +37 -0
- package/dist/artifacts/AsarArtifactReader.js +195 -23
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/DirectoryArtifactReader.js +41 -7
- package/dist/artifacts/NativeDmgArtifactReader.js +161 -9
- package/dist/artifacts/ZipArtifactReader.js +3 -0
- package/dist/{application → artifacts/apple}/AppleAssetCatalogAnalysis.js +4 -4
- package/dist/artifacts/apple/DylibResolutionReader.js +259 -0
- package/dist/{application → artifacts/apple}/InterfaceBuilderAnalysis.js +125 -51
- package/dist/artifacts/{KeyedArchiveReader.js → apple/KeyedArchiveReader.js} +21 -27
- package/dist/artifacts/apple/MachoLoadCommandReader.js +294 -0
- package/dist/artifacts/apple/NibViewHierarchy.js +150 -0
- package/dist/{application → artifacts/extraction}/ArtifactExtraction.js +10 -10
- package/dist/{application → artifacts/inventory}/ArtifactGraphConstruction.js +3 -3
- 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 +3 -3
- package/dist/{application/ArtifactInventory → artifacts/inventory}/scanReader.js +5 -5
- package/dist/{application → artifacts/javascript}/JavaScriptArtifactFiles.js +27 -6
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/readStableArtifact.js +68 -0
- package/dist/browser/BrowserScenarioSecrets.js +50 -8
- package/dist/browser/CdpAuthorizedMainFrame.js +4 -4
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +4 -15
- package/dist/browser/CdpCaptureDocuments.js +33 -21
- package/dist/browser/CdpCaptureEventBodyShapes.js +3 -3
- package/dist/browser/CdpCaptureEventHandlers.js +116 -28
- package/dist/browser/CdpCaptureEventHelpers.js +6 -6
- package/dist/browser/CdpCaptureEvents.js +9 -0
- package/dist/browser/CdpCaptureStorage.js +10 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +24 -22
- package/dist/browser/CdpCaptureValues.js +2 -2
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +51 -11
- package/dist/browser/CdpElectronInspection.js +10 -10
- package/dist/browser/CdpElectronProvider.js +3 -6
- package/dist/browser/CdpElectronScriptEvents.js +6 -6
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpElectronWorkers.js +4 -4
- package/dist/browser/CdpObservationSession.js +18 -23
- package/dist/browser/CdpPageCapture.js +4 -4
- package/dist/browser/CdpPageCaptureScripts.js +2 -2
- package/dist/browser/CdpPageCaptureWorkers.js +9 -9
- package/dist/browser/CdpSafeMetadata.js +48 -10
- package/dist/browser/CdpScreenshot.js +5 -5
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +2 -2
- package/dist/browser/CdpWebMcpDiscovery.js +22 -16
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +7 -6
- package/dist/browser/PlaywrightElectronActiveProvider.js +15 -9
- package/dist/browser/PlaywrightScenarioEvents.js +59 -51
- package/dist/browser/PlaywrightScenarioSession.js +8 -1
- package/dist/browser/WebSourceMapFetcher.js +37 -53
- package/dist/browser/assets/LocalWebScriptArtifacts.js +87 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +74 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +76 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +56 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +40 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +48 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/history/CaptureFailures.js +101 -0
- package/dist/browser/history/CaptureFormatError.js +10 -0
- package/dist/browser/history/CaptureRedaction.js +65 -0
- package/dist/browser/history/CaptureRelease.js +12 -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 +91 -0
- package/dist/browser/history/HarSchema.js +72 -0
- package/dist/browser/history/HistoricalCaptureDecoder.js +186 -0
- package/dist/browser/history/HistoricalCaptureFormatAdapter.js +1 -0
- package/dist/browser/history/MitmproxyCaptureAdapter.js +42 -0
- package/dist/browser/modules/NativeModuleResolver.js +210 -0
- package/dist/browser/modules/WebModuleArtifacts.js +40 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +23 -15
- package/dist/cli/androidCommands.js +13 -3
- package/dist/cli/applicationCommands.js +39 -8
- package/dist/cli/artifactCommands.js +27 -2
- package/dist/cli/binaryDiagnosticsCommands.js +39 -0
- package/dist/cli/browserAdvancedCommands.js +27 -9
- package/dist/cli/coreAnalysisCommands.js +6 -494
- package/dist/cli/coreBinaryCommands.js +211 -0
- package/dist/cli/coreNativeCommands.js +293 -0
- package/dist/cli/electronCommands.js +29 -27
- package/dist/cli/evmCommands.js +24 -0
- package/dist/cli/firmwareCommands.js +9 -6
- package/dist/cli/javascriptApplicationAnalysis.js +17 -4
- package/dist/cli/javascriptRecoveryCommands.js +45 -0
- package/dist/cli/jsonOutput.js +133 -0
- package/dist/cli/managedCommands.js +4 -4
- package/dist/cli/managedProjectGraphCommand.js +1 -1
- package/dist/cli/nativeCallCommands.js +35 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +6 -1
- package/dist/cli/streamedJsonOutput.js +56 -0
- package/dist/cli/utilityCommands.js +49 -23
- package/dist/cli/webModuleCommands.js +56 -0
- package/dist/cli/webNetworkCaptureCommands.js +40 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +31 -0
- package/dist/cli/webSourceLocationCommands.js +42 -0
- package/dist/cli.js +19 -3
- package/dist/cliBrowserContext.js +4 -2
- package/dist/cliBrowserScenarioCommands.js +6 -5
- package/dist/cliCommandNames.js +14 -0
- package/dist/cliJavaScriptRuntimeCommands.js +6 -4
- package/dist/cliJsonInput.js +38 -2
- package/dist/cliOutput.js +52 -11
- package/dist/composition/android.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/binaryDiagnostics.js +8 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +3 -0
- package/dist/composition/directAnalysis.js +17 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/evm.js +4 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/optionalObservationProviders.js +49 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webNetworkCaptures.js +6 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/parseConfig.js +22 -3
- package/dist/contracts/{androidToolContracts.js → android/androidToolContracts.js} +5 -5
- package/dist/contracts/applicationToolContracts.js +43 -8
- package/dist/contracts/artifactToolContracts.js +8 -2
- package/dist/contracts/browserCaptureToolInputSchema.js +43 -0
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/browserToolContracts.js +4 -3
- package/dist/contracts/enhancedInputs.js +1 -1
- package/dist/contracts/errorSchemas.js +8 -1
- package/dist/contracts/evm/evmToolContracts.js +20 -0
- package/dist/contracts/{firmwareToolContracts.js → firmware/firmwareToolContracts.js} +5 -5
- package/dist/contracts/investigationExamples.js +2 -2
- package/dist/contracts/{applicationWorkflowInputContracts.js → javascript/applicationWorkflowInputContracts.js} +6 -6
- package/dist/contracts/{electronToolContracts.js → javascript/electronToolContracts.js} +6 -6
- package/dist/contracts/{javascriptApplicationWorkflowExamples.js → javascript/javascriptApplicationWorkflowExamples.js} +3 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +23 -0
- package/dist/contracts/{javascriptRuntimeObservationToolContracts.js → javascript/javascriptRuntimeObservationToolContracts.js} +3 -3
- package/dist/contracts/{javascriptRuntimeReconciliationExample.js → javascript/javascriptRuntimeReconciliationExample.js} +5 -5
- package/dist/contracts/{managedToolContracts.js → managed/managedToolContracts.js} +10 -6
- package/dist/contracts/{managedWorkflowExamples.js → managed/managedWorkflowExamples.js} +1 -1
- package/dist/contracts/{managedWorkflowToolContracts.js → managed/managedWorkflowToolContracts.js} +6 -6
- package/dist/contracts/mobileApplicationGraphExamples.js +105 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +42 -0
- package/dist/contracts/{nativeToolContracts.js → native/nativeToolContracts.js} +31 -8
- package/dist/contracts/officialToolContracts.js +15 -12
- package/dist/contracts/process/processCaptureExample.js +2 -0
- package/dist/contracts/sessionLifecycleInputs.js +22 -5
- package/dist/contracts/sessionStatusContract.js +10 -2
- package/dist/contracts/sessionToolContracts.js +9 -2
- package/dist/contracts/sessionToolSchemas.js +10 -3
- package/dist/contracts/toolContractExamples.js +1 -1
- package/dist/contracts/toolContracts.js +19 -7
- package/dist/contracts/toolEffects.js +62 -0
- package/dist/contracts/toolOutputSchemaGroups.js +23 -19
- package/dist/contracts/toolOutputSchemaPrimitives.js +1 -1
- package/dist/contracts/webNetworkCaptureToolContracts.js +24 -0
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/domain/analysisErrorBase.js +15 -0
- package/dist/domain/analysisErrorCore.js +63 -7
- package/dist/domain/analysisErrorPresentation.js +29 -1
- package/dist/domain/analysisErrorProjection.js +53 -2
- package/dist/domain/analysisSnapshot.js +166 -2
- package/dist/domain/{androidApplication.js → android/androidApplication.js} +7 -6
- package/dist/domain/apple/appleApplication.js +277 -0
- package/dist/domain/{appleAssetCatalog.js → apple/appleAssetCatalog.js} +2 -2
- package/dist/domain/apple/appleBundleAnatomy.js +236 -0
- package/dist/domain/apple/dyldPaths.js +81 -0
- package/dist/domain/apple/dylibResolution.js +367 -0
- package/dist/domain/apple/dylibResolutionFindings.js +75 -0
- package/dist/domain/{interfaceBuilderGraph.js → apple/interfaceBuilderGraph.js} +47 -314
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +411 -0
- package/dist/domain/{keyedArchive.js → apple/keyedArchive.js} +10 -9
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactInventoryEvidence.js +12 -2
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +5 -1
- package/dist/domain/artifactPathSyntax.js +26 -0
- package/dist/domain/browserNetworkEvidence.js +82 -0
- package/dist/domain/browserObservation.js +1 -1
- package/dist/domain/browserObservationError.js +2 -0
- package/dist/domain/browserObservationSchemas.js +15 -1
- package/dist/domain/browserScenarioCapture.js +22 -0
- package/dist/domain/browserScenarioCaptureValues.js +25 -0
- package/dist/domain/browserScenarioDiff.js +6 -3
- package/dist/domain/browserScenarioDiffEvidence.js +35 -1
- package/dist/domain/browserScenarioValues.js +21 -3
- package/dist/domain/browserSession.js +2 -7
- package/dist/domain/bundleComparison.js +2 -1
- package/dist/domain/callPath.js +52 -44
- package/dist/domain/callPathSchemas.js +1 -1
- package/dist/domain/canonicalDigest.js +13 -1
- package/dist/domain/changedBehavior.js +3 -3
- package/dist/domain/comparisonStatus.js +11 -0
- package/dist/domain/conformanceTrustGate.js +0 -16
- package/dist/domain/evidence.js +17 -5
- package/dist/domain/evidenceBundle.js +98 -35
- package/dist/domain/evm/evmInterface.js +63 -0
- package/dist/domain/explicitSensitiveFailure.js +92 -0
- package/dist/domain/explicitSensitiveValues.js +10 -0
- package/dist/domain/{firmwareAnalysis.js → firmware/firmwareAnalysis.js} +10 -3
- package/dist/domain/functionComparisonNormalization.js +11 -13
- package/dist/domain/hopperValues.js +2 -2
- package/dist/domain/inputIssueProjection.js +17 -2
- package/dist/domain/{electronActiveObservation.js → javascript/electronActiveObservation.js} +9 -4
- package/dist/domain/{electronObservation.js → javascript/electronObservation.js} +5 -11
- package/dist/domain/{electronStaticAnalysisBrowser.js → javascript/electronStaticAnalysisBrowser.js} +4 -3
- package/dist/domain/{electronStaticAnalysisIpc.js → javascript/electronStaticAnalysisIpc.js} +2 -2
- package/dist/domain/{electronStaticAnalysisNative.js → javascript/electronStaticAnalysisNative.js} +12 -13
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/{electronStaticAnalysisValues.js → javascript/electronStaticAnalysisValues.js} +3 -3
- package/dist/domain/javascript/htmlArtifactReferences.js +40 -0
- package/dist/domain/{javascriptApplicationAnalysis.js → javascript/javascriptApplicationAnalysis.js} +2 -2
- package/dist/domain/{javascriptApplicationChangeGraph.js → javascript/javascriptApplicationChangeGraph.js} +1 -1
- package/dist/domain/{javascriptApplicationEvidenceSchemas.js → javascript/javascriptApplicationEvidenceSchemas.js} +6 -4
- package/dist/domain/{javascriptApplicationGraph.js → javascript/javascriptApplicationGraph.js} +2 -2
- package/dist/domain/{javascriptApplicationGraphSchemas.js → javascript/javascriptApplicationGraphSchemas.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparison.js → javascript/javascriptApplicationVersionComparison.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparisonSchemas.js → javascript/javascriptApplicationVersionComparisonSchemas.js} +3 -3
- package/dist/domain/{javascriptApplicationVersionItems.js → javascript/javascriptApplicationVersionItems.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionKeys.js → javascript/javascriptApplicationVersionKeys.js} +16 -9
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/{javascriptAstFingerprint.js → javascript/javascriptAstFingerprint.js} +38 -22
- package/dist/domain/javascript/javascriptAstValues.js +23 -0
- package/dist/domain/{javascriptExportShapeComparison.js → javascript/javascriptExportShapeComparison.js} +21 -5
- package/dist/domain/{javascriptExportShapeComparisonSchemas.js → javascript/javascriptExportShapeComparisonSchemas.js} +2 -2
- package/dist/domain/{javascriptExportShapeSelection.js → javascript/javascriptExportShapeSelection.js} +1 -1
- package/dist/domain/{javascriptExportShapeVariants.js → javascript/javascriptExportShapeVariants.js} +1 -11
- package/dist/domain/{javascriptFeatureSeed.js → javascript/javascriptFeatureSeed.js} +4 -3
- package/dist/domain/{javascriptFeatureTrace.js → javascript/javascriptFeatureTrace.js} +2 -2
- package/dist/domain/{javascriptFeatureTraceSchemas.js → javascript/javascriptFeatureTraceSchemas.js} +32 -18
- package/dist/domain/{javascriptFeatureTraversal.js → javascript/javascriptFeatureTraversal.js} +6 -2
- package/dist/domain/{javascriptNativeHandoff.js → javascript/javascriptNativeHandoff.js} +1 -1
- package/dist/domain/javascript/javascriptRecovery.js +88 -0
- package/dist/domain/{javascriptRuntimeLoadState.js → javascript/javascriptRuntimeLoadState.js} +1 -1
- package/dist/domain/{javascriptRuntimeObservation.js → javascript/javascriptRuntimeObservation.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationActive.js → javascript/javascriptRuntimeReconciliationActive.js} +3 -3
- package/dist/domain/{javascriptRuntimeReconciliationGraph.js → javascript/javascriptRuntimeReconciliationGraph.js} +1 -1
- package/dist/domain/{javascriptRuntimeReconciliationMatching.js → javascript/javascriptRuntimeReconciliationMatching.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationParsing.js → javascript/javascriptRuntimeReconciliationParsing.js} +5 -5
- package/dist/domain/{javascriptRuntimeReconciliationResult.js → javascript/javascriptRuntimeReconciliationResult.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationSchemas.js → javascript/javascriptRuntimeReconciliationSchemas.js} +4 -4
- package/dist/domain/{javascriptRuntimeStaticCandidates.js → javascript/javascriptRuntimeStaticCandidates.js} +1 -1
- package/dist/domain/{javascriptSemanticAnalysis.js → javascript/javascriptSemanticAnalysis.js} +40 -14
- package/dist/domain/{javascriptSemanticAsyncEffects.js → javascript/javascriptSemanticAsyncEffects.js} +2 -1
- package/dist/domain/{javascriptSemanticCallResolution.js → javascript/javascriptSemanticCallResolution.js} +10 -5
- package/dist/domain/{javascriptSemanticCalls.js → javascript/javascriptSemanticCalls.js} +7 -4
- package/dist/domain/{javascriptSemanticChildProcesses.js → javascript/javascriptSemanticChildProcesses.js} +4 -2
- package/dist/domain/{javascriptSemanticDataEffectHelpers.js → javascript/javascriptSemanticDataEffectHelpers.js} +7 -6
- package/dist/domain/{javascriptSemanticDataEffects.js → javascript/javascriptSemanticDataEffects.js} +8 -6
- package/dist/domain/{javascriptSemanticFingerprints.js → javascript/javascriptSemanticFingerprints.js} +40 -16
- package/dist/domain/{javascriptSemanticGraph.js → javascript/javascriptSemanticGraph.js} +23 -7
- package/dist/domain/{javascriptSemanticGraphSchemas.js → javascript/javascriptSemanticGraphSchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +116 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +53 -0
- package/dist/domain/{javascriptSemanticObjects.js → javascript/javascriptSemanticObjects.js} +5 -5
- package/dist/domain/{javascriptSemanticPrimitives.js → javascript/javascriptSemanticPrimitives.js} +1 -1
- package/dist/domain/{javascriptSemanticProjection.js → javascript/javascriptSemanticProjection.js} +31 -44
- package/dist/domain/{javascriptSemanticPromises.js → javascript/javascriptSemanticPromises.js} +77 -22
- package/dist/domain/{javascriptSemanticProvenance.js → javascript/javascriptSemanticProvenance.js} +4 -1
- package/dist/domain/{javascriptSemanticQuery.js → javascript/javascriptSemanticQuery.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryAssessment.js → javascript/javascriptSemanticQueryAssessment.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryIdentity.js → javascript/javascriptSemanticQueryIdentity.js} +1 -1
- package/dist/domain/{javascriptSemanticQuerySchemas.js → javascript/javascriptSemanticQuerySchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +25 -0
- package/dist/domain/{javascriptSemanticResources.js → javascript/javascriptSemanticResources.js} +2 -1
- package/dist/domain/{javascriptSemanticReturns.js → javascript/javascriptSemanticReturns.js} +1 -1
- package/dist/domain/{javascriptSemanticTraceSchemas.js → javascript/javascriptSemanticTraceSchemas.js} +2 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +55 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/{javascriptSemanticValues.js → javascript/javascriptSemanticValues.js} +72 -48
- package/dist/domain/{javascriptStaticAnalysis.js → javascript/javascriptStaticAnalysis.js} +7 -4
- package/dist/domain/{javascriptStaticAnalysisBundler.js → javascript/javascriptStaticAnalysisBundler.js} +14 -11
- package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js} +2 -2
- package/dist/domain/{javascriptStaticAnalysisHelpers.js → javascript/javascriptStaticAnalysisHelpers.js} +231 -40
- package/dist/domain/{sourceToBundleComparison.js → javascript/sourceToBundleComparison.js} +2 -2
- package/dist/domain/{sourceToBundleComparisonSchemas.js → javascript/sourceToBundleComparisonSchemas.js} +4 -4
- package/dist/domain/{sourceToBundleSignals.js → javascript/sourceToBundleSignals.js} +2 -2
- package/dist/domain/jsonValue.js +4 -0
- package/dist/domain/localPath.js +2 -0
- package/dist/domain/{managedApplicationGraph.js → managed/managedApplicationGraph.js} +4 -4
- package/dist/domain/{managedApplicationGraphNodes.js → managed/managedApplicationGraphNodes.js} +1 -1
- package/dist/domain/{managedArtifact.js → managed/managedArtifact.js} +1 -1
- package/dist/domain/{managedMemberComparison.js → managed/managedMemberComparison.js} +4 -4
- package/dist/domain/{managedMemberComparisonCoverage.js → managed/managedMemberComparisonCoverage.js} +2 -1
- package/dist/domain/{managedMemberComparisonItems.js → managed/managedMemberComparisonItems.js} +97 -40
- package/dist/domain/{managedMemberComparisonMatch.js → managed/managedMemberComparisonMatch.js} +22 -11
- package/dist/domain/{managedNativeVerification.js → managed/managedNativeVerification.js} +1 -1
- package/dist/domain/{managedNativeVerificationMatch.js → managed/managedNativeVerificationMatch.js} +3 -3
- package/dist/domain/{managedNativeVerificationSchemas.js → managed/managedNativeVerificationSchemas.js} +6 -5
- package/dist/domain/{managedReconstruction.js → managed/managedReconstruction.js} +3 -3
- package/dist/domain/native/binaryLayout.js +357 -0
- package/dist/domain/native/nativeCallObservation.js +164 -0
- package/dist/domain/{nativeFunctionAnnotations.js → native/nativeFunctionAnnotations.js} +1 -1
- package/dist/domain/{nativeInspection.js → native/nativeInspection.js} +1 -1
- package/dist/domain/{nativeInvestigationGraph.js → native/nativeInvestigationGraph.js} +13 -4
- package/dist/domain/{nativeLoadImage.js → native/nativeLoadImage.js} +1 -1
- package/dist/domain/{nativeUiObservation.js → native/nativeUiObservation.js} +20 -6
- package/dist/domain/{objcSwiftMetadata.js → native/objcSwiftMetadata.js} +17 -39
- package/dist/domain/native/recordedCrash.js +266 -0
- package/dist/domain/native/recordedCrashNoteCoverage.js +73 -0
- package/dist/domain/process/processCapture.js +316 -0
- 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} +1 -1
- package/dist/domain/{processObservation.js → process/processObservation.js} +1 -1
- package/dist/domain/{processScenario.js → process/processScenario.js} +17 -17
- package/dist/domain/{processTraceSpecification.js → process/processTraceSpecification.js} +1 -1
- package/dist/domain/propertyListKeys.js +69 -0
- package/dist/domain/providerCleanupError.js +5 -2
- package/dist/domain/providerSelectionError.js +4 -2
- package/dist/domain/reconstructionCoverageEvaluation.js +46 -24
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/reconstructionVerification.js +3 -3
- package/dist/domain/reconstructionVerificationSchemas.js +1 -1
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeVersion.js +2 -0
- package/dist/domain/sourceMapEnvelope.js +38 -0
- package/dist/domain/staticRuntimeCorrelation.js +3 -3
- package/dist/domain/unicodeCodePointOrder.js +11 -6
- package/dist/domain/webBundleAnalyzerAst.js +2 -34
- package/dist/domain/webBundleAnalyzerInspection.js +12 -9
- package/dist/domain/webCaptureDiff.js +1 -0
- package/dist/domain/webEventListeners.js +28 -0
- package/dist/domain/webExecution.js +74 -0
- package/dist/domain/webMcpDiscovery.js +1 -7
- package/dist/domain/webModuleImports.js +104 -0
- package/dist/domain/webModuleTrace.js +106 -0
- package/dist/domain/webNetworkCapture.js +118 -0
- package/dist/domain/webNetworkCaptureCoordinates.js +58 -0
- package/dist/domain/webRuntime.js +69 -0
- package/dist/domain/webScreenshot.js +1 -7
- package/dist/domain/webScriptArtifacts.js +39 -0
- package/dist/domain/webScriptExport.js +86 -0
- package/dist/domain/webScriptExportError.js +13 -0
- package/dist/domain/webScriptExportPlan.js +108 -0
- package/dist/domain/webSourceLocation.js +106 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/dotnet/ManagedArtifactInspector.js +1 -1
- package/dist/dotnet/ManagedExceptionRegionValidation.js +41 -0
- package/dist/dotnet/ManagedMemberInspector.js +5 -3
- package/dist/dotnet/ManagedMemberInspectorCore.js +72 -32
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +23 -7
- package/dist/dotnet/ManagedMemberRows.js +19 -6
- 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 +37 -19
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +59 -51
- package/dist/dotnet/ManagedPeReader.js +11 -0
- package/dist/dotnet/ManagedStaticProvider.js +3 -33
- package/dist/dotnet/ManagedStaticProviderMetadata.js +36 -0
- package/dist/evaluation/CodexAgentEval.js +2 -1
- 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/FirmwareProvider.js +18 -12
- package/dist/firmware/FirmwarePublication.js +1 -1
- package/dist/firmware/FirmwareRelease.js +1 -1
- package/dist/firmware/FirmwareReports.js +12 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraFunctionValues.js +5 -5
- package/dist/ghidra/GhidraInstallation.js +38 -34
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +1 -1
- package/dist/ghidra/GhidraLauncher.js +13 -4
- package/dist/ghidra/GhidraLoadImageAttest.js +36 -0
- package/dist/ghidra/GhidraLoadImageValues.js +1 -1
- package/dist/ghidra/GhidraProvider.js +17 -235
- package/dist/ghidra/GhidraProviderCapabilities.js +8 -15
- package/dist/ghidra/GhidraProviderClient.js +209 -0
- package/dist/ghidra/GhidraResponseBuffer.js +7 -1
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +17 -1
- package/dist/hopper/BridgeLauncher.js +2 -0
- package/dist/hopper/HopperProvider.js +2 -48
- package/dist/hopper/HopperProviderCapabilities.js +73 -0
- package/dist/hopper/HopperResponseStream.js +7 -1
- package/dist/hopper/LinuxPrivateDisplayProbe.js +8 -6
- package/dist/ida/IdaProviderCapabilities.js +3 -11
- package/dist/ida/IdaSessionClient.js +12 -0
- package/dist/{browser → inspector}/JavaScriptRuntimeScope.js +16 -5
- package/dist/{browser → inspector}/V8InspectorCaptureProjection.js +46 -8
- package/dist/{browser → inspector}/V8InspectorEndpoint.js +1 -1
- package/dist/{browser → inspector}/V8InspectorProvider.js +10 -13
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/recovery/RecoveryFiles.js +122 -0
- package/dist/javascript/recovery/WakaruCommand.js +119 -0
- package/dist/javascript/recovery/WakaruExecution.js +100 -0
- package/dist/javascript/recovery/WakaruProvider.js +96 -0
- package/dist/javascript/recovery/WakaruPublication.js +102 -0
- package/dist/javascript/recovery/WakaruRelease.js +29 -0
- package/dist/javascript/recovery/WakaruReport.js +134 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +177 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +61 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +185 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +138 -0
- package/dist/main/shutdown.js +8 -2
- package/dist/main/transport.js +24 -7
- package/dist/main.js +4 -18
- package/dist/native/AppleDispatchCoverage.js +58 -0
- package/dist/native/AppleDispatchMetadata.js +71 -509
- package/dist/native/AppleMachoFixups.js +292 -0
- package/dist/native/AppleMachoSelection.js +188 -0
- package/dist/native/AppleObjcCategories.js +59 -0
- package/dist/native/AppleObjcDispatchFacets.js +257 -0
- package/dist/native/AppleObjcProperties.js +68 -0
- package/dist/native/AppleObjcProtocols.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +150 -0
- package/dist/native/CommandRunner.js +2 -1
- package/dist/native/LldbCallTracer.js +278 -0
- package/dist/native/NativeCallObservation.js +135 -0
- package/dist/native/NativeMacOSProvider.js +151 -75
- package/dist/native/NativeMacOSProviderMetadata.js +47 -0
- package/dist/native/NativeMachoInspection.js +45 -14
- package/dist/native/NativeUiHelperRuntime.js +7 -3
- package/dist/native/NativeUiObservation.js +8 -4
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/parsers/codesign.js +40 -5
- package/dist/native/parsers/demangle.js +6 -2
- package/dist/native/parsers/dyldInfo.js +13 -4
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +14 -0
- package/dist/native/parsers/otool.js +1 -1
- package/dist/native/parsers/plist.js +174 -19
- package/dist/native/pwndbg/PwndbgCoreContext.js +160 -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 +101 -0
- package/dist/process/DarwinProcessRunTokenReader.js +294 -0
- package/dist/process/ExecFileOutput.js +2 -0
- package/dist/process/OwnedCommand.js +113 -0
- package/dist/process/ProcessOwnership.js +263 -33
- package/dist/process/ProcessOwnershipObservation.js +161 -24
- package/dist/process/ProviderProcess.js +68 -20
- package/dist/{application → process/capture}/FilesystemSnapshot.js +20 -5
- package/dist/{application → process/capture}/ProcessCaptureCapability.js +16 -1
- package/dist/{application → process/capture}/ProcessCaptureError.js +17 -1
- package/dist/process/capture/ProcessCaptureLifecycle.js +615 -0
- package/dist/process/capture/ProcessHarness.js +452 -0
- package/dist/{application → process/capture}/ProcessSampling.js +2 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +6 -1
- package/dist/server/createServer.js +70 -6
- package/dist/server/mcpClientMetadata.js +6 -3
- package/dist/server/promptCompletion.js +10 -3
- package/dist/server/registerAndroidTools.js +1 -1
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -2
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -2
- package/dist/server/registerApplicationTools/compareVersions.js +2 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +43 -0
- package/dist/server/registerApplicationTools/traceFeature.js +1 -1
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -1
- package/dist/server/registerApplicationTools.js +2 -0
- package/dist/server/registerBinaryDiagnosticsTools.js +17 -0
- package/dist/server/registerBrowserScenarioTool.js +6 -2
- package/dist/server/registerBrowserTools.js +13 -2
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +21 -7
- package/dist/server/registerEvidenceTools.js +1 -1
- package/dist/server/registerEvmTools.js +17 -0
- package/dist/server/registerJavaScriptRecoveryTool.js +17 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -4
- package/dist/server/registerManagedTools.js +3 -3
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -2
- package/dist/server/registerManagedWorkflowTools/contract.js +1 -1
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +1 -1
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +1 -1
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -2
- package/dist/server/registerNativeTools.js +1 -1
- package/dist/server/registerProcessComparisonTool.js +1 -1
- package/dist/server/registerPrompts.js +5 -1
- package/dist/server/registerRecordedCrashTools.js +17 -0
- package/dist/server/registerSessionTools.js +3 -3
- package/dist/server/registerWebModuleTool.js +17 -0
- package/dist/server/registerWebNetworkCaptureTool.js +28 -0
- package/dist/server/registerWebRuntimeTools.js +31 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +17 -0
- package/dist/server/sessionAvailabilityPolicy.js +27 -12
- package/dist/server/sessionToolPolicies.js +1 -1
- package/dist/server/toolResult.js +1 -1
- package/dist/windows/WindowsOwnedProcess.js +3 -1
- package/install.sh +12 -2
- package/native/windows/README.md +5 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +75 -26
- package/scripts/hopper-demo-x11.py +67 -8
- package/scripts/rea.mjs +19 -3
- package/skills/reverse-engineer-anything/SKILL.md +23 -3
- package/skills/reverse-engineer-anything/references/android-applications.md +2 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +1 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +61 -23
- 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/JavaScriptSemanticGraphProjection.js +0 -38
- package/dist/application/ProcessCaptureLifecycle.js +0 -299
- package/dist/application/ProcessHarness.js +0 -275
- package/dist/application/StoreFileLock.js +0 -124
- package/dist/application/runtime.js +0 -53
- package/dist/contracts/processCaptureExample.js +0 -2
- package/dist/domain/appleApplication.js +0 -181
- package/dist/domain/bytecodeProvider.js +0 -178
- package/dist/domain/customProtocolCapture.js +0 -137
- package/dist/domain/eventProcessTree.js +0 -225
- package/dist/domain/javascriptAstValues.js +0 -13
- package/dist/domain/javascriptSemanticTraversal.js +0 -30
- package/dist/domain/mobileApplicationInvestigation.js +0 -159
- package/dist/domain/packageAnalysis.js +0 -123
- package/dist/domain/peInspection.js +0 -197
- package/dist/domain/processCapture.js +0 -177
- 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/native/NativeHostCapabilities.js +0 -23
- /package/dist/application/{AndroidAnalysisPort.js → DirectAnalysisDependencies.js} +0 -0
- /package/dist/application/{BinarySessionPort.js → WebModulePorts.js} +0 -0
- /package/dist/application/{ElectronActiveObservationPort.js → WebNetworkCapturePort.js} +0 -0
- /package/dist/application/{ElectronObservationPort.js → WebRuntimePort.js} +0 -0
- /package/dist/application/{FirmwareAnalysisPort.js → WebScriptArtifactPort.js} +0 -0
- /package/dist/application/{JavaScriptArtifactAnalysisTypes.js → WebSourceLocationPorts.js} +0 -0
- /package/dist/application/{JavaScriptRuntimeObservationPort.js → android/AndroidAnalysisPort.js} +0 -0
- /package/dist/application/{ArtifactExtractionDestination.js → artifacts/ArtifactExtractionDestination.js} +0 -0
- /package/dist/application/{AbortablePromise.js → binary/AbortablePromise.js} +0 -0
- /package/dist/{domain/electronStaticAnalysisTypes.js → application/binary/BinarySessionPort.js} +0 -0
- /package/dist/application/{BinarySessionStatus.js → binary/BinarySessionStatus.js} +0 -0
- /package/dist/{domain/javascriptSemanticValueTypes.js → application/binaryDiagnostics/BinaryLayoutPort.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraph.js → javascript/ElectronBoundaryGraph.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphIpc.js → javascript/ElectronBoundaryGraphIpc.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphNative.js → javascript/ElectronBoundaryGraphNative.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphWindows.js → javascript/ElectronBoundaryGraphWindows.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphBundlers.js → javascript/JavaScriptArtifactGraphBundlers.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphEvidence.js → javascript/JavaScriptArtifactGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptArtifactReconstructionInput.js → javascript/JavaScriptArtifactReconstructionInput.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphEvidence.js → javascript/JavaScriptSemanticGraphEvidence.js} +0 -0
- /package/dist/artifacts/{NibArchive.js → apple/NibArchive.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/{androidAnalysis.js → android/androidAnalysis.js} +0 -0
- /package/dist/domain/{electronStaticAnalysis.js → javascript/electronStaticAnalysis.js} +0 -0
- /package/dist/domain/{javascriptExportShapeComparisonIdentity.js → javascript/javascriptExportShapeComparisonIdentity.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliation.js → javascript/javascriptRuntimeReconciliation.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliationRuntime.js → javascript/javascriptRuntimeReconciliationRuntime.js} +0 -0
- /package/dist/domain/{javascriptSemanticCoverage.js → javascript/javascriptSemanticCoverage.js} +0 -0
- /package/dist/domain/{javascriptSemanticDerivedAnalysis.js → javascript/javascriptSemanticDerivedAnalysis.js} +0 -0
- /package/dist/domain/{javascriptSemanticGraphSerialization.js → javascript/javascriptSemanticGraphSerialization.js} +0 -0
- /package/dist/domain/{javascriptSemanticIr.js → javascript/javascriptSemanticIr.js} +0 -0
- /package/dist/domain/{javascriptSemanticQueryRelations.js → javascript/javascriptSemanticQueryRelations.js} +0 -0
- /package/dist/domain/{javascriptSemanticState.js → javascript/javascriptSemanticState.js} +0 -0
- /package/dist/domain/{javascriptSourceParser.js → javascript/javascriptSourceParser.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisFindings.js → javascript/javascriptStaticAnalysisFindings.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisState.js → javascript/javascriptStaticAnalysisState.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisTypes.js → javascript/javascriptStaticAnalysisTypes.js} +0 -0
- /package/dist/domain/{managedApplicationGraphCoverage.js → managed/managedApplicationGraphCoverage.js} +0 -0
- /package/dist/domain/{managedApplicationGraphNodeCoverage.js → managed/managedApplicationGraphNodeCoverage.js} +0 -0
- /package/dist/domain/{nativeApiBoundary.js → native/nativeApiBoundary.js} +0 -0
- /package/dist/domain/{nativeDataType.js → native/nativeDataType.js} +0 -0
- /package/dist/domain/{nativeInstruction.js → native/nativeInstruction.js} +0 -0
- /package/dist/domain/{nativeMetadataRecovery.js → native/nativeMetadataRecovery.js} +0 -0
- /package/dist/domain/{nativeValueFlow.js → native/nativeValueFlow.js} +0 -0
- /package/dist/domain/{nativeValueTrace.js → native/nativeValueTrace.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}/ProcessCaptureEnvironment.js +0 -0
- /package/dist/{application → process/capture}/ProcessCaptureJournal.js +0 -0
- /package/dist/{application → process/capture}/ProcessFilesystemEffects.js +0 -0
- /package/dist/{application → process/capture}/ProcessNormalization.js +0 -0
- /package/dist/{application → process/capture}/ProcessScenarioRuntimeValidation.js +0 -0
- /package/dist/{application → process/capture}/ProcessTimer.js +0 -0
- /package/dist/{application → process/capture}/TerminalRenderer.js +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Fixed core-only GDB/pwndbg operation; no caller commands or historical PID lookup."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import resource
|
|
6
|
+
import gdb
|
|
7
|
+
|
|
8
|
+
OUTPUT_BYTES = 64 * 1024 * 1024
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ContextFailure(Exception):
|
|
12
|
+
def __init__(self, reason, message):
|
|
13
|
+
super().__init__(message)
|
|
14
|
+
self.reason = reason
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def inspect(request):
|
|
18
|
+
if gdb.selected_inferior().connection is not None:
|
|
19
|
+
raise ContextFailure("decoder", "Owned GDB unexpectedly has an inferior connection before core loading.")
|
|
20
|
+
root = Path(os.environ["REA_CORE_CONTEXT_REQUEST"]).parent
|
|
21
|
+
empty = root / "no-libraries"
|
|
22
|
+
empty.mkdir(mode=0o700)
|
|
23
|
+
for command in ["set auto-load off", "set debuginfod enabled off", "set auto-solib-add off", "set history save off", "set pagination off",
|
|
24
|
+
"set sysroot ./no-libraries", "set solib-search-path ./no-libraries"]:
|
|
25
|
+
gdb.execute(command, to_string=True)
|
|
26
|
+
entry = request["gdbinit"]
|
|
27
|
+
try:
|
|
28
|
+
exec(compile(Path(entry).read_bytes(), entry, "exec"), {"__name__": "__main__", "__file__": entry})
|
|
29
|
+
import pwndbg.aglib.vmmap
|
|
30
|
+
import pwndbg.lib.version
|
|
31
|
+
except (ImportError, OSError) as error:
|
|
32
|
+
raise ContextFailure("unavailable", "Selected pwndbg could not initialize: " + str(error)) from error
|
|
33
|
+
version = pwndbg.lib.version.__version__
|
|
34
|
+
if version != "2026.09.15" and not version.startswith("2026.09.15 build: "):
|
|
35
|
+
raise ContextFailure("unsupported", "Expected unchanged pwndbg2026.09.15; selected plugin reports " + version + ".")
|
|
36
|
+
gdb.execute('set context-sections ""', to_string=True)
|
|
37
|
+
# core-file takes a raw filename and retains quote characters. Use a fixed
|
|
38
|
+
# relative filename in the owned cwd so no selected path becomes GDB syntax.
|
|
39
|
+
if Path(request["snapshot_path"]) != root.parent / "object.snapshot":
|
|
40
|
+
raise ContextFailure("decoder", "Core context request did not select the shared owned snapshot.")
|
|
41
|
+
gdb.execute("core-file ../object.snapshot", to_string=True)
|
|
42
|
+
inferior = gdb.selected_inferior()
|
|
43
|
+
if inferior.connection is None or inferior.connection.type != "core" or gdb.current_progspace().filename is not None:
|
|
44
|
+
raise ContextFailure("decoder", "Requested core-only boundary was not established; no mapping query performed.")
|
|
45
|
+
maps = []
|
|
46
|
+
for page in pwndbg.aglib.vmmap.get():
|
|
47
|
+
flags = page.flags
|
|
48
|
+
maps.append({"start": hex(page.start), "end": hex(page.end), "offset": hex(page.offset), "reported_flags": flags,
|
|
49
|
+
"permissions": {"read": bool(flags & 4), "write": bool(flags & 2), "execute": bool(flags & 1)} if 1 <= flags <= 7 else None,
|
|
50
|
+
"pathname_display": page.objfile, "current_file_identity": "unknown"})
|
|
51
|
+
return {"status": "available", "gdb_version": gdb.VERSION, "pwndbg_version": version, "connection": "core", "executable": None,
|
|
52
|
+
"historical_pid": inferior.pid, "reported_limits": {"address_space_bytes": resource.getrlimit(resource.RLIMIT_AS)[0], "cpu_seconds": resource.getrlimit(resource.RLIMIT_CPU)[0], "file_size_bytes": resource.getrlimit(resource.RLIMIT_FSIZE)[0]}, "maps": maps, "confidence": "derived", "completeness": "unknown",
|
|
53
|
+
"diagnostics": {"stdout": "", "stderr": "", "truncated": False}}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def failure_exit(request_path, status, marker):
|
|
57
|
+
try:
|
|
58
|
+
descriptor = os.open(Path(request_path).parent / "resource.failure", os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
59
|
+
os.write(descriptor, marker)
|
|
60
|
+
os.close(descriptor)
|
|
61
|
+
except (OSError, MemoryError):
|
|
62
|
+
pass
|
|
63
|
+
os._exit(status)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def main():
|
|
67
|
+
request_path = os.environ["REA_CORE_CONTEXT_REQUEST"]
|
|
68
|
+
request = json.loads(Path(request_path).read_text(encoding="utf-8"))
|
|
69
|
+
reserve = bytearray(1024 * 1024)
|
|
70
|
+
try:
|
|
71
|
+
reply = {"ok": True, "value": inspect(request)}
|
|
72
|
+
except ContextFailure as error:
|
|
73
|
+
reply = {"ok": False, "reason": error.reason, "message": str(error)}
|
|
74
|
+
except MemoryError:
|
|
75
|
+
reserve = None
|
|
76
|
+
failure_exit(request_path, 75, b"M")
|
|
77
|
+
except Exception as error:
|
|
78
|
+
if isinstance(error, OSError) and error.errno == 12:
|
|
79
|
+
reserve = None
|
|
80
|
+
failure_exit(request_path, 75, b"M")
|
|
81
|
+
reply = {"ok": False, "reason": "decoder", "message": type(error).__name__ + ": " + str(error)}
|
|
82
|
+
try:
|
|
83
|
+
encoded = json.dumps(reply, ensure_ascii=True, allow_nan=False).encode("utf-8")
|
|
84
|
+
if len(encoded) > OUTPUT_BYTES:
|
|
85
|
+
encoded = json.dumps({"ok": False, "reason": "output-limit", "message": "Complete debugger context exceeds64 MiB reply budget."}).encode("utf-8")
|
|
86
|
+
descriptor = os.open(request["reply_path"], os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
87
|
+
with os.fdopen(descriptor, "wb") as handle:
|
|
88
|
+
handle.write(encoded)
|
|
89
|
+
except MemoryError:
|
|
90
|
+
reserve = None
|
|
91
|
+
failure_exit(request_path, 75, b"M")
|
|
92
|
+
except OSError as error:
|
|
93
|
+
if error.errno == 27:
|
|
94
|
+
failure_exit(request_path, 76, b"F")
|
|
95
|
+
if error.errno == 12:
|
|
96
|
+
reserve = None
|
|
97
|
+
failure_exit(request_path, 75, b"M")
|
|
98
|
+
raise
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
main()
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Catch typed resource failures while loading or running the owned debugger launcher.
|
|
2
|
+
|
|
3
|
+
Only this package's fixed sibling is executed; caller input stays in request.json.
|
|
4
|
+
Interpreter startup failures before this boundary remain unclassified.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resource_exit(status, marker):
|
|
11
|
+
try:
|
|
12
|
+
if len(sys.argv) > 2:
|
|
13
|
+
descriptor = os.open(sys.argv[1], os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
14
|
+
os.write(descriptor, marker)
|
|
15
|
+
os.close(descriptor)
|
|
16
|
+
except (OSError, MemoryError):
|
|
17
|
+
# Without a complete marker the parent keeps this failure unclassified.
|
|
18
|
+
pass
|
|
19
|
+
os._exit(status)
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
implementation = os.path.join(os.path.dirname(__file__), "launch_impl.py")
|
|
23
|
+
with open(implementation, "rb") as handle:
|
|
24
|
+
source = handle.read()
|
|
25
|
+
exec(compile(source, implementation, "exec"), {
|
|
26
|
+
"__file__": implementation,
|
|
27
|
+
"__name__": "__main__",
|
|
28
|
+
})
|
|
29
|
+
except MemoryError:
|
|
30
|
+
# Reserved status: an observed allocation failure, including imports/compile.
|
|
31
|
+
resource_exit(75, b"M")
|
|
32
|
+
except OSError as error:
|
|
33
|
+
# Linux ENOMEM is an observed allocation failure, independent of error text.
|
|
34
|
+
if error.errno == 12:
|
|
35
|
+
resource_exit(75, b"M")
|
|
36
|
+
# Linux EFBIG is observed directly, including a partial limits/reply write.
|
|
37
|
+
if error.errno == 27:
|
|
38
|
+
resource_exit(76, b"F")
|
|
39
|
+
raise
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Lower inherited limits before replacing this owned process with GDB."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
runtime_path = Path(__file__).parent.parent / "pwntools" / "decoder_runtime.py"
|
|
8
|
+
runtime = {"__file__": str(runtime_path), "__name__": "rea_decoder_runtime"}
|
|
9
|
+
exec(compile(runtime_path.read_bytes(), str(runtime_path), "exec"), runtime)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class LaunchFailure(Exception):
|
|
13
|
+
def __init__(self, reason, message):
|
|
14
|
+
super().__init__(message)
|
|
15
|
+
self.reason = reason
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def launch(snapshot, cache):
|
|
19
|
+
request_path = sys.argv[-1]
|
|
20
|
+
request = json.loads(Path(request_path).read_text(encoding="utf-8"))
|
|
21
|
+
bridge = str(Path(__file__).with_name("core_context.py"))
|
|
22
|
+
environment = dict(os.environ, REA_CORE_CONTEXT_REQUEST=request_path)
|
|
23
|
+
# Only fixed package code appears in the GDB Python command. Selected paths stay JSON data.
|
|
24
|
+
command = "python exec(compile(open(" + repr(bridge) + ", 'rb').read(), " + repr(bridge) + ", 'exec'), {'__name__':'__main__','__file__':" + repr(bridge) + "})"
|
|
25
|
+
try:
|
|
26
|
+
os.execve(request["gdb"], [request["gdb"], "-nx", "-nh", "--batch", "--quiet",
|
|
27
|
+
"-iex", "set auto-load off", "-iex", "set debuginfod enabled off",
|
|
28
|
+
"-iex", "set auto-solib-add off", "-ex", command], environment)
|
|
29
|
+
except OSError as error:
|
|
30
|
+
raise LaunchFailure("unavailable", "Selected GDB could not start (" + str(error.errno) + "): " + request["gdb"] + "; " + str(error)) from error
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
runtime["main"](sys.argv[-1], launch, LaunchFailure, "pwndbg-core-launcher")
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Shared bounded reply/limit protocol, independent of the supplied artifact format."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import resource
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
OUTPUT_BYTES = 64 * 1024 * 1024
|
|
9
|
+
|
|
10
|
+
def lower_resource_limits():
|
|
11
|
+
limits = {}
|
|
12
|
+
for name, kind, maximum in (
|
|
13
|
+
("address_space_bytes", resource.RLIMIT_AS, 3 * 1024**3),
|
|
14
|
+
("cpu_seconds", resource.RLIMIT_CPU, 30),
|
|
15
|
+
("file_size_bytes", resource.RLIMIT_FSIZE, OUTPUT_BYTES),
|
|
16
|
+
):
|
|
17
|
+
soft, hard = resource.getrlimit(kind)
|
|
18
|
+
finite = [maximum] + [value for value in (soft, hard) if value != resource.RLIM_INFINITY]
|
|
19
|
+
effective = min(finite)
|
|
20
|
+
# Preserve the inherited hard boundary and never raise a caller's soft limit.
|
|
21
|
+
resource.setrlimit(kind, (effective, hard))
|
|
22
|
+
limits[name] = effective
|
|
23
|
+
return limits
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def main(request_path, inspect, failure_type, profile):
|
|
27
|
+
request = json.loads(Path(request_path).read_text(encoding="utf-8"))
|
|
28
|
+
os.environ["PWNLIB_NOTERM"] = "1"
|
|
29
|
+
os.environ["PWNLIB_CACHE_DIR"] = str(Path(request_path).parent / "cache")
|
|
30
|
+
limits = None
|
|
31
|
+
# Release bounded emergency headroom before constructing a MemoryError reply.
|
|
32
|
+
# The outer exit-status contract also covers allocation failure during serialization.
|
|
33
|
+
memory_reserve = bytearray(1024 * 1024)
|
|
34
|
+
try:
|
|
35
|
+
limits = lower_resource_limits()
|
|
36
|
+
descriptor = os.open(Path(request_path).parent / "limits.json", os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
37
|
+
with os.fdopen(descriptor, "w", encoding="utf-8") as handle:
|
|
38
|
+
json.dump(limits, handle)
|
|
39
|
+
value = inspect(Path(request["snapshot_path"]), Path(request_path).parent / "cache")
|
|
40
|
+
value["limitations"].append("Effective owned Python resource soft limits: " + json.dumps(limits, sort_keys=True) + ". Inherited tighter limits are retained.")
|
|
41
|
+
reply = {"ok": True, "profile": profile, "value": value}
|
|
42
|
+
except failure_type as error:
|
|
43
|
+
reply = {"ok": False, "reason": error.reason, "message": str(error)}
|
|
44
|
+
except MemoryError:
|
|
45
|
+
memory_reserve = None
|
|
46
|
+
reply = {"ok": False, "reason": "resource-limit", "message": "pwntools memory allocation failed under the effective resource limits; the exact allocation cause is unknown.", "reported_limits": limits}
|
|
47
|
+
except Exception as error:
|
|
48
|
+
if isinstance(error, OSError) and error.errno == 12:
|
|
49
|
+
memory_reserve = None
|
|
50
|
+
reply = {"ok": False, "reason": "resource-limit", "message": "pwntools reported OSError(ENOMEM); the exact allocation cause is unknown.", "reported_limits": limits}
|
|
51
|
+
else:
|
|
52
|
+
reply = {"ok": False, "reason": "decoder", "message": type(error).__name__ + ": " + str(error)}
|
|
53
|
+
encoded = json.dumps(reply, ensure_ascii=True, allow_nan=False).encode("utf-8")
|
|
54
|
+
if len(encoded) > OUTPUT_BYTES:
|
|
55
|
+
encoded = json.dumps({"ok": False, "reason": "output-limit", "message": "Complete artifact result exceeds the 64 MiB reply budget."}).encode("utf-8")
|
|
56
|
+
descriptor = os.open(request["reply_path"], os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
57
|
+
with os.fdopen(descriptor, "wb") as handle:
|
|
58
|
+
handle.write(encoded)
|
|
59
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Catch typed resource failures while loading or running the owned ELF adapter.
|
|
2
|
+
|
|
3
|
+
Only this package's fixed sibling is executed; caller input stays in request.json.
|
|
4
|
+
Interpreter startup failures before this boundary remain unclassified.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resource_exit(status, marker):
|
|
11
|
+
try:
|
|
12
|
+
if len(sys.argv) > 2:
|
|
13
|
+
descriptor = os.open(sys.argv[1], os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
14
|
+
os.write(descriptor, marker)
|
|
15
|
+
os.close(descriptor)
|
|
16
|
+
except (OSError, MemoryError):
|
|
17
|
+
# Without a complete marker the parent keeps this failure unclassified.
|
|
18
|
+
pass
|
|
19
|
+
os._exit(status)
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
implementation = os.path.join(os.path.dirname(__file__), "layout_impl.py")
|
|
23
|
+
with open(implementation, "rb") as handle:
|
|
24
|
+
source = handle.read()
|
|
25
|
+
exec(compile(source, implementation, "exec"), {
|
|
26
|
+
"__file__": implementation,
|
|
27
|
+
"__name__": "__main__",
|
|
28
|
+
})
|
|
29
|
+
except MemoryError:
|
|
30
|
+
# Reserved status: an observed allocation failure, including imports/compile.
|
|
31
|
+
resource_exit(75, b"M")
|
|
32
|
+
except OSError as error:
|
|
33
|
+
# Linux ENOMEM is an observed allocation failure, independent of error text.
|
|
34
|
+
if error.errno == 12:
|
|
35
|
+
resource_exit(75, b"M")
|
|
36
|
+
# Linux EFBIG is observed directly, including a partial limits/reply write.
|
|
37
|
+
if error.errno == 27:
|
|
38
|
+
resource_exit(76, b"F")
|
|
39
|
+
raise
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"""Offline adapter to unchanged pwntools 4.15.0; never use libs/maps/libc.
|
|
2
|
+
|
|
3
|
+
Owned request/snapshot/reply paths are supplied by REA. No host target-process launch,
|
|
4
|
+
user configuration initialization, debugger startup, or dependency installation.
|
|
5
|
+
"""
|
|
6
|
+
import base64
|
|
7
|
+
import importlib.metadata
|
|
8
|
+
import io
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
import resource
|
|
13
|
+
import sys
|
|
14
|
+
|
|
15
|
+
PROFILE = "pwntools@4.15.0;pyelftools@0.33;unicorn@2.1.2"
|
|
16
|
+
PACKAGES = {"pwntools": "4.15.0", "pyelftools": "0.33", "unicorn": "2.1.2"}
|
|
17
|
+
OUTPUT_BYTES = 64 * 1024 * 1024
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class LayoutFailure(Exception):
|
|
21
|
+
def __init__(self, reason, message):
|
|
22
|
+
super().__init__(message)
|
|
23
|
+
self.reason = reason
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def address(value):
|
|
27
|
+
return hex(int(value))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def file_range(offset, size, length):
|
|
31
|
+
return 0 <= offset <= length and 0 <= size <= length - offset
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def location(offset, size, length):
|
|
35
|
+
if not file_range(offset, size, length):
|
|
36
|
+
raise LayoutFailure("format", "ELF contains a file-backed range outside the selected snapshot.")
|
|
37
|
+
return {"offset": address(offset), "bytes": address(size)}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def name_reference(display, section, offset, content):
|
|
41
|
+
header = getattr(section, "header", None)
|
|
42
|
+
if header is None or header.sh_type != "SHT_STRTAB":
|
|
43
|
+
return {"display": display, "bytes_base64": None, "location": None,
|
|
44
|
+
"unknown_reason": "Referenced string table could not be resolved."}
|
|
45
|
+
return name_in_table(display, header.sh_offset, header.sh_size, offset, content)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def name_in_table(display, table_start, table_size, offset, content):
|
|
49
|
+
location(table_start, table_size, len(content))
|
|
50
|
+
if not 0 <= offset < table_size:
|
|
51
|
+
raise LayoutFailure("format", f"ELF name offset {offset} lies outside its declared string table of {table_size} bytes at file offset {table_start}.")
|
|
52
|
+
start = table_start + offset
|
|
53
|
+
limit = table_start + table_size
|
|
54
|
+
end = content.find(b"\0", start, limit)
|
|
55
|
+
if end < 0:
|
|
56
|
+
raise LayoutFailure("format", "ELF name lacks a terminator within its reported string table.")
|
|
57
|
+
raw = content[start:end]
|
|
58
|
+
return {"display": raw.decode("utf-8", "replace") if display is None else display, "bytes_base64": base64.b64encode(raw).decode("ascii"),
|
|
59
|
+
"location": location(start, len(raw) + 1, len(content)), "unknown_reason": None}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def dynamic_name_reference(tags, offset, image, content):
|
|
63
|
+
starts = [tag.d_val for tag in tags if tag.d_tag == "DT_STRTAB"]
|
|
64
|
+
sizes = [tag.d_val for tag in tags if tag.d_tag == "DT_STRSZ"]
|
|
65
|
+
if not starts or not sizes:
|
|
66
|
+
raise LayoutFailure("format", "ELF dependency requires DT_STRTAB and DT_STRSZ.")
|
|
67
|
+
if len(starts) != 1 or len(sizes) != 1:
|
|
68
|
+
raise LayoutFailure("unsupported-target", "ELF dependency string-table tags are ambiguous: " + repr({"DT_STRTAB": starts, "DT_STRSZ": sizes}))
|
|
69
|
+
if not 0 <= offset < sizes[0]:
|
|
70
|
+
raise LayoutFailure("format", f"ELF dependency name offset {offset} lies outside declared DT_STRSZ {sizes[0]}.")
|
|
71
|
+
offsets = set()
|
|
72
|
+
if len(starts) == 1 and len(sizes) == 1:
|
|
73
|
+
for segment in image.iter_segments_by_type("PT_LOAD"):
|
|
74
|
+
h = segment.header
|
|
75
|
+
if starts[0] >= h.p_vaddr and starts[0] + sizes[0] <= h.p_vaddr + h.p_filesz:
|
|
76
|
+
offsets.add(h.p_offset + starts[0] - h.p_vaddr)
|
|
77
|
+
if len(offsets) != 1:
|
|
78
|
+
raise LayoutFailure("unsupported-target", "Dynamic string table lacks a unique file-backed mapping: " + repr({"DT_STRTAB": starts, "DT_STRSZ": sizes, "candidate_file_offsets": sorted(offsets)}))
|
|
79
|
+
return name_in_table(None, offsets.pop(), sizes[0], offset, content)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def symbol_value_meaning(raw, image_type, sections):
|
|
83
|
+
index = raw.st_shndx
|
|
84
|
+
if raw.st_info.type == "STT_FILE": return "no-address"
|
|
85
|
+
if index == "SHN_UNDEF": return "undefined"
|
|
86
|
+
if index == "SHN_COMMON": return "alignment"
|
|
87
|
+
if index == "SHN_ABS": return "absolute-value"
|
|
88
|
+
if not isinstance(index, int) or not 0 < index < len(sections) or index >= 0xff00:
|
|
89
|
+
return "unknown-section-index"
|
|
90
|
+
if sections[index].header.sh_type == "SHT_NULL":
|
|
91
|
+
return "unknown-section-index"
|
|
92
|
+
if image_type == "ET_REL": return "section-offset"
|
|
93
|
+
if raw.st_info.type == "STT_TLS": return "tls-offset"
|
|
94
|
+
return "linked-virtual-address"
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def relocation_target(image_type, section_index, offset, sections):
|
|
98
|
+
if image_type != "ET_REL":
|
|
99
|
+
return {"kind": "linked-virtual-address", "address": address(offset)}
|
|
100
|
+
if section_index == 0 or sections[section_index].header.sh_type == "SHT_NULL":
|
|
101
|
+
return {"kind": "unknown-section", "reported_section_index": section_index,
|
|
102
|
+
"offset": address(offset), "unknown_reason": "undefined-section-reference" if section_index == 0 else "inactive-section-header"}
|
|
103
|
+
return {"kind": "section-offset", "section_index": section_index, "offset": address(offset)}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def inspect_elf(path, cache):
|
|
107
|
+
for package, expected in PACKAGES.items():
|
|
108
|
+
try:
|
|
109
|
+
version = importlib.metadata.version(package)
|
|
110
|
+
except importlib.metadata.PackageNotFoundError as error:
|
|
111
|
+
raise LayoutFailure("unavailable", "Selected Python lacks " + package + " " + expected + ".") from error
|
|
112
|
+
if version != expected:
|
|
113
|
+
raise LayoutFailure("unsupported", "Expected " + package + " " + expected + "; selected Python reports " + version + ".")
|
|
114
|
+
content = path.read_bytes()
|
|
115
|
+
if len(content) < 4 or content[:4] != b"\x7fELF":
|
|
116
|
+
raise LayoutFailure("format", "Selected object does not contain an ELF header.")
|
|
117
|
+
if len(content) < 16:
|
|
118
|
+
raise LayoutFailure("format", "Selected ELF identification is truncated.")
|
|
119
|
+
if content[4] != 2 or content[5] != 1:
|
|
120
|
+
raise LayoutFailure("unsupported-target", "Initial layout profile requires ELF64 little-endian objects.")
|
|
121
|
+
if len(content) < 64:
|
|
122
|
+
raise LayoutFailure("format", "Selected ELF64 header is truncated.")
|
|
123
|
+
if int.from_bytes(content[18:20], "little") != 62:
|
|
124
|
+
raise LayoutFailure("unsupported-target", "Initial layout profile requires x86-64 ELF objects.")
|
|
125
|
+
if int.from_bytes(content[16:18], "little") not in (1, 2, 3):
|
|
126
|
+
raise LayoutFailure("unsupported-target", "Selected ELF type is outside the EXEC/DYN/REL layout profile; recorded core analysis is separate.")
|
|
127
|
+
from pwnlib.context import context
|
|
128
|
+
with context.local(cache_dir=str(cache), log_level="warning"):
|
|
129
|
+
from elftools.common.exceptions import ELFError
|
|
130
|
+
from elftools.elf.elffile import ELFFile
|
|
131
|
+
from pwnlib.elf import ELF
|
|
132
|
+
try:
|
|
133
|
+
headers = ELFFile(io.BytesIO(content))
|
|
134
|
+
section_count = headers.num_sections()
|
|
135
|
+
if headers.header.e_shstrndx == 0xffff and section_count == 0:
|
|
136
|
+
raise LayoutFailure("format", "ELF extended section-name index requires a declared section-zero header.")
|
|
137
|
+
raw_name_index = headers.header.e_shstrndx
|
|
138
|
+
if 0xff00 <= raw_name_index < 0xffff:
|
|
139
|
+
raise LayoutFailure("format", f"ELF section-name index {raw_name_index} is reserved and cannot directly reference a section.")
|
|
140
|
+
section_name_index = headers.get_shstrndx()
|
|
141
|
+
if raw_name_index == 0xffff and section_name_index < 0xff00:
|
|
142
|
+
raise LayoutFailure("format", f"ELF SHN_XINDEX resolves to ordinary index {section_name_index}; the escape requires an index at least SHN_LORESERVE (0xff00).")
|
|
143
|
+
if section_name_index != 0:
|
|
144
|
+
if section_name_index >= section_count:
|
|
145
|
+
raise LayoutFailure("format", f"ELF section-name table index {section_name_index} lies outside the declared section count {section_count}.")
|
|
146
|
+
names_header = headers._get_section_header(section_name_index)
|
|
147
|
+
if names_header.sh_type != "SHT_STRTAB":
|
|
148
|
+
raise LayoutFailure("format", f"ELF section-name table {section_name_index} is not SHT_STRTAB.")
|
|
149
|
+
location(names_header.sh_offset, names_header.sh_size, len(content))
|
|
150
|
+
except ELFError as error:
|
|
151
|
+
raise LayoutFailure("format", str(error)) from error
|
|
152
|
+
class LayoutELF(ELF):
|
|
153
|
+
def _get_section_name(self, header):
|
|
154
|
+
# SHN_UNDEF declares no names; upstream would otherwise read
|
|
155
|
+
# strings at the inactive section-zero offset.
|
|
156
|
+
return "" if section_name_index == 0 else super()._get_section_name(header)
|
|
157
|
+
|
|
158
|
+
# pyelftools 0.33 calls these documented filters internally;
|
|
159
|
+
# pwntools 4.15.0's cached overrides do not accept the argument.
|
|
160
|
+
# Forward the filter on this adapter instance, without modifying
|
|
161
|
+
# either upstream package or process-global methods.
|
|
162
|
+
def iter_segments(self, type=None):
|
|
163
|
+
return (segment for segment in super().iter_segments()
|
|
164
|
+
if type is None or segment.header.p_type == type)
|
|
165
|
+
|
|
166
|
+
def iter_sections(self, type=None):
|
|
167
|
+
return (section for section in super().iter_sections()
|
|
168
|
+
if type is None or section.header.sh_type == type)
|
|
169
|
+
try:
|
|
170
|
+
image = LayoutELF(str(path), checksec=False)
|
|
171
|
+
if image.arch != "amd64" or image.bits != 64 or image.endian != "little":
|
|
172
|
+
raise LayoutFailure("unsupported-target", "Initial layout profile requires x86-64 ELF64 little-endian objects.")
|
|
173
|
+
if image.header.e_type not in ("ET_EXEC", "ET_DYN", "ET_REL"):
|
|
174
|
+
raise LayoutFailure("unsupported-target", "Selected ELF type is outside the EXEC/DYN/REL layout profile; recorded core analysis is separate.")
|
|
175
|
+
length = len(content)
|
|
176
|
+
all_sections = list(image.iter_sections())
|
|
177
|
+
shstrings = image.get_section(section_name_index) if all_sections and section_name_index != 0 else None
|
|
178
|
+
sections, segments, symbols, relocations, packed_relatives = [], [], [], [], []
|
|
179
|
+
needed, interpreters = [], []
|
|
180
|
+
for index, section in enumerate(all_sections):
|
|
181
|
+
h = section.header
|
|
182
|
+
backing = h.sh_type not in ("SHT_NOBITS", "SHT_NULL")
|
|
183
|
+
if backing: location(h.sh_offset, h.sh_size, length)
|
|
184
|
+
sections.append({
|
|
185
|
+
"index": index, "name": name_reference(section.name, shstrings, h.sh_name, content) if shstrings is not None else {"display": "", "bytes_base64": None, "location": None, "unknown_reason": "ELF declares no section-name table (SHN_UNDEF index 0)."}, "name_offset": address(h.sh_name), "type": h.sh_type,
|
|
186
|
+
"header_location": location(image.header.e_shoff + index * image.header.e_shentsize, image.header.e_shentsize, length),
|
|
187
|
+
"address": address(h.sh_addr), "offset": address(h.sh_offset),
|
|
188
|
+
"size": address(h.sh_size), "alignment": address(h.sh_addralign),
|
|
189
|
+
"flags": address(h.sh_flags), "link": h.sh_link, "info": h.sh_info,
|
|
190
|
+
"entry_size": address(h.sh_entsize), "file_backing": "file" if backing else "none",
|
|
191
|
+
})
|
|
192
|
+
if h.sh_type in ("SHT_SYMTAB", "SHT_DYNSYM"):
|
|
193
|
+
if h.sh_entsize < image.structs.Elf_Sym.sizeof():
|
|
194
|
+
raise LayoutFailure("format", "ELF symbol entry is smaller than the decoded Elf64_Sym structure.")
|
|
195
|
+
if h.sh_link >= len(all_sections) or all_sections[h.sh_link].header.sh_type != "SHT_STRTAB":
|
|
196
|
+
raise LayoutFailure("format", f"ELF symbol table {index} links to invalid string table {h.sh_link}.")
|
|
197
|
+
strings = all_sections[h.sh_link]
|
|
198
|
+
for entry, symbol in enumerate(section.iter_symbols()):
|
|
199
|
+
raw = symbol.entry
|
|
200
|
+
symbols.append({
|
|
201
|
+
"table_index": index, "entry_index": entry,
|
|
202
|
+
"name": name_reference(symbol.name, strings, raw.st_name, content), "name_offset": address(raw.st_name),
|
|
203
|
+
"location": location(h.sh_offset + entry * h.sh_entsize, h.sh_entsize, length),
|
|
204
|
+
"value": address(raw.st_value), "value_meaning": symbol_value_meaning(raw, image.header.e_type, all_sections),
|
|
205
|
+
"size": address(raw.st_size), "binding": raw.st_info.bind, "type": raw.st_info.type,
|
|
206
|
+
"visibility": raw.st_other.visibility, "section_index": raw.st_shndx,
|
|
207
|
+
})
|
|
208
|
+
if h.sh_type in ("SHT_REL", "SHT_RELA"):
|
|
209
|
+
if image.header.e_type == "ET_REL" and h.sh_info >= len(all_sections):
|
|
210
|
+
raise LayoutFailure("format", f"ELF relocation section {index} references missing target section {h.sh_info}.")
|
|
211
|
+
symbol_table = None
|
|
212
|
+
if h.sh_link != 0:
|
|
213
|
+
if h.sh_link >= len(all_sections) or all_sections[h.sh_link].header.sh_type not in ("SHT_SYMTAB", "SHT_DYNSYM"):
|
|
214
|
+
raise LayoutFailure("format", f"ELF relocation section {index} links to invalid symbol table {h.sh_link}.")
|
|
215
|
+
symbol_table = all_sections[h.sh_link]
|
|
216
|
+
for entry, relocation in enumerate(section.iter_relocations()):
|
|
217
|
+
raw = relocation.entry
|
|
218
|
+
if raw.r_info_sym != 0 and (symbol_table is None or raw.r_info_sym >= symbol_table.num_symbols()):
|
|
219
|
+
raise LayoutFailure("format", f"ELF relocation section {index} entry {entry} references missing symbol {raw.r_info_sym} in table {h.sh_link}.")
|
|
220
|
+
relocations.append({
|
|
221
|
+
"section_index": index, "entry_index": entry, "reported_offset": address(raw.r_offset),
|
|
222
|
+
"target": relocation_target(image.header.e_type, h.sh_info, raw.r_offset, all_sections),
|
|
223
|
+
"location": location(h.sh_offset + entry * h.sh_entsize, h.sh_entsize, length),
|
|
224
|
+
"type": raw.r_info_type, "symbol_table_index": h.sh_link, "symbol_index": raw.r_info_sym,
|
|
225
|
+
"symbol_reference_meaning": "zero-symbol-value" if raw.r_info_sym == 0 else "symbol-table-entry",
|
|
226
|
+
"addend": None if "r_addend" not in raw else str(raw.r_addend),
|
|
227
|
+
})
|
|
228
|
+
if h.sh_type == "SHT_RELR":
|
|
229
|
+
packed_relatives.append({
|
|
230
|
+
"section_index": index,
|
|
231
|
+
"location": location(h.sh_offset, h.sh_size, length),
|
|
232
|
+
"encoded_bytes_base64": base64.b64encode(content[h.sh_offset:h.sh_offset + h.sh_size]).decode("ascii"),
|
|
233
|
+
"entries": [{"decoded_index": decoded, "reported_offset": address(relocation.entry.r_offset)} for decoded, relocation in enumerate(section.iter_relocations())],
|
|
234
|
+
"offset_meaning": "unknown" if image.header.e_type == "ET_REL" else "linked-virtual-address",
|
|
235
|
+
"evidence_kind": "derived", "entry_source_locations": None, "addends": None,
|
|
236
|
+
})
|
|
237
|
+
for index, segment in enumerate(image.iter_segments()):
|
|
238
|
+
h = segment.header
|
|
239
|
+
backing = h.p_type != "PT_NULL" and h.p_filesz != 0
|
|
240
|
+
if backing: location(h.p_offset, h.p_filesz, length)
|
|
241
|
+
if h.p_type == "PT_LOAD" and h.p_memsz < h.p_filesz:
|
|
242
|
+
raise LayoutFailure("format", "ELF load segment memory size is smaller than its file size.")
|
|
243
|
+
segments.append({
|
|
244
|
+
"index": index, "type": h.p_type, "offset": address(h.p_offset),
|
|
245
|
+
"header_location": location(image.header.e_phoff + index * image.header.e_phentsize, image.header.e_phentsize, length),
|
|
246
|
+
"file_size": address(h.p_filesz), "memory_size": address(h.p_memsz),
|
|
247
|
+
"virtual_address": address(h.p_vaddr), "physical_address": address(h.p_paddr),
|
|
248
|
+
"alignment": address(h.p_align), "flags": address(h.p_flags),
|
|
249
|
+
"file_backing": "file" if backing else "none",
|
|
250
|
+
"permissions": None if h.p_type == "PT_NULL" else {"read": bool(h.p_flags & 4), "write": bool(h.p_flags & 2), "execute": bool(h.p_flags & 1)},
|
|
251
|
+
})
|
|
252
|
+
if h.p_type == "PT_DYNAMIC":
|
|
253
|
+
tag_size = image.structs.Elf_Dyn.sizeof()
|
|
254
|
+
tags = []
|
|
255
|
+
for tag_index in range(h.p_filesz // tag_size):
|
|
256
|
+
tag = segment._get_tag(tag_index)
|
|
257
|
+
tags.append(tag)
|
|
258
|
+
if tag.d_tag == "DT_NULL":
|
|
259
|
+
break
|
|
260
|
+
else:
|
|
261
|
+
raise LayoutFailure("format", f"ELF dynamic segment {index} has no complete DT_NULL terminator within its reported file range.")
|
|
262
|
+
for tag in tags:
|
|
263
|
+
if tag.d_tag == "DT_NEEDED":
|
|
264
|
+
needed.append(dynamic_name_reference(tags, tag.d_val, image, content))
|
|
265
|
+
if h.p_type == "PT_INTERP":
|
|
266
|
+
raw = content[h.p_offset:h.p_offset + h.p_filesz]
|
|
267
|
+
end = raw.find(b"\0")
|
|
268
|
+
if end < 0:
|
|
269
|
+
raise LayoutFailure("format", "ELF interpreter lacks a reported terminator.")
|
|
270
|
+
interpreters.append({"display": raw[:end].decode("utf-8", "replace"), "bytes_base64": base64.b64encode(raw[:end]).decode("ascii"), "location": location(h.p_offset, end + 1, length), "unknown_reason": None})
|
|
271
|
+
return {
|
|
272
|
+
"format": "elf", "architecture": {"machine": image.header.e_machine, "bits": image.bits, "byte_order": image.endian},
|
|
273
|
+
"image_type": image.header.e_type,
|
|
274
|
+
"entry_point": {"reported_value": address(image.header.e_entry), "meaning": "not-applicable" if image.header.e_type == "ET_REL" else "absent" if image.header.e_entry == 0 else "linked-virtual-address", "execution_status": "unknown"},
|
|
275
|
+
"runtime_load_base": None, "sections": sections, "segments": segments, "symbols": symbols, "relocations": relocations,
|
|
276
|
+
"packed_relative_relocations": packed_relatives, "relocation_inventory_completeness": "unknown",
|
|
277
|
+
"linkage": {"needed_libraries": needed, "interpreters": interpreters,
|
|
278
|
+
"got": [{"display_name": name, "address": address(value)} for name, value in image.got.items()],
|
|
279
|
+
"plt": [{"display_name": name, "address": address(value)} for name, value in image.plt.items()],
|
|
280
|
+
"convenience_maps_completeness": "unknown", "runtime_library_paths": None},
|
|
281
|
+
"mitigations": {"evidence_kind": "inferred", "position_independent": image.pie, "nx_indicator": image.nx, "executable_stack_indicator": image.execstack, "stack_canary_indicator": image.canary, "relro": image.relro},
|
|
282
|
+
"limitations": [
|
|
283
|
+
"PT_NULL payload fields are unused and retain their reported numbers without file-byte or permission claims. Zero-file-size segments provide no file bytes.",
|
|
284
|
+
"SHN_XINDEX symbol values remain unresolved in this upstream representation; an external index table does not establish a resolved index in this report.",
|
|
285
|
+
"Reported values preserve linked addresses, section offsets, TLS offsets, alignment and absolute values separately. Runtime load base and library paths are unknown.",
|
|
286
|
+
"Names are display strings plus raw bytes and file ranges where resolvable; section/table/entry indices preserve identity and duplicates. Name ranges include their terminating NUL; raw name bytes exclude it.",
|
|
287
|
+
"Ordinary relocation rows cover REL/RELA. RELR tables retain complete encoded bytes and upstream-decoded offsets as derived evidence; per-offset packed-word locations and implicit addends remain unknown. Relocation inventory completeness is unknown, including other encodings and missing section tables.",
|
|
288
|
+
"Relocation symbol index zero uses a zero symbol value without a table lookup. Positive indices reference validated original symbol-table entries; raw table and symbol indices remain reported.",
|
|
289
|
+
"Relocatable relocation targets with SHN_UNDEF or inactive SHT_NULL headers retain their reported section index/offset as unknown; they do not establish an associated target section.",
|
|
290
|
+
"GOT/PLT are derived upstream convenience maps; PLT inference can emulate selected instructions in Unicorn. They do not establish target runtime behavior; aliases may collapse and warnings may indicate incomplete coverage. Their completeness is unknown.",
|
|
291
|
+
"Mitigations are upstream static heuristics, not runtime protection. ET_DYN does not prove an executable; absent canary symbols do not prove every function unprotected.",
|
|
292
|
+
"This profile inspects ELF EXEC/DYN/REL layout only. It does not analyze recorded cores, resolve loaded libraries, launch the target as a host process or start a debugger.",
|
|
293
|
+
"Symbol/relocation inventories reflect original section tables. A sectionless image can still report dynamic dependency names; missing tables do not prove absence of dynamic symbols or relocations.",
|
|
294
|
+
*(["Absent section-name table: section-dependent RELRO/canary heuristics may be incomplete; protection coverage is unknown."] if all_sections and section_name_index == 0 else []),
|
|
295
|
+
*(["Sectionless images lack the .dynamic section and symbol tables used by upstream heuristics. RELRO/canary indicators may be incomplete; their values remain reported static candidates, with protection coverage unknown."] if not all_sections else []),
|
|
296
|
+
],
|
|
297
|
+
}
|
|
298
|
+
except LayoutFailure:
|
|
299
|
+
raise
|
|
300
|
+
except (ELFError, ValueError, AssertionError, IndexError) as error:
|
|
301
|
+
raise LayoutFailure("format", "Selected ELF failed unchanged upstream structural parsing: " + str(error)) from error
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
if __name__ == "__main__":
|
|
306
|
+
runtime_path = Path(__file__).with_name("decoder_runtime.py")
|
|
307
|
+
runtime = {"__file__": str(runtime_path), "__name__": "rea_decoder_runtime"}
|
|
308
|
+
exec(compile(runtime_path.read_bytes(), str(runtime_path), "exec"), runtime)
|
|
309
|
+
runtime["main"](sys.argv[-1], inspect_elf, LayoutFailure, PROFILE)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Catch typed resource failures while loading or running the owned recorded-core adapter.
|
|
2
|
+
|
|
3
|
+
Only this package's fixed sibling is executed; caller input stays in request.json.
|
|
4
|
+
Interpreter startup failures before this boundary remain unclassified.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resource_exit(status, marker):
|
|
11
|
+
try:
|
|
12
|
+
if len(sys.argv) > 2:
|
|
13
|
+
descriptor = os.open(sys.argv[1], os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
14
|
+
os.write(descriptor, marker)
|
|
15
|
+
os.close(descriptor)
|
|
16
|
+
except (OSError, MemoryError):
|
|
17
|
+
# Without a complete marker the parent keeps this failure unclassified.
|
|
18
|
+
pass
|
|
19
|
+
os._exit(status)
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
implementation = os.path.join(os.path.dirname(__file__), "recorded_crash_impl.py")
|
|
23
|
+
with open(implementation, "rb") as handle:
|
|
24
|
+
source = handle.read()
|
|
25
|
+
exec(compile(source, implementation, "exec"), {
|
|
26
|
+
"__file__": implementation,
|
|
27
|
+
"__name__": "__main__",
|
|
28
|
+
})
|
|
29
|
+
except MemoryError:
|
|
30
|
+
# Reserved status: an observed allocation failure, including imports/compile.
|
|
31
|
+
resource_exit(75, b"M")
|
|
32
|
+
except OSError as error:
|
|
33
|
+
# Linux ENOMEM is an observed allocation failure, independent of error text.
|
|
34
|
+
if error.errno == 12:
|
|
35
|
+
resource_exit(75, b"M")
|
|
36
|
+
# Linux EFBIG is observed directly, including a partial limits/reply write.
|
|
37
|
+
if error.errno == 27:
|
|
38
|
+
resource_exit(76, b"F")
|
|
39
|
+
raise
|