Created
August 7, 2020 20:55
-
-
Save W4nn4Die/36c9b5b82dfcb2b45e593a0e86cea492 to your computer and use it in GitHub Desktop.
This small code in bash can convert your address into a valid address for BOF
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
| #!/bin/bash | |
| if [ $# -ne 1 ]; then | |
| echo "Must enter one parameter" | |
| exit 1 | |
| fi | |
| if [ $(expr length $1) -ne 8 ]; then | |
| echo "Length is not 8" | |
| exit 2 | |
| fi | |
| addr=$(echo $1 | sed 's|..|\\x&|g') | |
| declare finalA="" | |
| declare -i cont=5 | |
| while [ ${cont} -ne 1 ]; do | |
| finalA+="\\"`echo ${addr} | cut -d'\\' -f${cont}` | |
| let cont=${cont}-1 | |
| done | |
| echo $finalA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment