Skip to content
Snippets Groups Projects
Commit c3c283be authored by Anh Nguyen-Tuong's avatar Anh Nguyen-Tuong
Browse files

Add --stars --no-stars option to zafl

parent 0b31001b
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,10 @@ usage() ...@@ -10,8 +10,10 @@ usage()
echo "zafl.sh <input_binary> <output_zafl_binary> [options]" echo "zafl.sh <input_binary> <output_zafl_binary> [options]"
echo echo
echo "options:" echo "options:"
echo " --ida Use IDAPro" echo " --ida Use IDAPro (default)"
echo " --rida (default) Do not use IDAPro" echo " --rida Do not use IDAPro"
echo " --stars Use STARS (default)"
echo " --no-stars Do not use STARS"
} }
if [ "$1" = "-h" -o "$1" = "--help" ]; if [ "$1" = "-h" -o "$1" = "--help" ];
...@@ -31,11 +33,9 @@ output_zafl_binary=$2 ...@@ -31,11 +33,9 @@ output_zafl_binary=$2
shift shift
shift shift
# default is rida #ida_or_rida_opt=" -s meds_static=off -s rida=on "
#ida_or_rida=" -s meds_static=off -s rida=on " ida_or_rida_opt=" "
stars_opt=" -o zafl:--stars "
# default is ida
ida_or_rida=" "
other_args="" other_args=""
# parse args # parse args
...@@ -49,11 +49,19 @@ do ...@@ -49,11 +49,19 @@ do
exit 0 exit 0
;; ;;
--ida) --ida)
ida_or_rida=" " ida_or_rida_opt=" "
shift shift
;; ;;
--rida) --rida)
ida_or_rida=" -s meds_static=off -s rida=on " ida_or_rida_opt=" -s meds_static=off -s rida=on "
shift
;;
--stars)
stars_opt=" -o zafl:--stars "
shift
;;
--no-stars)
stars_opt=" "
shift shift
;; ;;
*) # unknown option *) # unknown option
...@@ -89,8 +97,7 @@ fi ...@@ -89,8 +97,7 @@ fi
rm $tmp_objdump rm $tmp_objdump
echo "Zafl: Transforming input binary $input_binary into $output_zafl_binary" echo "Zafl: Transforming input binary $input_binary into $output_zafl_binary"
#cmd="$PSZ $input_binary $output_zafl_binary -c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on -o zafl:--stars $*" cmd="$PSZ $input_binary $output_zafl_binary $ida_or_rida_opt -c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on $stars_opt $options $*"
cmd="$PSZ $input_binary $output_zafl_binary $ida_or_rida -c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on -o zafl:--stars $options $*"
echo "Zafl: Issuing command: $cmd" echo "Zafl: Issuing command: $cmd"
eval $cmd eval $cmd
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment