I parsed /proc/PID/maps using shell script , now I have 2 variable
START_ADDR=982fe000
END_ADDR=984fe000
I want to use those variable for dd using shell script command like:
dd if=SOME_MEMORY skip=START_ADDR count=(END_ADDR-START_ADDR) of=out.bin bs=1
How can I convert those variable for dd?
As you didn't mention which shell you are using, I am assuming you are using
bash.Keeping that in mind, you can modify your above command as shown below to make it work.
You need to make sure the variables
SOME_MEMORY,END_ADDRandSTART_ADDRare accessible and present in current shell environment, to verify you can doecho $SOME_MEMORY,echo $START_ADDRand similarlyecho $END_ADDR