Skip to main content

MemDiver MemDiver logo: a diver descending toward a golden key inside a teal memory blob

Interactive platform for identifying and analyzing data structures in memory dumps.

CI status on main PyPI version Supported Python versions License Apache-2.0 Documentation MCP enabled

MemDiver workspace with an MSL capture loaded — dark theme MemDiver workspace with an MSL capture loaded — light theme

MemDiver workspace with a sample .msl capture loaded — dark and light themes side by side.

MemDiver

MemDiver is a browser-based workbench for exploring binary memory dumps. A FastAPI backend drives a React dockable workspace, with an optional Marimo sandbox for deeper research workflows and an MCP server that exposes the same analysis engine to AI assistants. For automation and integration into existing pipelines, the same engine is available through non-interactive CLI subcommands ("headless" use — no separate mode or flag, just the CLI without a UI).

It combines known-key search, entropy scanning, change-point detection, structural parsing, and cross-run differential analysis to locate and classify data structures in memory.

Features

  • Interactive workspace — React-based dockable UI for hands-on exploration
  • Research sandbox — Optional Marimo environment for reproducible notebooks and custom analysis
  • AI-assisted analysis — MCP server integration for use with Claude and other assistants
  • Agent chat panel — optional in-UI chat with Claude over the MCP tools; read tools auto-run, writes need approval (pip install "memdiver[agent]", see docs)
  • Headless use — the same engine via non-interactive CLI subcommands (no separate mode or flag) for CI/CD, batch processing, and forensic pipelines
  • Python library — import memdiver to open dumps, convert to .msl, parse containers, and run analysis programmatically (see library quickstart)
  • Analysis engine — Known-key search, entropy scanning, change-point detection, structural parsing, and cross-run differential analysis
  • Pcap verification oracle — prove a recovered TLS secret by decrypting records from a real packet capture (first-party, built in), then export it as a Wireshark-loadable NSS key log

Install

pip install memdiver                 # everything: CLI, library, web UI, MCP server,
                                     # pcap oracle, dump collection, post-quantum KEM
pip install "memdiver[capture]"      # + MemSlicer and Frida Tools for live capture
pip install "memdiver[marimo]"       # + Marimo notebook UI (memdiver ui) -- the opt-in notebook interface
pip install "memdiver[all]"          # every interface (= the default install + marimo)
pip install "memdiver[docs]"         # + Sphinx toolchain for building the docs site
pip install "memdiver[dev]"          # + pytest and contributor tooling

Install the capture and Marimo extras in separate Python environments because they require incompatible WebSocket dependencies. Fridump and LLDB have separate installation requirements.

The default install is the complete product: memdiver web, memdiver mcp and the pcap verification oracle all work with no extras. Only the Marimo notebook UI is opt-in, because it alone costs ~164 MB — more than four times every other interface combined.

memdiver[api], [mcp], [pcap], [experiment] and [crypto] still resolve as no-op aliases, so existing pinned commands keep working. Note that Python extras can only add dependencies, never subtract them, so there is deliberately no install smaller than the default.

What pip cannot install for you. Three capabilities ship by default but need a native runtime piece, so a successful pip install does not by itself mean they will run. Each one reports the OS-level action rather than a misleading pip install hint:

Capability Needs
ML-KEM / hybrid MSL encryption the liboqs C library. liboqs-python builds it into ~/_oqs on first use, so cmake + a C compiler must be present. Without them, ML-KEM reports unavailable and only KeyEncap=None and X25519 are offered.
memdiver experiment (Frida) an attachable target process, plus platform support for Frida.
memdiver experiment (LLDB) LLDB from your OS — Xcode Command Line Tools on macOS, apt install lldb on Debian/Ubuntu.
Every command that needs something missing says exactly what to run — a pip install
hint when a Python package is genuinely absent, and the OS-level action when the
missing piece is native (see the table above). memdiver experiment exits gracefully
when no backend is present.

Quick start

# 1. Web app (FastAPI + React SPA, opens on http://127.0.0.1:8080)
memdiver                 # or: memdiver web

# 2. One-shot CLI analysis
memdiver analyze <library_dirs> --phase pre_abort --protocol-version TLS13

# 3. MCP server (stdio transport) — wire into AI assistants
memdiver mcp

# 4. Collect fresh dumps from a target process
memdiver experiment --target path/to/target.py --num-runs 10
memdiver capture 5552 app.msl --device usb:emulator-5554   # one dump of a running (Android) process

# 5. Marimo research sandbox (houses the 5 deeper visualization views)
memdiver ui

# 6. Already know the key? Find where it sits in every dump
memdiver locate-key runs/ --key-hex '<hex>' -o loc.json

locate-key exits 0 when the secret is found, 3 when it is proven absent, and 2 when nothing could be searched — see Locating a known key.

Verify against a real capture

The strongest proof that a recovered byte range is a TLS key: derive record keys from the candidate and AEAD-decrypt records from a real packet capture. This is a first-party, trusted oracle (TLS 1.3, TLS 1.2 GCM, TLS 1.2 CBC) — the capture is only ever parsed as data, never executed, so it runs without the untrusted-oracle sandbox that bring-your-own oracle scripts need.

It works in two steps: arm the capture — enumerate the TLS sessions it holds and their client_random values — then run brute-force against it, which answers whether any candidate actually decrypts those records.

# 1. Arm — which TLS sessions does this capture hold?
memdiver inspect-pcap /abs/path/to/traffic.pcap

# 2. Run — confirm a candidate decrypts real captured records
memdiver brute-force --candidates candidates.json --dump reference.msl \
    --pcap /abs/path/to/traffic.pcap --key-sizes 32 -o hits.json

# 3. Export the confirmed secret as a Wireshark-loadable NSS key log
memdiver export-keylog --secrets secrets.json -o session.keylog
Surface Arm (inspect) Run (confirm)
CLI memdiver inspect-pcap <capture> memdiver brute-force --pcap …
Web POST /api/pcaps/upload → POST /api/pcaps/validate POST /api/pipeline/run (pcap_path, tls_client_random)
MCP inspect_pcap tool brute_force tool (pcap_path)
Library memdiver.services.inspect_pcap(pcap_path=…) memdiver.services.brute_force(pcap_path=…)

The dpkt parser ships in the default install, so the oracle works out of the box. (If it is force-uninstalled, the arm step returns an INVALID_INPUT capability error and pcap runs are unavailable.)

The --key-sizes trap: the oracle recovers the secret and derives record keys from it, so the candidate length must match the secret, not the record key — 32 for a TLS 1.3 traffic secret (the default), 48 for a TLS 1.2 master secret. A TLS 1.2 run left at the default 32 will never find its key.

A hit confirmed this way is recorded with confirmed_by: "pcap" and shown in the web UI as "Verified via pcap capture".

Full walkthrough — the --stride coverage trap, restricting to a single session, the web uploader, and --persist-ground-truth — in docs/oracle/pcap_oracle.md.

API authentication

The FastAPI backend is open by default (no login, matching its localhost single-user design) unless you set MEMDIVER_API_TOKEN:

export MEMDIVER_API_TOKEN="a-long-random-secret"
memdiver web

Once a token is configured, every data route — everything under /api/, /ws/, and /notebook — requires it. Send it as either:

  • Authorization: Bearer <token> (HTTP), or
  • X-API-Key: <token> (HTTP), or
  • ?token=<token> query param (WebSocket only — browsers can't set custom headers on the WS handshake)

A missing or wrong token gets a 401 on HTTP routes, or a WebSocket close with code 1008 (policy violation). All comparisons are constant-time (hmac.compare_digest), so response timing can't be used to guess the token. The health check (/health), the OpenAPI/docs endpoints (/docs, /redoc, /openapi.json), and the static frontend bundle stay reachable without a token even when one is set.

Bind guardrail: memdiver web refuses to start if MEMDIVER_HOST is set to anything other than 127.0.0.1 / ::1 / localhost and no MEMDIVER_API_TOKEN is configured — binding a forensic-data API to the network with zero auth is refused outright. Set a token, or override with MEMDIVER_ALLOW_INSECURE=1 (logs a loud warning on every startup).

At a glance

Surface Count Location
Detection algorithms 8 algorithms/ — exact_match, entropy_scan, change_point, differential, constraint_validator, user_regex, pattern_match, structure_scan
CLI subcommands 33 cli/
FastAPI routers 19 + WebSocket api/routers/
MCP tools 128 + 8 prompts + 4 resources mcp_server/
Exporters YARA · JSON · Volatility3 architect/
Dump backends memslicer · lldb · fridump (Frida; not friTap) core/dump_driver.py
Visualization views 4 SPA + 5 Marimo research-mode frontend/ + ui/

Under the hood: DuckDB ProjectDB, .memdiver SessionStore, Welford incremental consensus, Aho-Corasick multi-pattern scan, Kaitai Struct binary-format parsers, ASLR-aware region alignment, auto-discovered KDF plugins, BYO decryption oracles, first-class Volatility3 plugin emission.

Wire MemDiver into Claude Desktop / Claude Code

Add this block to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent on your OS:

{
  "mcpServers": {
    "memdiver": { "command": "memdiver", "args": ["mcp"] }
  }
}

Restart the MCP client — the 129 MemDiver tools (scan_dataset, analyze_library, get_entropy, brute_force, emit_plugin, …) appear in the tool picker.

Power-user CLI

All 35 subcommands exposed by cli/:

Detection & analysis Consensus (Welford) Pipeline (Phase-25) Known secret & detectors Format conversion Runtime shells
analyze · scan · batch · verify · inspect · inspect-pcap · heap · annotations · case consensus · consensus-begin · consensus-add · consensus-finalize · consensus-window · consensus-regions · consensus-reference search-reduce · analyze-candidates · brute-force · n-sweep · auto-floor · emit-plugin locate-key · locate-field-pairs · export-key-pattern · scan-yara · verify-plugin · score-detector export · export-keylog · gen-kem-key · import · import-dir web · ui · notebook · mcp · experiment · capture

Newer subcommands at a glance:

  • search-reduce — besides a Welford --state session, also reduces Android Scudo heap dumps across cold boots: begin a collect session with consensus-begin --allocator scudo (or auto), feed the runs with consensus-add, then search-reduce --state … pairs heap chunks across the runs → candidates.json (same CLI, same contract). The web pipeline offers the same method up to brute-force
  • consensus-window — read one window in every dump at the address the consensus aligned
  • consensus-regions — list every occurrence of a consensus class, with jump offsets
  • consensus-reference — compare one declared reference across allocator-backed consensus rows: rows lists the paired-object rows, check tests one pointer (--source-row + --byte-offset → --target-row) in every dump
  • analyze-candidates — rank candidate regions across N dumps (no oracle needed)
  • propose-layout / model-build — propose field boundaries around a verified anchor across N dumps, and build the validated artifact model (written to a new .json)
  • consensus-anchor — anchor-relative consensus across N dumps around a verified value
  • xref-pointers — who points here: captured words holding a pointer into a target VA
  • model-export / model-validate — export an artifact model as a Volatility3 plugin (new .py), and score it on held-out captures against ground truth (verdict pass/fail)
  • locate-key — locate a KNOWN secret across N dumps (guide)
  • locate-field-pairs — locate a handshake FIELD across N dumps, each dump taking the field from its own capture
  • export-key-pattern — export a scanning signature anchored on a KNOWN secret (wildcards the key, keeps its neighbourhood)
  • scan-yara — scan N dumps with a YARA rule set
  • verify-plugin — run a MemDiver-emitted Volatility3 plugin over N dumps
  • score-detector — score detector firings against known-true key intervals
  • heap — allocator detection and heap layout (detect, summary, chunks, at, free-lists), e.g. memdiver heap summary dump.msl
  • annotations — versioned, append-only analysis record per capture (list, add, supersede, retract; --case required), e.g. memdiver annotations list --case ./case --capture <id>
  • case — the case data lake: Parquet tables, read-only SQL and locate_context (init, status, schema, query, context-at, export), e.g. memdiver case query --case ./case --sql "SELECT name, count(*) FROM annotations GROUP BY 1"
  • image — memory-image views via Volatility 3 (probe, profile, open, processes, extract), e.g. memdiver image open alma-9.lime --view process --pid 22176 --case ./case
  • isf — ISF workbench: run pakunoda probes on a full image and edit versioned ISF drafts in a case (probe, draft create|list|get|set|import|retract|versions|diff|validate|export, try, code-evidence), e.g. memdiver isf draft set ./case $SHA d struct --args '{"name": "task_struct", "size": 9792}'
  • disasm — disassemble the captured bytes at an address of a dump (never across a capture gap), e.g. memdiver disasm kernel.mdview 0xffffffff81000000 64
  • vol3 — run Volatility 3 plugins over a .mdview into a case and query them (list, describe, run, query, annotate, scaffold, check, import, write-config), e.g. memdiver vol3 run --view p.mdview --plugin linux.pslist --case ./case
  • pipeline — the whole differential pipeline in one call (run: consensus → search-reduce → brute-force → escalate → plugin, with one verdict: Recovered / Floor too high / Absent / Inconclusive; --template proven with a format oracle emits a self-proving plugin), e.g. memdiver pipeline run d1.msl d2.msl d3.msl --oracle-kind gocryptfs-gcm --oracle-sample ./vault --output-dir ./run
  • yara — YARA rule editor backend: compile-check a rule with its failing line, scan one dump's captured bytes with VA coordinates and coverage (check, scan, rules list|get|put|delete for stored library/case rules; put/delete default to the case when --case is given, get --scope library|case|auto), e.g. memdiver yara scan rule.yar dump.msl --offset 0x7f0000000000 --length 0x1000
  • keys — key finders: recognise key material by structure in a dump's captured bytes (list, scan), e.g. memdiver keys scan dump.msl --finder aes_schedule --heap-policy annotate --case ./case
  • fixtures — detector fixtures: positive controls and decoys with a pass / fail / indeterminate verdict for YARA rules and key finders (run, add, list, remove), e.g. memdiver fixtures run --kind keyfinder aes_schedule
  • strings — strings as a table with IOC badges (table), e.g. memdiver strings table dump.msl --case ./case; the strings_iocs saved query adds IOC columns
  • oracle — format oracles (gocryptfs, LUKS, XTS, AEAD, SSH, X25519) as a BYO-oracle source: list them, suggest one for a dump (always with the reason), build a spec and grade keys (formats, suggest, spec), e.g. memdiver oracle spec luks --sample hdr.bin --candidate <key hex>

Run memdiver <cmd> --help for any of them, or see the full CLI reference.

Screenshots

Workspace Hex + overlay Entropy Consensus
Workspace thumbnail Hex viewer thumbnail Entropy profile thumbnail Consensus view thumbnail

Screenshots regenerate deterministically via the Playwright harness under docs/screenshots/. Pipeline shots 09 and 10 use precomputed n-sweep fixtures produced by scripts/precompute_pipeline_fixtures.py against the gocryptfs reference dataset.

Chart backend

The four analysis charts — Entropy, Variance Map, VAS, and the Pipeline Survivor Curve — ship with two interchangeable renderers:

  • Plotly (default) — full interactive experience with pan/zoom/legend-toggle and a ~2.3 MB bundle.
  • SVG — hand-rolled React + SVG with hover tooltips but no pan/zoom, zero runtime dependencies, code-split so users who stay on SVG never download the Plotly chunk.

Switch via Settings → Display → Chart backend. The preference persists per-browser. No reload required. Both backends share the same theme tokens so dark/light/high-contrast behaviour is identical.

Where to go next

Volatility 3 plugins

MemDiver ships a suite of Volatility 3 plugins that recover secrets from Linux memory images and process captures and prove each one with a format-native oracle: linux.dmcrypt (LUKS1, LUKS2, VeraCrypt), linux.wireguard, linux.keyring, linux.fscrypt, linux.ecryptfs, memdiver.ssh, memdiver.wireguard_go, a .msl layer with msl.* plugins, and memdiver vol3 synthesize, which turns a key found in a process slice into a standalone plugin with its oracle inlined. They run under stock Volatility 3 (2.27 and 2.28): after pip install "memdiver[vol]" (or pip install memdiver next to your own Volatility 3), use vol -p "$(memdiver vol3 plugin-dir)" .... Small demo inputs are in samples/ and make validate checks every claim. See docs/vol3/ for usage, technical details, validation and compatibility.

Third-party integrations

pakunoda is a separate third-party open-source tool, not part of MemDiver. MemDiver integrates with it optionally, to build Linux kernel profiles (ISF): it is installed only with the image extra (pip install "memdiver[image]"), is imported lazily, and is never vendored in the MemDiver wheel. Without it, the features that use it report that it is not installed. Volatility 3 is likewise a separate, optional tool.

Architecture

api/            FastAPI backend — 19 routers + WebSocket, OpenAPI docs at /docs
frontend/       React + Vite SPA (TypeScript, Tailwind, Zustand) — dockable workspace
core/           Stdlib-only data layer (models, discovery, parsing, entropy, KDF, variance, ASLR alignment)
engine/         Differential Engine — ConsensusVector (Welford), SearchCorrelator, DiffStore,
                ProjectDB (DuckDB), SessionStore (.memdiver), oracle loader, Vol3 plugin emission
algorithms/     8 algorithms auto-discovered via pkgutil registry
harvester/      Data ingestion — DumpIngestor, SidecarParser, MetadataStore
architect/      Pattern Architect — static checker + generator + YARA / JSON / Volatility3 exporters
msl/            Memory Slice (.msl) v1.1.0 — hand-rolled container with BLAKE3 integrity chain
mcp_server/     MCP server — 129 tools + 8 playbook prompts + case resources for AI assistants
ui/             Marimo research sandbox (houses the 5 deeper views)
docs/           Sphinx site (Read the Docs theme), published to GitHub Pages via docs.yml

Memory Slice format

MemDiver reads and writes the open Memory Slice (.msl) container — a self-describing, integrity-chained snapshot format for process memory and sidecar metadata. The on-disk layout, capability bits, and conformance fixtures live in the dedicated specification repository so other tools can interoperate without depending on MemDiver itself:

The Python reader/writer in msl/ tracks that spec; see docs/file_formats/msl_v1_1_0.md for the in-repo summary used by this codebase.

Release process (maintainers)

  1. Bump version in pyproject.toml and move the [Unreleased] block in CHANGELOG.md under a new version heading.
  2. Commit and tag: git tag vX.Y.Z && git push origin vX.Y.Z.
  3. .github/workflows/publish.yml builds the React bundle, runs python -m build, and publishes to PyPI via OIDC trusted publishing (no token).
  4. .github/workflows/docs.yml rebuilds the Sphinx site and deploys to https://memoryslice.github.io/MemDiver/.
  5. For a pre-release dry run: gh workflow run publish.yml — the workflow_dispatch trigger publishes to test.pypi.org via the testpypi environment.

License

Apache License 2.0 — see LICENSE.

Citation

If you use MemDiver or the Memory Slice (.msl) format in your research, please cite the accompanying paper:

@article{baier2026memory,
  title={Memory Slice: A Process-Centric Dump Format for Differential Memory Analysis and Volatility 3 Plugin Synthesis},
  author={Baier, Daniel and Lambertz, Martin},
  journal={Digital Threats: Research and Practice},
  year={2026},
  publisher={ACM, New York, NY},
  doi={10.1145/3848418},
  url={https://doi.org/10.1145/3848418}
}

GitHub's "Cite this repository" button in the repository sidebar (generated from CITATION.cff) provides the same reference in APA and BibTeX format.

Metadata

Release files for memdiver 1.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for memdiver 1.2.7
File Size Uploaded Provenance Actions
memdiver-1.2.7.tar.gz 6.5 MB With provenance Details for memdiver-1.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memdiver 1.2.7
File Interpreter ABI Platform Actions
memdiver-1.2.7-py3-none-any.whl Python 3 none any Details for memdiver-1.2.7-py3-none-any.whl

Total release size: 10.9 MB

Release files / memdiver-1.2.7.tar.gz

Download URL memdiver-1.2.7.tar.gz
Size 6.5 MB
Tags Source
SHA-256 checksum
How to use checksums
519e617d4ad7ed6a7de913185bceddc2c8fbff3cebe530765ed937abb98f54b5
BLAKE2b-256 checksum
How to use checksums
11bc987dec4a660a73feb39dc0f6349e1baa9923f5335a9f98782fd6e975e897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / memdiver-1.2.7-py3-none-any.whl

Download URL memdiver-1.2.7-py3-none-any.whl
Size 4.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1751a614f3ce67def5ef7e493d4967275c31a326be43fb19b5160c30006aecc2
BLAKE2b-256 checksum
How to use checksums
b568eb0abb07acc537abfccf7a5613dde73da9a51851372f563844653677d1fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for memdiver 1.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for memdiver-1.2.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page