Skip to content

Instantly share code, notes, and snippets.

@luca-m
Created February 27, 2018 14:24
Show Gist options
  • Save luca-m/066bdc06142aeb58f2062a060e094b90 to your computer and use it in GitHub Desktop.
Save luca-m/066bdc06142aeb58f2062a060e094b90 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Credits: https://github.com/4shadoww
mkdir dump-cache
rm dump-cache/*.dump
grep rw-p /proc/$1/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch --pid $1 -ex "dump memory dump-cache/$1-$start-$stop.dump 0x$start 0x$stop"; done
cat dump-cache/*.dump > $1-dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment