Commit 0c49039d authored by Christopher Roberts's avatar Christopher Roberts

Added avoid logic

parent e16b11a1
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment