Created
May 12, 2020 00:50
-
-
Save Zobber/286ef5735d5692ef5c3584c17646fca7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Pure bash | |
procdump() | |
( | |
cat /proc/$1/maps | grep "rw-p" | 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 ) | |
) | |
###### procdump PID | |
procdump() | |
( | |
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