Experiment quickstart

Run an experiment to collect repeatable captures from a target program. MemDiver starts the program, waits for its ready marker, and captures memory with the selected backend.

Backends

Backend

Output

Install

memslicer

.msl

pip install "memdiver[capture]"

lldb

.dump

OS package (see below)

fridump

.dump

the fridump module/script itself must be installed separately (frida comes with the capture extra: pip install 'memdiver[capture]'); needs an attachable target

LLDB install per OS

# macOS  (LLDB ships with Xcode Command Line Tools)
xcode-select --install

# Debian / Ubuntu
sudo apt install lldb

# Fedora / RHEL
sudo dnf install lldb

Note

fridump is a Frida-based bulk memory dumper. It is not the same as friTap, despite the name similarity.

First experiment

  1. Run python -m pip install 'memdiver[capture]' in the environment that starts MemDiver. Use a separate environment if you also use Marimo. Install Fridump separately if you select that backend. For LLDB, run xcode-select --install on macOS or apt install lldb on Debian or Ubuntu.

  2. Write a target script that prints MEMDIVER_PID=<pid>, MEMDIVER_KEY=<hex>, MEMDIVER_IV=<hex>, MEMDIVER_READY=1 on stdout, then idles with the key in memory.

  3. Run:

    memdiver experiment --target path/to/target.py --num-runs 10 --output-dir ./experiment_output
    
  4. Inspect ./experiment_output/AES256/aes_key_in_memory/<tool>/ for dumps + keylog.csv, and ./experiment_output/plugins/*.py for the auto-generated Volatility3 plugin.

Capturing a running process (local, Android, remote)

experiment starts its own local target. To dump a process that is already running, possibly on an Android device or behind a remote frida-server, use capture:

memdiver capture 5552 app.msl --device usb:emulator-5556           # memslicer -D
memdiver capture 5552 app.msl --device usb                         # first USB device (-U)
memdiver capture 1234 app.msl --device remote:192.168.1.20:27042   # remote frida-server (-R)
memdiver capture 4242 snap.lldb_raw.bin --tool lldb                # local, chunked lldb

Every region that was not captured is reported (stderr, the JSON report’s skipped list, and <dump>.capture.json). See the capture notes in the CLI reference.

Layout produced

experiment_output/
  AES256/aes_key_in_memory/<tool>/<tool>_run_256_<N>/
    <TIMESTAMP>_pre_snapshot.<msl|dump>
    keylog.csv
  plugins/<tool>_aes256_key.py     # Volatility3 plugin
  plugins/<tool>_aes256_key.yar    # YARA rule