Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created July 25, 2025 18:01
Show Gist options
  • Save bjhaid/20f3df6f9cca8fbfdaebed23010f6594 to your computer and use it in GitHub Desktop.
Save bjhaid/20f3df6f9cca8fbfdaebed23010f6594 to your computer and use it in GitHub Desktop.
dump linux process memory
cat /proc/$1/maps | grep -Fv ".so" | grep " 0 " | awk '{print $1}' | ( IFS="-"
while read a b; do
dd if=/proc/$1/mem bs=$( getconf PAGESIZE ) iflag=skip_bytes,count_bytes \
skip=$(( 0x$a )) count=$(( 0x$b - 0x$a )) of="$1_mem_$a.bin"
done )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment