rea-agents 6.3.0 → 6.5.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/DISCLAIMER.md +136 -0
- package/README.md +72 -18
- package/THIRD_PARTY_NOTICES.md +134 -0
- package/bridge/android/ReaJadxBridge.java +123 -11
- package/bridge/cutter/rea_bridge.py +816 -0
- package/bridge/ghidra/ReaGhidraAnalysisOptions.java +38 -0
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +1729 -283
- package/bridge/ghidra/ReaGhidraBundleActivator.java +14 -0
- package/bridge/ghidra/ReaGhidraMipsSoftFloat.java +176 -0
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/ghidra/ReaGhidraPrepareRaw.java +49 -0
- package/bridge/hopper_bridge.py +103 -69
- package/bridge/mitmproxy/capture.py +189 -13
- package/bridge/native/rea_lldb_tracer.py +40 -6
- package/bridge/process/ProcessRunTokenReader.swift +76 -34
- package/bridge/pwntools/layout_impl.py +5 -0
- package/bridge/pwntools/recorded_crash_impl.py +31 -10
- package/dist/adb/AdbConfiguration.js +100 -0
- package/dist/adb/AdbDeviceOutput.js +208 -0
- package/dist/adb/AdbDirectoryListing.js +80 -0
- package/dist/adb/AdbHostFileName.js +34 -0
- package/dist/adb/AdbProvider.js +1433 -0
- package/dist/adb/AdbShellOutput.js +307 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxAnalysis.js +32 -7
- package/dist/android/JadxConfiguration.js +163 -53
- package/dist/android/JadxDoctor.js +115 -0
- package/dist/android/JadxMcpTransport.js +5 -3
- package/dist/android/JadxProtocol.js +14 -0
- package/dist/android/JadxProvider.js +63 -25
- package/dist/android/JadxRelease.js +12 -1
- package/dist/android/JadxWorkspaceRoot.js +157 -0
- package/dist/apktool/ApktoolConfiguration.js +227 -0
- package/dist/apktool/ApktoolDecodeOutput.js +142 -0
- package/dist/apktool/ApktoolProvider.js +543 -0
- package/dist/application/AnalysisContextQueries.js +5 -8
- package/dist/application/AnalysisProvider.js +24 -14
- package/dist/application/AppBundleExecutable.js +30 -25
- package/dist/application/BinaryTargetResolver.js +210 -33
- package/dist/application/BrowserEvidence.js +1 -1
- package/dist/application/BrowserObservationService.js +13 -2
- package/dist/application/BrowserScenarioCaptureService.js +0 -1
- package/dist/application/CallPathTracing.js +52 -13
- package/dist/application/CapabilityInventory.js +179 -29
- package/dist/application/ClaudeDesktopConfigLocation.js +152 -0
- package/dist/application/ClientConfigurationDocument.js +154 -7
- package/dist/application/ClientConfigurationFiles.js +128 -0
- package/dist/application/ClientRegistrationEnvironment.js +41 -0
- package/dist/application/ClientRegistrationIdentity.js +94 -29
- package/dist/application/ClientRegistrationStatus.js +223 -67
- package/dist/application/DirectAnalysis.js +86 -31
- package/dist/application/DirectAnalysisCleanup.js +1 -1
- package/dist/application/DirectAnalysisStatus.js +14 -2
- package/dist/application/Doctor.js +117 -34
- package/dist/application/DoctorDiagnostics.js +34 -12
- package/dist/application/DoctorProviderIds.js +2 -0
- package/dist/application/DoctorScope.js +11 -2
- package/dist/application/DshCordisPatch.js +355 -0
- package/dist/application/DshCordisYaml.js +155 -0
- package/dist/application/EnhancedLiteralTracing.js +30 -16
- package/dist/application/EnhancedToolTypes.js +0 -1
- package/dist/application/EnhancedTools.js +164 -54
- package/dist/application/EvidenceBundleCommands.js +36 -19
- package/dist/application/EvidenceBundleFiles.js +29 -7
- package/dist/application/FunctionAnalysisEvidence.js +3 -0
- package/dist/application/GeminiClientSettings.js +151 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HermesConfigurationYaml.js +272 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InventoryProjectionEvidence.js +0 -1
- package/dist/application/InvestigationProviders.js +19 -3
- package/dist/application/JsonFiles.js +114 -23
- package/dist/application/JsonInputFile.js +410 -0
- package/dist/application/LinuxHopper.js +130 -60
- package/dist/application/MacHopper.js +177 -150
- package/dist/application/MacHopperPaths.js +40 -0
- package/dist/application/MipsElfMetadata.js +201 -0
- package/dist/application/MipsElfSharedLoad.js +164 -0
- package/dist/application/MipsGnuAttributes.js +90 -0
- package/dist/application/MsixPackageStorage.js +133 -0
- package/dist/application/ProgressReporter.js +1 -1
- package/dist/application/ProviderOperationExecution.js +39 -0
- package/dist/application/ReconstructionCoverageService.js +0 -1
- package/dist/application/ReconstructionObligationCandidates.js +12 -5
- package/dist/application/ReconstructionObligationLedgerDiagnostics.js +2 -2
- package/dist/application/ReconstructionObligationLedgerEvaluation.js +15 -33
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -72
- package/dist/application/ReconstructionObligationLedgerService.js +3 -1
- package/dist/application/ReconstructionObligationOriginalCases.js +2 -1
- package/dist/application/ReferenceSourceImport.js +94 -31
- package/dist/application/ReferenceSourceImportEntries.js +40 -30
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -23
- package/dist/application/ReferenceSourceVcsAdapter.js +163 -31
- package/dist/application/RegularFileRead.js +121 -7
- package/dist/application/Setup.js +88 -14
- package/dist/application/SetupClientConfiguration.js +307 -38
- package/dist/application/SetupClients.js +12 -6
- package/dist/application/SetupHost.js +158 -38
- package/dist/application/SetupInstallFailure.js +42 -2
- package/dist/application/SetupPlan.js +83 -57
- package/dist/application/SetupRecoveryBackup.js +66 -0
- package/dist/application/SetupRegistrationEnvironment.js +2 -1
- package/dist/application/SetupSkill.js +354 -88
- package/dist/application/SupportedClients.js +429 -70
- package/dist/application/TypeScriptEmittedSourceCandidates.js +26 -0
- package/dist/application/Uninstall.js +412 -73
- package/dist/application/UninstallFailure.js +14 -0
- package/dist/application/Update.js +54 -25
- package/dist/application/UpdateFailure.js +17 -0
- package/dist/application/UpdateMaintenance.js +25 -47
- package/dist/application/UpdateRuntime.js +141 -27
- package/dist/application/Utf8JsonInput.js +7 -0
- package/dist/application/WebModuleTraceService.js +7 -0
- package/dist/application/WebNetworkCaptureService.js +16 -7
- package/dist/application/WebScriptExportService.js +131 -65
- package/dist/application/WebSourceLocationService.js +22 -3
- package/dist/application/WindowsCapabilities.js +18 -15
- package/dist/application/WorkflowEvidence.js +24 -1
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +122 -6
- package/dist/application/android/AndroidPackageInspection.js +25 -0
- package/dist/application/android/AndroidSearchEvidenceSummary.js +100 -0
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/AnalysisProviderEvaluation.js +1 -1
- package/dist/application/binary/AnalysisProviderRegistry.js +36 -21
- package/dist/application/binary/AnalysisSnapshotCache.js +41 -20
- package/dist/application/binary/AnalysisSnapshotFiles.js +75 -9
- package/dist/application/binary/BinarySession.js +250 -97
- package/dist/application/binary/BinarySessionExecution.js +5 -4
- package/dist/application/binary/BinarySessionOpen.js +13 -6
- package/dist/application/binary/BinarySessionRecords.js +33 -7
- package/dist/application/binary/BinarySessionStatus.js +93 -23
- package/dist/application/binary/BinaryTargetSummary.js +9 -0
- package/dist/application/binary/CompositeProvider.js +71 -28
- package/dist/application/binary/LazyAnalysisProvider.js +3 -1
- package/dist/application/binary/SessionProviderRouter.js +5 -2
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +13 -2
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +114 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +16 -4
- package/dist/application/captures/PacketCaptureService.js +83 -0
- package/dist/application/closeOwnedWebResources.js +7 -0
- package/dist/application/electron/ElectronFusePort.js +1 -0
- package/dist/application/electron/ElectronFuseService.js +80 -0
- package/dist/application/evm/EvmInterfaceService.js +4 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/flutter/DartAotInspection.js +26 -0
- package/dist/application/flutter/FlutterBuildAnalysisPort.js +1 -0
- package/dist/application/flutter/FlutterBuildAnalysisService.js +13 -0
- package/dist/application/frida/FridaInstrumentationPort.js +8 -0
- package/dist/application/frida/FridaInstrumentationService.js +310 -0
- package/dist/application/frida/fridaInputErrors.js +17 -0
- package/dist/application/go/GoBinaryPort.js +1 -0
- package/dist/application/go/GoBinaryService.js +80 -0
- package/dist/application/harmony/HarmonyApplicationService.js +17 -0
- package/dist/application/investigation/EvidenceLedger.js +40 -14
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/investigation/InvestigationRecords.js +12 -21
- package/dist/application/investigation/UnknownEvidence.js +22 -18
- package/dist/application/javascript/ElectronActiveObservationService.js +55 -25
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +17 -3
- package/dist/application/javascript/ElectronBoundaryGraph.js +2 -0
- package/dist/application/javascript/ElectronBoundaryGraphCallPaths.js +144 -0
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +28 -9
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -7
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +50 -12
- package/dist/application/javascript/ElectronObservationService.js +0 -1
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +15 -0
- package/dist/application/javascript/JavaScriptApplicationService.js +44 -18
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +0 -1
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +253 -60
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +51 -23
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +93 -21
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +35 -8
- package/dist/application/javascript/JavaScriptArtifactGraphDocuments.js +25 -14
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +163 -54
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +246 -15
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +1057 -323
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +134 -32
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +6 -1
- package/dist/application/javascript/JavaScriptModuleRelationships.js +39 -15
- package/dist/application/javascript/JavaScriptRecoveryService.js +32 -9
- package/dist/application/javascript/JavaScriptRuntimeObservationService.js +2 -1
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +0 -1
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +9 -3
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +228 -74
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +12 -19
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +4 -1
- package/dist/application/javascript/JavaScriptSemanticGraphElectronProjection.js +67 -0
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +5 -3
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +19 -8
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +0 -1
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -2
- package/dist/application/managed/ManagedMemberComparisonService.js +72 -54
- package/dist/application/managed/ManagedNativeVerificationService.js +0 -1
- package/dist/application/managed/ManagedReconstructionService.js +0 -1
- package/dist/application/native/NativeCallRoutes.js +54 -34
- package/dist/application/native/NativeDispatchMetadataInspection.js +6 -2
- package/dist/application/native/NativeUiActionTrace.js +51 -30
- package/dist/application/native/NativeValueTrace.js +75 -24
- package/dist/application/pcap/PcapAnalysisPort.js +1 -0
- package/dist/application/pcap/PcapAnalysisService.js +24 -0
- package/dist/application/process/ProcessCli.js +57 -32
- package/dist/application/reverse/ReverseEngineeringCommandPort.js +1 -0
- package/dist/application/reverse/ReverseEngineeringService.js +688 -0
- package/dist/application/rust/RustBinaryPort.js +1 -0
- package/dist/application/rust/RustBinaryService.js +80 -0
- package/dist/application/signals/SignalRecordingService.js +83 -0
- package/dist/application/sqlite/SqliteDatabaseCapability.js +30 -0
- package/dist/application/sqlite/SqliteDatabasePort.js +1 -0
- package/dist/application/sqlite/SqliteDatabaseService.js +76 -0
- package/dist/application/wasm/WasmArtifactPort.js +1 -0
- package/dist/application/wasm/WasmArtifactService.js +77 -0
- package/dist/application/wasm/WasmInterfaceComparisonService.js +188 -0
- package/dist/artifacts/ArtifactHash.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +133 -15
- package/dist/artifacts/ArtifactProvider.js +28 -19
- package/dist/artifacts/ArtifactReader.js +35 -0
- package/dist/artifacts/ArtifactResourceScope.js +109 -0
- package/dist/artifacts/AsarArtifactReader.js +295 -156
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/AsarListing.js +78 -0
- package/dist/artifacts/DirectoryArtifactReader.js +247 -74
- package/dist/artifacts/MachOSliceArtifactReader.js +198 -48
- package/dist/artifacts/NativeDmgArtifactReader.js +188 -78
- package/dist/artifacts/OrderedReads.js +57 -0
- package/dist/artifacts/SafeOutputTree.js +261 -71
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +186 -31
- package/dist/artifacts/apple/AppleAssetCatalogAnalysis.js +77 -68
- package/dist/artifacts/apple/DylibResolutionReader.js +11 -5
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +114 -38
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +125 -35
- package/dist/artifacts/apple/KeyedArchiveReader.js +35 -15
- package/dist/artifacts/apple/MachoLoadCommandReader.js +62 -61
- package/dist/artifacts/apple/NibArchive.js +11 -4
- package/dist/artifacts/apple/PlistNumberLiterals.js +2 -2
- package/dist/artifacts/extraction/ArtifactExtraction.js +115 -92
- package/dist/artifacts/hostExecutableMarking.js +16 -0
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +236 -69
- package/dist/artifacts/inventory/ArtifactInventory.js +7 -6
- package/dist/artifacts/inventory/classify.js +95 -35
- package/dist/artifacts/inventory/hashStableRootArtifact.js +48 -15
- package/dist/artifacts/inventory/reader.js +40 -17
- package/dist/artifacts/inventory/scanCanonical.js +84 -40
- package/dist/artifacts/inventory/scanReader.js +72 -19
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +177 -15
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/artifacts/readStableArtifact.js +28 -4
- package/dist/browser/BrowserProcessStartup.js +20 -9
- package/dist/browser/BrowserScenarioPartialObservation.js +60 -38
- package/dist/browser/BrowserScenarioSecrets.js +193 -48
- package/dist/browser/CdpBrowserProvider.js +74 -98
- package/dist/browser/CdpCaptureDocuments.js +261 -65
- package/dist/browser/CdpCaptureDomSvg.js +243 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +12 -12
- package/dist/browser/CdpCaptureEventHandlers.js +49 -21
- package/dist/browser/CdpCaptureEvents.js +53 -19
- package/dist/browser/CdpCaptureStorage.js +22 -5
- package/dist/browser/CdpCaptureStorageFingerprints.js +54 -11
- package/dist/browser/CdpCaptureValues.js +0 -1
- package/dist/browser/CdpConnection.js +25 -9
- package/dist/browser/CdpElectronInspection.js +14 -4
- package/dist/browser/CdpElectronProvider.js +7 -2
- package/dist/browser/CdpElectronScripts.js +2 -1
- package/dist/browser/CdpElectronWorkers.js +7 -2
- package/dist/browser/CdpEndpoint.js +143 -17
- package/dist/browser/CdpObservationSession.js +24 -8
- package/dist/browser/CdpPageCapture.js +67 -17
- package/dist/browser/CdpPageCaptureScripts.js +4 -3
- package/dist/browser/CdpPageCaptureWorkers.js +5 -1
- package/dist/browser/CdpSafeMetadata.js +9 -5
- package/dist/browser/CdpScreenshot.js +5 -14
- package/dist/browser/CdpSnapshotStrings.js +21 -0
- package/dist/browser/CdpTargetSession.js +59 -36
- package/dist/browser/CdpWebMcpDiscovery.js +55 -16
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +64 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +4 -4
- package/dist/browser/PlaywrightElectronActiveProjection.js +16 -4
- package/dist/browser/PlaywrightElectronActiveProvider.js +114 -36
- package/dist/browser/PlaywrightExecutionBoundary.js +2 -2
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +78 -13
- package/dist/browser/PlaywrightScenarioEvents.js +198 -36
- package/dist/browser/PlaywrightScenarioServiceWorkers.js +249 -0
- package/dist/browser/PlaywrightScenarioSession.js +180 -75
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +164 -81
- package/dist/browser/assets/LocalWebScriptArtifacts.js +27 -4
- package/dist/browser/assets/PublishWebScripts.js +88 -22
- package/dist/browser/assets/ScenarioScriptCapture.js +2 -1
- package/dist/browser/assets/WebArtifactReads.js +34 -4
- package/dist/browser/assets/WebSourceLocationArtifacts.js +39 -3
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/CaptureFailures.js +22 -8
- package/dist/browser/history/CaptureFormatError.js +2 -2
- package/dist/browser/history/{HarJson.js → CaptureJson.js} +14 -4
- package/dist/browser/history/CaptureRedaction.js +16 -3
- package/dist/browser/history/CaptureRelease.js +20 -2
- package/dist/browser/history/HarCapture.js +16 -9
- package/dist/browser/history/HarSchema.js +36 -36
- package/dist/browser/history/HistoricalCaptureDecoder.js +93 -25
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/history/NodeCaptureAdapter.js +48 -0
- package/dist/browser/history/{HarCaptureProcess.js → NodeCaptureProcess.js} +16 -15
- package/dist/browser/history/QlogCapture.js +385 -0
- package/dist/browser/history/SazCapture.js +130 -0
- package/dist/browser/history/SazHttp.js +61 -0
- package/dist/browser/history/SazMetadata.js +92 -0
- package/dist/browser/history/SazProjection.js +90 -0
- package/dist/browser/modules/NativeModuleResolver.js +177 -110
- package/dist/browser/modules/WebModuleArtifacts.js +41 -3
- package/dist/browser/network/PlaywrightNetworkContent.js +40 -5
- package/dist/browser/network/PlaywrightScenarioNetwork.js +125 -11
- package/dist/captures/TsharkCaptureProvider.js +370 -0
- package/dist/captures/parseFieldDiscovery.js +66 -0
- package/dist/captures/parsePacketOutput.js +21 -0
- package/dist/catalogIdentity.js +46 -35
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/androidCommands.js +11 -2
- package/dist/cli/apktoolCommands.js +52 -0
- package/dist/cli/applicationCommands.js +44 -17
- package/dist/cli/artifactCommands.js +9 -12
- package/dist/cli/binaryDiagnosticsCommands.js +27 -5
- package/dist/cli/browserAdvancedCommands.js +97 -55
- package/dist/cli/browserCommands.js +46 -29
- package/dist/cli/captureCommands.js +72 -0
- package/dist/cli/cliResultOutput.js +188 -0
- package/dist/cli/coreBinaryCommands.js +73 -32
- package/dist/cli/coreNativeCommands.js +54 -45
- package/dist/cli/cutterCommands.js +50 -0
- package/dist/cli/electronCommands.js +51 -4
- package/dist/cli/evmCommands.js +16 -8
- package/dist/cli/finishAnalysisCommand.js +44 -0
- package/dist/cli/firmwareCommands.js +21 -38
- package/dist/cli/flutterCommands.js +69 -0
- package/dist/cli/fridaCommands.js +211 -0
- package/dist/cli/goCommands.js +20 -0
- package/dist/cli/interactiveSetup.js +11 -1
- package/dist/cli/javascriptApplicationAnalysis.js +18 -2
- package/dist/cli/javascriptRecoveryCommands.js +29 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +13 -6
- package/dist/cli/managedCommands.js +31 -3
- package/dist/cli/options.js +20 -2
- package/dist/cli/pcapCommands.js +47 -0
- package/dist/cli/processCommands.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/reverseEngineeringCommands.js +268 -0
- package/dist/cli/rustCommands.js +21 -0
- package/dist/cli/setupCommands.js +55 -15
- package/dist/cli/signalCommands.js +72 -0
- package/dist/cli/sqliteCommands.js +79 -0
- package/dist/cli/utilityCommands.js +179 -89
- package/dist/cli/wasmCommands.js +61 -0
- package/dist/cli/webModuleCommands.js +36 -32
- package/dist/cli/webNetworkCaptureCommands.js +8 -8
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli-runtime/AbortablePromise-BVBemxbD.js +123 -0
- package/dist/cli-runtime/AnalysisProvider-D0Us2OTk.js +27 -0
- package/dist/cli-runtime/AnalysisSnapshotCache-BXS0wRd2.js +710 -0
- package/dist/cli-runtime/ArtifactReader-BXkffc1D.js +55 -0
- package/dist/cli-runtime/ArtifactResourceScope-DQWTcUwE.js +114 -0
- package/dist/cli-runtime/AsarHeader-CnzOzYEH.js +31 -0
- package/dist/cli-runtime/BinarySessionStatus-DnMxMk-r.js +211 -0
- package/dist/cli-runtime/BinaryTargetResolver-CVIJ_s1A.js +1308 -0
- package/dist/cli-runtime/BoundedFileBytes-BU30odTm.js +39 -0
- package/dist/cli-runtime/CdpTargetSession-DGX5pV9w.js +650 -0
- package/dist/cli-runtime/ClientConfigPath-c6jr6INc.js +36 -0
- package/dist/cli-runtime/ClientConfigurationDocument-ffQ9X0Se.js +1957 -0
- package/dist/cli-runtime/ClientRegistrationStatus-DszCyPEU.js +509 -0
- package/dist/cli-runtime/CurrentEntrypointPath-D5FRNdkq.js +14 -0
- package/dist/cli-runtime/DirectAnalysis-BgvAtpN3.js +528 -0
- package/dist/cli-runtime/Doctor-DIpf_I7N.js +588 -0
- package/dist/cli-runtime/ElectronFileScope-dpHm2nrS.js +1054 -0
- package/dist/cli-runtime/ExecFileOutput-BEQs-lDD.js +117 -0
- package/dist/cli-runtime/IdaConfiguration-CtGP7EKo.js +1094 -0
- package/dist/cli-runtime/InterfaceBuilderDecodeBudget-D4omRUe4.js +279 -0
- package/dist/cli-runtime/InventoryProjectionEvidence-DIsI4DJ6.js +49 -0
- package/dist/cli-runtime/InvestigationProviders-DoQRIHii.js +117 -0
- package/dist/cli-runtime/JavaScriptApplicationEvidenceGraph-D5aI_FSJ.js +160 -0
- package/dist/cli-runtime/JavaScriptApplicationWorkflowEvidence-Bz4-V0Ct.js +75 -0
- package/dist/cli-runtime/JavaScriptWorkerMemoryLimit-B1bwMM1a.js +86 -0
- package/dist/cli-runtime/JebMcpEndpoint-DUytrn5G.js +428 -0
- package/dist/cli-runtime/JsonFiles-DQa1PRKy.js +708 -0
- package/dist/cli-runtime/MacCodeSignature-MgYbRK_H.js +24 -0
- package/dist/cli-runtime/MacHopperPaths-CwL5lYPX.js +434 -0
- package/dist/cli-runtime/MachoLoadCommandReader-C7e074Ze.js +510 -0
- package/dist/cli-runtime/ManagedSnapshot-rqyBHcdL.js +4185 -0
- package/dist/cli-runtime/OwnedCommand-Cj9GhmPR.js +112 -0
- package/dist/cli-runtime/PrivateRuntimeRoot-DAy0PiBM.js +263 -0
- package/dist/cli-runtime/ProcessOwnership-DXC5-UWt.js +1378 -0
- package/dist/cli-runtime/ProviderDeadline-8m2pFRDc.js +122 -0
- package/dist/cli-runtime/RegularFile-B_6KPCNQ.js +139 -0
- package/dist/cli-runtime/RegularFileRead-DVlC5faM.js +125 -0
- package/dist/cli-runtime/SafeOutputTree-D6U15GXd.js +524 -0
- package/dist/cli-runtime/SetupHost-FkYWswsq.js +1098 -0
- package/dist/cli-runtime/SupportedClients-DaX6Lt2d.js +1049 -0
- package/dist/cli-runtime/UninstallFailure-1blyKXHE.js +22 -0
- package/dist/cli-runtime/Update-CbTC_eg1.js +143 -0
- package/dist/cli-runtime/UpdateFailure-BcFNxEZZ.js +24 -0
- package/dist/cli-runtime/ZipArtifactReader-B8ZgNe4D.js +248 -0
- package/dist/cli-runtime/analysisErrorCleanup-Do6YeeoD.js +32 -0
- package/dist/cli-runtime/analysisErrorPresentation-DGt7TdsH.js +497 -0
- package/dist/cli-runtime/appleArchiveFormat-tVoI2ykA.js +263 -0
- package/dist/cli-runtime/application__DirectAnalysisStatus-DpOejOf0.js +150 -0
- package/dist/cli-runtime/application__EnhancedTools-oFE2bOjs.js +1787 -0
- package/dist/cli-runtime/application__FunctionAnalysisEvidence-B6osuhvW.js +41 -0
- package/dist/cli-runtime/application__ReconstructionCoverageService-DN3wTFQj.js +32 -0
- package/dist/cli-runtime/application__ReconstructionObligationLedgerService-CKcTppX9.js +815 -0
- package/dist/cli-runtime/application__Setup-XpMaRNjy.js +514 -0
- package/dist/cli-runtime/application__Uninstall-_23pU2yB.js +427 -0
- package/dist/cli-runtime/application__UpdateRuntime-DPvY8ohd.js +345 -0
- package/dist/cli-runtime/application__android__AndroidApplicationService-CFgIFPM4.js +31 -0
- package/dist/cli-runtime/application__apple__AppleApplicationService-Db6QCsun.js +31 -0
- package/dist/cli-runtime/application__harmony__HarmonyApplicationService-CFjocHoK.js +31 -0
- package/dist/cli-runtime/application__javascript__ElectronActiveObservationService-CmVDUI_Z.js +118 -0
- package/dist/cli-runtime/application__javascript__ElectronObservationService-DEsR8KDN.js +63 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationService-CCkp8KBh.js +11450 -0
- package/dist/cli-runtime/application__javascript__JavaScriptApplicationWorkflowService-lPy0tzr3.js +2329 -0
- package/dist/cli-runtime/application__javascript__JavaScriptRuntimeReconciliationService-DWleA8K9.js +88 -0
- package/dist/cli-runtime/application__javascript__JavaScriptSemanticTraceService-DkALH4rL.js +299 -0
- package/dist/cli-runtime/artifactOperationError-B7n03FbD.js +27 -0
- package/dist/cli-runtime/artifacts__ArtifactProvider-zXI0QjSL.js +2187 -0
- package/dist/cli-runtime/binary-BVOr2mgE.js +14206 -0
- package/dist/cli-runtime/browserObservationError-Dx6xRTjb.js +40 -0
- package/dist/cli-runtime/catalogIdentity-DLoXgfIR.js +933 -0
- package/dist/cli-runtime/cli.js +41848 -0
- package/dist/cli-runtime/cliOutput-BC1BdAcB.js +122 -0
- package/dist/cli-runtime/cliOutput.js +5 -0
- package/dist/cli-runtime/cliResultOutput-DsRMI8CJ.js +780 -0
- package/dist/cli-runtime/cliResultOutput.js +5 -0
- package/dist/cli-runtime/composition__browserScenario-DHXC1a8n.js +2927 -0
- package/dist/cli-runtime/composition__electronObservation-GecK2EID.js +555 -0
- package/dist/cli-runtime/composition__electronScenario-CEZnVrAL.js +653 -0
- package/dist/cli-runtime/cutterToolContracts-TZH9EHr5.js +5134 -0
- package/dist/cli-runtime/doctorRuntime-BE5ZX8it.js +258 -0
- package/dist/cli-runtime/dotnet__ManagedStaticProvider-C8_yZCDc.js +5 -0
- package/dist/cli-runtime/errorSchemas-CTRmvMl3.js +601 -0
- package/dist/cli-runtime/javascriptApplicationAnalysis-HgMzVMQw.js +2068 -0
- package/dist/cli-runtime/javascriptExportReturnShapeProjection-Dg00g35t.js +78 -0
- package/dist/cli-runtime/javascriptExportShapeComparisonSchemas-BYnoIqIk.js +1242 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliation-DNjDoL3S.js +1507 -0
- package/dist/cli-runtime/javascriptRuntimeReconciliationSchemas-BWpGWNcI.js +247 -0
- package/dist/cli-runtime/javascriptSemanticTraceSchemas-BTCNcvbc.js +126 -0
- package/dist/cli-runtime/lipo-DSWP6fv-.js +396 -0
- package/dist/cli-runtime/logger-CQQCI4a2.js +48 -0
- package/dist/cli-runtime/machoContainer-C8BIkkq3.js +172 -0
- package/dist/cli-runtime/managedApplicationGraph-B08jb3jq.js +1130 -0
- package/dist/cli-runtime/managedToolContracts-D60QmIYj.js +99 -0
- package/dist/cli-runtime/mcpDoctor.js +359 -0
- package/dist/cli-runtime/mcpStartupPolicy-CVVSOmRc.js +21 -0
- package/dist/cli-runtime/native__NativeMacOSProvider-YBTvUeJO.js +4875 -0
- package/dist/cli-runtime/officialToolContracts-CCFF0an9.js +1501 -0
- package/dist/cli-runtime/propertyListKeys-G8e74YWb.js +248 -0
- package/dist/cli-runtime/providerAdapterError-DAjhICdr.js +25 -0
- package/dist/cli-runtime/providerCleanupError-Ceq8f0wK.js +27 -0
- package/dist/cli-runtime/providerIdentities-Ao1XTvwx.js +31 -0
- package/dist/cli-runtime/providerStartupTimeout-B2tF2LtZ.js +17 -0
- package/dist/cli-runtime/readFileHandleChunks-dp60iZ6v.js +38 -0
- package/dist/cli-runtime/reconstructionObligationLedgerSchemas-Bao0xMr-.js +19478 -0
- package/dist/cli-runtime/rolldown-runtime-DXoylpqc.js +121 -0
- package/dist/cli-runtime/runtimeVersion-CMGd0bDu.js +23 -0
- package/dist/cli-runtime/safeJson-DKKACtdy.js +25 -0
- package/dist/cli-runtime/scanCanonical-KP4T9jSl.js +2724 -0
- package/dist/cli-runtime/snapshotEnvironment-D_tWyOub.js +813 -0
- package/dist/cli-runtime/toolContracts-D2FOG_Nb.js +3721 -0
- package/dist/cli-runtime/toolOutputSchemaGroups-DRiYs1je.js +12070 -0
- package/dist/cli-runtime/workflowInputError-n8Oo-bLA.js +26 -0
- package/dist/cli.js +44 -5
- package/dist/cliBrowserScenarioCommands.js +41 -5
- package/dist/cliCommandNames.js +80 -0
- package/dist/cliEvidenceCommands.js +0 -1
- package/dist/cliJavaScriptRuntimeCommands.js +16 -14
- package/dist/cliJsonInput.js +14 -6
- package/dist/cliLogging.js +50 -14
- package/dist/cliObservationOptions.js +9 -0
- package/dist/cliOutput.js +38 -5
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/binary.js +4 -0
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/captures.js +3 -0
- package/dist/composition/directAnalysis.js +36 -11
- package/dist/composition/electronFuses.js +4 -0
- package/dist/composition/evm.js +12 -0
- package/dist/composition/flutter.js +3 -0
- package/dist/composition/go.js +4 -0
- package/dist/composition/javascriptAnalysisWorkerProcess.js +49 -0
- package/dist/composition/jeb.js +35 -0
- package/dist/composition/pcap.js +3 -0
- package/dist/composition/resolveWindowsProviderExecutable.js +61 -0
- package/dist/composition/reverseEngineering.js +29 -0
- package/dist/composition/rust.js +4 -0
- package/dist/composition/signals.js +3 -0
- package/dist/composition/sqlite.js +4 -0
- package/dist/composition/wasm.js +22 -0
- package/dist/composition/webNetworkCaptures.js +7 -2
- package/dist/config/environment.js +55 -4
- package/dist/config/ghidraDisabledAnalyzers.js +25 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/homeDirectory.js +9 -6
- package/dist/config/mcpInputSchemaProfile.js +31 -0
- package/dist/config/mcpOutputSchemaProfile.js +22 -0
- package/dist/config/parseConfig.js +36 -19
- package/dist/config/parsers.js +4 -3
- package/dist/config/{ghidraStartupTimeout.js → providerStartupTimeout.js} +7 -3
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +13 -0
- package/dist/contracts/analysisViewApiSurfaceExample.js +68 -0
- package/dist/contracts/analysisViewToolContracts.js +39 -3
- package/dist/contracts/android/androidToolContracts.js +17 -8
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/applicationToolContracts.js +17 -2
- package/dist/contracts/artifactToolContracts.js +21 -6
- package/dist/contracts/browserToolContracts.js +2 -1
- package/dist/contracts/captures/captureToolContracts.js +42 -0
- package/dist/contracts/compactInputSchema.js +276 -0
- package/dist/contracts/cutterToolContracts.js +84 -0
- package/dist/contracts/enhancedToolContracts.js +2 -2
- package/dist/contracts/evm/evmToolContracts.js +30 -15
- package/dist/contracts/firmware/firmwareToolContracts.js +1 -1
- package/dist/contracts/flutter/flutterToolContracts.js +47 -0
- package/dist/contracts/fridaRemoteAddress.js +23 -0
- package/dist/contracts/fridaToolContracts.js +273 -0
- package/dist/contracts/functionComparisonExample.js +12 -1
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/gdbToolContracts.js +103 -0
- package/dist/contracts/go/goToolContracts.js +20 -0
- package/dist/contracts/hopperMemoryContracts.js +15 -0
- package/dist/contracts/inputSchemaPresentation.js +91 -24
- package/dist/contracts/investigationExamples.js +1 -0
- package/dist/contracts/javascript/electronToolContracts.js +40 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +13 -1
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +43 -4
- package/dist/contracts/managed/managedWorkflowExamples.js +7 -1
- package/dist/contracts/managed/managedWorkflowToolContracts.js +4 -30
- package/dist/contracts/mobileApplicationGraphExamples.js +12 -0
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +27 -4
- package/dist/contracts/native/nativeToolContracts.js +10 -6
- package/dist/contracts/officialToolContracts.js +9 -9
- package/dist/contracts/pcap/pcapToolContracts.js +33 -0
- package/dist/contracts/providerSelection.js +1 -0
- package/dist/contracts/reconstructionReadinessExample.js +126 -119
- package/dist/contracts/reverseEngineeringToolContracts.js +52 -0
- package/dist/contracts/rizinDebugToolContracts.js +96 -0
- package/dist/contracts/rust/rustToolContracts.js +20 -0
- package/dist/contracts/sessionLifecycleInputs.js +34 -2
- package/dist/contracts/sessionToolContracts.js +4 -4
- package/dist/contracts/sessionToolSchemas.js +20 -2
- package/dist/contracts/signals/signalToolContracts.js +40 -0
- package/dist/contracts/sqlite/sqliteToolContracts.js +36 -0
- package/dist/contracts/toolContractExamples.js +35 -0
- package/dist/contracts/toolContractTypes.js +5 -0
- package/dist/contracts/toolContracts.js +32 -0
- package/dist/contracts/toolEffects.js +414 -8
- package/dist/contracts/toolOutputSchemaGroups.js +78 -33
- package/dist/contracts/toolOutputSchemaPrimitives.js +111 -10
- package/dist/contracts/toolSchemaMetadata.js +98 -9
- package/dist/contracts/unknownContractExamples.js +1 -1
- package/dist/contracts/wasm/wasmComparisonContracts.js +52 -0
- package/dist/contracts/wasm/wasmToolContracts.js +33 -0
- package/dist/contracts/webNetworkCaptureToolContracts.js +15 -4
- package/dist/cutter/CutterBridgeClient.js +621 -0
- package/dist/cutter/CutterBridgeService.js +139 -0
- package/dist/doctorRuntime.js +20 -8
- package/dist/domain/adb/adbDeviceAnalysis.js +605 -0
- package/dist/domain/analysisErrorBase.js +20 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorCore.js +19 -0
- package/dist/domain/analysisErrorPresentation.js +75 -22
- package/dist/domain/analysisErrorProjection.js +35 -13
- package/dist/domain/analysisProfile.js +7 -3
- package/dist/domain/analysisSnapshot.js +313 -185
- package/dist/domain/analysisView/WebNetworkApiSurfaceAccumulator.js +414 -0
- package/dist/domain/analysisView/analysisView.js +417 -45
- package/dist/domain/analysisView/analysisViewCoverage.js +32 -0
- package/dist/domain/analysisView/analysisViewErrors.js +4 -0
- package/dist/domain/analysisView/analysisViewParent.js +12 -0
- package/dist/domain/analysisView/analysisViewText.js +29 -0
- package/dist/domain/analysisView/androidPackageView.js +102 -0
- package/dist/domain/analysisView/artifactInventoryView.js +140 -0
- package/dist/domain/analysisView/binaryLayoutView.js +13 -4
- package/dist/domain/analysisView/dartAotView.js +93 -0
- package/dist/domain/analysisView/evmInterfaceView.js +105 -0
- package/dist/domain/analysisView/interfaceBuilderView.js +182 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +29 -26
- package/dist/domain/analysisView/machoView.js +186 -0
- package/dist/domain/analysisView/managedArtifactView.js +108 -0
- package/dist/domain/analysisView/managedMemberView.js +209 -0
- package/dist/domain/analysisView/nativeFunctionView.js +150 -0
- package/dist/domain/analysisView/pcapCaptureView.js +264 -0
- package/dist/domain/analysisView/qlogCaptureView.js +198 -0
- package/dist/domain/analysisView/wasmArtifactView.js +162 -0
- package/dist/domain/analysisView/webNetworkApiSurfaceView.js +123 -0
- package/dist/domain/analysisView/webNetworkCaptureView.js +388 -0
- package/dist/domain/android/androidAnalysis.js +36 -2
- package/dist/domain/android/androidApplication.js +57 -80
- package/dist/domain/apktool/apktoolResourceAnalysis.js +89 -0
- package/dist/domain/apple/appleApplication.js +71 -52
- package/dist/domain/apple/appleArchiveFormat.js +184 -0
- package/dist/domain/apple/appleAssetCatalog.js +15 -0
- package/dist/domain/apple/appleBundleAnatomy.js +96 -29
- package/dist/domain/apple/dyldPaths.js +18 -3
- package/dist/domain/apple/dylibResolution.js +21 -11
- package/dist/domain/apple/dylibResolutionFindings.js +8 -9
- package/dist/domain/apple/interfaceBuilderGraph.js +72 -45
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +38 -9
- package/dist/domain/apple/machoContainer.js +120 -8
- package/dist/domain/apple/machoCpuIdentity.js +4 -0
- package/dist/domain/apple/plistValue.js +6 -1
- package/dist/domain/artifactComparison.js +130 -25
- package/dist/domain/artifactDecompressionBudget.js +26 -0
- package/dist/domain/artifactGraph.js +28 -9
- package/dist/domain/artifactIdentity.js +33 -2
- package/dist/domain/artifactInspection.js +47 -45
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +148 -51
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +253 -80
- package/dist/domain/binaryTargetTypes.js +21 -1
- package/dist/domain/browserNetworkEvidence.js +4 -0
- package/dist/domain/browserObservation.js +88 -29
- package/dist/domain/browserObservationSchemas.js +12 -5
- package/dist/domain/browserScenarioCapture.js +2 -1
- package/dist/domain/browserScenarioCaptureValues.js +26 -2
- package/dist/domain/browserScenarioDiff.js +120 -11
- package/dist/domain/browserScenarioDiffEvidence.js +46 -13
- package/dist/domain/browserScenarioDiffValues.js +10 -3
- package/dist/domain/browserScenarioNetworkComparison.js +158 -0
- package/dist/domain/browserScenarioNormalization.js +10 -13
- package/dist/domain/browserScenarioValues.js +2 -12
- package/dist/domain/browserSession.js +2 -2
- package/dist/domain/bundleComparison.js +1 -5
- package/dist/domain/callPath.js +40 -3
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/captures/packetCapture.js +138 -0
- package/dist/domain/captures/packetFields.js +81 -0
- package/dist/domain/changedBehavior.js +43 -41
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSourceEvidence.js +6 -0
- package/dist/domain/dosCom.js +2 -2
- package/dist/domain/dosMz.js +52 -14
- package/dist/domain/electron/electronFuses.js +360 -0
- package/dist/domain/elfFixedHeader.js +42 -0
- package/dist/domain/evidence.js +104 -38
- package/dist/domain/evidenceBundle.js +58 -20
- package/dist/domain/evidenceErrors.js +5 -0
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/evm/evmInterface.js +18 -4
- package/dist/domain/evm/solidityMetadata.js +70 -0
- package/dist/domain/explicitSensitiveFailure.js +42 -24
- package/dist/domain/firmware/firmwareAnalysis.js +29 -0
- package/dist/domain/flutter/flutterBuildAnalysis.js +141 -0
- package/dist/domain/functionCallCoverage.js +60 -0
- package/dist/domain/functionComparisonDimensions.js +101 -10
- package/dist/domain/functionComparisonNormalization.js +66 -10
- package/dist/domain/functionComparisonResults.js +7 -6
- package/dist/domain/functionComparisonSchemas.js +14 -3
- package/dist/domain/functionDossierEvidence.js +3 -0
- package/dist/domain/go/goBinary.js +96 -0
- package/dist/domain/harmony/harmonyApplication.js +156 -0
- package/dist/domain/hopperErrors.js +15 -16
- package/dist/domain/hopperPublisher.js +12 -0
- package/dist/domain/hopperValues.js +112 -34
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronObservation.js +4 -1
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +24 -24
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +13 -20
- package/dist/domain/javascript/electronStaticAnalysisNative.js +85 -41
- package/dist/domain/javascript/electronStaticAnalysisValues.js +30 -8
- package/dist/domain/javascript/electronWrappedCallPaths.js +498 -0
- package/dist/domain/javascript/htmlArtifactReferences.js +94 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +65 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +7 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +13 -8
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +1 -1
- package/dist/domain/javascript/javascriptApplicationGraph.js +96 -19
- package/dist/domain/javascript/javascriptApplicationGraphSchemas.js +1 -0
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +43 -0
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +28 -12
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +40 -19
- package/dist/domain/javascript/javascriptArtifactFiles.js +2 -1
- package/dist/domain/javascript/javascriptAstFingerprint.js +100 -39
- package/dist/domain/javascript/javascriptAstValues.js +81 -0
- package/dist/domain/javascript/javascriptBootstrap.js +94 -0
- package/dist/domain/javascript/javascriptBootstrapIntegrity.js +372 -0
- package/dist/domain/javascript/javascriptBuiltinResourceMethods.js +8 -0
- package/dist/domain/javascript/javascriptBundledRequireOrigin.js +291 -0
- package/dist/domain/javascript/javascriptContextBridgeExposure.js +23 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +114 -0
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +6 -5
- package/dist/domain/javascript/javascriptExportShapeVariants.js +1 -1
- package/dist/domain/javascript/javascriptFeatureSeed.js +33 -16
- package/dist/domain/javascript/javascriptFeatureTrace.js +9 -3
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +42 -11
- package/dist/domain/javascript/javascriptIntrinsicInvocation.js +132 -0
- package/dist/domain/javascript/javascriptModuleDeclaration.js +28 -0
- package/dist/domain/javascript/javascriptModuleInterop.js +618 -0
- package/dist/domain/javascript/javascriptModuleResolutionMode.js +18 -0
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptModuleSpecifier.js +5 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +6 -2
- package/dist/domain/javascript/javascriptPackageImportAliases.js +58 -0
- package/dist/domain/javascript/javascriptRecovery.js +12 -5
- package/dist/domain/javascript/javascriptRpcEndpoints.js +331 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +12 -3
- package/dist/domain/javascript/javascriptRuntimeObservation.js +4 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +10 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +7 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +15 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +0 -1
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +5 -4
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +121 -22
- package/dist/domain/javascript/javascriptSemanticAmbientWrites.js +251 -0
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +493 -104
- package/dist/domain/javascript/javascriptSemanticAsyncEffects.js +17 -34
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +4 -3
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCallableStack.js +52 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +14 -12
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +42 -55
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +428 -32
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +14 -20
- package/dist/domain/javascript/javascriptSemanticDependencies.js +69 -0
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +51 -53
- package/dist/domain/javascript/javascriptSemanticGraph.js +74 -24
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +2 -11
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +41 -8
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +538 -151
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +199 -3
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +78 -35
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +671 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +27 -17
- package/dist/domain/javascript/javascriptSemanticProjection.js +202 -56
- package/dist/domain/javascript/javascriptSemanticPromises.js +6 -9
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +77 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +5 -1
- package/dist/domain/javascript/javascriptSemanticQuery.js +34 -31
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +1 -3
- package/dist/domain/javascript/javascriptSemanticReferenceSources.js +25 -0
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +331 -8
- package/dist/domain/javascript/javascriptSemanticResources.js +6 -40
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +233 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +49 -52
- package/dist/domain/javascript/javascriptSemanticState.js +61 -4
- package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -5
- package/dist/domain/javascript/javascriptSemanticValues.js +260 -35
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +44 -17
- package/dist/domain/javascript/javascriptSourceParser.js +72 -3
- package/dist/domain/javascript/javascriptSourceSelection.js +11 -0
- package/dist/domain/javascript/javascriptStaticAnalysis.js +72 -26
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +100 -24
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +271 -47
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +166 -56
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +2 -0
- package/dist/domain/javascript/javascriptStaticAnalysisTypes.js +2 -1
- package/dist/domain/javascript/javascriptSymbolicBindings.js +836 -0
- package/dist/domain/javascript/javascriptSymbolicControlFlow.js +40 -0
- package/dist/domain/javascript/javascriptSymbolicValues.js +34 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +3 -1
- package/dist/domain/javascript/sourceToBundleComparisonSchemas.js +2 -0
- package/dist/domain/javascript/sourceToBundleSignals.js +47 -13
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonShape.js +63 -52
- package/dist/domain/jsonValue.js +40 -12
- package/dist/domain/localPath.js +6 -3
- package/dist/domain/managed/managedApplicationGraph.js +42 -0
- package/dist/domain/managed/managedApplicationGraphCoverage.js +12 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +32 -23
- package/dist/domain/managed/managedArtifact.js +52 -1
- package/dist/domain/managed/managedInspectionEvidence.js +12 -0
- package/dist/domain/managed/managedMemberComparison.js +3 -0
- package/dist/domain/managed/managedMemberComparisonCoverage.js +23 -3
- package/dist/domain/managed/managedMemberComparisonItems.js +23 -19
- package/dist/domain/managed/managedMemberComparisonMatch.js +209 -18
- package/dist/domain/managed/managedNativeVerificationMatch.js +49 -26
- package/dist/domain/managed/managedNativeVerificationSchemas.js +13 -2
- package/dist/domain/managed/managedReconstruction.js +5 -8
- package/dist/domain/mobileApplicationGraphProjection.js +80 -0
- package/dist/domain/native/addressCoordinate.js +11 -0
- package/dist/domain/native/binaryLayout.js +2 -4
- package/dist/domain/native/bytePattern.js +100 -0
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeInspection.js +38 -4
- package/dist/domain/native/nativeInstruction.js +38 -2
- package/dist/domain/native/nativeInvestigationGraph.js +9 -5
- package/dist/domain/native/nativeLoadImage.js +19 -1
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/nativeUiObservation.js +5 -6
- package/dist/domain/native/objcSwiftMetadata.js +4 -1
- package/dist/domain/native/peResources.js +100 -0
- package/dist/domain/native/recordedCrash.js +79 -10
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/offsetDateTime.js +60 -0
- package/dist/domain/pcap/pcapAnalysis.js +91 -0
- package/dist/domain/pcap/pcapEvidence.js +15 -0
- package/dist/domain/peMachine.js +36 -0
- package/dist/domain/pngHeader.js +18 -0
- package/dist/domain/process/processCapture.js +91 -1
- package/dist/domain/process/processCaptureCoverage.js +26 -3
- package/dist/domain/process/processCaptureExample.js +26 -0
- package/dist/domain/process/processCaptureValidation.js +112 -8
- package/dist/domain/process/processComparison.js +41 -13
- package/dist/domain/process/processScenario.js +66 -7
- package/dist/domain/process/processTraceEvaluation.js +54 -50
- package/dist/domain/process/processTraceSpecification.js +243 -89
- package/dist/domain/propertyListKeys.js +214 -12
- package/dist/domain/propertyListXmlText.js +20 -4
- package/dist/domain/providerAdapterError.js +0 -5
- package/dist/domain/providerConfigurationRefusal.js +12 -0
- package/dist/domain/providerSelectionError.js +2 -1
- package/dist/domain/qlogCapture.js +62 -0
- package/dist/domain/rawBinary.js +96 -0
- package/dist/domain/reconstructionCoverage.js +5 -1
- package/dist/domain/reconstructionCoverageEvaluation.js +18 -15
- package/dist/domain/reconstructionCoverageVerifierResults.js +35 -0
- package/dist/domain/reconstructionObligationLedgerIntegrity.js +114 -0
- package/dist/domain/reconstructionObligationLedgerSchemas.js +104 -1
- package/dist/domain/reconstructionReadiness.js +4 -8
- package/dist/domain/reconstructionReadinessJourneyFindings.js +4 -1
- package/dist/domain/reconstructionUnknowns.js +9 -1
- package/dist/domain/reconstructionVerification.js +54 -25
- package/dist/domain/recordedTransportUrl.js +59 -0
- package/dist/domain/referenceSourceClassification.js +27 -23
- package/dist/domain/referenceSourceGraph.js +70 -23
- package/dist/domain/referenceSourceImportParsing.js +29 -16
- package/dist/domain/referenceSourcePathIdentity.js +32 -0
- package/dist/domain/referenceSourceRequireBindings.js +130 -0
- package/dist/domain/referenceSourceSummary.js +92 -0
- package/dist/domain/relationshipCoverage.js +44 -0
- package/dist/domain/residualUnknown.js +93 -26
- package/dist/domain/reverseEngineering.js +31 -0
- package/dist/domain/runtimeVersion.js +8 -0
- package/dist/domain/rust/rustBinary.js +200 -0
- package/dist/domain/signals/annotationTextWindow.js +31 -0
- package/dist/domain/signals/signalDecoders.js +69 -0
- package/dist/domain/signals/signalRecording.js +115 -0
- package/dist/domain/sourceMapContents.js +10 -3
- package/dist/domain/sourceMapEnvelope.js +17 -11
- package/dist/domain/sqlite/sqliteDatabase.js +188 -0
- package/dist/domain/staticRuntimeCorrelation.js +7 -9
- package/dist/domain/swiftSymbolClassification.js +17 -0
- package/dist/domain/symbolAnalysis.js +16 -4
- package/dist/domain/urlComponents.js +6 -0
- package/dist/domain/wasm/wasmArtifact.js +119 -0
- package/dist/domain/wasm/wasmInterface.js +89 -0
- package/dist/domain/webBundleAnalysis.js +14 -3
- package/dist/domain/webBundleAnalyzerAst.js +7 -2
- package/dist/domain/webBundleAnalyzerInspection.js +68 -40
- package/dist/domain/webBundleAnalyzerResult.js +18 -6
- package/dist/domain/webCaptureDiff.js +233 -34
- package/dist/domain/webCaptureFrameComparison.js +49 -0
- package/dist/domain/webMcpDiscovery.js +5 -2
- package/dist/domain/webModuleImports.js +22 -27
- package/dist/domain/webModuleTrace.js +3 -8
- package/dist/domain/webNetworkCapture.js +101 -39
- package/dist/domain/webNetworkCaptureCoordinates.js +21 -0
- package/dist/domain/webRuntime.js +0 -1
- package/dist/domain/webScreenshot.js +2 -2
- package/dist/domain/webScriptArtifacts.js +2 -4
- package/dist/domain/webScriptExport.js +6 -8
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +9 -15
- package/dist/domain/webSourceLocation.js +20 -9
- package/dist/domain/zipPackageFormat.js +31 -2
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +81 -54
- package/dist/dotnet/ManagedDecodeBudget.js +138 -0
- package/dist/dotnet/ManagedMemberInspector.js +113 -26
- package/dist/dotnet/ManagedMemberInspectorCore.js +356 -140
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +112 -38
- package/dist/dotnet/ManagedMemberOwnership.js +65 -0
- package/dist/dotnet/ManagedMemberPointers.js +69 -0
- package/dist/dotnet/ManagedMemberRows.js +182 -44
- package/dist/dotnet/ManagedMetadataHeaps.js +123 -27
- package/dist/dotnet/ManagedMetadataInventory.js +5 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +56 -63
- package/dist/dotnet/ManagedMetadataLayout.js +19 -5
- package/dist/dotnet/ManagedMetadataRowSizes.js +1 -1
- package/dist/dotnet/ManagedMethodBodyReader.js +34 -11
- package/dist/dotnet/ManagedMethodSpecs.js +78 -0
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +5 -4
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +52 -44
- package/dist/dotnet/ManagedPeReader.js +96 -52
- package/dist/dotnet/ManagedReaderFailure.js +11 -1
- package/dist/dotnet/ManagedSnapshot.js +88 -0
- package/dist/dotnet/ManagedStaticProvider.js +57 -35
- package/dist/dotnet/ManagedTypeMemberLists.js +105 -0
- package/dist/dotnet/ManagedTypeNames.js +98 -0
- package/dist/dotnet/ManagedUserStrings.js +75 -0
- package/dist/electron/ElectronFusePath.js +247 -0
- package/dist/electron/ElectronFuseProvider.js +113 -0
- package/dist/electron/ElectronFuseReader.js +317 -0
- package/dist/evaluation/AgentEvaluationFixtures.js +194 -11
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +58 -49
- package/dist/evaluation/KnownAnswerEvaluation.js +126 -57
- package/dist/evm/EvmoleFailures.js +19 -16
- package/dist/evm/EvmoleInterfaceAdapter.js +5 -1
- package/dist/evm/EvmoleInterfaceProvider.js +198 -23
- package/dist/evm/EvmoleInterfaceWorker.js +2 -0
- package/dist/evm/SolidityMetadata.js +139 -0
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/OwnedStagedOutput.js +138 -0
- package/dist/filesystem/RegularFile.js +81 -5
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +35 -0
- package/dist/firmware/FirmwareCommand.js +27 -5
- package/dist/firmware/FirmwareFiles.js +18 -7
- package/dist/firmware/FirmwareProvider.js +158 -32
- package/dist/firmware/FirmwarePublication.js +242 -4
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/firmware/FirmwareReports.js +202 -12
- package/dist/flutter/DartElf.js +418 -0
- package/dist/flutter/ElfBuildId.js +137 -0
- package/dist/flutter/ElfLoadMap.js +91 -0
- package/dist/flutter/FlutterBuildProvider.js +826 -0
- package/dist/flutter/FlutterPayloadScan.js +180 -0
- package/dist/frida/FridaInstrumentationManager.js +1104 -0
- package/dist/gdb/GdbSessionManager.js +1451 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +175 -6
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +208 -29
- package/dist/ghidra/GhidraDiagnostics.js +18 -8
- package/dist/ghidra/GhidraDoctor.js +15 -12
- package/dist/ghidra/GhidraFunctionValues.js +73 -2
- package/dist/ghidra/GhidraInstallation.js +216 -20
- package/dist/ghidra/GhidraInstallationPolicy.js +79 -29
- package/dist/ghidra/GhidraInventoryValues.js +53 -1
- package/dist/ghidra/GhidraJavaLaunch.js +91 -10
- package/dist/ghidra/GhidraJavaProperties.js +117 -0
- package/dist/ghidra/GhidraLanguageCatalog.js +169 -0
- package/dist/ghidra/GhidraLauncher.js +306 -88
- package/dist/ghidra/GhidraLoadImageAttest.js +74 -7
- package/dist/ghidra/GhidraLoadImageValues.js +72 -0
- package/dist/ghidra/GhidraMipsProfile.js +315 -0
- package/dist/ghidra/GhidraPeProfile.js +21 -0
- package/dist/ghidra/GhidraPowerPcProfile.js +51 -0
- package/dist/ghidra/GhidraProvider.js +106 -20
- package/dist/ghidra/GhidraProviderCapabilities.js +30 -19
- package/dist/ghidra/GhidraProviderClient.js +520 -56
- package/dist/ghidra/GhidraPspExtension.js +140 -0
- package/dist/ghidra/GhidraPspProfile.js +59 -0
- package/dist/ghidra/GhidraRawBinaryLanguage.js +40 -0
- package/dist/ghidra/GhidraRiscvProfile.js +100 -0
- package/dist/ghidra/GhidraSessionError.js +155 -11
- package/dist/ghidra/GhidraSessionValues.js +75 -2
- package/dist/ghidra/GhidraTransport.js +2 -1
- package/dist/go/GoBinaryContainer.js +140 -0
- package/dist/go/GoBinaryImage.js +210 -0
- package/dist/go/GoBinaryProvider.js +151 -0
- package/dist/go/GoElfImage.js +211 -0
- package/dist/go/GoMachoImage.js +164 -0
- package/dist/go/GoModuleText.js +217 -0
- package/dist/go/GoPeImage.js +124 -0
- package/dist/hopper/BridgeLauncher.js +35 -2
- package/dist/hopper/HopperAnalysisProfile.js +21 -9
- package/dist/hopper/HopperCleanup.js +15 -3
- package/dist/hopper/HopperClient.js +203 -42
- package/dist/hopper/HopperMacPublisher.js +29 -0
- package/dist/hopper/HopperMachOImage.js +61 -27
- package/dist/hopper/HopperProcessDiagnostic.js +27 -0
- package/dist/hopper/HopperProvider.js +68 -26
- package/dist/hopper/HopperProviderCapabilities.js +7 -3
- package/dist/hopper/HopperRequestQueue.js +17 -5
- package/dist/hopper/HopperSessionValues.js +10 -1
- package/dist/hopper/HopperTargetLease.js +66 -19
- package/dist/ida/IdaBusyHealth.js +44 -0
- package/dist/ida/IdaCallGraph.js +134 -0
- package/dist/ida/IdaConfiguration.js +7 -2
- package/dist/ida/IdaDiagnosticRedactor.js +199 -0
- package/dist/ida/IdaDiagnosticWriter.js +62 -0
- package/dist/ida/IdaDoctor.js +7 -5
- package/dist/ida/IdaJsonDiagnostic.js +138 -0
- package/dist/ida/IdaMcpConnection.js +297 -27
- package/dist/ida/IdaNativeProtocol.js +93 -0
- package/dist/ida/IdaOperationRunner.js +249 -40
- package/dist/ida/IdaProtocolValues.js +86 -4
- package/dist/ida/IdaProvider.js +34 -8
- package/dist/ida/IdaProviderCapabilities.js +37 -8
- package/dist/ida/IdaSessionClient.js +332 -53
- package/dist/ida/IdaWorkspace.js +57 -7
- package/dist/inspector/V8InspectorCaptureProjection.js +7 -2
- package/dist/inspector/V8InspectorEndpoint.js +15 -13
- package/dist/inspector/V8InspectorProvider.js +41 -7
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +337 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +594 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +65 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +590 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +126 -0
- package/dist/javascript/recovery/RecoveryFiles.js +68 -12
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +30 -18
- package/dist/javascript/recovery/WakaruProvider.js +150 -24
- package/dist/javascript/recovery/WakaruPublication.js +38 -14
- package/dist/javascript/recovery/WakaruRelease.js +11 -4
- package/dist/javascript/recovery/WakaruReport.js +15 -9
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/DecodedSourceMap.js +2 -16
- package/dist/javascript/sourceMaps/SourceMapCommand.js +38 -7
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +84 -10
- package/dist/javascript/sourceMaps/SourceMapFormat.js +26 -28
- package/dist/javascript/sourceMaps/TraceSourceMap.js +34 -6
- package/dist/jeb/JebMcpConnection.js +186 -0
- package/dist/jeb/JebMcpEndpoint.js +45 -0
- package/dist/jeb/JebProvider.js +297 -0
- package/dist/logger.js +14 -1
- package/dist/main/shutdown.js +3 -0
- package/dist/main/transport.js +48 -4
- package/dist/main.js +14 -3
- package/dist/mcp/AnalysisSnapshotFiles-BAbiJQOc.js +1412 -0
- package/dist/mcp/ArtifactProvider-DViCU_rn.js +2183 -0
- package/dist/mcp/ArtifactProviderMetadata-b7pOK5_t.js +76 -0
- package/dist/mcp/ArtifactReader-OyM03Gjn.js +55 -0
- package/dist/mcp/ArtifactResourceScope-P3tq5z8Z.js +162 -0
- package/dist/mcp/AsarHeader-WsPgoooH.js +31 -0
- package/dist/mcp/BinarySessionStatus-B4P9gf-S.js +212 -0
- package/dist/mcp/BinaryTargetResolver-BMaE_0H1.js +1427 -0
- package/dist/mcp/BoundedFileBytes-DuczXiQZ.js +68 -0
- package/dist/mcp/CdpCaptureDocuments-HDiF2O7k.js +746 -0
- package/dist/mcp/CdpCaptureValues-M-j6CIh1.js +90 -0
- package/dist/mcp/CdpConnection-BpDfz4MK.js +570 -0
- package/dist/mcp/CdpOptionalCommand-BPjRD9Kz.js +120 -0
- package/dist/mcp/CdpTargetSession-BsPoKhEU.js +86 -0
- package/dist/mcp/DirectAnalysis-DrafbXke.js +409 -0
- package/dist/mcp/DirectAnalysisStatus-CjjeDLzW.js +44 -0
- package/dist/mcp/ElectronFileScope-BPG_YoyU.js +110 -0
- package/dist/mcp/InterfaceBuilderDecodeBudget-5F2AkxJT.js +652 -0
- package/dist/mcp/ManagedStaticProvider-BthZbKyZ.js +5028 -0
- package/dist/mcp/NativeMacOSProvider-Bh79k8dI.js +4867 -0
- package/dist/mcp/NativeMacOSProviderMetadata-N1lPOaY_.js +307 -0
- package/dist/mcp/ProcedureAddressResolution-CQpuwm1h.js +19 -0
- package/dist/mcp/ProcessOwnership-Bl_3ejLe.js +1502 -0
- package/dist/mcp/ProviderDeadline-DskQ94YD.js +932 -0
- package/dist/mcp/WorkflowEvidence-umWrB_wm.js +111 -0
- package/dist/mcp/analysisErrorCore-DXRTvF_m.js +235 -0
- package/dist/mcp/analysisErrorProjection-BN0EPM-3.js +892 -0
- package/dist/mcp/artifactOperationError-CkHMMaf7.js +27 -0
- package/dist/mcp/artifactToolContracts-Di4qZlEt.js +72 -0
- package/dist/mcp/browserObservation-C0s4i8UI.js +4468 -0
- package/dist/mcp/browserObservationError-CyLugqX4.js +40 -0
- package/dist/mcp/browserObservationSchemas-tgqjH7aA.js +573 -0
- package/dist/mcp/browserScenario-CAQ8Fns9.js +2929 -0
- package/dist/mcp/browserScenarioCapture-CTNFN-FI.js +479 -0
- package/dist/mcp/canonicalDigest-Bi_0_zGi.js +71 -0
- package/dist/mcp/digests-BFoWUT_-.js +223 -0
- package/dist/mcp/electronActiveObservation-lDvQTMR0.js +226 -0
- package/dist/mcp/electronObservation-DFOFEood.js +112 -0
- package/dist/mcp/electronObservation-i7LcILQ-.js +562 -0
- package/dist/mcp/electronScenario-nCzE6IfJ.js +653 -0
- package/dist/mcp/emptyArraySchema-tL6Qymyd.js +140 -0
- package/dist/mcp/enhancedInputs-DgdEnzHy.js +56 -0
- package/dist/mcp/javascriptRuntimeObservation-61NhCf7H.js +690 -0
- package/dist/mcp/javascriptRuntimeObservation-PIUoLfX6.js +121 -0
- package/dist/mcp/jsonSerialization-V-wWiFRE.js +152 -0
- package/dist/mcp/lipo-Bnkoq_6W.js +502 -0
- package/dist/mcp/localPath-AxvW9aPe.js +19 -0
- package/dist/mcp/logger-BQY5ulYv.js +48 -0
- package/dist/mcp/main-kBXHZ8S5.js +69390 -0
- package/dist/mcp/main.js +6 -0
- package/dist/mcp/managedToolContracts-CK--I_s7.js +101 -0
- package/dist/mcp/nativeValueTrace-DR9UE62L.js +3439 -0
- package/dist/mcp/officialToolContracts-B67NJ2tC.js +1413 -0
- package/dist/mcp/pngHeader-DQ-ObyY2.js +147 -0
- package/dist/mcp/propertyListKeys-DD25WsjI.js +553 -0
- package/dist/mcp/providerAdapterError-sDxToNal.js +25 -0
- package/dist/mcp/providerIdentities--ptAh481.js +31 -0
- package/dist/mcp/providerIdentity-BCQ5n5tw.js +16 -0
- package/dist/mcp/providerOperationHealth-CTYa3iLf.js +48 -0
- package/dist/mcp/rolldown-runtime-BjeaiXFo.js +121 -0
- package/dist/mcp/safeJson-NeGfpkrI.js +25 -0
- package/dist/mcp/scanCanonical-CRXSpule.js +3982 -0
- package/dist/mcp/serverIdentity-Cio4iFV3.js +1328 -0
- package/dist/mcp/sourceMapEnvelope-C0uJlrOh.js +94 -0
- package/dist/mcp/toolContracts-BW05wpcr.js +12200 -0
- package/dist/mcp/toolOutputSchemaGroups-ColvNZ1r.js +17533 -0
- package/dist/mcp/unicodeCodePointOrder-BezCbTpg.js +26 -0
- package/dist/mcp/webContentArtifact-Dzjc1z-R.js +284 -0
- package/dist/mcp/webRuntime-K__NYzXm.js +74 -0
- package/dist/mcp/webSourceLocation-DbMAT2J9.js +11130 -0
- package/dist/mcpDoctor.js +108 -76
- package/dist/mcpStartupPolicy.js +3 -0
- package/dist/native/AppleDispatchCoverage.js +81 -28
- package/dist/native/AppleDispatchMetadata.js +20 -9
- package/dist/native/AppleMachoFixups.js +253 -34
- package/dist/native/AppleMachoSelection.js +44 -17
- package/dist/native/AppleObjcCategories.js +1 -2
- package/dist/native/AppleObjcDispatchFacets.js +76 -7
- package/dist/native/CommandRunner.js +142 -32
- package/dist/native/LldbCallTracer.js +5 -3
- package/dist/native/MachoArchitectureSelection.js +50 -0
- package/dist/native/NativeCallObservation.js +2 -1
- package/dist/native/NativeMacOSProvider.js +173 -37
- package/dist/native/NativeMachoInspection.js +142 -78
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +6 -5
- package/dist/native/SignatureTargetBinding.js +118 -55
- package/dist/native/parsers/codesign.js +27 -10
- package/dist/native/parsers/demangle.js +7 -1
- package/dist/native/parsers/dyldInfo.js +73 -4
- package/dist/native/parsers/lipo.js +53 -19
- package/dist/native/parsers/machoUuid.js +150 -0
- package/dist/native/parsers/otool.js +232 -29
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +77 -0
- package/dist/native/pwndbg/PwndbgCoreContext.js +20 -20
- package/dist/native/pwntools/PwntoolsDecoder.js +264 -40
- package/dist/native/pwntools/PwntoolsFailures.js +2 -1
- package/dist/native/pwntools/PwntoolsInputLimit.js +27 -0
- package/dist/native/pwntools/PwntoolsRecordedCrashProvider.js +27 -15
- package/dist/native/pwntools/PwntoolsResourceLimits.js +3 -3
- package/dist/native/pwntools/RecordedCrashSourceBindings.js +12 -8
- package/dist/native/pwntools/RecordedCrashStructureBindings.js +3 -1
- package/dist/objdump/ObjdumpCommand.js +21 -0
- package/dist/pcap/PcapCommand.js +146 -0
- package/dist/pcap/PcapConfiguration.js +93 -0
- package/dist/pcap/PcapNativeBound.js +58 -0
- package/dist/pcap/PcapOutput.js +240 -0
- package/dist/pcap/PcapProvider.js +424 -0
- package/dist/pcap/PcapSnapshot.js +171 -0
- package/dist/process/ArtifactAnalysisResources.js +213 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/CurrentEntrypointPath.js +6 -0
- package/dist/process/DarwinProcessRunTokenReader.js +125 -16
- package/dist/process/ExecFileBoundedOutput.js +44 -0
- package/dist/process/ExecFileOutput.js +30 -6
- package/dist/process/JavaScriptWorkerMemoryLimit.js +25 -0
- package/dist/process/LinuxResourceLimits.js +80 -0
- package/dist/process/MacCodeSignature.js +3 -0
- package/dist/process/OwnedCommand.js +40 -15
- package/dist/process/PrivateRuntimeRoot.js +9 -19
- package/dist/process/PrivateRuntimeRootUnavailableError.js +10 -0
- package/dist/process/ProcessOwnership.js +173 -128
- package/dist/process/ProcessOwnershipObservation.js +131 -43
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDeadline.js +58 -12
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +112 -14
- package/dist/process/WindowsAuthority.js +48 -39
- package/dist/process/WindowsBatchCommand.js +46 -0
- package/dist/process/boundedUtf8Text.js +13 -0
- package/dist/process/capture/FilesystemSnapshot.js +87 -12
- package/dist/process/capture/ProcessCaptureClock.js +2 -0
- package/dist/process/capture/ProcessCaptureError.js +22 -3
- package/dist/process/capture/ProcessCaptureJournal.js +2 -1
- package/dist/process/capture/ProcessCaptureLifecycle.js +433 -91
- package/dist/process/capture/ProcessCaptureProgress.js +63 -0
- package/dist/process/capture/ProcessHarness.js +209 -38
- package/dist/process/capture/ProcessNormalization.js +278 -34
- package/dist/process/capture/ProcessSampling.js +3 -2
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +18 -15
- package/dist/process/capture/TerminalRenderer.js +52 -14
- package/dist/process/ownedDebuggerSession.js +203 -0
- package/dist/reference/ReferenceSourceReader.js +22 -6
- package/dist/reference/ReferenceSourceReaderEntries.js +182 -105
- package/dist/reference/ReferenceSourceReaderErrors.js +17 -1
- package/dist/reference/ReferenceSourceReaderFile.js +50 -11
- package/dist/reference/ReferenceSourceReaderTypes.js +1 -2
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -5
- package/dist/rizin/RizinCommand.js +14 -0
- package/dist/rizin/RizinDebugSessionManager.js +1072 -0
- package/dist/rust/RustAuditableReader.js +309 -0
- package/dist/rust/RustBinaryImage.js +116 -0
- package/dist/rust/RustBinaryProvider.js +162 -0
- package/dist/server/EvidenceMcpServer.js +185 -27
- package/dist/server/admittedToolOperation.js +14 -0
- package/dist/server/contractToolHandler.js +28 -0
- package/dist/server/createServer.js +238 -36
- package/dist/server/externalMutationAdmission.js +50 -0
- package/dist/server/mcpProgress.js +4 -2
- package/dist/server/promptCompletion.js +19 -6
- package/dist/server/providerEnvironment.js +3 -0
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +9 -10
- package/dist/server/registerAndroidTools.js +22 -13
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +4 -6
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +11 -3
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerArtifactTools.js +21 -1
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +14 -13
- package/dist/server/registerBundleComparisonTool.js +20 -6
- package/dist/server/registerCaptureTools.js +12 -0
- package/dist/server/registerCloseLifecycleTool.js +32 -3
- package/dist/server/registerCutterTools.js +33 -0
- package/dist/server/registerElectronTools.js +38 -17
- package/dist/server/registerEnhancedTools.js +7 -6
- package/dist/server/registerEvidenceTools.js +14 -10
- package/dist/server/registerEvmTools.js +24 -11
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFlutterTools.js +17 -0
- package/dist/server/registerFridaTools.js +205 -0
- package/dist/server/registerFunctionComparisonTool.js +34 -11
- package/dist/server/registerGdbTools.js +64 -0
- package/dist/server/registerGoTools.js +9 -0
- package/dist/server/registerInvestigationTools/helpers.js +2 -2
- package/dist/server/registerInvestigationTools.js +12 -8
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +10 -11
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +11 -1
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerNativeTools.js +14 -0
- package/dist/server/registerOfficialTools.js +5 -0
- package/dist/server/registerPcapTools.js +35 -0
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +14 -4
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerReverseEngineeringTools.js +86 -0
- package/dist/server/registerRizinDebugTools.js +53 -0
- package/dist/server/registerRustTools.js +9 -0
- package/dist/server/registerSessionRecordTools.js +21 -14
- package/dist/server/registerSessionStatusTool.js +22 -4
- package/dist/server/registerSessionTools.js +78 -34
- package/dist/server/registerSignalTools.js +12 -0
- package/dist/server/registerSqliteTools.js +9 -0
- package/dist/server/registerWasmTools.js +46 -0
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +26 -17
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/retainedSummaryDelivery.js +28 -0
- package/dist/server/sessionAvailabilityPolicy.js +3 -0
- package/dist/server/toolRegistrationOptions.js +8 -0
- package/dist/server/toolResult.js +68 -16
- package/dist/server/toolResultEncoding.js +36 -3
- package/dist/serverIdentity.js +17 -8
- package/dist/signals/SigrokRecordingProvider.js +339 -0
- package/dist/signals/parseDecoderDiscovery.js +65 -0
- package/dist/sqlite/SqliteDatabaseFailures.js +134 -0
- package/dist/sqlite/SqliteDatabaseInspection.js +421 -0
- package/dist/sqlite/SqliteDatabaseLimits.js +16 -0
- package/dist/sqlite/SqliteDatabaseProvider.js +295 -0
- package/dist/sqlite/SqliteDatabaseSnapshot.js +156 -0
- package/dist/sqlite/SqliteDatabaseWorker.js +46 -0
- package/dist/sqlite/SqliteDatabaseWorkerExecution.js +112 -0
- package/dist/wasm/WabtArtifactProvider.js +336 -0
- package/dist/wasm/WabtFailures.js +101 -0
- package/dist/wasm/WabtInterface.js +309 -0
- package/dist/wasm/WabtOutput.js +60 -0
- package/dist/wasm/WabtRelease.js +12 -0
- package/dist/wasm/WabtString.js +48 -0
- package/dist/wasm/WabtWat.js +147 -0
- package/dist/wasm/WasmGlueAdapter.js +53 -0
- package/dist/wasm/WasmInterfaceBudget.js +11 -0
- package/dist/windows/WindowsNativeLoader.js +37 -7
- package/dist/windows/WindowsOwnedProcess.js +150 -17
- package/dist/windows/WindowsPrivateRuntime.js +34 -6
- package/install.sh +157 -95
- package/licenses/Apache-2.0.txt +202 -0
- package/licenses/GCC-Runtime-Library-Exception-3.1.txt +73 -0
- package/licenses/GPL-3.0.txt +674 -0
- package/licenses/LGPL-2.0.txt +480 -0
- package/licenses/MIT-template.txt +18 -0
- package/licenses/MinGW-w64-runtime.txt +240 -0
- package/licenses/Node-22.19.0-LICENSE.txt +2666 -0
- package/licenses/README.md +68 -0
- package/licenses/cfworker-MIT.txt +21 -0
- package/licenses/dotnet-runtime-MIT.txt +23 -0
- package/licenses/frida-17.23.2-COPYING.txt +50 -0
- package/licenses/ghidra-12.1.4-DISCLAIMER.txt +13 -0
- package/licenses/ghidra-12.1.4-LICENSE.txt +201 -0
- package/licenses/ghidra-12.1.4-NOTICE.txt +49 -0
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/licenses/npm-dependencies.txt +3612 -0
- package/licenses/npm-runtime-notices.txt +8548 -0
- package/licenses/upstream-sources.json +72 -0
- package/licenses/xterm-MIT.txt +21 -0
- package/native/windows/README.md +92 -11
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +117 -22
- package/scripts/electron-active-hook.cjs +4 -1
- package/scripts/hopper-demo-x11.py +53 -3
- package/scripts/prepack.mjs +5 -0
- package/scripts/rea-android-workspace-guardian.mjs +46 -0
- package/scripts/rea.mjs +44 -13
- package/scripts/verify-windows-native-artifact.mjs +2 -2
- package/skills/reverse-engineer-anything/SKILL.md +142 -20
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +31 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +118 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +147 -16
- package/skills/reverse-engineer-anything/references/runtime-observation.md +57 -7
- package/third_party/README.md +1 -1
- package/third_party/wabt/README.md +24 -0
- package/dist/browser/history/HarCaptureAdapter.js +0 -20
- package/dist/cli/streamedJsonOutput.js +0 -135
- package/dist/cliJsonFile.js +0 -179
- /package/dist/{application/binary → process}/AbortablePromise.js +0 -0
|
@@ -0,0 +1,3439 @@
|
|
|
1
|
+
import { t as __esmMin } from "./rolldown-runtime-BjeaiXFo.js";
|
|
2
|
+
import { _ as ok, f as init_analysisErrorCore, g as init_result, h as err, s as AnalysisOutputError } from "./analysisErrorCore-DXRTvF_m.js";
|
|
3
|
+
import { i as nulFreeStringSchema, t as init_localPath } from "./localPath-AxvW9aPe.js";
|
|
4
|
+
import { c as jsonValueSchema, d as freezeJsonSnapshot, i as prefixedDigestSchema, l as jsonValueValidationIssue, m as isImmutableJsonSnapshot, n as init_digests, o as init_jsonValue, p as init_immutableJson, s as jsonObjectSchema, t as digestSchema, u as jsonValueValidationSteps } from "./digests-BFoWUT_-.js";
|
|
5
|
+
import { n as compositeKey, r as init_unicodeCodePointOrder, t as compareUnicodeCodePoints } from "./unicodeCodePointOrder-BezCbTpg.js";
|
|
6
|
+
import { i as init_providerOperationHealth, n as PROVIDER_OPERATION_STATES, r as PROVIDER_RETRY_ACTIONS, t as PROVIDER_FAILURE_STAGES } from "./providerOperationHealth-CTYa3iLf.js";
|
|
7
|
+
import { n as init_canonicalDigest, t as digestCanonicalValue } from "./canonicalDigest-Bi_0_zGi.js";
|
|
8
|
+
import { basename } from "node:path";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
import canonicalize from "canonicalize";
|
|
12
|
+
|
|
13
|
+
//#region dist/contracts/providerSelection.js
|
|
14
|
+
var analysisProviderIdSchema, analysisProviderSelectorSchema, PROVIDER_REJECTION_CODES;
|
|
15
|
+
function init_providerSelection() {
|
|
16
|
+
return (init_providerSelection = __esmMin((() => {
|
|
17
|
+
analysisProviderIdSchema = z.string().min(1).regex(/^[a-z][a-z0-9\x2d]*$/u).refine((value) => value !== "auto", { message: "auto is reserved for provider selection" });
|
|
18
|
+
analysisProviderSelectorSchema = z.union([z.literal("auto"), analysisProviderIdSchema]);
|
|
19
|
+
PROVIDER_REJECTION_CODES = [
|
|
20
|
+
"not_configured",
|
|
21
|
+
"executable_missing",
|
|
22
|
+
"runtime_missing",
|
|
23
|
+
"runtime_unavailable",
|
|
24
|
+
"unsupported_host",
|
|
25
|
+
"unsupported_version",
|
|
26
|
+
"target_kind_unsupported",
|
|
27
|
+
"target_format_unsupported",
|
|
28
|
+
"architecture_unsupported",
|
|
29
|
+
"target_role_unsupported",
|
|
30
|
+
"managed_target_unsupported",
|
|
31
|
+
"open_options_invalid",
|
|
32
|
+
"version_unresolved"
|
|
33
|
+
];
|
|
34
|
+
})))();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region dist/domain/relationshipCoverage.js
|
|
39
|
+
var diagnostics, completeCoverage, limitedDirections, partialCoverage, unknownCoverage, relationshipCoverageSchema, relationshipCoverageLimitations;
|
|
40
|
+
function init_relationshipCoverage() {
|
|
41
|
+
return (init_relationshipCoverage = __esmMin((() => {
|
|
42
|
+
diagnostics = z.array(z.string().min(1)).min(1).exactOptional();
|
|
43
|
+
completeCoverage = z.strictObject({
|
|
44
|
+
status: z.literal("complete"),
|
|
45
|
+
diagnostics
|
|
46
|
+
});
|
|
47
|
+
limitedDirections = z.union([
|
|
48
|
+
z.tuple([z.literal("callers")]).check(z.minLength(1), z.maxLength(1)),
|
|
49
|
+
z.tuple([z.literal("callees")]).check(z.minLength(1), z.maxLength(1)),
|
|
50
|
+
z.tuple([z.literal("callers"), z.literal("callees")]).check(z.minLength(2), z.maxLength(2))
|
|
51
|
+
]);
|
|
52
|
+
partialCoverage = z.strictObject({
|
|
53
|
+
status: z.literal("partial"),
|
|
54
|
+
limitations: z.array(z.string().min(1)).min(1),
|
|
55
|
+
limited_directions: limitedDirections.exactOptional(),
|
|
56
|
+
diagnostics
|
|
57
|
+
});
|
|
58
|
+
unknownCoverage = z.strictObject({
|
|
59
|
+
status: z.literal("unknown"),
|
|
60
|
+
reason: z.string().min(1),
|
|
61
|
+
limited_directions: limitedDirections.exactOptional(),
|
|
62
|
+
diagnostics
|
|
63
|
+
});
|
|
64
|
+
relationshipCoverageSchema = z.discriminatedUnion("status", [
|
|
65
|
+
completeCoverage,
|
|
66
|
+
partialCoverage,
|
|
67
|
+
unknownCoverage
|
|
68
|
+
]);
|
|
69
|
+
relationshipCoverageLimitations = (coverage) => {
|
|
70
|
+
switch (coverage?.status) {
|
|
71
|
+
case undefined: return ["Provider did not report relationship coverage."];
|
|
72
|
+
case "complete": return [];
|
|
73
|
+
case "partial": return coverage.limitations;
|
|
74
|
+
case "unknown": return [coverage.reason];
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
})))();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region dist/domain/binaryTargetTypes.js
|
|
82
|
+
var BINARY_ARCHITECTURES, ELF_METADATA_ARCHITECTURES, isElfMetadataArchitecture, isMachOFormat;
|
|
83
|
+
function init_binaryTargetTypes() {
|
|
84
|
+
return (init_binaryTargetTypes = __esmMin((() => {
|
|
85
|
+
BINARY_ARCHITECTURES = [
|
|
86
|
+
"x86",
|
|
87
|
+
"x86_64",
|
|
88
|
+
"arm",
|
|
89
|
+
"arm64",
|
|
90
|
+
"mips",
|
|
91
|
+
"6502",
|
|
92
|
+
"riscv",
|
|
93
|
+
"powerpc"
|
|
94
|
+
];
|
|
95
|
+
ELF_METADATA_ARCHITECTURES = [
|
|
96
|
+
"mips",
|
|
97
|
+
"riscv",
|
|
98
|
+
"powerpc"
|
|
99
|
+
];
|
|
100
|
+
isElfMetadataArchitecture = (architecture) => ELF_METADATA_ARCHITECTURES.includes(architecture);
|
|
101
|
+
isMachOFormat = (format) => format === "mach-o" || format === "mach-o-universal";
|
|
102
|
+
})))();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region dist/domain/analysisProfile.js
|
|
107
|
+
var committedProviderSchema, unsignedAnalysisProfileSchema, analysisProfileSchema, createAnalysisProfile, analysisProfilesEqual, profileDigest, canonicalJson;
|
|
108
|
+
function init_analysisProfile() {
|
|
109
|
+
return (init_analysisProfile = __esmMin((() => {
|
|
110
|
+
init_jsonValue();
|
|
111
|
+
init_digests();
|
|
112
|
+
committedProviderSchema = z.strictObject({
|
|
113
|
+
id: z.string().min(1),
|
|
114
|
+
name: z.string().min(1),
|
|
115
|
+
version: z.string().min(1)
|
|
116
|
+
});
|
|
117
|
+
unsignedAnalysisProfileSchema = z.strictObject({
|
|
118
|
+
provider: committedProviderSchema,
|
|
119
|
+
parameters: jsonObjectSchema
|
|
120
|
+
});
|
|
121
|
+
analysisProfileSchema = unsignedAnalysisProfileSchema.extend({ digest: digestSchema }).superRefine((profile, context) => {
|
|
122
|
+
const { digest: _digest, ...unsigned } = profile;
|
|
123
|
+
if (profileDigest(unsigned) !== profile.digest) context.addIssue({
|
|
124
|
+
code: "custom",
|
|
125
|
+
path: ["digest"],
|
|
126
|
+
message: "Analysis profile digest does not match its parameters"
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
createAnalysisProfile = (provider, parameters) => {
|
|
130
|
+
const unsigned = unsignedAnalysisProfileSchema.parse({
|
|
131
|
+
provider: {
|
|
132
|
+
id: provider.id,
|
|
133
|
+
name: provider.name,
|
|
134
|
+
version: provider.version
|
|
135
|
+
},
|
|
136
|
+
parameters
|
|
137
|
+
});
|
|
138
|
+
return analysisProfileSchema.parse({
|
|
139
|
+
...unsigned,
|
|
140
|
+
digest: profileDigest(unsigned)
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
analysisProfilesEqual = (left, right) => left.digest === right.digest && left.provider.id === right.provider.id && left.provider.name === right.provider.name && left.provider.version === right.provider.version;
|
|
144
|
+
profileDigest = (profile) => createHash("sha256").update(canonicalJson(profile)).digest("hex");
|
|
145
|
+
canonicalJson = (value) => {
|
|
146
|
+
const encoded = canonicalize(value);
|
|
147
|
+
if (encoded === undefined) throw new TypeError("RFC 8785 canonicalization rejected analysis profile");
|
|
148
|
+
return encoded;
|
|
149
|
+
};
|
|
150
|
+
})))();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region dist/domain/native/addressCoordinate.js
|
|
155
|
+
var addressCoordinate;
|
|
156
|
+
function init_addressCoordinate() {
|
|
157
|
+
return (init_addressCoordinate = __esmMin((() => {
|
|
158
|
+
addressCoordinate = (value) => {
|
|
159
|
+
const separator = value.lastIndexOf(":0x");
|
|
160
|
+
if (separator === 0) return null;
|
|
161
|
+
const space = separator < 0 ? null : value.slice(0, separator);
|
|
162
|
+
const offset = separator < 0 ? value : value.slice(separator + 1);
|
|
163
|
+
if (!/^0x[0-9a-f]+$/u.test(offset)) return null;
|
|
164
|
+
return {
|
|
165
|
+
space,
|
|
166
|
+
offset: BigInt(offset)
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
})))();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region dist/domain/native/nativeApiBoundary.js
|
|
174
|
+
var inferenceConfidenceSchema, inferenceEvidenceSchema, inferredBoundaryTypeFacts, inferredReturnTypeSchema, inferredParameterTypeSchema, jumpTableDataSourceSchema, jumpTableMappingSchema, jumpTableDefaultTargetSchema, inferredJumpTableSchema, availableNativeApiBoundarySchema, unavailableNativeApiBoundarySchema, nativeApiBoundarySchema, nativeApiInspectionSubstepSchema, nativeApiInspectionResultSchema;
|
|
175
|
+
function init_nativeApiBoundary() {
|
|
176
|
+
return (init_nativeApiBoundary = __esmMin((() => {
|
|
177
|
+
inferenceConfidenceSchema = z.enum([
|
|
178
|
+
"low",
|
|
179
|
+
"medium",
|
|
180
|
+
"high"
|
|
181
|
+
]);
|
|
182
|
+
inferenceEvidenceSchema = z.object({
|
|
183
|
+
kind: z.enum([
|
|
184
|
+
"signature-source",
|
|
185
|
+
"decompiler-type",
|
|
186
|
+
"type-lock",
|
|
187
|
+
"calling-convention",
|
|
188
|
+
"jump-table"
|
|
189
|
+
]),
|
|
190
|
+
source: z.string().min(1),
|
|
191
|
+
detail: z.string().min(1)
|
|
192
|
+
}).strict();
|
|
193
|
+
inferredBoundaryTypeFacts = {
|
|
194
|
+
ordinal: z.number().int().min(0).nullable(),
|
|
195
|
+
name: z.string().min(1).nullable(),
|
|
196
|
+
data_type: z.string().min(1),
|
|
197
|
+
size_bytes: z.number().int().min(0).nullable(),
|
|
198
|
+
storage: z.string().min(1).nullable(),
|
|
199
|
+
confidence: inferenceConfidenceSchema,
|
|
200
|
+
evidence: z.array(inferenceEvidenceSchema).min(1),
|
|
201
|
+
decompiler_artifacts: z.array(z.enum([
|
|
202
|
+
"recovered-signature",
|
|
203
|
+
"register-or-stack-storage",
|
|
204
|
+
"compiler-generated-variable"
|
|
205
|
+
]))
|
|
206
|
+
};
|
|
207
|
+
inferredReturnTypeSchema = z.strictObject({
|
|
208
|
+
...inferredBoundaryTypeFacts,
|
|
209
|
+
role: z.literal("return"),
|
|
210
|
+
ordinal: z.null(),
|
|
211
|
+
name: z.null()
|
|
212
|
+
});
|
|
213
|
+
inferredParameterTypeSchema = z.strictObject({
|
|
214
|
+
...inferredBoundaryTypeFacts,
|
|
215
|
+
role: z.literal("parameter"),
|
|
216
|
+
ordinal: z.number().int().min(0)
|
|
217
|
+
});
|
|
218
|
+
jumpTableDataSourceSchema = z.object({
|
|
219
|
+
address: z.string().min(1),
|
|
220
|
+
provenance: z.enum([
|
|
221
|
+
"ghidra-decompiler-load-table",
|
|
222
|
+
"ghidra-dispatch-block-data-reference",
|
|
223
|
+
"ghidra-aarch64-byte-table",
|
|
224
|
+
"ghidra-aarch64-halfword-table"
|
|
225
|
+
]),
|
|
226
|
+
entry_size_bytes: z.number().int().min(1).nullable(),
|
|
227
|
+
entry_count: z.number().int().min(0).nullable(),
|
|
228
|
+
confidence: inferenceConfidenceSchema,
|
|
229
|
+
evidence: z.array(inferenceEvidenceSchema).min(1)
|
|
230
|
+
}).strict();
|
|
231
|
+
jumpTableMappingSchema = z.object({
|
|
232
|
+
case_value: z.number().int().nullable(),
|
|
233
|
+
target_address: z.string().min(1),
|
|
234
|
+
confidence: inferenceConfidenceSchema,
|
|
235
|
+
evidence: z.array(inferenceEvidenceSchema).min(1)
|
|
236
|
+
}).strict();
|
|
237
|
+
jumpTableDefaultTargetSchema = z.strictObject({
|
|
238
|
+
target_address: z.string().min(1),
|
|
239
|
+
confidence: inferenceConfidenceSchema,
|
|
240
|
+
evidence: z.array(inferenceEvidenceSchema).min(1)
|
|
241
|
+
});
|
|
242
|
+
inferredJumpTableSchema = z.object({
|
|
243
|
+
dispatch_address: z.string().min(1),
|
|
244
|
+
data_sources: z.array(jumpTableDataSourceSchema),
|
|
245
|
+
mappings: z.array(jumpTableMappingSchema),
|
|
246
|
+
default_targets: z.array(jumpTableDefaultTargetSchema),
|
|
247
|
+
limitations: z.array(z.string())
|
|
248
|
+
}).strict();
|
|
249
|
+
availableNativeApiBoundarySchema = z.object({
|
|
250
|
+
available: z.literal(true),
|
|
251
|
+
provenance: z.string().min(1),
|
|
252
|
+
signature_source: z.string().min(1),
|
|
253
|
+
calling_convention: z.string().min(1),
|
|
254
|
+
return_type: inferredReturnTypeSchema,
|
|
255
|
+
parameters: z.array(inferredParameterTypeSchema),
|
|
256
|
+
jump_tables: z.array(inferredJumpTableSchema),
|
|
257
|
+
pseudocode: z.object({
|
|
258
|
+
classification: z.literal("decompiler-generated-non-source"),
|
|
259
|
+
compilable: z.literal(false)
|
|
260
|
+
}).strict(),
|
|
261
|
+
decompiler_artifacts: z.array(z.enum([
|
|
262
|
+
"recovered-signature",
|
|
263
|
+
"register-and-stack-variables",
|
|
264
|
+
"compiler-generated-control-flow",
|
|
265
|
+
"pointer-arithmetic",
|
|
266
|
+
"pseudocode"
|
|
267
|
+
])),
|
|
268
|
+
limitations: z.array(z.string())
|
|
269
|
+
}).strict();
|
|
270
|
+
unavailableNativeApiBoundarySchema = z.object({
|
|
271
|
+
available: z.literal(false),
|
|
272
|
+
reason: z.string().min(1),
|
|
273
|
+
residual_unknowns: z.array(z.string().min(1)).min(1)
|
|
274
|
+
}).strict();
|
|
275
|
+
nativeApiBoundarySchema = z.discriminatedUnion("available", [unavailableNativeApiBoundarySchema, availableNativeApiBoundarySchema]);
|
|
276
|
+
nativeApiInspectionSubstepSchema = z.object({
|
|
277
|
+
operation: z.enum([
|
|
278
|
+
"analyze_function",
|
|
279
|
+
"project_native_api_boundary",
|
|
280
|
+
"preserve_residual_unknowns"
|
|
281
|
+
]),
|
|
282
|
+
status: z.enum(["completed", "unsupported"]),
|
|
283
|
+
observations: z.array(z.string().min(1))
|
|
284
|
+
}).strict();
|
|
285
|
+
nativeApiInspectionResultSchema = z.object({
|
|
286
|
+
procedure: z.object({
|
|
287
|
+
address: z.string().min(1),
|
|
288
|
+
name: z.string().min(1)
|
|
289
|
+
}).strict(),
|
|
290
|
+
boundary: nativeApiBoundarySchema,
|
|
291
|
+
substeps: z.array(nativeApiInspectionSubstepSchema).length(3),
|
|
292
|
+
unsupported_branches: z.array(z.string().min(1)),
|
|
293
|
+
residual_unknowns: z.array(z.string().min(1))
|
|
294
|
+
}).strict();
|
|
295
|
+
})))();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region dist/domain/native/nativeValueFlow.js
|
|
300
|
+
var nativeVarnodeSchema, nativePcodeOperationSchema, nativePcodeDefUseSchema, nativePcodeEffectSchema, nativeValueFlowSchema;
|
|
301
|
+
function init_nativeValueFlow() {
|
|
302
|
+
return (init_nativeValueFlow = __esmMin((() => {
|
|
303
|
+
nativeVarnodeSchema = z.strictObject({
|
|
304
|
+
kind: z.enum([
|
|
305
|
+
"constant",
|
|
306
|
+
"address",
|
|
307
|
+
"register",
|
|
308
|
+
"unique",
|
|
309
|
+
"other"
|
|
310
|
+
]),
|
|
311
|
+
size_bytes: z.number().int().nonnegative(),
|
|
312
|
+
location: z.string().nullable(),
|
|
313
|
+
constant_hex: z.string().regex(/^[0-9a-f]+$/u).nullable()
|
|
314
|
+
});
|
|
315
|
+
nativePcodeOperationSchema = z.strictObject({
|
|
316
|
+
id: z.string().min(1),
|
|
317
|
+
address: z.string().min(1),
|
|
318
|
+
sequence: z.number().int().nonnegative(),
|
|
319
|
+
opcode: z.string().min(1),
|
|
320
|
+
is_dead: z.boolean(),
|
|
321
|
+
block_membership: z.enum([
|
|
322
|
+
"member",
|
|
323
|
+
"detached",
|
|
324
|
+
"unavailable"
|
|
325
|
+
]),
|
|
326
|
+
inputs: z.array(nativeVarnodeSchema),
|
|
327
|
+
output: nativeVarnodeSchema.nullable()
|
|
328
|
+
});
|
|
329
|
+
nativePcodeDefUseSchema = z.strictObject({
|
|
330
|
+
definition: z.string().min(1),
|
|
331
|
+
use: z.string().min(1),
|
|
332
|
+
input_index: z.number().int().nonnegative()
|
|
333
|
+
});
|
|
334
|
+
nativePcodeEffectSchema = z.strictObject({
|
|
335
|
+
operation: z.string().min(1),
|
|
336
|
+
kind: z.enum([
|
|
337
|
+
"memory_read",
|
|
338
|
+
"memory_write",
|
|
339
|
+
"conditional_branch",
|
|
340
|
+
"indirect_branch",
|
|
341
|
+
"direct_call",
|
|
342
|
+
"indirect_call"
|
|
343
|
+
]),
|
|
344
|
+
operand_input: z.number().int().nonnegative().nullable(),
|
|
345
|
+
value_input: z.number().int().nonnegative().nullable()
|
|
346
|
+
});
|
|
347
|
+
nativeValueFlowSchema = z.discriminatedUnion("available", [z.strictObject({
|
|
348
|
+
available: z.literal(true),
|
|
349
|
+
provenance: z.literal("ghidra-high-pcode"),
|
|
350
|
+
operations: z.array(nativePcodeOperationSchema),
|
|
351
|
+
def_use: z.array(nativePcodeDefUseSchema),
|
|
352
|
+
effects: z.array(nativePcodeEffectSchema),
|
|
353
|
+
parameters: z.array(z.strictObject({
|
|
354
|
+
ordinal: z.number().int().nonnegative(),
|
|
355
|
+
name: z.string(),
|
|
356
|
+
data_type: z.string()
|
|
357
|
+
})),
|
|
358
|
+
parameter_uses: z.array(z.strictObject({
|
|
359
|
+
ordinal: z.number().int().nonnegative(),
|
|
360
|
+
use: z.string(),
|
|
361
|
+
input_index: z.number().int().nonnegative()
|
|
362
|
+
})),
|
|
363
|
+
truncated: z.boolean(),
|
|
364
|
+
omitted_operations_lower_bound: z.number().int().nonnegative(),
|
|
365
|
+
known_omitted_inputs: z.number().int().nonnegative(),
|
|
366
|
+
known_omitted_edges: z.number().int().nonnegative(),
|
|
367
|
+
limitations: z.array(z.string().min(1))
|
|
368
|
+
}), z.strictObject({
|
|
369
|
+
available: z.literal(false),
|
|
370
|
+
reason: z.string().min(1),
|
|
371
|
+
limitations: z.array(z.string().min(1))
|
|
372
|
+
})]);
|
|
373
|
+
})))();
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region dist/domain/hopperValues.js
|
|
378
|
+
var addressDistance, procedureMapSchema, addressedNamesSchema, addressedNameMapSchema, segmentSchema, unavailableAnalysisFactSchema, analysisStringSchema, analysisBookmarkSchema, functionBodySchema, functionBodyEntryAgrees, procedureClassificationSchema, procedureIdentitySchema, localVariableSchema, functionInstructionWindowSchema, availableReferenceKindSchema, referenceKindSchema, unresolvedCallSchema, swiftStringLiteralFields, swiftStringLiteralSchema, swiftStringLiteralOmissionFields, swiftStringLiteralOmissionSchema, referenceEdgeSchema, facetAvailabilitySchema, functionDossierSchema, parseFunctionDossier, parseProcedures, parseNames, parseRelatedAddresses, parseSegments, parseSegmentImageBase, parseDocuments, parseListCount, unwrapProperty, invalid;
|
|
379
|
+
function init_hopperValues() {
|
|
380
|
+
return (init_hopperValues = __esmMin((() => {
|
|
381
|
+
init_addressCoordinate();
|
|
382
|
+
init_result();
|
|
383
|
+
init_nativeApiBoundary();
|
|
384
|
+
init_nativeValueFlow();
|
|
385
|
+
init_analysisErrorCore();
|
|
386
|
+
addressDistance = (start, end) => {
|
|
387
|
+
const left = addressCoordinate(start);
|
|
388
|
+
const right = addressCoordinate(end);
|
|
389
|
+
if (left === null || right === null || left.space !== right.space) return null;
|
|
390
|
+
const distance = right.offset - left.offset;
|
|
391
|
+
if (distance < 0n || distance > BigInt(Number.MAX_SAFE_INTEGER)) return null;
|
|
392
|
+
return Number(distance);
|
|
393
|
+
};
|
|
394
|
+
procedureMapSchema = z.record(z.string(), z.string());
|
|
395
|
+
addressedNamesSchema = z.array(z.object({
|
|
396
|
+
address: z.string(),
|
|
397
|
+
name: z.string()
|
|
398
|
+
}));
|
|
399
|
+
addressedNameMapSchema = z.record(z.string(), z.string());
|
|
400
|
+
segmentSchema = z.object({
|
|
401
|
+
name: z.string(),
|
|
402
|
+
start: z.string(),
|
|
403
|
+
end: z.string(),
|
|
404
|
+
readable: z.boolean().nullable(),
|
|
405
|
+
writable: z.boolean().nullable(),
|
|
406
|
+
executable: z.boolean().nullable(),
|
|
407
|
+
image_base: z.string().min(1).exactOptional(),
|
|
408
|
+
address_space: z.string().min(1).exactOptional()
|
|
409
|
+
});
|
|
410
|
+
unavailableAnalysisFactSchema = z.object({
|
|
411
|
+
available: z.literal(false),
|
|
412
|
+
reason: z.string()
|
|
413
|
+
}).strict();
|
|
414
|
+
analysisStringSchema = z.object({
|
|
415
|
+
address: z.string(),
|
|
416
|
+
value: z.string(),
|
|
417
|
+
provider_value: z.string().exactOptional().describe("Original provider display text, which may shorten the typed object."),
|
|
418
|
+
decoding: unavailableAnalysisFactSchema.exactOptional().describe("When present, value retains native display text because typed bytes could not be decoded."),
|
|
419
|
+
string: z.object({
|
|
420
|
+
encoding: z.string().min(1),
|
|
421
|
+
encoding_status: z.enum(["observed", "inferred"]).exactOptional().describe("Whether the provider declares the encoding or REA infers it from the typed bytes and native display. This does not establish the original source's intended encoding."),
|
|
422
|
+
termination: z.enum(["missing", "present_or_not_required"]),
|
|
423
|
+
byte_length: z.number().int().min(0)
|
|
424
|
+
}).exactOptional()
|
|
425
|
+
});
|
|
426
|
+
analysisBookmarkSchema = z.strictObject({
|
|
427
|
+
address: z.string(),
|
|
428
|
+
name: z.string().nullable()
|
|
429
|
+
});
|
|
430
|
+
functionBodySchema = z.discriminatedUnion("available", [unavailableAnalysisFactSchema, z.strictObject({
|
|
431
|
+
available: z.literal(true),
|
|
432
|
+
provenance: z.string().min(1),
|
|
433
|
+
ranges: z.array(z.strictObject({
|
|
434
|
+
start: z.string(),
|
|
435
|
+
end: z.string().describe("Inclusive last address of this observed body range.")
|
|
436
|
+
})),
|
|
437
|
+
total_bytes: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
438
|
+
span_bytes: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER).nullable(),
|
|
439
|
+
non_contiguous: z.boolean(),
|
|
440
|
+
contains_entry: z.boolean()
|
|
441
|
+
}).superRefine((body, context) => {
|
|
442
|
+
let total = 0n;
|
|
443
|
+
const bounds = new Map();
|
|
444
|
+
const closedSpaces = new Set();
|
|
445
|
+
let previousSpace;
|
|
446
|
+
for (const range of body.ranges) {
|
|
447
|
+
const start = addressCoordinate(range.start);
|
|
448
|
+
const end = addressCoordinate(range.end);
|
|
449
|
+
if (start === null || end === null || start.space !== end.space || end.offset < start.offset) {
|
|
450
|
+
context.addIssue({
|
|
451
|
+
code: "custom",
|
|
452
|
+
message: "Function body range has invalid inclusive endpoints"
|
|
453
|
+
});
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (previousSpace !== undefined && previousSpace !== start.space) closedSpaces.add(previousSpace);
|
|
457
|
+
const previous = bounds.get(start.space);
|
|
458
|
+
if (closedSpaces.has(start.space) || previous !== undefined && start.offset <= previous.end + 1n) {
|
|
459
|
+
context.addIssue({
|
|
460
|
+
code: "custom",
|
|
461
|
+
message: "Function body ranges must be ordered, disjoint and maximal within each address space"
|
|
462
|
+
});
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
bounds.set(start.space, {
|
|
466
|
+
start: previous?.start ?? start.offset,
|
|
467
|
+
end: end.offset
|
|
468
|
+
});
|
|
469
|
+
previousSpace = start.space;
|
|
470
|
+
total += end.offset - start.offset + 1n;
|
|
471
|
+
}
|
|
472
|
+
const onlyBounds = bounds.size === 1 ? [...bounds.values()][0] : undefined;
|
|
473
|
+
const span = bounds.size === 0 ? 0n : onlyBounds === undefined ? null : onlyBounds.end - onlyBounds.start + 1n;
|
|
474
|
+
const reportedSpan = body.span_bytes === null ? null : BigInt(body.span_bytes);
|
|
475
|
+
if (total !== BigInt(body.total_bytes) || span !== reportedSpan || body.non_contiguous !== body.ranges.length > 1) context.addIssue({
|
|
476
|
+
code: "custom",
|
|
477
|
+
message: "Function body counts, enclosing span or contiguity disagree with inclusive ranges"
|
|
478
|
+
});
|
|
479
|
+
})]);
|
|
480
|
+
functionBodyEntryAgrees = (body, address) => {
|
|
481
|
+
if (!body.available) return true;
|
|
482
|
+
const entry = addressCoordinate(address);
|
|
483
|
+
if (entry === null) return false;
|
|
484
|
+
const contains = body.ranges.some((range) => {
|
|
485
|
+
const start = addressCoordinate(range.start);
|
|
486
|
+
const end = addressCoordinate(range.end);
|
|
487
|
+
return start !== null && end !== null && start.space === entry.space && entry.offset >= start.offset && entry.offset <= end.offset;
|
|
488
|
+
});
|
|
489
|
+
return contains === body.contains_entry;
|
|
490
|
+
};
|
|
491
|
+
procedureClassificationSchema = z.object({
|
|
492
|
+
external: z.boolean(),
|
|
493
|
+
thunk: z.boolean(),
|
|
494
|
+
thunk_target: z.string().nullable(),
|
|
495
|
+
provenance: z.string().min(1)
|
|
496
|
+
}).strict();
|
|
497
|
+
procedureIdentitySchema = z.object({
|
|
498
|
+
address: z.string(),
|
|
499
|
+
name: z.string(),
|
|
500
|
+
classification: procedureClassificationSchema.nullable(),
|
|
501
|
+
body: functionBodySchema
|
|
502
|
+
}).strict().superRefine((identity, context) => {
|
|
503
|
+
if (!functionBodyEntryAgrees(identity.body, identity.address)) context.addIssue({
|
|
504
|
+
code: "custom",
|
|
505
|
+
message: "Function body entry membership disagrees with procedure identity"
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
localVariableSchema = z.object({
|
|
509
|
+
description: z.string(),
|
|
510
|
+
provenance: z.string().min(1),
|
|
511
|
+
name: z.string().nullable().exactOptional(),
|
|
512
|
+
stack_displacement: z.string().regex(/^-?\d+$/u).nullable().exactOptional().describe("Observed signed stack byte displacement, encoded as decimal to preserve precision.")
|
|
513
|
+
}).strict();
|
|
514
|
+
functionInstructionWindowSchema = z.object({
|
|
515
|
+
procedure: procedureIdentitySchema,
|
|
516
|
+
instructions: z.array(z.string()),
|
|
517
|
+
limitations: z.array(z.string())
|
|
518
|
+
}).strict();
|
|
519
|
+
availableReferenceKindSchema = z.object({
|
|
520
|
+
available: z.literal(true),
|
|
521
|
+
provenance: z.string().min(1),
|
|
522
|
+
type: z.string(),
|
|
523
|
+
flow: z.boolean(),
|
|
524
|
+
call: z.boolean(),
|
|
525
|
+
jump: z.boolean(),
|
|
526
|
+
data: z.boolean(),
|
|
527
|
+
read: z.boolean(),
|
|
528
|
+
write: z.boolean(),
|
|
529
|
+
indirect: z.boolean(),
|
|
530
|
+
computed: z.boolean(),
|
|
531
|
+
conditional: z.boolean(),
|
|
532
|
+
terminal: z.boolean(),
|
|
533
|
+
primary: z.boolean(),
|
|
534
|
+
operand_index: z.number().int(),
|
|
535
|
+
external: z.boolean()
|
|
536
|
+
}).strict();
|
|
537
|
+
referenceKindSchema = z.discriminatedUnion("available", [unavailableAnalysisFactSchema, availableReferenceKindSchema]);
|
|
538
|
+
unresolvedCallSchema = z.strictObject({
|
|
539
|
+
address: z.string(),
|
|
540
|
+
reason: z.string()
|
|
541
|
+
});
|
|
542
|
+
swiftStringLiteralFields = {
|
|
543
|
+
source_address: z.string().describe("Instruction that consumes both words: a call, tail call, return, or paired store."),
|
|
544
|
+
value: z.string().describe("Decoded UTF-8 text, including the canonical empty string."),
|
|
545
|
+
registers: z.tuple([z.string(), z.string()]),
|
|
546
|
+
words: z.tuple([z.string(), z.string()]).describe("Observed constant register values, in register order.")
|
|
547
|
+
};
|
|
548
|
+
swiftStringLiteralSchema = z.discriminatedUnion("representation", [z.strictObject({
|
|
549
|
+
...swiftStringLiteralFields,
|
|
550
|
+
representation: z.literal("small").describe("The UTF-8 bytes are inside the two words."),
|
|
551
|
+
address: z.null().describe("A small literal has no storage of its own.")
|
|
552
|
+
}), z.strictObject({
|
|
553
|
+
...swiftStringLiteralFields,
|
|
554
|
+
representation: z.literal("large").describe("An immortal literal whose words hold its count and a pointer to its bytes."),
|
|
555
|
+
address: z.string().describe("Address of a large literal's bytes.")
|
|
556
|
+
})]);
|
|
557
|
+
swiftStringLiteralOmissionFields = {
|
|
558
|
+
source_address: swiftStringLiteralFields.source_address,
|
|
559
|
+
byte_length: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
560
|
+
reason: z.enum(["capacity", "unresolved_jump"]).describe("Why this candidate is omitted: capacity stopped decoding, or an unresolved jump left its use unknown."),
|
|
561
|
+
registers: swiftStringLiteralFields.registers,
|
|
562
|
+
words: swiftStringLiteralFields.words
|
|
563
|
+
};
|
|
564
|
+
swiftStringLiteralOmissionSchema = z.discriminatedUnion("representation", [z.strictObject({
|
|
565
|
+
...swiftStringLiteralOmissionFields,
|
|
566
|
+
representation: z.literal("small"),
|
|
567
|
+
address: z.null()
|
|
568
|
+
}), z.strictObject({
|
|
569
|
+
...swiftStringLiteralOmissionFields,
|
|
570
|
+
representation: z.literal("large"),
|
|
571
|
+
address: z.string().describe("Address of the literal's bytes.")
|
|
572
|
+
})]);
|
|
573
|
+
referenceEdgeSchema = z.object({
|
|
574
|
+
source_address: z.string(),
|
|
575
|
+
target_address: z.string(),
|
|
576
|
+
source_procedure: procedureIdentitySchema.nullable(),
|
|
577
|
+
target_procedure: procedureIdentitySchema.nullable(),
|
|
578
|
+
kind: referenceKindSchema,
|
|
579
|
+
call: z.strictObject({
|
|
580
|
+
classification: z.enum([
|
|
581
|
+
"none",
|
|
582
|
+
"unknown",
|
|
583
|
+
"direct",
|
|
584
|
+
"objective_c"
|
|
585
|
+
]),
|
|
586
|
+
provider_type: z.number().int(),
|
|
587
|
+
provenance: z.string().min(1)
|
|
588
|
+
}).exactOptional()
|
|
589
|
+
}).strict();
|
|
590
|
+
facetAvailabilitySchema = z.discriminatedUnion("available", [z.object({ available: z.literal(true) }).strict(), z.object({
|
|
591
|
+
available: z.literal(false),
|
|
592
|
+
reason: z.string().min(1)
|
|
593
|
+
}).strict()]);
|
|
594
|
+
functionDossierSchema = z.object({
|
|
595
|
+
procedure: procedureIdentitySchema.safeExtend({
|
|
596
|
+
signature: z.string().nullable(),
|
|
597
|
+
locals: z.array(localVariableSchema)
|
|
598
|
+
}),
|
|
599
|
+
pseudocode: z.string(),
|
|
600
|
+
assembly: z.array(z.string()),
|
|
601
|
+
comments: z.array(z.object({
|
|
602
|
+
address: z.string(),
|
|
603
|
+
kind: z.enum(["comment", "inline"]),
|
|
604
|
+
text: z.string()
|
|
605
|
+
}).strict()),
|
|
606
|
+
callers: z.array(procedureIdentitySchema),
|
|
607
|
+
callees: z.array(procedureIdentitySchema),
|
|
608
|
+
incoming_references: z.array(referenceEdgeSchema),
|
|
609
|
+
outgoing_references: z.array(referenceEdgeSchema),
|
|
610
|
+
unresolved_calls: z.array(unresolvedCallSchema).exactOptional(),
|
|
611
|
+
referenced_strings: z.array(analysisStringSchema.extend({ source_address: z.string() })),
|
|
612
|
+
referenced_names: z.array(z.object({
|
|
613
|
+
address: z.string(),
|
|
614
|
+
value: z.string(),
|
|
615
|
+
source_address: z.string()
|
|
616
|
+
}).strict()),
|
|
617
|
+
swift_string_literals: z.array(swiftStringLiteralSchema).exactOptional().describe("Swift String literals decoded from constant register values. Absent when the provider does not decode them for this target."),
|
|
618
|
+
swift_string_literal_omissions: z.array(swiftStringLiteralOmissionSchema).exactOptional().describe("Literal candidates omitted for capacity or unresolved control flow. Present exactly when swift_string_literals is present; empty when all examined use sites were classified."),
|
|
619
|
+
basic_blocks: z.array(z.object({
|
|
620
|
+
start: z.string(),
|
|
621
|
+
end: z.string(),
|
|
622
|
+
successors: z.array(z.string())
|
|
623
|
+
}).strict()),
|
|
624
|
+
native_api: nativeApiBoundarySchema.nullable(),
|
|
625
|
+
native_value_flow: nativeValueFlowSchema.nullable(),
|
|
626
|
+
facet_availability: z.object({
|
|
627
|
+
pseudocode: facetAvailabilitySchema.exactOptional(),
|
|
628
|
+
assembly: facetAvailabilitySchema.exactOptional(),
|
|
629
|
+
comments: facetAvailabilitySchema.exactOptional(),
|
|
630
|
+
callers: facetAvailabilitySchema.exactOptional(),
|
|
631
|
+
callees: facetAvailabilitySchema.exactOptional(),
|
|
632
|
+
references: facetAvailabilitySchema.exactOptional(),
|
|
633
|
+
strings_names: facetAvailabilitySchema.exactOptional(),
|
|
634
|
+
cfg: facetAvailabilitySchema.exactOptional()
|
|
635
|
+
}).strict().exactOptional(),
|
|
636
|
+
limitations: z.array(z.string())
|
|
637
|
+
}).strict();
|
|
638
|
+
parseFunctionDossier = (value) => {
|
|
639
|
+
const parsed = functionDossierSchema.safeParse(value);
|
|
640
|
+
return parsed.success ? ok(parsed.data) : err(new AnalysisOutputError("analyze_function", "provider output did not match the dossier contract", { cause: parsed.error }));
|
|
641
|
+
};
|
|
642
|
+
parseProcedures = (value, operation = "list_procedures") => {
|
|
643
|
+
const parsed = procedureMapSchema.safeParse(unwrapProperty(value, "procedures"));
|
|
644
|
+
return parsed.success ? ok(Object.entries(parsed.data).map(([address, name]) => ({
|
|
645
|
+
address,
|
|
646
|
+
name
|
|
647
|
+
}))) : invalid(operation, "procedure map", parsed.error);
|
|
648
|
+
};
|
|
649
|
+
parseNames = (value, operation = "list_names") => {
|
|
650
|
+
const unwrapped = unwrapProperty(value, "names");
|
|
651
|
+
const records = addressedNamesSchema.safeParse(unwrapped);
|
|
652
|
+
if (records.success) return ok(records.data);
|
|
653
|
+
const map = addressedNameMapSchema.safeParse(unwrapped);
|
|
654
|
+
return map.success ? ok(Object.entries(map.data).map(([address, name]) => ({
|
|
655
|
+
address,
|
|
656
|
+
name
|
|
657
|
+
}))) : invalid(operation, "name list", map.error);
|
|
658
|
+
};
|
|
659
|
+
parseRelatedAddresses = (value, relation, operation = relation === "callees" ? "procedure_callees" : "procedure_callers") => {
|
|
660
|
+
const parsed = z.array(z.string()).safeParse(unwrapProperty(value, relation));
|
|
661
|
+
return parsed.success ? ok(parsed.data) : invalid(operation, `${relation} list`, parsed.error);
|
|
662
|
+
};
|
|
663
|
+
parseSegments = (value, operation = "list_segments") => {
|
|
664
|
+
const parsed = z.array(segmentSchema).safeParse(unwrapProperty(value, "segments"));
|
|
665
|
+
return parsed.success ? ok(parsed.data) : invalid(operation, "segment list", parsed.error);
|
|
666
|
+
};
|
|
667
|
+
parseSegmentImageBase = (segments) => {
|
|
668
|
+
const base = segments[0]?.image_base;
|
|
669
|
+
return base !== undefined && segments.every((segment) => segment.image_base === base) ? base : undefined;
|
|
670
|
+
};
|
|
671
|
+
parseDocuments = (value, operation = "list_documents") => {
|
|
672
|
+
const parsed = z.array(z.string()).safeParse(unwrapProperty(value, "documents"));
|
|
673
|
+
return parsed.success ? ok(parsed.data) : invalid(operation, "document list", parsed.error);
|
|
674
|
+
};
|
|
675
|
+
parseListCount = (value, property, operation = property === "procedures" ? "list_procedures" : "list_strings") => {
|
|
676
|
+
const unwrapped = unwrapProperty(value, property);
|
|
677
|
+
const list = z.array(z.unknown()).safeParse(unwrapped);
|
|
678
|
+
if (list.success) return ok(list.data.length);
|
|
679
|
+
const map = z.record(z.string(), z.unknown()).safeParse(unwrapped);
|
|
680
|
+
return map.success ? ok(Object.keys(map.data).length) : invalid(operation, `${property} list`, map.error);
|
|
681
|
+
};
|
|
682
|
+
unwrapProperty = (value, property) => {
|
|
683
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && property in value) {
|
|
684
|
+
return value[property] ?? null;
|
|
685
|
+
}
|
|
686
|
+
return value;
|
|
687
|
+
};
|
|
688
|
+
invalid = (operation, expected, cause) => err(new AnalysisOutputError(operation, `Provider returned an invalid ${expected}`, { cause }));
|
|
689
|
+
})))();
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region dist/domain/native/nativeInstruction.js
|
|
694
|
+
var nativeInstructionInputSchema, reference, nativeInstructionSchema, nativeCallTargetsSchema;
|
|
695
|
+
function init_nativeInstruction() {
|
|
696
|
+
return (init_nativeInstruction = __esmMin((() => {
|
|
697
|
+
nativeInstructionInputSchema = z.strictObject({
|
|
698
|
+
address: z.string().min(1),
|
|
699
|
+
document: z.string().optional()
|
|
700
|
+
});
|
|
701
|
+
reference = z.strictObject({
|
|
702
|
+
target_address: z.string(),
|
|
703
|
+
type: z.string(),
|
|
704
|
+
call: z.boolean(),
|
|
705
|
+
jump: z.boolean(),
|
|
706
|
+
indirect: z.boolean(),
|
|
707
|
+
computed: z.boolean(),
|
|
708
|
+
operand_index: z.number().int(),
|
|
709
|
+
source_address: z.string().min(1).nullable().optional(),
|
|
710
|
+
data: z.boolean().nullable().optional(),
|
|
711
|
+
read: z.boolean().nullable().optional(),
|
|
712
|
+
write: z.boolean().nullable().optional(),
|
|
713
|
+
primary: z.boolean().nullable().optional().describe("Provider primary-reference status, not proof of literal addressing or a runtime access. Null or omission means unavailable."),
|
|
714
|
+
provenance: z.string().min(1).nullable().optional().describe("Provider subsystem reporting this reference; null or omission means unavailable."),
|
|
715
|
+
source: z.string().min(1).nullable().optional().describe("Provider reference origin, such as analysis, default, imported or user_defined; null or omission means unavailable.")
|
|
716
|
+
});
|
|
717
|
+
nativeInstructionSchema = z.strictObject({
|
|
718
|
+
address: z.string(),
|
|
719
|
+
status: z.enum([
|
|
720
|
+
"decoded",
|
|
721
|
+
"not-instruction-boundary",
|
|
722
|
+
"data",
|
|
723
|
+
"undecodable",
|
|
724
|
+
"outside-memory"
|
|
725
|
+
]),
|
|
726
|
+
procedure: z.string().nullable(),
|
|
727
|
+
architecture: z.string(),
|
|
728
|
+
mode: z.string().describe("Provider-reported mode label. Per-address decoder context, when available, is reported separately; a program-wide label does not establish runtime encoding mode."),
|
|
729
|
+
decoder_context: z.array(z.strictObject({
|
|
730
|
+
register: z.string().min(1),
|
|
731
|
+
value: z.string().min(1).nullable(),
|
|
732
|
+
source: z.string().min(1)
|
|
733
|
+
})).optional().describe("Observed per-address decoder context. Null means no value was available; omission means the provider or older capture does not expose this facet. The separate mode field retains the program language variant."),
|
|
734
|
+
bytes: z.string().nullable(),
|
|
735
|
+
length: z.number().int().positive().nullable(),
|
|
736
|
+
mnemonic: z.string().nullable(),
|
|
737
|
+
raw_disassembly: z.string().nullable(),
|
|
738
|
+
operands: z.array(z.strictObject({
|
|
739
|
+
index: z.number().int().nonnegative(),
|
|
740
|
+
raw: z.string(),
|
|
741
|
+
provider_type: z.number().int(),
|
|
742
|
+
components: z.array(z.strictObject({
|
|
743
|
+
kind: z.enum([
|
|
744
|
+
"register",
|
|
745
|
+
"immediate",
|
|
746
|
+
"address",
|
|
747
|
+
"unknown"
|
|
748
|
+
]),
|
|
749
|
+
text: z.string(),
|
|
750
|
+
value: z.string().nullable(),
|
|
751
|
+
bit_width: z.number().int().nonnegative().nullable()
|
|
752
|
+
})),
|
|
753
|
+
memory_addressing: z.literal("unavailable")
|
|
754
|
+
})),
|
|
755
|
+
flow: z.strictObject({
|
|
756
|
+
kind: z.enum([
|
|
757
|
+
"call",
|
|
758
|
+
"jump",
|
|
759
|
+
"return",
|
|
760
|
+
"fallthrough",
|
|
761
|
+
"terminal",
|
|
762
|
+
"unavailable"
|
|
763
|
+
]),
|
|
764
|
+
conditional: z.boolean(),
|
|
765
|
+
computed: z.boolean(),
|
|
766
|
+
direct_destinations: z.array(z.string()),
|
|
767
|
+
classification_evidence: z.array(z.strictObject({
|
|
768
|
+
source: z.string().min(1),
|
|
769
|
+
value: z.string().min(1)
|
|
770
|
+
})).optional().describe("Observed provider facts used to classify flow; older captures or other providers may omit them.")
|
|
771
|
+
}),
|
|
772
|
+
references: z.array(reference),
|
|
773
|
+
incoming_references: z.array(reference).nullable().optional().describe("Static references to this exact code or data address, excluding synthetic entry-point references. An empty array means the provider examined the address and found none; null or omission means unavailable. Analyzer references do not prove literal addressing or runtime access."),
|
|
774
|
+
limitations: z.array(z.string())
|
|
775
|
+
});
|
|
776
|
+
nativeCallTargetsSchema = z.strictObject({
|
|
777
|
+
call_site: z.string(),
|
|
778
|
+
procedure: z.string().nullable(),
|
|
779
|
+
status: z.enum([
|
|
780
|
+
"direct",
|
|
781
|
+
"resolved-indirect",
|
|
782
|
+
"ambiguous",
|
|
783
|
+
"unresolved",
|
|
784
|
+
"not-call",
|
|
785
|
+
"unavailable"
|
|
786
|
+
]),
|
|
787
|
+
mechanism: z.enum([
|
|
788
|
+
"direct",
|
|
789
|
+
"computed",
|
|
790
|
+
"indirect",
|
|
791
|
+
"unavailable"
|
|
792
|
+
]),
|
|
793
|
+
targets: z.array(z.strictObject({
|
|
794
|
+
address: z.string(),
|
|
795
|
+
procedure: z.string().nullable(),
|
|
796
|
+
status: z.enum([
|
|
797
|
+
"direct",
|
|
798
|
+
"resolved-indirect",
|
|
799
|
+
"candidate"
|
|
800
|
+
]),
|
|
801
|
+
basis: z.literal("provider-reference"),
|
|
802
|
+
references: z.array(reference)
|
|
803
|
+
})),
|
|
804
|
+
limitations: z.array(z.string())
|
|
805
|
+
});
|
|
806
|
+
})))();
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region dist/domain/canonicalJsonDigestSteps.js
|
|
811
|
+
/** Hash owned, validated JSON in bounded steps without a document-sized string. */
|
|
812
|
+
function* canonicalJsonDigestSteps(value) {
|
|
813
|
+
const hash = createHash("sha256");
|
|
814
|
+
const ancestors = new Set();
|
|
815
|
+
const stack = [{
|
|
816
|
+
kind: "value",
|
|
817
|
+
value
|
|
818
|
+
}];
|
|
819
|
+
const encodedKeys = new Map();
|
|
820
|
+
let remainingKeyCodeUnits = 8192;
|
|
821
|
+
let buffered = "";
|
|
822
|
+
let flushed = false;
|
|
823
|
+
const emit = (part) => {
|
|
824
|
+
buffered += part;
|
|
825
|
+
if (buffered.length >= 8192) {
|
|
826
|
+
hash.update(buffered);
|
|
827
|
+
buffered = "";
|
|
828
|
+
flushed = true;
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
try {
|
|
832
|
+
while (stack.length > 0) {
|
|
833
|
+
if (flushed) {
|
|
834
|
+
flushed = false;
|
|
835
|
+
yield;
|
|
836
|
+
}
|
|
837
|
+
const frame = stack.pop();
|
|
838
|
+
if (frame === undefined) break;
|
|
839
|
+
if (frame.kind === "separator") {
|
|
840
|
+
emit(":");
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (frame.kind === "string") {
|
|
844
|
+
if (frame.index === frame.value.length) {
|
|
845
|
+
emit("\"");
|
|
846
|
+
continue;
|
|
847
|
+
}
|
|
848
|
+
let end = Math.min(frame.index + 8192, frame.value.length);
|
|
849
|
+
const last = frame.value.charCodeAt(end - 1);
|
|
850
|
+
const next = frame.value.charCodeAt(end);
|
|
851
|
+
if (end < frame.value.length && last >= 55296 && last <= 56319 && next >= 56320 && next <= 57343) end -= 1;
|
|
852
|
+
emit(JSON.stringify(frame.value.slice(frame.index, end)).slice(1, -1));
|
|
853
|
+
frame.index = end;
|
|
854
|
+
stack.push(frame);
|
|
855
|
+
continue;
|
|
856
|
+
}
|
|
857
|
+
let item;
|
|
858
|
+
if (frame.kind === "array") {
|
|
859
|
+
if (frame.index === frame.length) {
|
|
860
|
+
emit("]");
|
|
861
|
+
ancestors.delete(frame.value);
|
|
862
|
+
continue;
|
|
863
|
+
}
|
|
864
|
+
const element = frame.value[frame.index];
|
|
865
|
+
if (element === undefined) throw new TypeError("Canonical JSON digest requires dense JSON arrays");
|
|
866
|
+
if (frame.index++ > 0) emit(",");
|
|
867
|
+
stack.push(frame);
|
|
868
|
+
item = element;
|
|
869
|
+
} else if (frame.kind === "object") {
|
|
870
|
+
if (frame.index === frame.keys.length) {
|
|
871
|
+
emit("}");
|
|
872
|
+
ancestors.delete(frame.value);
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
const key = frame.keys[frame.index++];
|
|
876
|
+
if (key === undefined) throw new TypeError("Canonical JSON object changed during hashing");
|
|
877
|
+
const property = frame.value[key];
|
|
878
|
+
if (property === undefined) {
|
|
879
|
+
stack.push(frame);
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
if (frame.written++ > 0) emit(",");
|
|
883
|
+
if (key.length > 8192) {
|
|
884
|
+
emit("\"");
|
|
885
|
+
stack.push(frame, {
|
|
886
|
+
kind: "value",
|
|
887
|
+
value: property
|
|
888
|
+
}, { kind: "separator" }, {
|
|
889
|
+
kind: "string",
|
|
890
|
+
value: key,
|
|
891
|
+
index: 0
|
|
892
|
+
});
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
let encodedKey = encodedKeys.get(key);
|
|
896
|
+
if (encodedKey === undefined) {
|
|
897
|
+
encodedKey = JSON.stringify(key);
|
|
898
|
+
if (encodedKey.length <= remainingKeyCodeUnits) {
|
|
899
|
+
encodedKeys.set(key, encodedKey);
|
|
900
|
+
remainingKeyCodeUnits -= encodedKey.length;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
emit(encodedKey);
|
|
904
|
+
emit(":");
|
|
905
|
+
stack.push(frame);
|
|
906
|
+
item = property;
|
|
907
|
+
} else {
|
|
908
|
+
item = frame.value;
|
|
909
|
+
}
|
|
910
|
+
if (flushed) {
|
|
911
|
+
flushed = false;
|
|
912
|
+
yield;
|
|
913
|
+
}
|
|
914
|
+
if (typeof item === "string" && item.length > 8192) {
|
|
915
|
+
emit("\"");
|
|
916
|
+
stack.push({
|
|
917
|
+
kind: "string",
|
|
918
|
+
value: item,
|
|
919
|
+
index: 0
|
|
920
|
+
});
|
|
921
|
+
} else if (item === null || typeof item !== "object") {
|
|
922
|
+
if (typeof item === "number" && !Number.isFinite(item)) throw new Error(Number.isNaN(item) ? "NaN is not allowed" : "Infinity is not allowed");
|
|
923
|
+
emit(JSON.stringify(item));
|
|
924
|
+
} else {
|
|
925
|
+
if (ancestors.has(item)) throw new Error("Circular reference detected");
|
|
926
|
+
ancestors.add(item);
|
|
927
|
+
if (Array.isArray(item)) {
|
|
928
|
+
emit("[");
|
|
929
|
+
stack.push({
|
|
930
|
+
kind: "array",
|
|
931
|
+
value: item,
|
|
932
|
+
length: item.length,
|
|
933
|
+
index: 0
|
|
934
|
+
});
|
|
935
|
+
} else {
|
|
936
|
+
emit("{");
|
|
937
|
+
stack.push({
|
|
938
|
+
kind: "object",
|
|
939
|
+
value: item,
|
|
940
|
+
keys: Object.keys(item).sort(),
|
|
941
|
+
index: 0,
|
|
942
|
+
written: 0
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
if (buffered !== "") hash.update(buffered);
|
|
948
|
+
return hash.digest("hex");
|
|
949
|
+
} finally {
|
|
950
|
+
stack.length = 0;
|
|
951
|
+
ancestors.clear();
|
|
952
|
+
encodedKeys.clear();
|
|
953
|
+
buffered = "";
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function init_canonicalJsonDigestSteps() {
|
|
957
|
+
return (init_canonicalJsonDigestSteps = __esmMin((() => {})))();
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
//#endregion
|
|
961
|
+
//#region dist/domain/evidence.js
|
|
962
|
+
/** Create Evidence from owned immutable JSON while exposing cooperative computation steps. */
|
|
963
|
+
function* createImmutableEvidenceSteps(target, provider, observation) {
|
|
964
|
+
if (!isImmutableJsonSnapshot(observation.result)) throw new TypeError("Cooperative Evidence requires an authenticated immutable result");
|
|
965
|
+
yield* jsonValueValidationSteps(observation.result);
|
|
966
|
+
const { normalized } = normalizeEvidenceObservation(target, provider, observation);
|
|
967
|
+
const digest = yield* canonicalJsonDigestSteps(semanticProjection(normalized));
|
|
968
|
+
return rememberImmutableEvidence({
|
|
969
|
+
...normalized,
|
|
970
|
+
evidence_id: `ev_${digest}`
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
var providerSchema, subjectFormatSchema, subjectBaseSchema, subjectSchema, evidenceLocationSchema, evidenceAuthoritySchema, executionEnvironmentSchema, evidenceBaseSchema, validateAnalysisProfileProvider, evidenceSchema, authenticatedEvidenceSchema, immutableEvidenceSnapshots, immutableResultSchema, rebindEvidenceSubjectTargetPath, semanticProjection, computeEvidenceId, parseEvidence, immutableEvidence, rebindEvidenceToTargetPath, isImmutableEvidence, rememberImmutableEvidence, createEvidence, normalizeEvidenceObservation;
|
|
974
|
+
function init_evidence() {
|
|
975
|
+
return (init_evidence = __esmMin((() => {
|
|
976
|
+
init_canonicalDigest();
|
|
977
|
+
init_canonicalJsonDigestSteps();
|
|
978
|
+
init_localPath();
|
|
979
|
+
init_analysisProfile();
|
|
980
|
+
init_binaryTargetTypes();
|
|
981
|
+
init_jsonValue();
|
|
982
|
+
init_immutableJson();
|
|
983
|
+
init_digests();
|
|
984
|
+
init_relationshipCoverage();
|
|
985
|
+
providerSchema = z.strictObject({
|
|
986
|
+
id: z.string().min(1),
|
|
987
|
+
name: z.string().min(1),
|
|
988
|
+
version: z.string().nullable()
|
|
989
|
+
});
|
|
990
|
+
subjectFormatSchema = z.enum([
|
|
991
|
+
"hopper",
|
|
992
|
+
"analysis-database",
|
|
993
|
+
"mach-o",
|
|
994
|
+
"elf",
|
|
995
|
+
"pe",
|
|
996
|
+
"dos-mz",
|
|
997
|
+
"dos-com",
|
|
998
|
+
"raw-binary",
|
|
999
|
+
"zip",
|
|
1000
|
+
"ipa",
|
|
1001
|
+
"apk",
|
|
1002
|
+
"msix",
|
|
1003
|
+
"appx",
|
|
1004
|
+
"hap",
|
|
1005
|
+
"hsp",
|
|
1006
|
+
"app-pack",
|
|
1007
|
+
"asar",
|
|
1008
|
+
"dmg",
|
|
1009
|
+
"pkg",
|
|
1010
|
+
"plist",
|
|
1011
|
+
"javascript",
|
|
1012
|
+
"source-map",
|
|
1013
|
+
"directory",
|
|
1014
|
+
"file",
|
|
1015
|
+
"unknown",
|
|
1016
|
+
"mach-o-universal",
|
|
1017
|
+
"javascript-bundle",
|
|
1018
|
+
"entitlements"
|
|
1019
|
+
]);
|
|
1020
|
+
subjectBaseSchema = z.strictObject({
|
|
1021
|
+
name: z.string().min(1),
|
|
1022
|
+
digest: z.strictObject({ sha256: digestSchema }),
|
|
1023
|
+
local_path: nulFreeStringSchema
|
|
1024
|
+
});
|
|
1025
|
+
subjectSchema = z.discriminatedUnion("format", [subjectBaseSchema.extend({
|
|
1026
|
+
format: subjectFormatSchema.exclude(["raw-binary"]),
|
|
1027
|
+
architecture: z.enum(BINARY_ARCHITECTURES).exclude(["6502"]).nullable()
|
|
1028
|
+
}), subjectBaseSchema.extend({
|
|
1029
|
+
format: z.literal("raw-binary"),
|
|
1030
|
+
architecture: z.enum(BINARY_ARCHITECTURES).nullable()
|
|
1031
|
+
})]);
|
|
1032
|
+
evidenceLocationSchema = z.discriminatedUnion("kind", [
|
|
1033
|
+
z.strictObject({
|
|
1034
|
+
kind: z.literal("address"),
|
|
1035
|
+
address: z.string().min(1)
|
|
1036
|
+
}),
|
|
1037
|
+
z.strictObject({
|
|
1038
|
+
kind: z.literal("address-range"),
|
|
1039
|
+
start: z.string().min(1),
|
|
1040
|
+
end: z.string().min(1)
|
|
1041
|
+
}),
|
|
1042
|
+
z.strictObject({
|
|
1043
|
+
kind: z.literal("artifact-path"),
|
|
1044
|
+
path: z.string().min(1)
|
|
1045
|
+
}),
|
|
1046
|
+
z.strictObject({
|
|
1047
|
+
kind: z.literal("file-offset"),
|
|
1048
|
+
offset: z.number().int().min(0)
|
|
1049
|
+
}),
|
|
1050
|
+
z.strictObject({
|
|
1051
|
+
kind: z.literal("file-offset-range"),
|
|
1052
|
+
start: z.number().int().min(0),
|
|
1053
|
+
end: z.number().int().min(0)
|
|
1054
|
+
})
|
|
1055
|
+
]);
|
|
1056
|
+
evidenceAuthoritySchema = z.enum([
|
|
1057
|
+
"shipped-artifact",
|
|
1058
|
+
"controlled-replay",
|
|
1059
|
+
"historical-reference",
|
|
1060
|
+
"external-service",
|
|
1061
|
+
"analyst-inference"
|
|
1062
|
+
]);
|
|
1063
|
+
executionEnvironmentSchema = z.strictObject({
|
|
1064
|
+
id: z.string().min(1),
|
|
1065
|
+
platform: z.string().min(1),
|
|
1066
|
+
architecture: z.string().min(1),
|
|
1067
|
+
isolation: z.enum([
|
|
1068
|
+
"none",
|
|
1069
|
+
"process",
|
|
1070
|
+
"container",
|
|
1071
|
+
"virtual-machine"
|
|
1072
|
+
])
|
|
1073
|
+
});
|
|
1074
|
+
evidenceBaseSchema = z.object({
|
|
1075
|
+
evidence_id: prefixedDigestSchema("ev"),
|
|
1076
|
+
subject: subjectSchema.nullable(),
|
|
1077
|
+
provider: providerSchema,
|
|
1078
|
+
analysis_profile: analysisProfileSchema.nullable(),
|
|
1079
|
+
predicate_type: z.string().min(1),
|
|
1080
|
+
operation: z.string().min(1),
|
|
1081
|
+
parameters: jsonObjectSchema,
|
|
1082
|
+
raw_result: jsonValueSchema.nullable(),
|
|
1083
|
+
normalized_result: jsonValueSchema,
|
|
1084
|
+
confidence: z.enum([
|
|
1085
|
+
"observed",
|
|
1086
|
+
"derived",
|
|
1087
|
+
"inferred"
|
|
1088
|
+
]),
|
|
1089
|
+
authority: evidenceAuthoritySchema,
|
|
1090
|
+
environment: executionEnvironmentSchema.nullable(),
|
|
1091
|
+
limitations: z.array(z.string()),
|
|
1092
|
+
relationship_coverage: relationshipCoverageSchema.nullable().default(null),
|
|
1093
|
+
locations: z.array(evidenceLocationSchema),
|
|
1094
|
+
evidence_links: z.array(prefixedDigestSchema("ev"))
|
|
1095
|
+
}).strict();
|
|
1096
|
+
validateAnalysisProfileProvider = (evidence, context) => {
|
|
1097
|
+
const profile = evidence.analysis_profile;
|
|
1098
|
+
if (profile !== null && (profile.provider.id !== evidence.provider.id || profile.provider.name !== evidence.provider.name || profile.provider.version !== evidence.provider.version)) context.addIssue({
|
|
1099
|
+
code: "custom",
|
|
1100
|
+
path: ["analysis_profile", "provider"],
|
|
1101
|
+
message: "Analysis profile provider does not match Evidence provider"
|
|
1102
|
+
});
|
|
1103
|
+
};
|
|
1104
|
+
evidenceSchema = evidenceBaseSchema.superRefine(validateAnalysisProfileProvider);
|
|
1105
|
+
authenticatedEvidenceSchema = evidenceSchema.superRefine((evidence, context) => {
|
|
1106
|
+
const { evidence_id: evidenceId, ...withoutId } = evidence;
|
|
1107
|
+
if (computeEvidenceId(withoutId) !== evidenceId) context.addIssue({
|
|
1108
|
+
code: "custom",
|
|
1109
|
+
path: ["evidence_id"],
|
|
1110
|
+
message: "Evidence semantic identifier does not match its record"
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
immutableEvidenceSnapshots = new WeakMap();
|
|
1114
|
+
immutableResultSchema = z.custom(isImmutableJsonSnapshot).superRefine((value, context) => {
|
|
1115
|
+
const issue = jsonValueValidationIssue(value);
|
|
1116
|
+
if (issue !== undefined) context.addIssue({
|
|
1117
|
+
code: "custom",
|
|
1118
|
+
message: issue
|
|
1119
|
+
});
|
|
1120
|
+
});
|
|
1121
|
+
rebindEvidenceSubjectTargetPath = (subject, target) => subject.sha256 === target.sha256 && subject.format === target.format && (subject.architecture ?? null) === (target.architecture ?? null) ? {
|
|
1122
|
+
...subject,
|
|
1123
|
+
path: target.path
|
|
1124
|
+
} : subject;
|
|
1125
|
+
semanticProjection = (evidence) => ({
|
|
1126
|
+
subject: evidence.subject === null ? null : {
|
|
1127
|
+
digest: evidence.subject.digest,
|
|
1128
|
+
format: evidence.subject.format,
|
|
1129
|
+
architecture: evidence.subject.architecture
|
|
1130
|
+
},
|
|
1131
|
+
provider: evidence.provider,
|
|
1132
|
+
analysis_profile: evidence.analysis_profile,
|
|
1133
|
+
predicate_type: evidence.predicate_type,
|
|
1134
|
+
operation: evidence.operation,
|
|
1135
|
+
parameters: evidence.parameters,
|
|
1136
|
+
raw_result: evidence.raw_result,
|
|
1137
|
+
normalized_result: evidence.normalized_result,
|
|
1138
|
+
confidence: evidence.confidence,
|
|
1139
|
+
authority: evidence.authority,
|
|
1140
|
+
environment: evidence.environment,
|
|
1141
|
+
limitations: evidence.limitations,
|
|
1142
|
+
...evidence.relationship_coverage === null ? {} : { relationship_coverage: evidence.relationship_coverage },
|
|
1143
|
+
locations: evidence.locations,
|
|
1144
|
+
evidence_links: evidence.evidence_links
|
|
1145
|
+
});
|
|
1146
|
+
computeEvidenceId = (evidence) => `ev_${digestCanonicalValue(semanticProjection(evidence), "Evidence")}`;
|
|
1147
|
+
parseEvidence = (input) => {
|
|
1148
|
+
const immutable = typeof input === "object" && input !== null ? immutableEvidenceSnapshots.get(input) : undefined;
|
|
1149
|
+
if (immutable !== undefined) return immutable;
|
|
1150
|
+
return authenticatedEvidenceSchema.parse(input);
|
|
1151
|
+
};
|
|
1152
|
+
immutableEvidence = (input) => rememberImmutableEvidence(parseEvidence(input));
|
|
1153
|
+
rebindEvidenceToTargetPath = (evidence, target) => {
|
|
1154
|
+
const subject = evidence.subject;
|
|
1155
|
+
if (subject === null) return evidence;
|
|
1156
|
+
const rebound = rebindEvidenceSubjectTargetPath({
|
|
1157
|
+
path: subject.local_path,
|
|
1158
|
+
sha256: subject.digest.sha256,
|
|
1159
|
+
format: subject.format,
|
|
1160
|
+
...subject.architecture === null ? {} : { architecture: subject.architecture }
|
|
1161
|
+
}, target);
|
|
1162
|
+
if (rebound.path === subject.local_path) return evidence;
|
|
1163
|
+
const reboundSubject = subjectSchema.parse({
|
|
1164
|
+
...subject,
|
|
1165
|
+
name: basename(target.path) || "artifact",
|
|
1166
|
+
local_path: target.path
|
|
1167
|
+
});
|
|
1168
|
+
const reboundEvidence = {
|
|
1169
|
+
...evidence,
|
|
1170
|
+
subject: reboundSubject
|
|
1171
|
+
};
|
|
1172
|
+
if (!isImmutableEvidence(evidence)) return immutableEvidence(reboundEvidence);
|
|
1173
|
+
Object.freeze(reboundSubject.digest);
|
|
1174
|
+
Object.freeze(reboundSubject);
|
|
1175
|
+
Object.freeze(reboundEvidence);
|
|
1176
|
+
immutableEvidenceSnapshots.set(reboundEvidence, reboundEvidence);
|
|
1177
|
+
return reboundEvidence;
|
|
1178
|
+
};
|
|
1179
|
+
isImmutableEvidence = (evidence) => immutableEvidenceSnapshots.has(evidence);
|
|
1180
|
+
rememberImmutableEvidence = (evidence) => {
|
|
1181
|
+
freezeJsonSnapshot(evidence);
|
|
1182
|
+
immutableEvidenceSnapshots.set(evidence, evidence);
|
|
1183
|
+
return evidence;
|
|
1184
|
+
};
|
|
1185
|
+
createEvidence = (target, provider, observation) => {
|
|
1186
|
+
const { normalized, sharedResult } = normalizeEvidenceObservation(target, provider, observation);
|
|
1187
|
+
const evidence = {
|
|
1188
|
+
...normalized,
|
|
1189
|
+
evidence_id: computeEvidenceId(normalized)
|
|
1190
|
+
};
|
|
1191
|
+
return sharedResult ? rememberImmutableEvidence(evidence) : evidence;
|
|
1192
|
+
};
|
|
1193
|
+
normalizeEvidenceObservation = (target, provider, observation) => {
|
|
1194
|
+
const subject = target === undefined ? null : {
|
|
1195
|
+
name: basename(target.path) || "artifact",
|
|
1196
|
+
digest: { sha256: target.sha256 },
|
|
1197
|
+
format: target.format,
|
|
1198
|
+
architecture: target.architecture ?? null,
|
|
1199
|
+
local_path: target.path
|
|
1200
|
+
};
|
|
1201
|
+
const semantic = {
|
|
1202
|
+
subject: subject === null ? null : {
|
|
1203
|
+
digest: subject.digest,
|
|
1204
|
+
format: subject.format,
|
|
1205
|
+
architecture: subject.architecture
|
|
1206
|
+
},
|
|
1207
|
+
provider: {
|
|
1208
|
+
id: provider.id,
|
|
1209
|
+
name: provider.name,
|
|
1210
|
+
version: provider.version
|
|
1211
|
+
},
|
|
1212
|
+
analysis_profile: observation.analysisProfile ?? null,
|
|
1213
|
+
predicate_type: observation.predicateType ?? "rea.analysis",
|
|
1214
|
+
operation: observation.operation,
|
|
1215
|
+
parameters: observation.parameters,
|
|
1216
|
+
raw_result: observation.rawResult ?? null,
|
|
1217
|
+
normalized_result: observation.result,
|
|
1218
|
+
confidence: observation.confidence ?? "observed",
|
|
1219
|
+
authority: observation.authority ?? "shipped-artifact",
|
|
1220
|
+
environment: observation.environment ?? null,
|
|
1221
|
+
limitations: [...target === undefined ? [observation.subjectUnavailableReason ?? "Artifact identity is unavailable for this observation."] : [], ...observation.limitations ?? []],
|
|
1222
|
+
...observation.relationshipCoverage === undefined ? { relationship_coverage: null } : { relationship_coverage: observation.relationshipCoverage },
|
|
1223
|
+
locations: [...observation.locations ?? []],
|
|
1224
|
+
evidence_links: [...observation.evidenceLinks ?? []]
|
|
1225
|
+
};
|
|
1226
|
+
const sharedResult = typeof observation.result === "object" && observation.result !== null && isImmutableJsonSnapshot(observation.result);
|
|
1227
|
+
const selectedSchema = sharedResult ? evidenceSchema.safeExtend({ normalized_result: immutableResultSchema }) : evidenceSchema;
|
|
1228
|
+
const normalized = selectedSchema.parse({
|
|
1229
|
+
...semantic,
|
|
1230
|
+
evidence_id: `ev_${"0".repeat(64)}`,
|
|
1231
|
+
subject
|
|
1232
|
+
});
|
|
1233
|
+
return {
|
|
1234
|
+
normalized,
|
|
1235
|
+
sharedResult
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
})))();
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
//#endregion
|
|
1242
|
+
//#region dist/contracts/errorSchemas.js
|
|
1243
|
+
var categorySchema, remediationSchema, common, genericDetails, generic, analysisErrorProjectionSchema, analysisCliErrorEnvelopeSchema, analysisErrorJsonSchema;
|
|
1244
|
+
function init_errorSchemas() {
|
|
1245
|
+
return (init_errorSchemas = __esmMin((() => {
|
|
1246
|
+
init_jsonValue();
|
|
1247
|
+
categorySchema = z.enum([
|
|
1248
|
+
"invalid_input",
|
|
1249
|
+
"unsupported_provider",
|
|
1250
|
+
"unsupported_target",
|
|
1251
|
+
"integrity_mismatch",
|
|
1252
|
+
"truncated",
|
|
1253
|
+
"cancelled",
|
|
1254
|
+
"timeout",
|
|
1255
|
+
"resource_constraint",
|
|
1256
|
+
"unavailable",
|
|
1257
|
+
"execution_failure"
|
|
1258
|
+
]);
|
|
1259
|
+
remediationSchema = z.object({ action: z.string().min(1) }).strict();
|
|
1260
|
+
common = {
|
|
1261
|
+
category: categorySchema,
|
|
1262
|
+
message: z.string().min(1),
|
|
1263
|
+
retryable: z.boolean(),
|
|
1264
|
+
remediation: remediationSchema
|
|
1265
|
+
};
|
|
1266
|
+
genericDetails = z.record(z.string(), jsonValueSchema).optional();
|
|
1267
|
+
generic = (code) => z.object({
|
|
1268
|
+
code: z.literal(code),
|
|
1269
|
+
...common,
|
|
1270
|
+
details: genericDetails
|
|
1271
|
+
}).strict();
|
|
1272
|
+
analysisErrorProjectionSchema = z.discriminatedUnion("code", [
|
|
1273
|
+
generic("invalid_request"),
|
|
1274
|
+
generic("access_denied"),
|
|
1275
|
+
generic("artifact_changed"),
|
|
1276
|
+
generic("unreadable_output"),
|
|
1277
|
+
generic("capability_unavailable"),
|
|
1278
|
+
generic("unsupported_target"),
|
|
1279
|
+
generic("provider_unavailable"),
|
|
1280
|
+
generic("provider_timeout"),
|
|
1281
|
+
generic("resource_constraint"),
|
|
1282
|
+
generic("cancelled"),
|
|
1283
|
+
z.object({
|
|
1284
|
+
code: z.literal("artifact_integrity_mismatch"),
|
|
1285
|
+
...common,
|
|
1286
|
+
details: z.object({
|
|
1287
|
+
logical_path: z.string(),
|
|
1288
|
+
declared_sha256: z.string().nullable(),
|
|
1289
|
+
calculated_sha256: z.string().nullable(),
|
|
1290
|
+
unpacked: z.boolean()
|
|
1291
|
+
}).strict()
|
|
1292
|
+
}).strict(),
|
|
1293
|
+
generic("artifact_operation_failed"),
|
|
1294
|
+
generic("evidence_integrity_mismatch"),
|
|
1295
|
+
generic("truncated"),
|
|
1296
|
+
generic("process_capture_failed"),
|
|
1297
|
+
generic("cleanup_incomplete"),
|
|
1298
|
+
generic("revision_conflict"),
|
|
1299
|
+
generic("configuration_invalid"),
|
|
1300
|
+
generic("target_unavailable"),
|
|
1301
|
+
generic("execution_failure")
|
|
1302
|
+
]);
|
|
1303
|
+
analysisCliErrorEnvelopeSchema = z.object({
|
|
1304
|
+
error: z.string().min(1),
|
|
1305
|
+
input_path: z.string().optional(),
|
|
1306
|
+
input_reason: z.enum([
|
|
1307
|
+
"invalid-json",
|
|
1308
|
+
"read-failed",
|
|
1309
|
+
"too-large"
|
|
1310
|
+
]).optional()
|
|
1311
|
+
}).passthrough().superRefine((value, context) => {
|
|
1312
|
+
const { error: _label, input_path: _inputPath, input_reason: _inputReason, ...projection } = value;
|
|
1313
|
+
const parsed = analysisErrorProjectionSchema.safeParse(projection);
|
|
1314
|
+
if (!parsed.success) {
|
|
1315
|
+
context.addIssue({
|
|
1316
|
+
code: "custom",
|
|
1317
|
+
message: "CLI error envelope must contain a canonical analysis error projection"
|
|
1318
|
+
});
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
analysisErrorJsonSchema = z.toJSONSchema(analysisErrorProjectionSchema);
|
|
1322
|
+
})))();
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
//#endregion
|
|
1326
|
+
//#region dist/domain/zipPackageFormat.js
|
|
1327
|
+
var ZIP_PACKAGE_FORMATS, isZipPackageFormat, hasZipSignature, zipPackageFormatForPath, ZIP_NON_ENTRY_LIMITATION, isZipInventoryScopeLimitation;
|
|
1328
|
+
function init_zipPackageFormat() {
|
|
1329
|
+
return (init_zipPackageFormat = __esmMin((() => {
|
|
1330
|
+
ZIP_PACKAGE_FORMATS = [
|
|
1331
|
+
"zip",
|
|
1332
|
+
"ipa",
|
|
1333
|
+
"apk",
|
|
1334
|
+
"msix",
|
|
1335
|
+
"appx",
|
|
1336
|
+
"hap",
|
|
1337
|
+
"hsp",
|
|
1338
|
+
"app-pack"
|
|
1339
|
+
];
|
|
1340
|
+
isZipPackageFormat = (format) => ZIP_PACKAGE_FORMATS.some((candidate) => candidate === format);
|
|
1341
|
+
hasZipSignature = (bytes) => bytes.length >= 4 && bytes[0] === 80 && bytes[1] === 75 && (bytes[2] === 3 && bytes[3] === 4 || bytes[2] === 5 && bytes[3] === 6 || bytes[2] === 7 && bytes[3] === 8);
|
|
1342
|
+
zipPackageFormatForPath = (path) => {
|
|
1343
|
+
const lower = path.toLowerCase();
|
|
1344
|
+
if (lower.endsWith(".zip")) return "zip";
|
|
1345
|
+
if (lower.endsWith(".ipa")) return "ipa";
|
|
1346
|
+
if (lower.endsWith(".apk")) return "apk";
|
|
1347
|
+
if (lower.endsWith(".msix") || lower.endsWith(".msixbundle")) return "msix";
|
|
1348
|
+
if (lower.endsWith(".appx") || lower.endsWith(".appxbundle")) return "appx";
|
|
1349
|
+
if (lower.endsWith(".hap")) return "hap";
|
|
1350
|
+
if (lower.endsWith(".hsp")) return "hsp";
|
|
1351
|
+
return undefined;
|
|
1352
|
+
};
|
|
1353
|
+
ZIP_NON_ENTRY_LIMITATION = "ZIP inventory lists central-directory entries only. Non-entry bytes, including an APK Signing Block before the central directory or a ZIP comment after it, are not occurrences.";
|
|
1354
|
+
isZipInventoryScopeLimitation = (limitation) => limitation === "ZIP inventory lists central-directory entries only. Non-entry bytes, including an APK Signing Block before the central directory or a ZIP comment after it, are not occurrences." || limitation === "ZIP inventory lists central-directory entries only. Bytes after the central directory, including an APK Signing Block or a ZIP comment, are not occurrences.";
|
|
1355
|
+
})))();
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
//#endregion
|
|
1359
|
+
//#region dist/contracts/toolOutputSchemaPrimitives.js
|
|
1360
|
+
var evidenceResultOf, lifecycleResultOf, requireOutputSchema, targetFormatSchema, targetKindSchema, providerCapabilityFacts, providerCapability, PROVIDER_EFFECT_NAMES, providerIdentity, providerCapabilityGroupFacts, providerCapabilityGroup, providerCapabilitySet, expandProviderCapabilities, processCoordinates, processLineageObservation, analysisRun, analysisActivity, providerOperationRequest, providerOperationHealth, providerRejectionCode, providerDiagnostics, providerAvailability, providerTargetSupport, clientFeatureNameSchema, clientFeatureAvailabilitySchema, toolAvailabilityMode, toolAvailabilityFacts, toolUnavailabilityReason, toolAvailability, TOOL_EFFECT_NAMES, TOOL_ANNOTATION_NAMES, toolAvailabilityGroupFacts, toolAvailabilityGroup, toolAvailabilityInventory, expandToolAvailability, sessionProvider, nullableText, addressList, addressedEntry, containingProcedureResolution, unavailable, availableMemoryPermissions, addressedValue, memoryRegionOutput, segmentOutput, procedureInfoOutput, symbolDiscoveryOutput, graphNode, functionDossierOutput;
|
|
1361
|
+
function init_toolOutputSchemaPrimitives() {
|
|
1362
|
+
return (init_toolOutputSchemaPrimitives = __esmMin((() => {
|
|
1363
|
+
init_hopperValues();
|
|
1364
|
+
init_analysisProfile();
|
|
1365
|
+
init_evidence();
|
|
1366
|
+
init_jsonValue();
|
|
1367
|
+
init_providerSelection();
|
|
1368
|
+
init_providerOperationHealth();
|
|
1369
|
+
init_errorSchemas();
|
|
1370
|
+
init_relationshipCoverage();
|
|
1371
|
+
init_zipPackageFormat();
|
|
1372
|
+
evidenceResultOf = (schema) => z.strictObject({
|
|
1373
|
+
...evidenceSchema.shape,
|
|
1374
|
+
normalized_result: schema
|
|
1375
|
+
}).superRefine(validateAnalysisProfileProvider);
|
|
1376
|
+
lifecycleResultOf = (schema) => z.object({ result: schema });
|
|
1377
|
+
requireOutputSchema = (schemas, name) => {
|
|
1378
|
+
const schema = schemas[name];
|
|
1379
|
+
if (schema === undefined) throw new Error(`Missing output schema for ${name}`);
|
|
1380
|
+
return schema;
|
|
1381
|
+
};
|
|
1382
|
+
targetFormatSchema = z.enum([
|
|
1383
|
+
"hopper",
|
|
1384
|
+
"analysis-database",
|
|
1385
|
+
"mach-o",
|
|
1386
|
+
"mach-o-universal",
|
|
1387
|
+
"elf",
|
|
1388
|
+
"pe",
|
|
1389
|
+
"dos-mz",
|
|
1390
|
+
"dos-com",
|
|
1391
|
+
"raw-binary",
|
|
1392
|
+
...ZIP_PACKAGE_FORMATS,
|
|
1393
|
+
"asar",
|
|
1394
|
+
"dmg",
|
|
1395
|
+
"pkg",
|
|
1396
|
+
"plist",
|
|
1397
|
+
"javascript",
|
|
1398
|
+
"source-map"
|
|
1399
|
+
]);
|
|
1400
|
+
targetKindSchema = z.enum([
|
|
1401
|
+
"executable",
|
|
1402
|
+
"database",
|
|
1403
|
+
"archive",
|
|
1404
|
+
"artifact"
|
|
1405
|
+
]);
|
|
1406
|
+
providerCapabilityFacts = {
|
|
1407
|
+
operation: z.string(),
|
|
1408
|
+
effects: z.object({
|
|
1409
|
+
mutates_artifact: z.boolean(),
|
|
1410
|
+
launches_process: z.boolean(),
|
|
1411
|
+
may_show_ui: z.boolean(),
|
|
1412
|
+
may_access_network: z.boolean(),
|
|
1413
|
+
may_write_filesystem: z.boolean(),
|
|
1414
|
+
changes_permissions: z.boolean(),
|
|
1415
|
+
requires_root: z.boolean()
|
|
1416
|
+
}),
|
|
1417
|
+
limitations: z.array(z.string())
|
|
1418
|
+
};
|
|
1419
|
+
providerCapability = z.discriminatedUnion("available", [z.object({
|
|
1420
|
+
...providerCapabilityFacts,
|
|
1421
|
+
available: z.literal(true),
|
|
1422
|
+
reason: z.null(),
|
|
1423
|
+
availability_code: z.null()
|
|
1424
|
+
}), z.object({
|
|
1425
|
+
...providerCapabilityFacts,
|
|
1426
|
+
available: z.literal(false),
|
|
1427
|
+
reason: z.string().nullable(),
|
|
1428
|
+
availability_code: z.enum(PROVIDER_REJECTION_CODES).nullable()
|
|
1429
|
+
})]);
|
|
1430
|
+
PROVIDER_EFFECT_NAMES = Object.keys(providerCapabilityFacts.effects.shape);
|
|
1431
|
+
providerIdentity = z.object({
|
|
1432
|
+
id: z.string(),
|
|
1433
|
+
name: z.string(),
|
|
1434
|
+
version: z.string().nullable()
|
|
1435
|
+
});
|
|
1436
|
+
providerCapabilityGroupFacts = {
|
|
1437
|
+
operations: z.array(z.string().min(1)).min(1),
|
|
1438
|
+
effects: z.array(providerCapabilityFacts.effects.keyof()),
|
|
1439
|
+
limitations: z.array(z.string())
|
|
1440
|
+
};
|
|
1441
|
+
providerCapabilityGroup = z.discriminatedUnion("available", [z.strictObject({
|
|
1442
|
+
...providerCapabilityGroupFacts,
|
|
1443
|
+
available: z.literal(true),
|
|
1444
|
+
reason: z.null(),
|
|
1445
|
+
availability_code: z.null()
|
|
1446
|
+
}), z.strictObject({
|
|
1447
|
+
...providerCapabilityGroupFacts,
|
|
1448
|
+
available: z.literal(false),
|
|
1449
|
+
reason: z.string().nullable(),
|
|
1450
|
+
availability_code: z.enum(PROVIDER_REJECTION_CODES).nullable()
|
|
1451
|
+
})]);
|
|
1452
|
+
providerCapabilitySet = z.strictObject({
|
|
1453
|
+
provider: providerIdentity,
|
|
1454
|
+
shared_limitations: z.array(z.string()),
|
|
1455
|
+
groups: z.array(providerCapabilityGroup)
|
|
1456
|
+
});
|
|
1457
|
+
expandProviderCapabilities = (sets) => sets.flatMap((set) => set.groups.flatMap((group) => group.operations.map((operation) => ({
|
|
1458
|
+
...providerCapability.parse({
|
|
1459
|
+
operation,
|
|
1460
|
+
available: group.available,
|
|
1461
|
+
reason: group.reason,
|
|
1462
|
+
availability_code: group.availability_code,
|
|
1463
|
+
effects: Object.fromEntries(PROVIDER_EFFECT_NAMES.map((name) => [name, group.effects.includes(name)])),
|
|
1464
|
+
limitations: [...set.shared_limitations, ...group.limitations]
|
|
1465
|
+
}),
|
|
1466
|
+
provider: set.provider
|
|
1467
|
+
}))));
|
|
1468
|
+
processCoordinates = {
|
|
1469
|
+
launcher_pid: z.number().int().min(1),
|
|
1470
|
+
process_group_id: z.number().int().min(1)
|
|
1471
|
+
};
|
|
1472
|
+
processLineageObservation = z.discriminatedUnion("status", [z.object({
|
|
1473
|
+
status: z.literal("unavailable"),
|
|
1474
|
+
observed_at: z.iso.datetime(),
|
|
1475
|
+
...processCoordinates,
|
|
1476
|
+
reason: z.string().min(1)
|
|
1477
|
+
}), z.object({
|
|
1478
|
+
status: z.literal("verified"),
|
|
1479
|
+
observed_at: z.iso.datetime(),
|
|
1480
|
+
...processCoordinates,
|
|
1481
|
+
launcher_parent_pid: z.number().int().min(0),
|
|
1482
|
+
descendants: z.array(z.object({
|
|
1483
|
+
pid: z.number().int().min(1),
|
|
1484
|
+
parent_pid: z.number().int().min(0),
|
|
1485
|
+
process_group_id: z.number().int().min(1)
|
|
1486
|
+
}))
|
|
1487
|
+
})]);
|
|
1488
|
+
analysisRun = z.object({
|
|
1489
|
+
run_id: z.string().uuid(),
|
|
1490
|
+
process_lineage: z.discriminatedUnion("status", [z.object({ status: z.literal("not_observed") }), z.object({
|
|
1491
|
+
status: z.literal("snapshots"),
|
|
1492
|
+
snapshots: z.array(z.object({
|
|
1493
|
+
provider: providerIdentity,
|
|
1494
|
+
observation: processLineageObservation
|
|
1495
|
+
}))
|
|
1496
|
+
})])
|
|
1497
|
+
}).nullable();
|
|
1498
|
+
analysisActivity = z.object({
|
|
1499
|
+
status: z.enum([
|
|
1500
|
+
"not_observed",
|
|
1501
|
+
"idle",
|
|
1502
|
+
"busy"
|
|
1503
|
+
]),
|
|
1504
|
+
providers: z.array(z.object({
|
|
1505
|
+
provider: providerIdentity,
|
|
1506
|
+
active: z.object({
|
|
1507
|
+
request_id: z.number().int().min(1),
|
|
1508
|
+
operation: z.string().min(1),
|
|
1509
|
+
elapsed_ms: z.number().int().min(0),
|
|
1510
|
+
caller_state: z.enum(["waiting", "cancelled"])
|
|
1511
|
+
}).nullable(),
|
|
1512
|
+
queued_requests: z.number().int().min(0)
|
|
1513
|
+
}))
|
|
1514
|
+
});
|
|
1515
|
+
providerOperationRequest = z.object({
|
|
1516
|
+
request_id: z.number().int().min(1),
|
|
1517
|
+
operation: z.string().min(1),
|
|
1518
|
+
stage: z.enum(PROVIDER_FAILURE_STAGES)
|
|
1519
|
+
});
|
|
1520
|
+
providerOperationHealth = z.object({
|
|
1521
|
+
state: z.enum(PROVIDER_OPERATION_STATES),
|
|
1522
|
+
stage: z.enum(PROVIDER_FAILURE_STAGES).nullable(),
|
|
1523
|
+
retry_action: z.enum(PROVIDER_RETRY_ACTIONS).nullable(),
|
|
1524
|
+
exit_code: z.number().int().nullable(),
|
|
1525
|
+
requests: z.array(providerOperationRequest)
|
|
1526
|
+
}).nullable();
|
|
1527
|
+
providerRejectionCode = z.enum(PROVIDER_REJECTION_CODES);
|
|
1528
|
+
providerDiagnostics = z.record(z.string(), jsonValueSchema);
|
|
1529
|
+
providerAvailability = z.discriminatedUnion("status", [z.object({
|
|
1530
|
+
status: z.literal("available"),
|
|
1531
|
+
code: z.null(),
|
|
1532
|
+
reason: z.null(),
|
|
1533
|
+
diagnostics: providerDiagnostics
|
|
1534
|
+
}), z.object({
|
|
1535
|
+
status: z.literal("unavailable"),
|
|
1536
|
+
code: providerRejectionCode,
|
|
1537
|
+
reason: z.string().min(1),
|
|
1538
|
+
diagnostics: providerDiagnostics
|
|
1539
|
+
})]);
|
|
1540
|
+
providerTargetSupport = z.discriminatedUnion("status", [
|
|
1541
|
+
z.object({
|
|
1542
|
+
status: z.literal("unknown"),
|
|
1543
|
+
code: z.null(),
|
|
1544
|
+
reason: z.string().min(1),
|
|
1545
|
+
diagnostics: providerDiagnostics
|
|
1546
|
+
}),
|
|
1547
|
+
z.object({
|
|
1548
|
+
status: z.literal("supported"),
|
|
1549
|
+
code: z.null(),
|
|
1550
|
+
reason: z.null(),
|
|
1551
|
+
diagnostics: providerDiagnostics
|
|
1552
|
+
}),
|
|
1553
|
+
z.object({
|
|
1554
|
+
status: z.literal("unsupported"),
|
|
1555
|
+
code: z.enum([
|
|
1556
|
+
"target_kind_unsupported",
|
|
1557
|
+
"target_format_unsupported",
|
|
1558
|
+
"architecture_unsupported",
|
|
1559
|
+
"target_role_unsupported",
|
|
1560
|
+
"managed_target_unsupported"
|
|
1561
|
+
]),
|
|
1562
|
+
reason: z.string().min(1),
|
|
1563
|
+
diagnostics: providerDiagnostics
|
|
1564
|
+
})
|
|
1565
|
+
]);
|
|
1566
|
+
clientFeatureNameSchema = z.enum([
|
|
1567
|
+
"elicitation_form",
|
|
1568
|
+
"elicitation_url",
|
|
1569
|
+
"roots",
|
|
1570
|
+
"sampling"
|
|
1571
|
+
]);
|
|
1572
|
+
clientFeatureAvailabilitySchema = z.object({
|
|
1573
|
+
elicitation_form: z.boolean(),
|
|
1574
|
+
elicitation_url: z.boolean(),
|
|
1575
|
+
roots: z.boolean(),
|
|
1576
|
+
sampling: z.boolean()
|
|
1577
|
+
});
|
|
1578
|
+
toolAvailabilityMode = z.discriminatedUnion("available", [z.object({
|
|
1579
|
+
name: z.string(),
|
|
1580
|
+
available: z.literal(true),
|
|
1581
|
+
missing_operations: z.array(z.string()).length(0),
|
|
1582
|
+
remediation: z.null()
|
|
1583
|
+
}), z.object({
|
|
1584
|
+
name: z.string(),
|
|
1585
|
+
available: z.literal(false),
|
|
1586
|
+
missing_operations: z.array(z.string()).min(1),
|
|
1587
|
+
remediation: z.string().nullable()
|
|
1588
|
+
})]);
|
|
1589
|
+
toolAvailabilityFacts = {
|
|
1590
|
+
name: z.string(),
|
|
1591
|
+
surface: z.string(),
|
|
1592
|
+
default_mode_available: z.boolean().optional(),
|
|
1593
|
+
modes: z.array(toolAvailabilityMode).optional(),
|
|
1594
|
+
client_requirements: z.object({
|
|
1595
|
+
required: z.array(clientFeatureNameSchema),
|
|
1596
|
+
optional: z.array(clientFeatureNameSchema),
|
|
1597
|
+
missing_required: z.array(clientFeatureNameSchema),
|
|
1598
|
+
missing_optional: z.array(clientFeatureNameSchema)
|
|
1599
|
+
}),
|
|
1600
|
+
effects: z.strictObject({
|
|
1601
|
+
mutatesTarget: z.boolean(),
|
|
1602
|
+
mutatesSession: z.boolean(),
|
|
1603
|
+
writesFilesystem: z.boolean(),
|
|
1604
|
+
launchesProcess: z.boolean(),
|
|
1605
|
+
accessesNetwork: z.boolean(),
|
|
1606
|
+
changesUiState: z.boolean(),
|
|
1607
|
+
mayDiscardData: z.boolean(),
|
|
1608
|
+
executesForeignCode: z.boolean(),
|
|
1609
|
+
mutatesDevice: z.boolean(),
|
|
1610
|
+
idempotent: z.boolean()
|
|
1611
|
+
}),
|
|
1612
|
+
annotations: z.object({
|
|
1613
|
+
read_only: z.boolean(),
|
|
1614
|
+
destructive: z.boolean(),
|
|
1615
|
+
idempotent: z.boolean(),
|
|
1616
|
+
open_world: z.boolean()
|
|
1617
|
+
})
|
|
1618
|
+
};
|
|
1619
|
+
toolUnavailabilityReason = z.enum([
|
|
1620
|
+
"client_capability_missing",
|
|
1621
|
+
"target_required",
|
|
1622
|
+
"provider_missing",
|
|
1623
|
+
"provider_unavailable",
|
|
1624
|
+
"target_unsupported",
|
|
1625
|
+
"unsupported_host"
|
|
1626
|
+
]);
|
|
1627
|
+
toolAvailability = z.discriminatedUnion("available", [z.object({
|
|
1628
|
+
...toolAvailabilityFacts,
|
|
1629
|
+
available: z.literal(true),
|
|
1630
|
+
reason: z.literal("available"),
|
|
1631
|
+
remediation: z.null()
|
|
1632
|
+
}), z.object({
|
|
1633
|
+
...toolAvailabilityFacts,
|
|
1634
|
+
available: z.literal(false),
|
|
1635
|
+
reason: toolUnavailabilityReason,
|
|
1636
|
+
remediation: z.string().nullable()
|
|
1637
|
+
})]);
|
|
1638
|
+
TOOL_EFFECT_NAMES = Object.keys(toolAvailabilityFacts.effects.shape);
|
|
1639
|
+
TOOL_ANNOTATION_NAMES = Object.keys(toolAvailabilityFacts.annotations.shape);
|
|
1640
|
+
toolAvailabilityGroupFacts = {
|
|
1641
|
+
names: z.array(z.string().min(1)).min(1),
|
|
1642
|
+
surface: toolAvailabilityFacts.surface,
|
|
1643
|
+
default_mode_available: toolAvailabilityFacts.default_mode_available,
|
|
1644
|
+
modes: toolAvailabilityFacts.modes,
|
|
1645
|
+
client_requirements: toolAvailabilityFacts.client_requirements.optional(),
|
|
1646
|
+
effects: z.array(toolAvailabilityFacts.effects.keyof()),
|
|
1647
|
+
annotations: z.array(toolAvailabilityFacts.annotations.keyof())
|
|
1648
|
+
};
|
|
1649
|
+
toolAvailabilityGroup = z.discriminatedUnion("available", [z.strictObject({
|
|
1650
|
+
...toolAvailabilityGroupFacts,
|
|
1651
|
+
available: z.literal(true),
|
|
1652
|
+
reason: z.literal("available"),
|
|
1653
|
+
remediation: z.null()
|
|
1654
|
+
}), z.strictObject({
|
|
1655
|
+
...toolAvailabilityGroupFacts,
|
|
1656
|
+
available: z.literal(false),
|
|
1657
|
+
reason: toolUnavailabilityReason,
|
|
1658
|
+
remediation: z.string().nullable()
|
|
1659
|
+
})]);
|
|
1660
|
+
toolAvailabilityInventory = z.strictObject({
|
|
1661
|
+
client_requirements: toolAvailabilityFacts.client_requirements,
|
|
1662
|
+
groups: z.array(toolAvailabilityGroup)
|
|
1663
|
+
});
|
|
1664
|
+
expandToolAvailability = (inventory) => inventory.groups.flatMap((group) => group.names.map((name) => toolAvailability.parse({
|
|
1665
|
+
...group,
|
|
1666
|
+
name,
|
|
1667
|
+
client_requirements: group.client_requirements ?? inventory.client_requirements,
|
|
1668
|
+
effects: Object.fromEntries(TOOL_EFFECT_NAMES.map((effect) => [effect, group.effects.includes(effect)])),
|
|
1669
|
+
annotations: Object.fromEntries(TOOL_ANNOTATION_NAMES.map((annotation) => [annotation, group.annotations.includes(annotation)]))
|
|
1670
|
+
})));
|
|
1671
|
+
sessionProvider = z.object({
|
|
1672
|
+
capabilities: z.array(providerCapabilitySet),
|
|
1673
|
+
analysis_run: analysisRun,
|
|
1674
|
+
analysis_activity: analysisActivity,
|
|
1675
|
+
provider_operation_health: providerOperationHealth,
|
|
1676
|
+
analysis_provider_binding: z.object({
|
|
1677
|
+
provider: providerIdentity,
|
|
1678
|
+
selection_source: z.enum([
|
|
1679
|
+
"request",
|
|
1680
|
+
"environment",
|
|
1681
|
+
"auto-single-candidate"
|
|
1682
|
+
]),
|
|
1683
|
+
analysis_profile: analysisProfileSchema
|
|
1684
|
+
}).nullable(),
|
|
1685
|
+
analysis_provider_candidates: z.array(z.object({
|
|
1686
|
+
provider: providerIdentity,
|
|
1687
|
+
availability: providerAvailability,
|
|
1688
|
+
target_support: providerTargetSupport,
|
|
1689
|
+
selected: z.boolean(),
|
|
1690
|
+
capabilities: z.array(providerCapabilitySet)
|
|
1691
|
+
})),
|
|
1692
|
+
tool_availability: toolAvailabilityInventory,
|
|
1693
|
+
client_features: z.object({
|
|
1694
|
+
elicitation_form: z.boolean(),
|
|
1695
|
+
elicitation_url: z.boolean(),
|
|
1696
|
+
roots: z.boolean(),
|
|
1697
|
+
sampling: z.boolean()
|
|
1698
|
+
}),
|
|
1699
|
+
server_identity: z.object({
|
|
1700
|
+
package: z.object({
|
|
1701
|
+
name: z.string(),
|
|
1702
|
+
version: z.string(),
|
|
1703
|
+
root_path: z.string(),
|
|
1704
|
+
build_commit: z.string().nullable()
|
|
1705
|
+
}),
|
|
1706
|
+
server: z.object({
|
|
1707
|
+
name: z.string(),
|
|
1708
|
+
version: z.string(),
|
|
1709
|
+
started_at: z.string(),
|
|
1710
|
+
command_path: z.string().nullable()
|
|
1711
|
+
}),
|
|
1712
|
+
sdk: z.object({
|
|
1713
|
+
server: z.string(),
|
|
1714
|
+
client_test: z.string(),
|
|
1715
|
+
core: z.string()
|
|
1716
|
+
}),
|
|
1717
|
+
negotiated_protocol_version: z.string().nullable(),
|
|
1718
|
+
client: z.object({
|
|
1719
|
+
name: z.string(),
|
|
1720
|
+
version: z.string()
|
|
1721
|
+
}).nullable(),
|
|
1722
|
+
skill: z.object({
|
|
1723
|
+
name: z.string(),
|
|
1724
|
+
expected_version: z.string()
|
|
1725
|
+
}),
|
|
1726
|
+
catalog: z.strictObject({
|
|
1727
|
+
counts: z.strictObject({
|
|
1728
|
+
cli_commands: z.number().int().min(0),
|
|
1729
|
+
mcp_tools: z.number().int().min(0),
|
|
1730
|
+
mcp_prompts: z.number().int().min(0)
|
|
1731
|
+
}),
|
|
1732
|
+
digests: z.strictObject({
|
|
1733
|
+
tools_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
1734
|
+
prompts_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
1735
|
+
combined_sha256: z.string().regex(/^[a-f0-9]{64}$/u)
|
|
1736
|
+
})
|
|
1737
|
+
}),
|
|
1738
|
+
protocol_features: z.object({
|
|
1739
|
+
progress: z.boolean(),
|
|
1740
|
+
cancellation: z.boolean(),
|
|
1741
|
+
elicitation: z.boolean()
|
|
1742
|
+
}),
|
|
1743
|
+
alignment: z.object({
|
|
1744
|
+
state: z.enum([
|
|
1745
|
+
"aligned",
|
|
1746
|
+
"mcp_server_restart_required",
|
|
1747
|
+
"unknown"
|
|
1748
|
+
]),
|
|
1749
|
+
reasons: z.array(z.string()),
|
|
1750
|
+
remediation: z.string().nullable()
|
|
1751
|
+
})
|
|
1752
|
+
})
|
|
1753
|
+
}).passthrough();
|
|
1754
|
+
nullableText = z.string().nullable();
|
|
1755
|
+
addressList = z.array(z.string());
|
|
1756
|
+
addressedEntry = z.object({
|
|
1757
|
+
address: z.string(),
|
|
1758
|
+
name: z.string()
|
|
1759
|
+
});
|
|
1760
|
+
containingProcedureResolution = z.discriminatedUnion("found", [z.object({
|
|
1761
|
+
query_address: z.string(),
|
|
1762
|
+
found: z.literal(true),
|
|
1763
|
+
procedure: procedureIdentitySchema
|
|
1764
|
+
}), z.object({
|
|
1765
|
+
query_address: z.string(),
|
|
1766
|
+
found: z.literal(false),
|
|
1767
|
+
procedure: z.null(),
|
|
1768
|
+
reason: z.enum(["outside_segments", "not_in_procedure"])
|
|
1769
|
+
})]);
|
|
1770
|
+
unavailable = z.object({
|
|
1771
|
+
available: z.literal(false),
|
|
1772
|
+
reason: z.string()
|
|
1773
|
+
});
|
|
1774
|
+
availableMemoryPermissions = z.object({
|
|
1775
|
+
available: z.literal(true),
|
|
1776
|
+
source: z.literal("ghidra-memory-block")
|
|
1777
|
+
});
|
|
1778
|
+
addressedValue = z.object({
|
|
1779
|
+
address: z.string(),
|
|
1780
|
+
value: z.string(),
|
|
1781
|
+
symbol: z.object({
|
|
1782
|
+
primary: z.boolean(),
|
|
1783
|
+
dynamic: z.boolean(),
|
|
1784
|
+
external: z.boolean(),
|
|
1785
|
+
type: z.string(),
|
|
1786
|
+
source: z.enum([
|
|
1787
|
+
"default",
|
|
1788
|
+
"analysis",
|
|
1789
|
+
"ai",
|
|
1790
|
+
"imported",
|
|
1791
|
+
"user_defined"
|
|
1792
|
+
])
|
|
1793
|
+
}).optional(),
|
|
1794
|
+
procedure: z.object({
|
|
1795
|
+
external: z.boolean(),
|
|
1796
|
+
thunk: z.boolean(),
|
|
1797
|
+
thunk_target: z.string().nullable()
|
|
1798
|
+
}).optional(),
|
|
1799
|
+
string: z.object({
|
|
1800
|
+
encoding: z.string(),
|
|
1801
|
+
termination: z.enum(["missing", "present_or_not_required"]),
|
|
1802
|
+
byte_length: z.number().int().min(0)
|
|
1803
|
+
}).optional()
|
|
1804
|
+
});
|
|
1805
|
+
memoryRegionOutput = z.object({
|
|
1806
|
+
name: z.string(),
|
|
1807
|
+
start: z.string(),
|
|
1808
|
+
end: z.string(),
|
|
1809
|
+
readable: z.boolean().nullable(),
|
|
1810
|
+
writable: z.boolean().nullable(),
|
|
1811
|
+
executable: z.boolean().nullable(),
|
|
1812
|
+
permissions: z.union([unavailable, availableMemoryPermissions]),
|
|
1813
|
+
provenance: z.enum(["hopper-public-python-api", "ghidra-memory-block"]),
|
|
1814
|
+
address_space: z.string().optional(),
|
|
1815
|
+
image_base: z.string().optional(),
|
|
1816
|
+
initialized: z.boolean().optional(),
|
|
1817
|
+
overlay: z.boolean().optional()
|
|
1818
|
+
});
|
|
1819
|
+
segmentOutput = evidenceResultOf(z.array(memoryRegionOutput.extend({ sections: z.array(memoryRegionOutput) })));
|
|
1820
|
+
procedureInfoOutput = evidenceResultOf(z.object({
|
|
1821
|
+
name: z.string(),
|
|
1822
|
+
entrypoint: z.string(),
|
|
1823
|
+
basicblock_count: z.number().int().min(0),
|
|
1824
|
+
length: z.number().min(0),
|
|
1825
|
+
signature: nullableText,
|
|
1826
|
+
locals: z.array(localVariableSchema),
|
|
1827
|
+
classification: procedureClassificationSchema.nullable(),
|
|
1828
|
+
body: functionBodySchema
|
|
1829
|
+
}));
|
|
1830
|
+
symbolDiscoveryOutput = (property) => evidenceResultOf(z.object({
|
|
1831
|
+
count: z.number().int().min(0),
|
|
1832
|
+
[property]: z.array(addressedEntry)
|
|
1833
|
+
}));
|
|
1834
|
+
graphNode = z.discriminatedUnion("status", [z.object({
|
|
1835
|
+
address: z.string(),
|
|
1836
|
+
status: z.literal("ok"),
|
|
1837
|
+
calls: z.array(z.string()),
|
|
1838
|
+
relationship_coverage: relationshipCoverageSchema,
|
|
1839
|
+
limitations: z.array(z.string()).optional()
|
|
1840
|
+
}), z.object({
|
|
1841
|
+
address: z.string(),
|
|
1842
|
+
status: z.literal("error"),
|
|
1843
|
+
error: analysisErrorProjectionSchema
|
|
1844
|
+
})]);
|
|
1845
|
+
functionDossierOutput = evidenceResultOf(functionDossierSchema);
|
|
1846
|
+
})))();
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
//#endregion
|
|
1850
|
+
//#region dist/domain/apple/interfaceBuilderKeyedArchive.js
|
|
1851
|
+
var recordSchema, objectNode, connection, isUIKitRuntimeConnectionClass, interfaceBuilderConnectionFieldNames, parseInterfaceBuilderRecords, archiveUid, HIERARCHY_KEY, keyedArchiveTable, parseKeyedArchive, record, firstString, archivedObjectReference, firstObjectReference, classifyObject, classifyConnection, jsonSafeRecord;
|
|
1852
|
+
function init_interfaceBuilderKeyedArchive() {
|
|
1853
|
+
return (init_interfaceBuilderKeyedArchive = __esmMin((() => {
|
|
1854
|
+
init_jsonValue();
|
|
1855
|
+
recordSchema = z.record(z.string(), z.unknown());
|
|
1856
|
+
objectNode = z.strictObject({
|
|
1857
|
+
id: z.string().min(1),
|
|
1858
|
+
kind: z.enum([
|
|
1859
|
+
"view_controller",
|
|
1860
|
+
"view",
|
|
1861
|
+
"control",
|
|
1862
|
+
"constraint",
|
|
1863
|
+
"layout_guide",
|
|
1864
|
+
"resource",
|
|
1865
|
+
"placeholder",
|
|
1866
|
+
"external_object",
|
|
1867
|
+
"other"
|
|
1868
|
+
]),
|
|
1869
|
+
class_name: z.string().nullable(),
|
|
1870
|
+
name: z.string().min(1),
|
|
1871
|
+
attributes: z.record(z.string(), jsonValueSchema)
|
|
1872
|
+
});
|
|
1873
|
+
connection = z.strictObject({
|
|
1874
|
+
id: z.string().min(1),
|
|
1875
|
+
kind: z.enum([
|
|
1876
|
+
"outlet",
|
|
1877
|
+
"action",
|
|
1878
|
+
"segue",
|
|
1879
|
+
"other"
|
|
1880
|
+
]),
|
|
1881
|
+
source_id: z.string().min(1),
|
|
1882
|
+
destination_id: z.string().nullable(),
|
|
1883
|
+
label: z.string().nullable(),
|
|
1884
|
+
attributes: z.record(z.string(), jsonValueSchema)
|
|
1885
|
+
});
|
|
1886
|
+
isUIKitRuntimeConnectionClass = (className) => /^UIRuntime\w*Connection$/u.test(className);
|
|
1887
|
+
interfaceBuilderConnectionFieldNames = (className) => isUIKitRuntimeConnectionClass(className) ? {
|
|
1888
|
+
source: "UISource",
|
|
1889
|
+
destination: "UIDestination",
|
|
1890
|
+
label: "UILabel"
|
|
1891
|
+
} : {
|
|
1892
|
+
source: "NSSource",
|
|
1893
|
+
destination: "NSDestination",
|
|
1894
|
+
label: "NSLabel"
|
|
1895
|
+
};
|
|
1896
|
+
parseInterfaceBuilderRecords = (value) => {
|
|
1897
|
+
const root = record(value);
|
|
1898
|
+
const keyed = parseKeyedArchive(root);
|
|
1899
|
+
if (keyed !== null) return keyed;
|
|
1900
|
+
const objectsRaw = record(root["com.apple.ibtool.document.objects"]);
|
|
1901
|
+
const connectionsRaw = record(root["com.apple.ibtool.document.connections"]);
|
|
1902
|
+
const hierarchyRaw = root["com.apple.ibtool.document.hierarchy"];
|
|
1903
|
+
const classesRaw = record(root["com.apple.ibtool.document.classes"]);
|
|
1904
|
+
const objects = [];
|
|
1905
|
+
const connections = [];
|
|
1906
|
+
let omittedConnections = 0;
|
|
1907
|
+
const objectEntries = Object.entries(objectsRaw);
|
|
1908
|
+
for (const [id, raw] of objectEntries.slice(0, 2e4)) {
|
|
1909
|
+
const attributes = record(raw);
|
|
1910
|
+
const className = firstString(attributes["customClass"], attributes["class"], attributes["isa"]);
|
|
1911
|
+
const label = firstString(attributes["label"], attributes["title"], attributes["name"], className);
|
|
1912
|
+
const carried = new Set();
|
|
1913
|
+
if (attributes["customClass"] === className) carried.add("customClass");
|
|
1914
|
+
if (attributes["label"] === label) carried.add("label");
|
|
1915
|
+
if (attributes["objectID"] === id) carried.add("objectID");
|
|
1916
|
+
objects.push(objectNode.parse({
|
|
1917
|
+
id,
|
|
1918
|
+
kind: classifyObject(className),
|
|
1919
|
+
class_name: className,
|
|
1920
|
+
name: label ?? id,
|
|
1921
|
+
attributes: jsonSafeRecord(Object.fromEntries(Object.entries(attributes).filter(([key]) => !carried.has(key))))
|
|
1922
|
+
}));
|
|
1923
|
+
}
|
|
1924
|
+
for (const [sourceId, rawConnections] of Object.entries(connectionsRaw)) {
|
|
1925
|
+
if (!Array.isArray(rawConnections)) continue;
|
|
1926
|
+
for (const [index, raw] of rawConnections.entries()) {
|
|
1927
|
+
if (connections.length >= 4e4) {
|
|
1928
|
+
omittedConnections += rawConnections.length - index;
|
|
1929
|
+
break;
|
|
1930
|
+
}
|
|
1931
|
+
const item = record(raw);
|
|
1932
|
+
const type = firstString(item.type, item.connectionType) ?? "unknown";
|
|
1933
|
+
const destination = firstString(item["destination-id"], item.destinationId);
|
|
1934
|
+
const label = firstString(item.label, item.selector, item.identifier);
|
|
1935
|
+
connections.push(connection.parse({
|
|
1936
|
+
id: `${sourceId}:connection:${index}`,
|
|
1937
|
+
kind: classifyConnection(type),
|
|
1938
|
+
source_id: sourceId,
|
|
1939
|
+
destination_id: destination,
|
|
1940
|
+
label,
|
|
1941
|
+
attributes: jsonSafeRecord(item)
|
|
1942
|
+
}));
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
return {
|
|
1946
|
+
objects,
|
|
1947
|
+
connections,
|
|
1948
|
+
hierarchy: Array.isArray(hierarchyRaw) ? hierarchyRaw.slice(0, 2e4) : [],
|
|
1949
|
+
classes: classesRaw,
|
|
1950
|
+
objectCount: objectEntries.length,
|
|
1951
|
+
omittedObjects: Math.max(0, objectEntries.length - 2e4),
|
|
1952
|
+
omittedConnections,
|
|
1953
|
+
unresolvedConnections: 0,
|
|
1954
|
+
omittedHierarchyReferences: 0
|
|
1955
|
+
};
|
|
1956
|
+
};
|
|
1957
|
+
archiveUid = (value) => {
|
|
1958
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return undefined;
|
|
1959
|
+
if (Object.keys(value).length !== 1) return undefined;
|
|
1960
|
+
const item = record(value);
|
|
1961
|
+
const marker = Object.hasOwn(item, "UID") ? item.UID : item["CF$UID"];
|
|
1962
|
+
return typeof marker === "number" && Number.isInteger(marker) ? marker : undefined;
|
|
1963
|
+
};
|
|
1964
|
+
HIERARCHY_KEY = /(?:subviews|contentview|childviewcontrollers|children|views)$/iu;
|
|
1965
|
+
keyedArchiveTable = (objectTable) => {
|
|
1966
|
+
const classNameOf = (value) => {
|
|
1967
|
+
const classReference = record(value).$class;
|
|
1968
|
+
const uid = archiveUid(classReference);
|
|
1969
|
+
return firstString(record(uid === undefined ? classReference : objectTable[uid]).$classname);
|
|
1970
|
+
};
|
|
1971
|
+
/** The string an archived string object holds, if it is one. */
|
|
1972
|
+
const archivedString = (target) => {
|
|
1973
|
+
if (typeof target === "string") return target;
|
|
1974
|
+
const text = record(target)["NS.string"];
|
|
1975
|
+
return typeof text === "string" && /^NS(?:Mutable)?String$/u.test(classNameOf(target) ?? "") ? text : undefined;
|
|
1976
|
+
};
|
|
1977
|
+
const text = (value) => {
|
|
1978
|
+
const uid = archiveUid(value);
|
|
1979
|
+
return firstString(uid === undefined ? value : archivedString(objectTable[uid]));
|
|
1980
|
+
};
|
|
1981
|
+
const authoredId = (item) => firstString(text(item.objectID), text(item["object-id"]));
|
|
1982
|
+
const reference = (uid) => {
|
|
1983
|
+
const target = uid === 0 ? null : objectTable[uid];
|
|
1984
|
+
if (target === undefined || target === null) return null;
|
|
1985
|
+
if (typeof target !== "object") return target;
|
|
1986
|
+
const string = archivedString(target);
|
|
1987
|
+
if (string !== undefined) return string;
|
|
1988
|
+
const objectId = authoredId(record(target));
|
|
1989
|
+
return {
|
|
1990
|
+
archiveUID: uid,
|
|
1991
|
+
...objectId === null ? {} : { objectID: objectId },
|
|
1992
|
+
className: classNameOf(target)
|
|
1993
|
+
};
|
|
1994
|
+
};
|
|
1995
|
+
/** Resolve one object's own fields, leaving references to other objects as stubs. */
|
|
1996
|
+
const resolve = (value) => {
|
|
1997
|
+
const uid = archiveUid(value);
|
|
1998
|
+
if (uid !== undefined) return reference(uid);
|
|
1999
|
+
if (Array.isArray(value)) return value.map(resolve);
|
|
2000
|
+
if (typeof value !== "object" || value === null) return value;
|
|
2001
|
+
const output = {};
|
|
2002
|
+
for (const [key, child] of Object.entries(value)) {
|
|
2003
|
+
if (key === "$class") output.className = classNameOf(value);
|
|
2004
|
+
else output[key] = resolve(child);
|
|
2005
|
+
}
|
|
2006
|
+
return output;
|
|
2007
|
+
};
|
|
2008
|
+
const hierarchy = (start) => {
|
|
2009
|
+
let omittedReferences = 0;
|
|
2010
|
+
const visited = new Set();
|
|
2011
|
+
const root = [];
|
|
2012
|
+
const pending = [{
|
|
2013
|
+
value: start,
|
|
2014
|
+
output: root
|
|
2015
|
+
}];
|
|
2016
|
+
const appendNode = (item, uid, output) => {
|
|
2017
|
+
const objectId = firstString(authoredId(item), text(item.id), uid === undefined ? null : String(uid));
|
|
2018
|
+
if (objectId === null) {
|
|
2019
|
+
for (const [key, child] of Object.entries(item).reverse()) if (HIERARCHY_KEY.test(key)) pending.push({
|
|
2020
|
+
value: child,
|
|
2021
|
+
output
|
|
2022
|
+
});
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
const children = [];
|
|
2026
|
+
output.push({
|
|
2027
|
+
objectID: objectId,
|
|
2028
|
+
children
|
|
2029
|
+
});
|
|
2030
|
+
for (const [key, child] of Object.entries(item).reverse()) if (HIERARCHY_KEY.test(key)) pending.push({
|
|
2031
|
+
value: child,
|
|
2032
|
+
output: children
|
|
2033
|
+
});
|
|
2034
|
+
};
|
|
2035
|
+
while (pending.length > 0) {
|
|
2036
|
+
const entry = pending.pop();
|
|
2037
|
+
if (entry === undefined) break;
|
|
2038
|
+
const { value, output } = entry;
|
|
2039
|
+
const uid = archiveUid(value);
|
|
2040
|
+
if (uid !== undefined) {
|
|
2041
|
+
if (uid === 0) continue;
|
|
2042
|
+
const target = objectTable[uid];
|
|
2043
|
+
if (target === undefined) {
|
|
2044
|
+
omittedReferences += 1;
|
|
2045
|
+
continue;
|
|
2046
|
+
}
|
|
2047
|
+
if (visited.has(uid)) continue;
|
|
2048
|
+
visited.add(uid);
|
|
2049
|
+
if (Array.isArray(target)) {
|
|
2050
|
+
for (let index = target.length - 1; index >= 0; index -= 1) {
|
|
2051
|
+
const child = target[index];
|
|
2052
|
+
if (child !== undefined) pending.push({
|
|
2053
|
+
value: child,
|
|
2054
|
+
output
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
continue;
|
|
2058
|
+
}
|
|
2059
|
+
if (typeof target !== "object" || target === null) continue;
|
|
2060
|
+
const item = record(target);
|
|
2061
|
+
if (archivedArrayClass(item.$class)) {
|
|
2062
|
+
const members = item["NS.objects"];
|
|
2063
|
+
if (Array.isArray(members)) for (let index = members.length - 1; index >= 0; index -= 1) {
|
|
2064
|
+
const child = members[index];
|
|
2065
|
+
if (child !== undefined) pending.push({
|
|
2066
|
+
value: child,
|
|
2067
|
+
output
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
continue;
|
|
2071
|
+
}
|
|
2072
|
+
appendNode(item, uid, output);
|
|
2073
|
+
continue;
|
|
2074
|
+
}
|
|
2075
|
+
if (Array.isArray(value)) {
|
|
2076
|
+
for (let index = value.length - 1; index >= 0; index -= 1) {
|
|
2077
|
+
const child = value[index];
|
|
2078
|
+
if (child !== undefined) pending.push({
|
|
2079
|
+
value: child,
|
|
2080
|
+
output
|
|
2081
|
+
});
|
|
2082
|
+
}
|
|
2083
|
+
} else if (typeof value === "object" && value !== null) {
|
|
2084
|
+
appendNode(record(value), undefined, output);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
return {
|
|
2088
|
+
items: root,
|
|
2089
|
+
omittedReferences
|
|
2090
|
+
};
|
|
2091
|
+
};
|
|
2092
|
+
const archivedArrayClass = (classReference) => {
|
|
2093
|
+
const uid = archiveUid(classReference);
|
|
2094
|
+
const descriptor = record(uid === undefined ? classReference : objectTable[uid]);
|
|
2095
|
+
const classNames = Array.isArray(descriptor.$classes) ? descriptor.$classes.filter((name) => typeof name === "string") : [];
|
|
2096
|
+
return classNames.includes("NSArray") || classNames.includes("NSMutableArray");
|
|
2097
|
+
};
|
|
2098
|
+
return {
|
|
2099
|
+
resolve,
|
|
2100
|
+
hierarchy
|
|
2101
|
+
};
|
|
2102
|
+
};
|
|
2103
|
+
parseKeyedArchive = (root) => {
|
|
2104
|
+
if (root.$archiver !== "NSKeyedArchiver" || !Array.isArray(root.$objects)) return null;
|
|
2105
|
+
const objectTable = root.$objects;
|
|
2106
|
+
const { resolve, hierarchy: toHierarchy } = keyedArchiveTable(objectTable);
|
|
2107
|
+
const objects = [];
|
|
2108
|
+
const connections = [];
|
|
2109
|
+
let objectCount = 0;
|
|
2110
|
+
let omittedConnections = 0;
|
|
2111
|
+
let unresolvedConnections = 0;
|
|
2112
|
+
for (const [index, raw] of objectTable.entries()) {
|
|
2113
|
+
if (index === 0) continue;
|
|
2114
|
+
const resolved = record(resolve(raw));
|
|
2115
|
+
const className = firstString(resolved.className);
|
|
2116
|
+
if (className === null) continue;
|
|
2117
|
+
objectCount += 1;
|
|
2118
|
+
const fields = Object.fromEntries(Object.entries(resolved).filter(([key]) => key !== "className"));
|
|
2119
|
+
const authoredId = firstString(fields.objectID, fields["object-id"]);
|
|
2120
|
+
const objectId = authoredId ?? (typeof fields.archiveUID === "number" ? String(fields.archiveUID) : String(index));
|
|
2121
|
+
const kind = classifyObject(className);
|
|
2122
|
+
if (objects.length < 2e4) objects.push(objectNode.parse({
|
|
2123
|
+
id: objectId,
|
|
2124
|
+
kind,
|
|
2125
|
+
class_name: className,
|
|
2126
|
+
name: firstString(fields.label, fields.title, fields.identifier, fields.accessibilityLabel, className) ?? `object ${String(index)}`,
|
|
2127
|
+
attributes: jsonSafeRecord(fields)
|
|
2128
|
+
}));
|
|
2129
|
+
if (/(?:Outlet|Connection|Segue|ActionConnection|ControlConnector)/iu.test(className)) {
|
|
2130
|
+
const controlAction = /ControlConnector/iu.test(className);
|
|
2131
|
+
const uiKit = isUIKitRuntimeConnectionClass(className);
|
|
2132
|
+
const connectionFields = interfaceBuilderConnectionFieldNames(className);
|
|
2133
|
+
const source = uiKit ? archivedObjectReference(fields[connectionFields.source]) : firstObjectReference(controlAction ? fields.destination : fields.source, archivedObjectReference(fields[connectionFields.source]), controlAction ? fields.to : fields.from, controlAction ? fields.target : fields.owner);
|
|
2134
|
+
if (source === null) {
|
|
2135
|
+
unresolvedConnections += 1;
|
|
2136
|
+
continue;
|
|
2137
|
+
}
|
|
2138
|
+
const kind = controlAction ? "action" : classifyConnection(className);
|
|
2139
|
+
const parsedConnection = connection.parse({
|
|
2140
|
+
id: `archive:${objectId}`,
|
|
2141
|
+
kind,
|
|
2142
|
+
source_id: source,
|
|
2143
|
+
destination_id: uiKit ? archivedObjectReference(fields[connectionFields.destination]) : firstObjectReference(controlAction ? fields.source : fields.destination, archivedObjectReference(fields[connectionFields.destination]), controlAction ? fields.from : fields.to, controlAction ? fields.owner : fields.target),
|
|
2144
|
+
label: uiKit ? firstString(fields[connectionFields.label]) : firstString(fields.label, fields[connectionFields.label], fields.selector, fields.identifier, fields.action),
|
|
2145
|
+
attributes: jsonSafeRecord(fields)
|
|
2146
|
+
});
|
|
2147
|
+
if (connections.length < 4e4) connections.push(parsedConnection);
|
|
2148
|
+
else omittedConnections += 1;
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
const top = record(root.$top);
|
|
2152
|
+
const hierarchy = toHierarchy(top.root ?? top.UITopLevelObjectsKey);
|
|
2153
|
+
const classes = Object.fromEntries(objectTable.flatMap((raw) => {
|
|
2154
|
+
const item = record(raw);
|
|
2155
|
+
const name = firstString(item.$classname);
|
|
2156
|
+
return name === null ? [] : [[name, { superclasses: Array.isArray(item.$classes) ? item.$classes : [] }]];
|
|
2157
|
+
}));
|
|
2158
|
+
return {
|
|
2159
|
+
objects,
|
|
2160
|
+
connections,
|
|
2161
|
+
hierarchy: hierarchy.items,
|
|
2162
|
+
classes,
|
|
2163
|
+
objectCount,
|
|
2164
|
+
omittedObjects: Math.max(0, objectCount - 2e4),
|
|
2165
|
+
omittedConnections,
|
|
2166
|
+
unresolvedConnections,
|
|
2167
|
+
omittedHierarchyReferences: hierarchy.omittedReferences
|
|
2168
|
+
};
|
|
2169
|
+
};
|
|
2170
|
+
record = (value) => recordSchema.safeParse(value).data ?? {};
|
|
2171
|
+
firstString = (...values) => {
|
|
2172
|
+
for (const value of values) if (typeof value === "string" && value.length > 0) return value;
|
|
2173
|
+
return null;
|
|
2174
|
+
};
|
|
2175
|
+
archivedObjectReference = (value) => {
|
|
2176
|
+
const item = record(value);
|
|
2177
|
+
if (typeof item.archiveUID !== "number") return null;
|
|
2178
|
+
return firstString(item.objectID, item["object-id"]) ?? String(item.archiveUID);
|
|
2179
|
+
};
|
|
2180
|
+
firstObjectReference = (...values) => {
|
|
2181
|
+
for (const value of values) {
|
|
2182
|
+
const direct = firstString(value);
|
|
2183
|
+
if (direct !== null) return direct;
|
|
2184
|
+
const item = record(value);
|
|
2185
|
+
const objectId = firstString(item.objectID, item["object-id"], item.id, item.identifier, typeof item.archiveUID === "number" ? String(item.archiveUID) : null);
|
|
2186
|
+
if (objectId !== null) return objectId;
|
|
2187
|
+
}
|
|
2188
|
+
return null;
|
|
2189
|
+
};
|
|
2190
|
+
classifyObject = (className) => {
|
|
2191
|
+
const value = className?.toLowerCase() ?? "";
|
|
2192
|
+
if (value.includes("constraint")) return "constraint";
|
|
2193
|
+
if (value.includes("layoutguide")) return "layout_guide";
|
|
2194
|
+
if (value.includes("placeholder") || value.includes("firstresponder") || value === "uiproxyobject") return "placeholder";
|
|
2195
|
+
if (value.includes("image") || value.includes("color") || value.includes("font")) return "resource";
|
|
2196
|
+
if (value.includes("external")) return "external_object";
|
|
2197
|
+
if (value.includes("viewcontroller") || value.includes("windowcontroller")) return "view_controller";
|
|
2198
|
+
if (value.includes("button") || value.includes("control") || value.includes("textfield") || value.includes("slider") || value.includes("menuitem")) return "control";
|
|
2199
|
+
if (value.includes("view") || value.includes("window") || value.includes("cell")) return "view";
|
|
2200
|
+
return "other";
|
|
2201
|
+
};
|
|
2202
|
+
classifyConnection = (type) => {
|
|
2203
|
+
const value = type.toLowerCase();
|
|
2204
|
+
if (value.includes("outlet")) return "outlet";
|
|
2205
|
+
if (value.includes("action")) return "action";
|
|
2206
|
+
if (value.includes("segue")) return "segue";
|
|
2207
|
+
return "other";
|
|
2208
|
+
};
|
|
2209
|
+
jsonSafeRecord = (value) => Object.fromEntries(Object.entries(value).flatMap(([key, item]) => {
|
|
2210
|
+
try {
|
|
2211
|
+
const serialized = JSON.stringify(item);
|
|
2212
|
+
if (serialized === undefined) return [];
|
|
2213
|
+
const parsed = jsonValueSchema.safeParse(JSON.parse(serialized));
|
|
2214
|
+
return parsed.success ? [[key, parsed.data]] : [];
|
|
2215
|
+
} catch (cause) {
|
|
2216
|
+
void cause;
|
|
2217
|
+
return [];
|
|
2218
|
+
}
|
|
2219
|
+
}));
|
|
2220
|
+
})))();
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region dist/domain/swiftSymbolClassification.js
|
|
2225
|
+
var LEGACY_CATEGORIES, NOMINAL_CATEGORIES, classifySwiftSymbol, SWIFT_MANGLING_PREFIXES, isSwiftMangledSymbolName, identifierEnd;
|
|
2226
|
+
function init_swiftSymbolClassification() {
|
|
2227
|
+
return (init_swiftSymbolClassification = __esmMin((() => {
|
|
2228
|
+
LEGACY_CATEGORIES = [
|
|
2229
|
+
["_TtC", "classes"],
|
|
2230
|
+
["_TtV", "structs"],
|
|
2231
|
+
["_TtO", "enums"],
|
|
2232
|
+
["_TtP", "protocols"],
|
|
2233
|
+
["_TtE", "extensions"]
|
|
2234
|
+
];
|
|
2235
|
+
NOMINAL_CATEGORIES = new Map([
|
|
2236
|
+
["C", "classes"],
|
|
2237
|
+
["V", "structs"],
|
|
2238
|
+
["O", "enums"],
|
|
2239
|
+
["P", "protocols"]
|
|
2240
|
+
]);
|
|
2241
|
+
classifySwiftSymbol = (name) => {
|
|
2242
|
+
const prefix = /^_?(?:\$[sS]|_T0)/u.exec(name);
|
|
2243
|
+
if (prefix === null) {
|
|
2244
|
+
if (!name.includes("_Tt")) return undefined;
|
|
2245
|
+
return { category: LEGACY_CATEGORIES.find(([prefix]) => name.startsWith(prefix))?.[1] ?? null };
|
|
2246
|
+
}
|
|
2247
|
+
const mangling = name.slice(prefix[0].length);
|
|
2248
|
+
let offset = identifierEnd(mangling, 0);
|
|
2249
|
+
if (offset === undefined) return { category: null };
|
|
2250
|
+
let category = null;
|
|
2251
|
+
for (;;) {
|
|
2252
|
+
const end = identifierEnd(mangling, offset);
|
|
2253
|
+
if (end === undefined) break;
|
|
2254
|
+
const kind = mangling.charAt(end);
|
|
2255
|
+
const nominal = NOMINAL_CATEGORIES.get(kind);
|
|
2256
|
+
if (nominal === undefined) {
|
|
2257
|
+
if (mangling.slice(end) === "Mp") category = "protocols";
|
|
2258
|
+
else if (kind === "E" && category !== null) category = "extensions";
|
|
2259
|
+
break;
|
|
2260
|
+
}
|
|
2261
|
+
category = nominal;
|
|
2262
|
+
offset = end + 1;
|
|
2263
|
+
}
|
|
2264
|
+
return { category };
|
|
2265
|
+
};
|
|
2266
|
+
SWIFT_MANGLING_PREFIXES = [
|
|
2267
|
+
"_T0",
|
|
2268
|
+
"$S",
|
|
2269
|
+
"_$S",
|
|
2270
|
+
"$s",
|
|
2271
|
+
"_$s",
|
|
2272
|
+
"@__swiftmacro_",
|
|
2273
|
+
"$e",
|
|
2274
|
+
"_$e"
|
|
2275
|
+
];
|
|
2276
|
+
isSwiftMangledSymbolName = (name) => SWIFT_MANGLING_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
2277
|
+
identifierEnd = (mangling, offset) => {
|
|
2278
|
+
const lengthToken = /^[1-9][0-9]*/u.exec(mangling.slice(offset))?.[0];
|
|
2279
|
+
if (lengthToken === undefined) return undefined;
|
|
2280
|
+
const start = offset + lengthToken.length;
|
|
2281
|
+
const end = start + Number(lengthToken);
|
|
2282
|
+
if (!Number.isSafeInteger(end) || end > mangling.length || !/^[A-Za-z_][A-Za-z0-9_]*$/u.test(mangling.slice(start, end))) return undefined;
|
|
2283
|
+
return end;
|
|
2284
|
+
};
|
|
2285
|
+
})))();
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
//#endregion
|
|
2289
|
+
//#region dist/domain/native/objcSwiftMetadata.js
|
|
2290
|
+
var objcMethodTypeSchema, objcPropertyAttributeSchema, objcMethodSchema, objcPropertySchema, objcProtocolSchema, objcClassSchema, nativeMetadataLocationSchema, nativeMetadataDecodeSchema, nativeMetadataEvidenceSchema, objcIvarSchema, objcProtocolRecordSchema, objcDispatchImplementationSchema, objcCategorySchema, swiftConformanceSchema, swiftDispatchSlotSchema, relativePointerSchema, swiftSymbolSchema, nativeMetadataCoverageSchema, swiftDeclKindSchema, swiftAccessLevelSchema, swiftDeclSchema, dbOperationSchema, dbSaveResultSchema, objcSwiftMetadataSchema, nativeDispatchMetadataResultSchema, inspectNativeDispatchMetadata, parseMetadataAddress;
|
|
2291
|
+
function init_objcSwiftMetadata() {
|
|
2292
|
+
return (init_objcSwiftMetadata = __esmMin((() => {
|
|
2293
|
+
init_evidence();
|
|
2294
|
+
init_swiftSymbolClassification();
|
|
2295
|
+
init_unicodeCodePointOrder();
|
|
2296
|
+
objcMethodTypeSchema = z.enum([
|
|
2297
|
+
"instance",
|
|
2298
|
+
"class",
|
|
2299
|
+
"ivar_getter",
|
|
2300
|
+
"ivar_setter"
|
|
2301
|
+
]);
|
|
2302
|
+
objcPropertyAttributeSchema = z.strictObject({
|
|
2303
|
+
name: z.string().min(1),
|
|
2304
|
+
value: z.string()
|
|
2305
|
+
});
|
|
2306
|
+
objcMethodSchema = z.strictObject({
|
|
2307
|
+
selector: z.string().min(1),
|
|
2308
|
+
method_type: objcMethodTypeSchema,
|
|
2309
|
+
address: z.number().int().nullable(),
|
|
2310
|
+
is_required: z.boolean().nullable(),
|
|
2311
|
+
is_optional: z.boolean().nullable()
|
|
2312
|
+
});
|
|
2313
|
+
objcPropertySchema = z.strictObject({
|
|
2314
|
+
name: z.string().min(1),
|
|
2315
|
+
type_encoding: z.string().nullable(),
|
|
2316
|
+
attributes: z.array(objcPropertyAttributeSchema),
|
|
2317
|
+
atomicity: z.enum(["atomic", "nonatomic"]).nullable(),
|
|
2318
|
+
is_readonly: z.boolean().nullable(),
|
|
2319
|
+
getter: z.string().nullable(),
|
|
2320
|
+
setter: z.string().nullable()
|
|
2321
|
+
});
|
|
2322
|
+
objcProtocolSchema = z.strictObject({
|
|
2323
|
+
name: z.string().min(1),
|
|
2324
|
+
methods: z.array(objcMethodSchema).default([]),
|
|
2325
|
+
optional_methods: z.array(objcMethodSchema).default([]),
|
|
2326
|
+
properties: z.array(objcPropertySchema).default([])
|
|
2327
|
+
});
|
|
2328
|
+
objcClassSchema = z.strictObject({
|
|
2329
|
+
name: z.string().min(1),
|
|
2330
|
+
super_class: z.string().nullable(),
|
|
2331
|
+
is_meta_class: z.boolean().nullable(),
|
|
2332
|
+
is_root_class: z.boolean().nullable(),
|
|
2333
|
+
methods: z.array(objcMethodSchema).default([]),
|
|
2334
|
+
properties: z.array(objcPropertySchema).default([]),
|
|
2335
|
+
protocols: z.array(z.string()).default([]),
|
|
2336
|
+
ivar_count: z.number().int().nonnegative().nullable(),
|
|
2337
|
+
instance_size: z.number().int().nonnegative().nullable(),
|
|
2338
|
+
location: z.object({
|
|
2339
|
+
address: z.string().nullable(),
|
|
2340
|
+
file_offset: z.number().int().nonnegative().nullable()
|
|
2341
|
+
}).optional(),
|
|
2342
|
+
superclass_address: z.string().nullable().optional(),
|
|
2343
|
+
metaclass_address: z.string().nullable().optional(),
|
|
2344
|
+
decode: z.object({
|
|
2345
|
+
status: z.enum([
|
|
2346
|
+
"decoded",
|
|
2347
|
+
"partial",
|
|
2348
|
+
"unsupported",
|
|
2349
|
+
"invalid"
|
|
2350
|
+
]),
|
|
2351
|
+
reason: z.string().nullable()
|
|
2352
|
+
}).optional(),
|
|
2353
|
+
evidence: z.array(z.object({
|
|
2354
|
+
kind: z.literal("binary_metadata"),
|
|
2355
|
+
description: z.string(),
|
|
2356
|
+
location: z.object({
|
|
2357
|
+
address: z.string().nullable(),
|
|
2358
|
+
file_offset: z.number().int().nonnegative().nullable()
|
|
2359
|
+
}),
|
|
2360
|
+
artifact_path: z.string(),
|
|
2361
|
+
artifact_sha256: z.string()
|
|
2362
|
+
})).optional()
|
|
2363
|
+
});
|
|
2364
|
+
nativeMetadataLocationSchema = z.strictObject({
|
|
2365
|
+
address: z.string().nullable(),
|
|
2366
|
+
file_offset: z.number().int().nonnegative().nullable()
|
|
2367
|
+
});
|
|
2368
|
+
nativeMetadataDecodeSchema = z.strictObject({
|
|
2369
|
+
status: z.enum([
|
|
2370
|
+
"decoded",
|
|
2371
|
+
"partial",
|
|
2372
|
+
"unsupported",
|
|
2373
|
+
"invalid"
|
|
2374
|
+
]),
|
|
2375
|
+
reason: z.string().nullable()
|
|
2376
|
+
});
|
|
2377
|
+
nativeMetadataEvidenceSchema = z.strictObject({
|
|
2378
|
+
kind: z.enum([
|
|
2379
|
+
"binary_metadata",
|
|
2380
|
+
"interface_builder_resource",
|
|
2381
|
+
"symbol",
|
|
2382
|
+
"reference",
|
|
2383
|
+
"decompiler"
|
|
2384
|
+
]),
|
|
2385
|
+
description: z.string().min(1),
|
|
2386
|
+
provider: providerSchema.optional(),
|
|
2387
|
+
location: nativeMetadataLocationSchema,
|
|
2388
|
+
artifact_path: z.string().min(1).nullable().default(null),
|
|
2389
|
+
artifact_sha256: z.string().regex(/^[a-f0-9]{64}$/u).nullable().default(null)
|
|
2390
|
+
});
|
|
2391
|
+
objcIvarSchema = z.strictObject({
|
|
2392
|
+
class_name: z.string().min(1),
|
|
2393
|
+
name: z.string().min(1),
|
|
2394
|
+
type_encoding: z.string().nullable(),
|
|
2395
|
+
offset: z.number().int().nonnegative().nullable(),
|
|
2396
|
+
size: z.number().int().nonnegative().nullable().default(null),
|
|
2397
|
+
alignment: z.number().int().positive().nullable().default(null),
|
|
2398
|
+
location: nativeMetadataLocationSchema,
|
|
2399
|
+
decode: nativeMetadataDecodeSchema,
|
|
2400
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2401
|
+
});
|
|
2402
|
+
objcProtocolRecordSchema = z.strictObject({
|
|
2403
|
+
name: z.string(),
|
|
2404
|
+
adopted_protocols: z.array(z.string()),
|
|
2405
|
+
methods: z.array(objcMethodSchema),
|
|
2406
|
+
optional_methods: z.array(objcMethodSchema),
|
|
2407
|
+
location: nativeMetadataLocationSchema,
|
|
2408
|
+
decode: nativeMetadataDecodeSchema,
|
|
2409
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2410
|
+
});
|
|
2411
|
+
objcDispatchImplementationSchema = z.strictObject({
|
|
2412
|
+
class_name: z.string().min(1),
|
|
2413
|
+
selector: z.string().min(1),
|
|
2414
|
+
method_type: z.enum(["instance", "class"]),
|
|
2415
|
+
implementation_address: z.string().nullable(),
|
|
2416
|
+
/** Category that adds this method, when it is not defined by the class itself. */
|
|
2417
|
+
category: z.string().nullable().optional(),
|
|
2418
|
+
location: nativeMetadataLocationSchema,
|
|
2419
|
+
decode: nativeMetadataDecodeSchema,
|
|
2420
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2421
|
+
});
|
|
2422
|
+
objcCategorySchema = z.strictObject({
|
|
2423
|
+
name: z.string().min(1),
|
|
2424
|
+
/** Extended class; external classes come from the category's bind symbol. */
|
|
2425
|
+
class_name: z.string().min(1).nullable(),
|
|
2426
|
+
class_source: z.enum([
|
|
2427
|
+
"local",
|
|
2428
|
+
"external",
|
|
2429
|
+
"unresolved"
|
|
2430
|
+
]),
|
|
2431
|
+
instance_methods: z.array(z.string()),
|
|
2432
|
+
class_methods: z.array(z.string()),
|
|
2433
|
+
protocols: z.array(z.string()),
|
|
2434
|
+
properties: z.array(objcPropertySchema),
|
|
2435
|
+
location: nativeMetadataLocationSchema,
|
|
2436
|
+
decode: nativeMetadataDecodeSchema,
|
|
2437
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2438
|
+
});
|
|
2439
|
+
swiftConformanceSchema = z.strictObject({
|
|
2440
|
+
type_name: z.string().min(1),
|
|
2441
|
+
protocol_name: z.string().min(1),
|
|
2442
|
+
module: z.string().nullable(),
|
|
2443
|
+
witness_table: nativeMetadataLocationSchema,
|
|
2444
|
+
location: nativeMetadataLocationSchema,
|
|
2445
|
+
decode: nativeMetadataDecodeSchema,
|
|
2446
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2447
|
+
});
|
|
2448
|
+
swiftDispatchSlotSchema = z.strictObject({
|
|
2449
|
+
owner: z.string().min(1),
|
|
2450
|
+
table_kind: z.enum(["witness_table", "class_vtable"]),
|
|
2451
|
+
slot_index: z.number().int().nonnegative(),
|
|
2452
|
+
requirement: z.string().nullable(),
|
|
2453
|
+
implementation: z.string().nullable(),
|
|
2454
|
+
implementation_address: z.string().nullable(),
|
|
2455
|
+
thunk_address: z.string().nullable(),
|
|
2456
|
+
location: nativeMetadataLocationSchema,
|
|
2457
|
+
decode: nativeMetadataDecodeSchema,
|
|
2458
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2459
|
+
});
|
|
2460
|
+
relativePointerSchema = z.strictObject({
|
|
2461
|
+
field: nativeMetadataLocationSchema,
|
|
2462
|
+
target: nativeMetadataLocationSchema,
|
|
2463
|
+
displacement: z.number().int(),
|
|
2464
|
+
indirectable: z.boolean(),
|
|
2465
|
+
indirect: z.boolean().nullable(),
|
|
2466
|
+
decode: nativeMetadataDecodeSchema,
|
|
2467
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2468
|
+
});
|
|
2469
|
+
swiftSymbolSchema = z.strictObject({
|
|
2470
|
+
mangled_name: z.string().min(1),
|
|
2471
|
+
address: z.string().min(1),
|
|
2472
|
+
decode: nativeMetadataDecodeSchema,
|
|
2473
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1)
|
|
2474
|
+
});
|
|
2475
|
+
nativeMetadataCoverageSchema = z.strictObject({
|
|
2476
|
+
facet: z.string().min(1),
|
|
2477
|
+
status: z.enum([
|
|
2478
|
+
"complete",
|
|
2479
|
+
"partial",
|
|
2480
|
+
"unsupported",
|
|
2481
|
+
"not_requested"
|
|
2482
|
+
]),
|
|
2483
|
+
reason: z.string().nullable(),
|
|
2484
|
+
examined: z.number().int().nonnegative(),
|
|
2485
|
+
decoded: z.number().int().nonnegative()
|
|
2486
|
+
});
|
|
2487
|
+
swiftDeclKindSchema = z.enum([
|
|
2488
|
+
"class",
|
|
2489
|
+
"struct",
|
|
2490
|
+
"enum",
|
|
2491
|
+
"protocol",
|
|
2492
|
+
"extension",
|
|
2493
|
+
"actor",
|
|
2494
|
+
"global_var",
|
|
2495
|
+
"global_func"
|
|
2496
|
+
]);
|
|
2497
|
+
swiftAccessLevelSchema = z.enum([
|
|
2498
|
+
"private",
|
|
2499
|
+
"fileprivate",
|
|
2500
|
+
"internal",
|
|
2501
|
+
"public",
|
|
2502
|
+
"open"
|
|
2503
|
+
]);
|
|
2504
|
+
swiftDeclSchema = z.strictObject({
|
|
2505
|
+
kind: swiftDeclKindSchema,
|
|
2506
|
+
name: z.string().min(1),
|
|
2507
|
+
module: z.string().nullable(),
|
|
2508
|
+
access_level: swiftAccessLevelSchema.default("internal"),
|
|
2509
|
+
super_class: z.string().nullable(),
|
|
2510
|
+
protocols: z.array(z.string()).default([]),
|
|
2511
|
+
is_final: z.boolean().default(false),
|
|
2512
|
+
is_required: z.boolean().default(false),
|
|
2513
|
+
is_convenience_init: z.boolean().default(false),
|
|
2514
|
+
is_override: z.boolean().default(false)
|
|
2515
|
+
});
|
|
2516
|
+
dbOperationSchema = z.enum([
|
|
2517
|
+
"save",
|
|
2518
|
+
"readback",
|
|
2519
|
+
"open_database",
|
|
2520
|
+
"close_database",
|
|
2521
|
+
"export",
|
|
2522
|
+
"import"
|
|
2523
|
+
]);
|
|
2524
|
+
dbSaveResultSchema = z.strictObject({
|
|
2525
|
+
operation: dbOperationSchema,
|
|
2526
|
+
succeeded: z.boolean(),
|
|
2527
|
+
preserved_names: z.number().int().nonnegative().default(0),
|
|
2528
|
+
preserved_comments: z.number().int().nonnegative().default(0),
|
|
2529
|
+
preserved_bookmarks: z.number().int().nonnegative().default(0),
|
|
2530
|
+
database_path: z.string().nullable(),
|
|
2531
|
+
error: z.string().nullable()
|
|
2532
|
+
});
|
|
2533
|
+
objcSwiftMetadataSchema = z.strictObject({
|
|
2534
|
+
objc_classes: z.array(objcClassSchema).default([]),
|
|
2535
|
+
objc_protocols: z.array(objcProtocolSchema).default([]),
|
|
2536
|
+
objc_categories: z.array(objcCategorySchema).default([]),
|
|
2537
|
+
swift_decls: z.array(swiftDeclSchema).default([]),
|
|
2538
|
+
objc_ivars: z.array(objcIvarSchema).default([]),
|
|
2539
|
+
objc_protocol_records: z.array(objcProtocolRecordSchema).default([]),
|
|
2540
|
+
objc_dispatch_implementations: z.array(objcDispatchImplementationSchema).default([]),
|
|
2541
|
+
swift_conformances: z.array(swiftConformanceSchema).default([]),
|
|
2542
|
+
swift_dispatch_slots: z.array(swiftDispatchSlotSchema).default([]),
|
|
2543
|
+
swift_symbols: z.array(swiftSymbolSchema).default([]),
|
|
2544
|
+
relative_pointers: z.array(relativePointerSchema).default([]),
|
|
2545
|
+
coverage: z.array(nativeMetadataCoverageSchema).default([]),
|
|
2546
|
+
db_save_result: dbSaveResultSchema.nullable()
|
|
2547
|
+
});
|
|
2548
|
+
nativeDispatchMetadataResultSchema = z.strictObject({
|
|
2549
|
+
target_sha256: z.string().regex(/^[a-f0-9]{64}$/u).nullable(),
|
|
2550
|
+
provider: z.strictObject({
|
|
2551
|
+
id: z.string().min(1),
|
|
2552
|
+
name: z.string().min(1),
|
|
2553
|
+
version: z.string().nullable()
|
|
2554
|
+
}),
|
|
2555
|
+
analysis_profile_digest: z.string().min(1).nullable(),
|
|
2556
|
+
result: objcSwiftMetadataSchema
|
|
2557
|
+
});
|
|
2558
|
+
inspectNativeDispatchMetadata = (names, maxRecords = 5e3) => {
|
|
2559
|
+
const symbolEvidence = (name, address) => [{
|
|
2560
|
+
kind: "symbol",
|
|
2561
|
+
description: `Provider symbol ${name}`,
|
|
2562
|
+
location: {
|
|
2563
|
+
address,
|
|
2564
|
+
file_offset: null
|
|
2565
|
+
},
|
|
2566
|
+
artifact_path: null,
|
|
2567
|
+
artifact_sha256: null
|
|
2568
|
+
}];
|
|
2569
|
+
const classNames = new Set();
|
|
2570
|
+
const implementations = new Map();
|
|
2571
|
+
const swiftSymbols = [];
|
|
2572
|
+
const examinedNames = names.slice(0, maxRecords);
|
|
2573
|
+
for (const entry of examinedNames) {
|
|
2574
|
+
const classMatch = /(?:OBJC_CLASS_|OBJC_METACLASS_)\$_([^\s]+)/u.exec(entry.name);
|
|
2575
|
+
if (classMatch?.[1] !== undefined) classNames.add(classMatch[1]);
|
|
2576
|
+
const methodMatch = /^([+-])\[([^\s\]]+)\s+([^\]]+)\]$/u.exec(entry.name);
|
|
2577
|
+
if (methodMatch?.[1] !== undefined && methodMatch[2] && methodMatch[3]) {
|
|
2578
|
+
const methodType = methodMatch[1] === "+" ? "class" : "instance";
|
|
2579
|
+
const selector = methodMatch[3];
|
|
2580
|
+
implementations.set(`${methodMatch[2]}:${selector}:${methodType}`, {
|
|
2581
|
+
class_name: methodMatch[2],
|
|
2582
|
+
selector,
|
|
2583
|
+
method_type: methodType,
|
|
2584
|
+
implementation_address: entry.address,
|
|
2585
|
+
location: {
|
|
2586
|
+
address: entry.address,
|
|
2587
|
+
file_offset: null
|
|
2588
|
+
},
|
|
2589
|
+
decode: {
|
|
2590
|
+
status: "partial",
|
|
2591
|
+
reason: "symbol_name_only"
|
|
2592
|
+
},
|
|
2593
|
+
evidence: symbolEvidence(entry.name, entry.address)
|
|
2594
|
+
});
|
|
2595
|
+
classNames.add(methodMatch[2]);
|
|
2596
|
+
}
|
|
2597
|
+
if (isSwiftMangledSymbolName(entry.name) || entry.name.startsWith("_Tt")) swiftSymbols.push({
|
|
2598
|
+
mangled_name: entry.name,
|
|
2599
|
+
address: entry.address,
|
|
2600
|
+
decode: {
|
|
2601
|
+
status: "partial",
|
|
2602
|
+
reason: "mangled_symbol_not_demangled"
|
|
2603
|
+
},
|
|
2604
|
+
evidence: symbolEvidence(entry.name, entry.address)
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2607
|
+
const methodsByClass = new Map();
|
|
2608
|
+
for (const implementation of implementations.values()) {
|
|
2609
|
+
const methods = methodsByClass.get(implementation.class_name) ?? [];
|
|
2610
|
+
methods.push({
|
|
2611
|
+
selector: implementation.selector,
|
|
2612
|
+
method_type: implementation.method_type,
|
|
2613
|
+
address: parseMetadataAddress(implementation.implementation_address),
|
|
2614
|
+
is_required: null,
|
|
2615
|
+
is_optional: null
|
|
2616
|
+
});
|
|
2617
|
+
methodsByClass.set(implementation.class_name, methods);
|
|
2618
|
+
}
|
|
2619
|
+
const classes = [...classNames].sort().map((name) => ({
|
|
2620
|
+
name,
|
|
2621
|
+
super_class: null,
|
|
2622
|
+
is_meta_class: null,
|
|
2623
|
+
is_root_class: null,
|
|
2624
|
+
methods: methodsByClass.get(name) ?? [],
|
|
2625
|
+
properties: [],
|
|
2626
|
+
protocols: [],
|
|
2627
|
+
ivar_count: null,
|
|
2628
|
+
instance_size: null
|
|
2629
|
+
}));
|
|
2630
|
+
const decodedImplementations = [...implementations.values()].sort((left, right) => compareUnicodeCodePoints(compositeKey([left.class_name, left.selector]), compositeKey([right.class_name, right.selector])));
|
|
2631
|
+
const swift = swiftSymbols.length > 0;
|
|
2632
|
+
return objcSwiftMetadataSchema.parse({
|
|
2633
|
+
objc_classes: classes,
|
|
2634
|
+
objc_dispatch_implementations: decodedImplementations,
|
|
2635
|
+
swift_symbols: swiftSymbols,
|
|
2636
|
+
coverage: [
|
|
2637
|
+
{
|
|
2638
|
+
facet: "objc_class_symbols",
|
|
2639
|
+
status: "partial",
|
|
2640
|
+
reason: names.length > examinedNames.length ? "record_limit_reached_and_symbol_names_are_not_runtime_class_metadata" : "symbol_names_do_not_recover_all_runtime_class_metadata",
|
|
2641
|
+
examined: examinedNames.length,
|
|
2642
|
+
decoded: classes.length
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
facet: "objc_dispatch_implementations",
|
|
2646
|
+
status: decodedImplementations.length > 0 ? "partial" : "unsupported",
|
|
2647
|
+
reason: names.length > examinedNames.length ? "record_limit_reached_and_only_symbolized_methods_are_resolved" : decodedImplementations.length > 0 ? "only_symbolized_methods_are_resolved" : "provider_name_inventory_has_no_objc_method_symbols",
|
|
2648
|
+
examined: examinedNames.length,
|
|
2649
|
+
decoded: decodedImplementations.length
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
facet: "objc_ivar_layouts",
|
|
2653
|
+
status: "unsupported",
|
|
2654
|
+
reason: "symbol_inventory_does_not_expose_runtime_ivar_layouts",
|
|
2655
|
+
examined: 0,
|
|
2656
|
+
decoded: 0
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
facet: "swift_declarations",
|
|
2660
|
+
status: swift ? "partial" : "unsupported",
|
|
2661
|
+
reason: swift ? "symbols_are_not_demangled_declarations" : "no_swift_symbols_observed",
|
|
2662
|
+
examined: swiftSymbols.length,
|
|
2663
|
+
decoded: 0
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
facet: "swift_dispatch_tables",
|
|
2667
|
+
status: "unsupported",
|
|
2668
|
+
reason: "provider_name_inventory_does_not_decode_witness_or_class_vtables",
|
|
2669
|
+
examined: 0,
|
|
2670
|
+
decoded: 0
|
|
2671
|
+
},
|
|
2672
|
+
{
|
|
2673
|
+
facet: "relative_pointers",
|
|
2674
|
+
status: "unsupported",
|
|
2675
|
+
reason: "provider_name_inventory_does_not_decode_binary_relative_pointers",
|
|
2676
|
+
examined: 0,
|
|
2677
|
+
decoded: 0
|
|
2678
|
+
}
|
|
2679
|
+
],
|
|
2680
|
+
db_save_result: null
|
|
2681
|
+
});
|
|
2682
|
+
};
|
|
2683
|
+
parseMetadataAddress = (address) => {
|
|
2684
|
+
if (address === null) return null;
|
|
2685
|
+
const match = /(?:^|:)0x([0-9a-f]+)$/iu.exec(address);
|
|
2686
|
+
if (match?.[1] === undefined) return null;
|
|
2687
|
+
const value = Number.parseInt(match[1], 16);
|
|
2688
|
+
return Number.isSafeInteger(value) ? value : null;
|
|
2689
|
+
};
|
|
2690
|
+
})))();
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
//#endregion
|
|
2694
|
+
//#region dist/domain/native/nativeInvestigationGraph.js
|
|
2695
|
+
var nativeInvestigationNodeKindSchema, nativeInvestigationNodeSchema, nativeInvestigationRelationSchema, nativeInvestigationEdgeSchema, nativeInvestigationCoverageSchema, nativeInvestigationGraphSchema, nativeInvestigationTraceLimitsSchema, nativeInvestigationTraceSchema, traceNativeInvestigationGraph, joinInterfaceBuilderDispatch;
|
|
2696
|
+
function init_nativeInvestigationGraph() {
|
|
2697
|
+
return (init_nativeInvestigationGraph = __esmMin((() => {
|
|
2698
|
+
init_objcSwiftMetadata();
|
|
2699
|
+
init_jsonValue();
|
|
2700
|
+
nativeInvestigationNodeKindSchema = z.enum([
|
|
2701
|
+
"storyboard",
|
|
2702
|
+
"scene",
|
|
2703
|
+
"view_controller",
|
|
2704
|
+
"view",
|
|
2705
|
+
"control",
|
|
2706
|
+
"constraint",
|
|
2707
|
+
"layout_guide",
|
|
2708
|
+
"resource",
|
|
2709
|
+
"placeholder",
|
|
2710
|
+
"external_object",
|
|
2711
|
+
"outlet",
|
|
2712
|
+
"action",
|
|
2713
|
+
"segue",
|
|
2714
|
+
"objc_class",
|
|
2715
|
+
"objc_selector",
|
|
2716
|
+
"swift_declaration",
|
|
2717
|
+
"swift_requirement",
|
|
2718
|
+
"dispatch_table",
|
|
2719
|
+
"dispatch_slot",
|
|
2720
|
+
"thunk",
|
|
2721
|
+
"function",
|
|
2722
|
+
"state_value",
|
|
2723
|
+
"global_value",
|
|
2724
|
+
"field",
|
|
2725
|
+
"branch_condition",
|
|
2726
|
+
"sink",
|
|
2727
|
+
"unknown"
|
|
2728
|
+
]);
|
|
2729
|
+
nativeInvestigationNodeSchema = z.strictObject({
|
|
2730
|
+
id: z.string().min(1),
|
|
2731
|
+
kind: nativeInvestigationNodeKindSchema,
|
|
2732
|
+
name: z.string().min(1),
|
|
2733
|
+
location: nativeMetadataLocationSchema.nullable(),
|
|
2734
|
+
attributes: z.record(z.string(), jsonValueSchema),
|
|
2735
|
+
evidence: z.array(nativeMetadataEvidenceSchema)
|
|
2736
|
+
});
|
|
2737
|
+
nativeInvestigationRelationSchema = z.enum([
|
|
2738
|
+
"contains",
|
|
2739
|
+
"outlet_to",
|
|
2740
|
+
"target_action",
|
|
2741
|
+
"segue_to",
|
|
2742
|
+
"objc_dispatch",
|
|
2743
|
+
"swift_witness_dispatch",
|
|
2744
|
+
"swift_vtable_dispatch",
|
|
2745
|
+
"thunk_to",
|
|
2746
|
+
"direct_call",
|
|
2747
|
+
"indirect_call",
|
|
2748
|
+
"provider_call",
|
|
2749
|
+
"reads",
|
|
2750
|
+
"writes",
|
|
2751
|
+
"flows_to",
|
|
2752
|
+
"controls"
|
|
2753
|
+
]);
|
|
2754
|
+
nativeInvestigationEdgeSchema = z.discriminatedUnion("resolution", [z.strictObject({
|
|
2755
|
+
id: z.string().min(1),
|
|
2756
|
+
from: z.string().min(1),
|
|
2757
|
+
to: z.string().min(1),
|
|
2758
|
+
relation: nativeInvestigationRelationSchema,
|
|
2759
|
+
resolution: z.enum([
|
|
2760
|
+
"observed",
|
|
2761
|
+
"inferred",
|
|
2762
|
+
"resolved",
|
|
2763
|
+
"ambiguous"
|
|
2764
|
+
]),
|
|
2765
|
+
evidence: z.array(nativeMetadataEvidenceSchema).min(1),
|
|
2766
|
+
limitations: z.array(z.string())
|
|
2767
|
+
}), z.strictObject({
|
|
2768
|
+
id: z.string().min(1),
|
|
2769
|
+
from: z.string().min(1),
|
|
2770
|
+
to: z.null(),
|
|
2771
|
+
relation: nativeInvestigationRelationSchema,
|
|
2772
|
+
resolution: z.literal("unresolved"),
|
|
2773
|
+
reason: z.string().min(1),
|
|
2774
|
+
evidence: z.array(nativeMetadataEvidenceSchema),
|
|
2775
|
+
limitations: z.array(z.string())
|
|
2776
|
+
})]);
|
|
2777
|
+
nativeInvestigationCoverageSchema = z.strictObject({
|
|
2778
|
+
facet: z.string().min(1),
|
|
2779
|
+
status: z.enum([
|
|
2780
|
+
"complete",
|
|
2781
|
+
"partial",
|
|
2782
|
+
"unsupported",
|
|
2783
|
+
"not_requested"
|
|
2784
|
+
]),
|
|
2785
|
+
reason: z.string().nullable(),
|
|
2786
|
+
examined: z.number().int().nonnegative(),
|
|
2787
|
+
omitted: z.number().int().nonnegative()
|
|
2788
|
+
});
|
|
2789
|
+
nativeInvestigationGraphSchema = z.strictObject({
|
|
2790
|
+
target_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
2791
|
+
provider: z.strictObject({
|
|
2792
|
+
id: z.string().min(1),
|
|
2793
|
+
version: z.string().nullable(),
|
|
2794
|
+
tool_version: z.string().min(1)
|
|
2795
|
+
}),
|
|
2796
|
+
nodes: z.array(nativeInvestigationNodeSchema),
|
|
2797
|
+
edges: z.array(nativeInvestigationEdgeSchema),
|
|
2798
|
+
coverage: z.array(nativeInvestigationCoverageSchema),
|
|
2799
|
+
truncated: z.boolean()
|
|
2800
|
+
});
|
|
2801
|
+
nativeInvestigationTraceLimitsSchema = z.strictObject({
|
|
2802
|
+
max_depth: z.number().int().min(0).max(32).default(8),
|
|
2803
|
+
max_nodes: z.number().int().min(1).max(2e3).default(250),
|
|
2804
|
+
max_edges: z.number().int().min(1).max(5e3).default(500)
|
|
2805
|
+
});
|
|
2806
|
+
nativeInvestigationTraceSchema = z.strictObject({
|
|
2807
|
+
target_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
2808
|
+
provider: nativeInvestigationGraphSchema.shape.provider,
|
|
2809
|
+
start: z.string().min(1),
|
|
2810
|
+
direction: z.enum(["forward", "backward"]),
|
|
2811
|
+
nodes: z.array(nativeInvestigationNodeSchema),
|
|
2812
|
+
edges: z.array(nativeInvestigationEdgeSchema),
|
|
2813
|
+
unresolved: z.array(nativeInvestigationEdgeSchema),
|
|
2814
|
+
reached_depth: z.number().int().nonnegative(),
|
|
2815
|
+
truncated: z.boolean(),
|
|
2816
|
+
reason: z.string().nullable(),
|
|
2817
|
+
coverage: z.array(nativeInvestigationCoverageSchema),
|
|
2818
|
+
limitations: z.array(z.string().min(1))
|
|
2819
|
+
});
|
|
2820
|
+
traceNativeInvestigationGraph = (graph, input) => {
|
|
2821
|
+
const start = graph.nodes.find(({ id }) => id === input.start);
|
|
2822
|
+
if (start === undefined) return {
|
|
2823
|
+
target_sha256: graph.target_sha256,
|
|
2824
|
+
provider: graph.provider,
|
|
2825
|
+
start: input.start,
|
|
2826
|
+
direction: input.direction ?? "forward",
|
|
2827
|
+
nodes: [],
|
|
2828
|
+
edges: [],
|
|
2829
|
+
unresolved: [],
|
|
2830
|
+
reached_depth: 0,
|
|
2831
|
+
truncated: false,
|
|
2832
|
+
reason: "start_node_missing",
|
|
2833
|
+
coverage: graph.coverage,
|
|
2834
|
+
limitations: ["The requested start node is absent from the supplied graph."]
|
|
2835
|
+
};
|
|
2836
|
+
const limits = nativeInvestigationTraceLimitsSchema.parse(input.limits ?? {});
|
|
2837
|
+
const direction = input.direction ?? "forward";
|
|
2838
|
+
const nodeById = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
2839
|
+
const visited = new Set([start.id]);
|
|
2840
|
+
const selectedEdges = new Map();
|
|
2841
|
+
const unresolved = new Map();
|
|
2842
|
+
const queue = [{
|
|
2843
|
+
id: start.id,
|
|
2844
|
+
depth: 0
|
|
2845
|
+
}];
|
|
2846
|
+
let reachedDepth = 0;
|
|
2847
|
+
let truncated = false;
|
|
2848
|
+
let reason = null;
|
|
2849
|
+
const adjacency = new Map();
|
|
2850
|
+
for (const edge of graph.edges) {
|
|
2851
|
+
const nodeId = direction === "forward" ? edge.from : edge.to;
|
|
2852
|
+
if (nodeId === null) continue;
|
|
2853
|
+
const entries = adjacency.get(nodeId);
|
|
2854
|
+
if (entries === undefined) adjacency.set(nodeId, [edge]);
|
|
2855
|
+
else entries.push(edge);
|
|
2856
|
+
}
|
|
2857
|
+
while (queue.length > 0) {
|
|
2858
|
+
const current = queue.shift();
|
|
2859
|
+
if (current === undefined) break;
|
|
2860
|
+
const adjacent = adjacency.get(current.id) ?? [];
|
|
2861
|
+
for (const edge of adjacent) {
|
|
2862
|
+
if (selectedEdges.size + unresolved.size >= limits.max_edges) {
|
|
2863
|
+
truncated = true;
|
|
2864
|
+
reason = "max_edges_reached";
|
|
2865
|
+
break;
|
|
2866
|
+
}
|
|
2867
|
+
if (edge.resolution === "unresolved") {
|
|
2868
|
+
unresolved.set(edge.id, edge);
|
|
2869
|
+
continue;
|
|
2870
|
+
}
|
|
2871
|
+
const nextId = direction === "forward" ? edge.to : edge.from;
|
|
2872
|
+
const alreadyVisited = visited.has(nextId);
|
|
2873
|
+
if (!alreadyVisited && current.depth >= limits.max_depth) {
|
|
2874
|
+
truncated = true;
|
|
2875
|
+
reason ??= "max_depth_reached";
|
|
2876
|
+
continue;
|
|
2877
|
+
}
|
|
2878
|
+
if (!alreadyVisited && visited.size >= limits.max_nodes) {
|
|
2879
|
+
truncated = true;
|
|
2880
|
+
reason = "max_nodes_reached";
|
|
2881
|
+
break;
|
|
2882
|
+
}
|
|
2883
|
+
selectedEdges.set(edge.id, edge);
|
|
2884
|
+
if (alreadyVisited) continue;
|
|
2885
|
+
if (!nodeById.has(nextId)) {
|
|
2886
|
+
truncated = true;
|
|
2887
|
+
reason ??= "edge_target_missing_from_graph";
|
|
2888
|
+
continue;
|
|
2889
|
+
}
|
|
2890
|
+
visited.add(nextId);
|
|
2891
|
+
reachedDepth = Math.max(reachedDepth, current.depth + 1);
|
|
2892
|
+
queue.push({
|
|
2893
|
+
id: nextId,
|
|
2894
|
+
depth: current.depth + 1
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
if (reason === "max_edges_reached" || reason === "max_nodes_reached") break;
|
|
2898
|
+
}
|
|
2899
|
+
return {
|
|
2900
|
+
target_sha256: graph.target_sha256,
|
|
2901
|
+
provider: graph.provider,
|
|
2902
|
+
start: start.id,
|
|
2903
|
+
direction,
|
|
2904
|
+
nodes: [...visited].flatMap((id) => {
|
|
2905
|
+
const node = nodeById.get(id);
|
|
2906
|
+
return node === undefined ? [] : [node];
|
|
2907
|
+
}),
|
|
2908
|
+
edges: [...selectedEdges.values()],
|
|
2909
|
+
unresolved: [...unresolved.values()],
|
|
2910
|
+
reached_depth: reachedDepth,
|
|
2911
|
+
truncated,
|
|
2912
|
+
reason,
|
|
2913
|
+
coverage: graph.coverage,
|
|
2914
|
+
limitations: ["Static analysis does not prove that an authored UI action is reachable or executed at runtime.", "Provider call graphs may omit unresolved indirect dispatch."]
|
|
2915
|
+
};
|
|
2916
|
+
};
|
|
2917
|
+
joinInterfaceBuilderDispatch = (graph, metadata) => {
|
|
2918
|
+
const nodes = new Map(graph.nodes.map((node) => [node.id, node]));
|
|
2919
|
+
const edges = [...graph.edges];
|
|
2920
|
+
const existingEdgeIds = new Set(edges.map(({ id }) => id));
|
|
2921
|
+
const selectorNodesByAction = new Map();
|
|
2922
|
+
for (const edge of edges) {
|
|
2923
|
+
if (edge.resolution === "observed" && edge.relation === "target_action" && nodes.get(edge.to)?.kind === "objc_selector") selectorNodesByAction.set(edge.from, edge.to);
|
|
2924
|
+
}
|
|
2925
|
+
let examined = 0;
|
|
2926
|
+
let resolved = 0;
|
|
2927
|
+
let inferredWithoutOwnerClass = 0;
|
|
2928
|
+
for (const action of nodes.values()) {
|
|
2929
|
+
if (action.kind !== "action") continue;
|
|
2930
|
+
const selector = action.attributes.selector;
|
|
2931
|
+
if (typeof selector !== "string" || selector.length === 0) continue;
|
|
2932
|
+
const selectorNodeId = selectorNodesByAction.get(action.id);
|
|
2933
|
+
if (selectorNodeId === undefined) continue;
|
|
2934
|
+
const destinationEdge = edges.find((edge) => edge.resolution === "observed" && edge.relation === "target_action" && edge.from === action.id && [
|
|
2935
|
+
"view_controller",
|
|
2936
|
+
"placeholder",
|
|
2937
|
+
"external_object"
|
|
2938
|
+
].includes(nodes.get(edge.to)?.kind ?? ""));
|
|
2939
|
+
if (destinationEdge === undefined || destinationEdge.resolution !== "observed") continue;
|
|
2940
|
+
const owner = nodes.get(destinationEdge.to);
|
|
2941
|
+
examined += 1;
|
|
2942
|
+
const declaredClass = owner?.attributes.class_name;
|
|
2943
|
+
const className = typeof declaredClass === "string" && declaredClass.length > 0 && owner?.kind === "view_controller" ? declaredClass : null;
|
|
2944
|
+
const candidates = metadata.objc_dispatch_implementations.filter((candidate) => candidate.method_type === "instance" && candidate.selector === selector && (className === null || candidate.class_name.replace(/\([^)]*\)$/u, "") === className));
|
|
2945
|
+
const implementation = candidates.length === 1 ? candidates[0] : undefined;
|
|
2946
|
+
const edgeId = `dispatch:${selectorNodeId}:${className ?? owner?.id ?? "unknown"}:${selector}`;
|
|
2947
|
+
if (existingEdgeIds.has(edgeId)) continue;
|
|
2948
|
+
existingEdgeIds.add(edgeId);
|
|
2949
|
+
if (implementation === undefined || implementation.implementation_address === null) {
|
|
2950
|
+
edges.push({
|
|
2951
|
+
id: edgeId,
|
|
2952
|
+
from: selectorNodeId,
|
|
2953
|
+
to: null,
|
|
2954
|
+
relation: "objc_dispatch",
|
|
2955
|
+
resolution: "unresolved",
|
|
2956
|
+
reason: candidates.length > 1 ? "selector_has_multiple_candidate_implementations" : "implementation_not_resolved_from_binary_metadata_or_provider_symbols",
|
|
2957
|
+
evidence: [...action.evidence, ...candidates.flatMap(({ evidence }) => evidence)],
|
|
2958
|
+
limitations: ["A missing or ambiguous symbol match does not prove that the runtime implementation is absent."]
|
|
2959
|
+
});
|
|
2960
|
+
continue;
|
|
2961
|
+
}
|
|
2962
|
+
const functionId = `native:function:${implementation.implementation_address}`;
|
|
2963
|
+
if (!nodes.has(functionId)) nodes.set(functionId, {
|
|
2964
|
+
id: functionId,
|
|
2965
|
+
kind: "function",
|
|
2966
|
+
name: `${implementation.class_name} ${selector}`,
|
|
2967
|
+
location: {
|
|
2968
|
+
address: implementation.implementation_address,
|
|
2969
|
+
file_offset: implementation.location.file_offset
|
|
2970
|
+
},
|
|
2971
|
+
attributes: {
|
|
2972
|
+
class_name: implementation.class_name,
|
|
2973
|
+
selector,
|
|
2974
|
+
method_type: implementation.method_type
|
|
2975
|
+
},
|
|
2976
|
+
evidence: implementation.evidence
|
|
2977
|
+
});
|
|
2978
|
+
edges.push({
|
|
2979
|
+
id: edgeId,
|
|
2980
|
+
from: selectorNodeId,
|
|
2981
|
+
to: functionId,
|
|
2982
|
+
relation: "objc_dispatch",
|
|
2983
|
+
resolution: className !== null && implementation.decode.status === "decoded" ? "resolved" : "inferred",
|
|
2984
|
+
evidence: [...action.evidence, ...implementation.evidence],
|
|
2985
|
+
limitations: className === null ? ["The selector uniquely matches a encoded or symbolized method, but the Interface Builder receiver is an unresolved placeholder; runtime dispatch was not observed."] : ["The Interface Builder target and encoded or symbolized method agree on class and selector; runtime dispatch and dynamically supplied targets were not observed."]
|
|
2986
|
+
});
|
|
2987
|
+
resolved += 1;
|
|
2988
|
+
if (className === null) inferredWithoutOwnerClass += 1;
|
|
2989
|
+
}
|
|
2990
|
+
return nativeInvestigationGraphSchema.parse({
|
|
2991
|
+
...graph,
|
|
2992
|
+
provider: {
|
|
2993
|
+
id: "rea-native-investigation",
|
|
2994
|
+
version: null,
|
|
2995
|
+
tool_version: "rea-native-investigation/1"
|
|
2996
|
+
},
|
|
2997
|
+
nodes: [...nodes.values()],
|
|
2998
|
+
edges,
|
|
2999
|
+
coverage: [...graph.coverage, {
|
|
3000
|
+
facet: "ui_to_objc_dispatch",
|
|
3001
|
+
status: examined === resolved && inferredWithoutOwnerClass === 0 ? "complete" : "partial",
|
|
3002
|
+
reason: examined === resolved && inferredWithoutOwnerClass === 0 ? null : inferredWithoutOwnerClass > 0 ? "some_action_receivers_remain_placeholders" : "some_action_implementations_not_resolved",
|
|
3003
|
+
examined,
|
|
3004
|
+
omitted: examined - resolved + inferredWithoutOwnerClass
|
|
3005
|
+
}]
|
|
3006
|
+
});
|
|
3007
|
+
};
|
|
3008
|
+
})))();
|
|
3009
|
+
}
|
|
3010
|
+
|
|
3011
|
+
//#endregion
|
|
3012
|
+
//#region dist/domain/apple/interfaceBuilderGraph.js
|
|
3013
|
+
var interfaceBuilderDocumentSchema, interfaceBuilderAnalysisSchema, buildInterfaceBuilderAnalysis, interfaceBuilderLimitsSchema;
|
|
3014
|
+
function init_interfaceBuilderGraph() {
|
|
3015
|
+
return (init_interfaceBuilderGraph = __esmMin((() => {
|
|
3016
|
+
init_interfaceBuilderKeyedArchive();
|
|
3017
|
+
init_nativeInvestigationGraph();
|
|
3018
|
+
interfaceBuilderDocumentSchema = z.strictObject({
|
|
3019
|
+
relative_path: z.string().min(1),
|
|
3020
|
+
archive_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
3021
|
+
document_kind: z.enum(["nib", "storyboard_scene"]),
|
|
3022
|
+
object_count: z.number().int().nonnegative(),
|
|
3023
|
+
connection_count: z.number().int().nonnegative(),
|
|
3024
|
+
hierarchy_complete: z.boolean()
|
|
3025
|
+
});
|
|
3026
|
+
interfaceBuilderAnalysisSchema = z.strictObject({
|
|
3027
|
+
target_sha256: z.string().regex(/^[a-f0-9]{64}$/u),
|
|
3028
|
+
documents: z.array(interfaceBuilderDocumentSchema).max(64),
|
|
3029
|
+
graph: nativeInvestigationGraphSchema,
|
|
3030
|
+
limitations: z.array(z.string())
|
|
3031
|
+
});
|
|
3032
|
+
buildInterfaceBuilderAnalysis = (input) => {
|
|
3033
|
+
const nodes = new Map();
|
|
3034
|
+
const edges = [];
|
|
3035
|
+
const coverage = [];
|
|
3036
|
+
const summaries = [];
|
|
3037
|
+
let truncated = false;
|
|
3038
|
+
let omittedObjects = 0;
|
|
3039
|
+
let omittedConnections = 0;
|
|
3040
|
+
let omittedGraphNodes = 0;
|
|
3041
|
+
let omittedHierarchyReferences = 0;
|
|
3042
|
+
for (const document of input.documents.slice(0, input.limits.max_documents)) {
|
|
3043
|
+
const parsed = parseInterfaceBuilderRecords(document.raw);
|
|
3044
|
+
const prefix = `ib:${JSON.stringify(document.relativePath)}:`;
|
|
3045
|
+
const graphId = (kind, parts = []) => `${prefix}${kind}:${JSON.stringify(parts)}`;
|
|
3046
|
+
const rootId = `${prefix}root`;
|
|
3047
|
+
const objectIds = new Set(parsed.objects.map(({ id }) => id));
|
|
3048
|
+
const evidenceFor = (description) => [{
|
|
3049
|
+
kind: "interface_builder_resource",
|
|
3050
|
+
description,
|
|
3051
|
+
location: {
|
|
3052
|
+
address: null,
|
|
3053
|
+
file_offset: null
|
|
3054
|
+
},
|
|
3055
|
+
artifact_path: document.relativePath,
|
|
3056
|
+
artifact_sha256: document.archiveSha256
|
|
3057
|
+
}];
|
|
3058
|
+
const addNode = (node) => {
|
|
3059
|
+
if (nodes.has(node.id)) return true;
|
|
3060
|
+
if (nodes.size >= input.limits.max_objects) {
|
|
3061
|
+
truncated = true;
|
|
3062
|
+
omittedGraphNodes += 1;
|
|
3063
|
+
return false;
|
|
3064
|
+
}
|
|
3065
|
+
nodes.set(node.id, node);
|
|
3066
|
+
return true;
|
|
3067
|
+
};
|
|
3068
|
+
const rootNode = {
|
|
3069
|
+
id: rootId,
|
|
3070
|
+
kind: document.documentKind === "nib" ? "scene" : "storyboard",
|
|
3071
|
+
name: document.relativePath,
|
|
3072
|
+
location: null,
|
|
3073
|
+
attributes: { document_kind: document.documentKind },
|
|
3074
|
+
evidence: evidenceFor("compiled document")
|
|
3075
|
+
};
|
|
3076
|
+
addNode(rootNode);
|
|
3077
|
+
let documentObjectCount = 0;
|
|
3078
|
+
for (const object of parsed.objects.slice(0, input.limits.max_objects)) {
|
|
3079
|
+
const id = graphId("object", [object.id]);
|
|
3080
|
+
const kind = object.kind === "other" ? "unknown" : object.kind;
|
|
3081
|
+
if (!addNode({
|
|
3082
|
+
id,
|
|
3083
|
+
kind,
|
|
3084
|
+
name: object.name,
|
|
3085
|
+
location: null,
|
|
3086
|
+
attributes: {
|
|
3087
|
+
...object.attributes,
|
|
3088
|
+
interface_builder_object_id: object.id,
|
|
3089
|
+
class_name: object.class_name
|
|
3090
|
+
},
|
|
3091
|
+
evidence: evidenceFor(`object ${object.id}`)
|
|
3092
|
+
})) {
|
|
3093
|
+
break;
|
|
3094
|
+
}
|
|
3095
|
+
documentObjectCount += 1;
|
|
3096
|
+
}
|
|
3097
|
+
let connectionEdgeCount = 0;
|
|
3098
|
+
let hierarchyEdgeCount = 0;
|
|
3099
|
+
let documentOmittedConnections = 0;
|
|
3100
|
+
let documentOmittedHierarchyEdges = 0;
|
|
3101
|
+
let hierarchyTruncated = false;
|
|
3102
|
+
const objectNodeId = (objectId) => graphId("object", [objectId]);
|
|
3103
|
+
const addEdge = (edge, isHierarchy) => {
|
|
3104
|
+
if (isHierarchy ? hierarchyEdgeCount >= input.limits.max_objects : connectionEdgeCount >= input.limits.max_connections * 3) {
|
|
3105
|
+
truncated = true;
|
|
3106
|
+
if (isHierarchy) {
|
|
3107
|
+
hierarchyTruncated = true;
|
|
3108
|
+
documentOmittedHierarchyEdges += 1;
|
|
3109
|
+
} else {
|
|
3110
|
+
omittedConnections += 1;
|
|
3111
|
+
documentOmittedConnections += 1;
|
|
3112
|
+
}
|
|
3113
|
+
return;
|
|
3114
|
+
}
|
|
3115
|
+
edges.push(edge);
|
|
3116
|
+
if (isHierarchy) hierarchyEdgeCount += 1;
|
|
3117
|
+
else connectionEdgeCount += 1;
|
|
3118
|
+
};
|
|
3119
|
+
const connect = (id, from, to, relation, description, reason) => {
|
|
3120
|
+
const isHierarchy = relation === "contains" && id.includes(":hierarchy:");
|
|
3121
|
+
if (!nodes.has(from)) {
|
|
3122
|
+
truncated = true;
|
|
3123
|
+
if (isHierarchy) {
|
|
3124
|
+
hierarchyTruncated = true;
|
|
3125
|
+
documentOmittedHierarchyEdges += 1;
|
|
3126
|
+
} else {
|
|
3127
|
+
omittedConnections += 1;
|
|
3128
|
+
documentOmittedConnections += 1;
|
|
3129
|
+
}
|
|
3130
|
+
return;
|
|
3131
|
+
}
|
|
3132
|
+
const evidence = evidenceFor(description);
|
|
3133
|
+
const unresolvedEndpoint = to !== null && !nodes.has(to);
|
|
3134
|
+
if (unresolvedEndpoint) {
|
|
3135
|
+
truncated = true;
|
|
3136
|
+
if (isHierarchy) hierarchyTruncated = true;
|
|
3137
|
+
}
|
|
3138
|
+
const edgeTo = unresolvedEndpoint ? null : to;
|
|
3139
|
+
const edgeReason = unresolvedEndpoint ? "endpoint_omitted_by_object_limit" : reason ?? "destination_unresolved";
|
|
3140
|
+
addEdge(edgeTo === null ? {
|
|
3141
|
+
id,
|
|
3142
|
+
from,
|
|
3143
|
+
to: null,
|
|
3144
|
+
relation,
|
|
3145
|
+
resolution: "unresolved",
|
|
3146
|
+
reason: edgeReason,
|
|
3147
|
+
evidence,
|
|
3148
|
+
limitations: []
|
|
3149
|
+
} : {
|
|
3150
|
+
id,
|
|
3151
|
+
from,
|
|
3152
|
+
to: edgeTo,
|
|
3153
|
+
relation,
|
|
3154
|
+
resolution: "observed",
|
|
3155
|
+
evidence,
|
|
3156
|
+
limitations: []
|
|
3157
|
+
}, isHierarchy);
|
|
3158
|
+
};
|
|
3159
|
+
let hierarchyCount = 0;
|
|
3160
|
+
const visitHierarchy = (initial, initialParentId) => {
|
|
3161
|
+
const pending = [{
|
|
3162
|
+
value: initial,
|
|
3163
|
+
parentId: initialParentId
|
|
3164
|
+
}];
|
|
3165
|
+
while (pending.length > 0) {
|
|
3166
|
+
if (hierarchyCount >= input.limits.max_objects) {
|
|
3167
|
+
truncated = true;
|
|
3168
|
+
hierarchyTruncated = true;
|
|
3169
|
+
return;
|
|
3170
|
+
}
|
|
3171
|
+
const entry = pending.pop();
|
|
3172
|
+
if (entry === undefined) break;
|
|
3173
|
+
const { value, parentId } = entry;
|
|
3174
|
+
if (Array.isArray(value)) {
|
|
3175
|
+
for (let index = value.length - 1; index >= 0; index -= 1) {
|
|
3176
|
+
const child = value[index];
|
|
3177
|
+
if (child !== undefined) pending.push({
|
|
3178
|
+
value: child,
|
|
3179
|
+
parentId
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
continue;
|
|
3183
|
+
}
|
|
3184
|
+
if (typeof value !== "object" || value === null) continue;
|
|
3185
|
+
const item = record(value);
|
|
3186
|
+
const objectId = firstString(item.objectID, item["object-id"], item.id, typeof item.archiveUID === "number" ? String(item.archiveUID) : null);
|
|
3187
|
+
let nextParent = parentId;
|
|
3188
|
+
if (objectId !== null) {
|
|
3189
|
+
const known = objectIds.has(objectId);
|
|
3190
|
+
const childId = known ? objectNodeId(objectId) : graphId("unknown", [objectId]);
|
|
3191
|
+
if (!known && !addNode({
|
|
3192
|
+
id: childId,
|
|
3193
|
+
kind: "unknown",
|
|
3194
|
+
name: firstString(item.label, item.name) ?? objectId,
|
|
3195
|
+
location: null,
|
|
3196
|
+
attributes: { interface_builder_object_id: objectId },
|
|
3197
|
+
evidence: evidenceFor(`hierarchy item ${objectId}`)
|
|
3198
|
+
})) hierarchyTruncated = true;
|
|
3199
|
+
connect(graphId("hierarchy", [parentId, childId]), parentId, childId, "contains", `hierarchy ${objectId}`);
|
|
3200
|
+
nextParent = childId;
|
|
3201
|
+
hierarchyCount += 1;
|
|
3202
|
+
}
|
|
3203
|
+
pending.push({
|
|
3204
|
+
value: item.children,
|
|
3205
|
+
parentId: nextParent
|
|
3206
|
+
});
|
|
3207
|
+
}
|
|
3208
|
+
};
|
|
3209
|
+
for (const hierarchy of parsed.hierarchy) visitHierarchy(hierarchy, rootId);
|
|
3210
|
+
for (const [index, item] of parsed.connections.slice(0, input.limits.max_connections).entries()) {
|
|
3211
|
+
const sourceId = objectNodeId(item.source_id);
|
|
3212
|
+
if (!nodes.has(sourceId)) addNode({
|
|
3213
|
+
id: sourceId,
|
|
3214
|
+
kind: "unknown",
|
|
3215
|
+
name: item.source_id,
|
|
3216
|
+
location: null,
|
|
3217
|
+
attributes: { interface_builder_object_id: item.source_id },
|
|
3218
|
+
evidence: evidenceFor(`connection source ${item.source_id}`)
|
|
3219
|
+
});
|
|
3220
|
+
const destinationId = item.destination_id === null ? null : objectNodeId(item.destination_id);
|
|
3221
|
+
if (item.kind === "action") {
|
|
3222
|
+
const actionId = graphId("action", [item.id]);
|
|
3223
|
+
const selectorId = item.label === null ? null : graphId("selector", [item.destination_id, item.label]);
|
|
3224
|
+
addNode({
|
|
3225
|
+
id: actionId,
|
|
3226
|
+
kind: "action",
|
|
3227
|
+
name: item.label ?? "unlabeled action",
|
|
3228
|
+
location: null,
|
|
3229
|
+
attributes: {
|
|
3230
|
+
selector: item.label,
|
|
3231
|
+
destination_id: item.destination_id,
|
|
3232
|
+
...item.attributes
|
|
3233
|
+
},
|
|
3234
|
+
evidence: evidenceFor(`action ${item.id}`)
|
|
3235
|
+
});
|
|
3236
|
+
connect(graphId("action-edge", [item.id, "source"]), sourceId, actionId, "target_action", `action source ${item.source_id}`);
|
|
3237
|
+
if (selectorId !== null) {
|
|
3238
|
+
addNode({
|
|
3239
|
+
id: selectorId,
|
|
3240
|
+
kind: "objc_selector",
|
|
3241
|
+
name: item.label ?? "unknown selector",
|
|
3242
|
+
location: null,
|
|
3243
|
+
attributes: { destination_id: item.destination_id },
|
|
3244
|
+
evidence: evidenceFor(`selector ${item.label}`)
|
|
3245
|
+
});
|
|
3246
|
+
connect(graphId("action-edge", [item.id, "selector"]), actionId, selectorId, "target_action", `selector ${item.label}`);
|
|
3247
|
+
}
|
|
3248
|
+
if (destinationId === null || !nodes.has(destinationId)) connect(graphId("action-edge", [item.id, "destination"]), actionId, null, "target_action", `action destination ${item.destination_id ?? "missing"}`, "destination_object_missing_or_external");
|
|
3249
|
+
else connect(graphId("action-edge", [item.id, "destination"]), actionId, destinationId, "target_action", `action destination ${item.destination_id}`);
|
|
3250
|
+
} else if (item.kind === "outlet") {
|
|
3251
|
+
const outletId = graphId("outlet", [item.id]);
|
|
3252
|
+
addNode({
|
|
3253
|
+
id: outletId,
|
|
3254
|
+
kind: "outlet",
|
|
3255
|
+
name: item.label ?? item.id,
|
|
3256
|
+
location: null,
|
|
3257
|
+
attributes: item.attributes,
|
|
3258
|
+
evidence: evidenceFor(`outlet ${item.id}`)
|
|
3259
|
+
});
|
|
3260
|
+
connect(graphId("outlet-edge", [item.id, "source"]), sourceId, outletId, "contains", `outlet source ${item.source_id}`);
|
|
3261
|
+
if (destinationId === null || !nodes.has(destinationId)) connect(graphId("outlet-edge", [item.id, "destination"]), outletId, null, "outlet_to", `outlet ${item.label ?? item.id}`, "destination_object_missing_or_external");
|
|
3262
|
+
else connect(graphId("outlet-edge", [item.id, "destination"]), outletId, destinationId, "outlet_to", `outlet ${item.label ?? item.id}`);
|
|
3263
|
+
} else if (item.kind === "segue") {
|
|
3264
|
+
if (destinationId === null || !nodes.has(destinationId)) connect(graphId("segue", [index]), sourceId, null, "segue_to", `segue ${item.label ?? item.id}`, "destination_scene_missing");
|
|
3265
|
+
else connect(graphId("segue", [index]), sourceId, destinationId, "segue_to", `segue ${item.label ?? item.id}`);
|
|
3266
|
+
} else {
|
|
3267
|
+
connect(graphId("unknown-connection", [index]), sourceId, null, "contains", `connection type ${item.kind}`, "unsupported_connection_type");
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
const objectsTruncated = parsed.omittedObjects > 0 || parsed.objects.length > documentObjectCount;
|
|
3271
|
+
const parserOmittedHierarchyReferences = parsed.omittedHierarchyReferences;
|
|
3272
|
+
const omittedSerializedHierarchyReferences = document.omittedSerializedHierarchyReferences ?? 0;
|
|
3273
|
+
omittedHierarchyReferences += parserOmittedHierarchyReferences + omittedSerializedHierarchyReferences;
|
|
3274
|
+
const parserOmittedConnections = parsed.omittedConnections;
|
|
3275
|
+
const connectionsTruncated = parserOmittedConnections > 0 || parsed.connections.length > input.limits.max_connections;
|
|
3276
|
+
const connectionsUnresolved = parsed.unresolvedConnections > 0;
|
|
3277
|
+
omittedObjects += parsed.omittedObjects + Math.max(0, parsed.objects.length - documentObjectCount);
|
|
3278
|
+
omittedConnections += Math.max(0, parsed.connections.length - input.limits.max_connections) + parserOmittedConnections + parsed.unresolvedConnections;
|
|
3279
|
+
const hierarchyStatus = parserOmittedHierarchyReferences > 0 || omittedSerializedHierarchyReferences > 0 ? "partial" : parsed.hierarchy.length === 0 ? "unsupported" : hierarchyTruncated ? "partial" : "complete";
|
|
3280
|
+
summaries.push({
|
|
3281
|
+
relative_path: document.relativePath,
|
|
3282
|
+
archive_sha256: document.archiveSha256,
|
|
3283
|
+
document_kind: document.documentKind,
|
|
3284
|
+
object_count: parsed.objectCount,
|
|
3285
|
+
connection_count: parsed.connections.length + parserOmittedConnections + parsed.unresolvedConnections,
|
|
3286
|
+
hierarchy_complete: hierarchyStatus === "complete"
|
|
3287
|
+
});
|
|
3288
|
+
coverage.push({
|
|
3289
|
+
facet: `objects:${document.relativePath}`,
|
|
3290
|
+
status: objectsTruncated ? "partial" : "complete",
|
|
3291
|
+
reason: objectsTruncated ? "object_limit_reached" : null,
|
|
3292
|
+
examined: documentObjectCount,
|
|
3293
|
+
omitted: parsed.omittedObjects + Math.max(0, parsed.objects.length - documentObjectCount)
|
|
3294
|
+
}, {
|
|
3295
|
+
facet: `connections:${document.relativePath}`,
|
|
3296
|
+
status: connectionsTruncated || documentOmittedConnections > 0 || connectionsUnresolved ? "partial" : "complete",
|
|
3297
|
+
reason: connectionsTruncated || documentOmittedConnections > 0 ? "connection_limit_reached" : connectionsUnresolved ? "connection_unresolved" : null,
|
|
3298
|
+
examined: Math.min(parsed.connections.length, input.limits.max_connections),
|
|
3299
|
+
omitted: Math.max(0, parsed.connections.length - input.limits.max_connections) + documentOmittedConnections + parserOmittedConnections + parsed.unresolvedConnections
|
|
3300
|
+
}, {
|
|
3301
|
+
facet: `hierarchy:${document.relativePath}`,
|
|
3302
|
+
status: hierarchyStatus,
|
|
3303
|
+
reason: parserOmittedHierarchyReferences > 0 ? "archive_hierarchy_references_missing" : omittedSerializedHierarchyReferences > 0 ? "serialized_view_hierarchy_incomplete" : parsed.hierarchy.length === 0 ? "archive_hierarchy_not_decoded" : hierarchyTruncated ? "graph_limit_reached" : null,
|
|
3304
|
+
examined: hierarchyCount,
|
|
3305
|
+
omitted: documentOmittedHierarchyEdges + parserOmittedHierarchyReferences + omittedSerializedHierarchyReferences
|
|
3306
|
+
}, {
|
|
3307
|
+
facet: `classes:${document.relativePath}`,
|
|
3308
|
+
status: Object.keys(parsed.classes).length > 0 ? "complete" : "unsupported",
|
|
3309
|
+
reason: Object.keys(parsed.classes).length > 0 ? null : "archive_class_table_not_decoded",
|
|
3310
|
+
examined: Object.keys(parsed.classes).length,
|
|
3311
|
+
omitted: 0
|
|
3312
|
+
});
|
|
3313
|
+
}
|
|
3314
|
+
if (input.documents.length > input.limits.max_documents) {
|
|
3315
|
+
truncated = true;
|
|
3316
|
+
coverage.push({
|
|
3317
|
+
facet: "documents",
|
|
3318
|
+
status: "partial",
|
|
3319
|
+
reason: "document_limit_reached",
|
|
3320
|
+
examined: input.limits.max_documents,
|
|
3321
|
+
omitted: input.documents.length - input.limits.max_documents
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
if (omittedGraphNodes > 0) coverage.push({
|
|
3325
|
+
facet: "graph_nodes",
|
|
3326
|
+
status: "partial",
|
|
3327
|
+
reason: "max_objects_reached",
|
|
3328
|
+
examined: nodes.size,
|
|
3329
|
+
omitted: omittedGraphNodes
|
|
3330
|
+
});
|
|
3331
|
+
return interfaceBuilderAnalysisSchema.parse({
|
|
3332
|
+
target_sha256: input.targetSha256,
|
|
3333
|
+
documents: summaries,
|
|
3334
|
+
graph: {
|
|
3335
|
+
target_sha256: input.targetSha256,
|
|
3336
|
+
provider: {
|
|
3337
|
+
id: "rea-artifact-graph",
|
|
3338
|
+
version: "1",
|
|
3339
|
+
tool_version: input.toolVersion
|
|
3340
|
+
},
|
|
3341
|
+
nodes: [...nodes.values()],
|
|
3342
|
+
edges,
|
|
3343
|
+
coverage,
|
|
3344
|
+
truncated: truncated || omittedObjects > 0 || omittedConnections > 0 || omittedHierarchyReferences > 0
|
|
3345
|
+
},
|
|
3346
|
+
limitations: [
|
|
3347
|
+
"The graph reflects recognized Interface Builder archive fields and connections; omitted private or unrecognized archive fields remain unknown.",
|
|
3348
|
+
"A target-action selector is an Interface Builder observation and does not prove that the binary contains a matching implementation.",
|
|
3349
|
+
"Decoded constraints, runtime visibility, dynamic UI creation, and pixel geometry are not inferred from these archives."
|
|
3350
|
+
]
|
|
3351
|
+
});
|
|
3352
|
+
};
|
|
3353
|
+
interfaceBuilderLimitsSchema = z.strictObject({
|
|
3354
|
+
max_documents: z.number().int().min(1).max(64).default(64),
|
|
3355
|
+
max_objects: z.number().int().min(1).max(2e4).default(2e4),
|
|
3356
|
+
max_connections: z.number().int().min(1).max(4e4).default(4e4),
|
|
3357
|
+
trace: nativeInvestigationTraceLimitsSchema.default({
|
|
3358
|
+
max_depth: 8,
|
|
3359
|
+
max_nodes: 250,
|
|
3360
|
+
max_edges: 500
|
|
3361
|
+
})
|
|
3362
|
+
});
|
|
3363
|
+
})))();
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
//#endregion
|
|
3367
|
+
//#region dist/domain/native/nativeValueTrace.js
|
|
3368
|
+
var nativeValueTraceInputSchema, nativeValueTraceSchema;
|
|
3369
|
+
function init_nativeValueTrace() {
|
|
3370
|
+
return (init_nativeValueTrace = __esmMin((() => {
|
|
3371
|
+
init_nativeValueFlow();
|
|
3372
|
+
nativeValueTraceInputSchema = z.strictObject({
|
|
3373
|
+
procedure: z.string().min(1),
|
|
3374
|
+
max_depth: z.number().int().min(0).max(16).default(3),
|
|
3375
|
+
max_functions: z.number().int().min(1).max(64).default(16),
|
|
3376
|
+
max_call_sites: z.number().int().min(1).max(4096).default(256),
|
|
3377
|
+
max_nodes: z.number().int().min(1).max(2e4).default(5e3),
|
|
3378
|
+
max_edges: z.number().int().min(1).max(4e4).default(1e4),
|
|
3379
|
+
offset: z.number().int().min(0).default(0),
|
|
3380
|
+
limit: z.number().int().min(1).max(5e3).default(1e3)
|
|
3381
|
+
});
|
|
3382
|
+
nativeValueTraceSchema = z.strictObject({
|
|
3383
|
+
seed: z.string(),
|
|
3384
|
+
target_sha256: z.string(),
|
|
3385
|
+
nodes: z.array(z.strictObject({
|
|
3386
|
+
id: z.string(),
|
|
3387
|
+
procedure: z.string(),
|
|
3388
|
+
evidence_id: z.string(),
|
|
3389
|
+
kind: z.enum(["operation", "parameter"]),
|
|
3390
|
+
operation: nativePcodeOperationSchema.nullable(),
|
|
3391
|
+
parameter: z.strictObject({
|
|
3392
|
+
ordinal: z.number().int().nonnegative(),
|
|
3393
|
+
name: z.string(),
|
|
3394
|
+
data_type: z.string()
|
|
3395
|
+
}).nullable()
|
|
3396
|
+
})),
|
|
3397
|
+
edges: z.array(z.strictObject({
|
|
3398
|
+
source: z.string(),
|
|
3399
|
+
target: z.string(),
|
|
3400
|
+
input_index: z.number().int().nonnegative().nullable(),
|
|
3401
|
+
kind: z.enum([
|
|
3402
|
+
"def-use",
|
|
3403
|
+
"call",
|
|
3404
|
+
"parameter-use",
|
|
3405
|
+
"argument-binding",
|
|
3406
|
+
"return-binding"
|
|
3407
|
+
]),
|
|
3408
|
+
status: z.enum([
|
|
3409
|
+
"derived",
|
|
3410
|
+
"direct",
|
|
3411
|
+
"resolved-indirect",
|
|
3412
|
+
"candidate"
|
|
3413
|
+
]),
|
|
3414
|
+
evidence_id: z.string()
|
|
3415
|
+
})),
|
|
3416
|
+
procedures: z.array(z.strictObject({
|
|
3417
|
+
address: z.string(),
|
|
3418
|
+
depth: z.number().int().nonnegative(),
|
|
3419
|
+
evidence_id: z.string(),
|
|
3420
|
+
provider: z.string(),
|
|
3421
|
+
analysis_profile_digest: z.string().nullable()
|
|
3422
|
+
})),
|
|
3423
|
+
unknowns: z.array(z.strictObject({
|
|
3424
|
+
procedure: z.string(),
|
|
3425
|
+
address: z.string().nullable(),
|
|
3426
|
+
reason: z.string()
|
|
3427
|
+
})),
|
|
3428
|
+
total_nodes: z.number().int().nonnegative(),
|
|
3429
|
+
total_edges: z.number().int().nonnegative(),
|
|
3430
|
+
decompilations: z.number().int().nonnegative(),
|
|
3431
|
+
next_offset: z.number().int().nonnegative().nullable(),
|
|
3432
|
+
truncated: z.boolean(),
|
|
3433
|
+
limitations: z.array(z.string())
|
|
3434
|
+
});
|
|
3435
|
+
})))();
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
//#endregion
|
|
3439
|
+
export { isZipInventoryScopeLimitation as $, isElfMetadataArchitecture as $t, addressList as A, parseFunctionDossier as At, nullableText as B, nativeValueFlowSchema as Bt, isSwiftMangledSymbolName as C, analysisStringSchema as Ct, PROVIDER_EFFECT_NAMES as D, functionInstructionWindowSchema as Dt, isUIKitRuntimeConnectionClass as E, functionDossierSchema as Et, expandProviderCapabilities as F, procedureIdentitySchema as Ft, sessionProvider as G, init_addressCoordinate as Gt, providerCapabilitySet as H, nativeApiBoundarySchema as Ht, functionDossierOutput as I, referenceEdgeSchema as It, targetKindSchema as J, committedProviderSchema as Jt, symbolDiscoveryOutput as K, analysisProfileSchema as Kt, graphNode as L, referenceKindSchema as Lt, addressedValue as M, parseRelatedAddresses as Mt, containingProcedureResolution as N, parseSegmentImageBase as Nt, TOOL_ANNOTATION_NAMES as O, init_hopperValues as Ot, evidenceResultOf as P, parseSegments as Pt, init_zipPackageFormat as Q, init_binaryTargetTypes as Qt, init_toolOutputSchemaPrimitives as R, unresolvedCallSchema as Rt, init_swiftSymbolClassification as S, analysisBookmarkSchema as St, interfaceBuilderConnectionFieldNames as T, functionBodySchema as Tt, requireOutputSchema as U, nativeApiInspectionResultSchema as Ut, procedureInfoOutput as V, init_nativeApiBoundary as Vt, segmentOutput as W, addressCoordinate as Wt, ZIP_NON_ENTRY_LIMITATION as X, init_analysisProfile as Xt, toolAvailabilityInventory as Y, createAnalysisProfile as Yt, hasZipSignature as Z, BINARY_ARCHITECTURES as Zt, init_objcSwiftMetadata as _, init_nativeInstruction as _t, init_interfaceBuilderGraph as a, analysisProviderSelectorSchema as an, createImmutableEvidenceSteps as at, objcSwiftMetadataSchema as b, nativeInstructionSchema as bt, interfaceBuilderLimitsSchema as c, immutableEvidence as ct, nativeInvestigationCoverageSchema as d, parseEvidence as dt, isMachOFormat as en, isZipPackageFormat as et, nativeInvestigationEdgeSchema as f, providerSchema as ft, traceNativeInvestigationGraph as g, init_canonicalJsonDigestSteps as gt, nativeInvestigationTraceSchema as h, canonicalJsonDigestSteps as ht, buildInterfaceBuilderAnalysis as i, analysisProviderIdSchema as in, createEvidence as it, addressedEntry as j, parseListCount as jt, TOOL_EFFECT_NAMES as k, parseDocuments as kt, init_nativeInvestigationGraph as l, init_evidence as lt, nativeInvestigationNodeSchema as m, rebindEvidenceToTargetPath as mt, nativeValueTraceInputSchema as n, relationshipCoverageLimitations as nn, analysisErrorProjectionSchema as nt, interfaceBuilderAnalysisSchema as o, init_providerSelection as on, evidenceLocationSchema as ot, nativeInvestigationGraphSchema as p, rebindEvidenceSubjectTargetPath as pt, targetFormatSchema as q, analysisProfilesEqual as qt, nativeValueTraceSchema as r, relationshipCoverageSchema as rn, init_errorSchemas as rt, interfaceBuilderDocumentSchema as s, evidenceSchema as st, init_nativeValueTrace as t, init_relationshipCoverage as tn, zipPackageFormatForPath as tt, joinInterfaceBuilderDispatch as u, isImmutableEvidence as ut, inspectNativeDispatchMetadata as v, nativeCallTargetsSchema as vt, init_interfaceBuilderKeyedArchive as w, functionBodyEntryAgrees as wt, classifySwiftSymbol as x, addressDistance as xt, nativeDispatchMetadataResultSchema as y, nativeInstructionInputSchema as yt, lifecycleResultOf as z, init_nativeValueFlow as zt };
|