Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zafl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
zafl
Commits
fa53ecec
Commit
fa53ecec
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
New options: --ida and --rida (default)
parent
d1022da5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/zafl.sh
+51
-1
51 additions, 1 deletion
bin/zafl.sh
with
51 additions
and
1 deletion
bin/zafl.sh
+
51
−
1
View file @
fa53ecec
...
...
@@ -4,12 +4,62 @@
#
# @todo: make it more user-friendly and have zafl-specific options
#
usage
()
{
echo
echo
"zafl.sh <input_binary> <output_zafl_binary> [options]"
echo
echo
"options:"
echo
" --ida Use IDAPro"
echo
" --rida (default) Do not use IDAPro"
}
if
[
"
$1
"
=
"-h"
-o
"
$1
"
=
"--help"
]
;
then
usage
exit
0
fi
if
[
"$#"
-lt
2
]
;
then
usage
exit
1
fi
input_binary
=
$1
output_zafl_binary
=
$2
shift
shift
# default is rida
ida_or_rida
=
" -s meds_static=off -s rida=on "
other_args
=
""
# parse args
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
usage
exit
0
;;
--ida
)
ida_or_rida
=
" "
shift
;;
--rida
)
ida_or_rida
=
" -s meds_static=off -s rida=on "
shift
;;
*
)
# unknown option
other_args
=
"
$other_args
$1
"
shift
# past argument
;;
esac
done
# find main
tmp_objdump
=
/tmp/
$$
.objdump
objdump
-d
$input_binary
>
$tmp_objdump
...
...
@@ -37,7 +87,7 @@ rm $tmp_objdump
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
-s meds_static=off -s
rida
=on
-c move_globals=on -c zafl=on -o move_globals:--elftables -o zipr:--traceplacement:on -o zafl:--stars
$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
"
eval
$cmd
if
[
$?
-eq
0
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment