#!/bin/sh
if [ x$1 = x ] || [ x$2 = x ] || [ x$3 = x ] || [ x$4 = x ]
then
echo "Usage:$0 pid beginaddr endaddr outname"
exit
fi
pid=$1
ba=$(($2))
ea=$(($3))
on=$4
bs=4096
`dd if=/proc/$pid/mem of=$outname bs=$bs skip=$(($ba/$bs)) count=$((($ea-$ba)/bs))`