Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cc
easy-re
Commits
0c49039d
Commit
0c49039d
authored
Jan 11, 2018
by
Christopher Roberts
Browse files
Added avoid logic
parent
e16b11a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
easy_re.py
View file @
0c49039d
...
...
@@ -4,13 +4,21 @@ parser.add_argument('-f', '--file', help='Binary File')
parser
.
add_argument
(
'-s'
,
'--start'
,
help
=
'Where to start analyzing from'
)
parser
.
add_argument
(
'-e'
,
'--end'
,
help
=
'Where to stop analyzing'
)
parser
.
add_argument
(
'-a'
,
'--args'
,
help
=
'Solve for a symbolic arg (optional)'
,
default
=
False
,
action
=
'store_true'
)
parser
.
add_argument
(
'-x'
,
'--avoid'
,
help
=
'Where to avoid analysis, eg 0x12345678,0x12345678'
)
avoidList
=
[]
args
=
parser
.
parse_args
()
if
args
.
avoid
:
avoidList
=
[
int
(
x
,
16
)
for
x
in
args
.
avoid
.
split
(
','
)]
if
args
.
file
is
None
or
args
.
file
is
''
:
print
(
"[-] Missing file to analyze"
)
exit
(
0
)
#Load imports after displaying help to get a fast menu
import
angr
,
claripy
,
simuvex
import
angr
,
claripy
p
=
angr
.
Project
(
args
.
file
,
load_options
=
{
"auto_load_libs"
:
False
})
argv1
=
claripy
.
BVS
(
"argv1"
,
8
*
100
)
# Setting to 100 max chars for argument
state
=
None
...
...
@@ -18,8 +26,11 @@ if args.args:
state
=
p
.
factory
.
path
(
args
=
[
args
.
file
,
argv1
])
else
:
state
=
p
.
factory
.
blank_state
(
addr
=
int
(
args
.
start
,
0
))
pg
=
p
.
factory
.
path_group
(
state
)
pg
.
explore
(
find
=
int
(
args
.
end
,
0
),
avoid
=
[])
print
(
"[+] Analyzing {} from {} to {} avoiding {}"
.
format
(
args
.
file
,
args
.
start
,
args
.
end
,
args
.
avoid
))
pg
=
p
.
factory
.
simgr
(
state
)
pg
.
explore
(
find
=
int
(
args
.
end
,
0
),
avoid
=
avoidList
)
if
len
(
pg
.
found
):
print
(
"[+] Found path(s)"
)
for
path
in
pg
.
found
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment