Created
August 10, 2017 21:00
-
-
Save tpruzina/d30eb213b15e57b8158c5cf0bb528c1c to your computer and use it in GitHub Desktop.
Radare2 automatic session store (.zshrc function)
This file contains 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
# automatically calculates md5 of binary path and saves it as a name for project file | |
function r2() | |
{ | |
BACKUP="$@" | |
MD5="" | |
NAME="" | |
while [[ "$#" -gt 0 ]]; do | |
if [ -f "$1" ]; then | |
NAME=$(realpath $1) | |
MD5=$(echo $NAME | md5sum | awk '{print $1}') | |
#echo "MD5 $MD5" | |
#echo "NAME $NAME" | |
fi | |
shift | |
done | |
if [[ $MD5 == "" ]]; then | |
radare2 $BACKUP | |
else | |
#echo "executing radare2 -p $MD5 $BACKUP" | |
radare2 -p $MD5 ${ARG} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment