Add cmdline argument for configuring symbolic exec depth

pull/41/head
Bernhard Mueller 7 years ago
parent 36b37d4c58
commit eaf7dbe7ea
  1. 9
      myth
  2. 4
      mythril/analysis/symbolic.py

@ -71,6 +71,7 @@ options.add_argument('--rpchost', default='127.0.0.1', help='RPC host')
options.add_argument('--rpcport', type=int, default=8545, help='RPC port')
options.add_argument('--rpctls', type=bool, default=False, help='RPC port')
options.add_argument('--ipc', help='use IPC interface instead of RPC', action='store_true')
options.add_argument('--max-depth', type=int, default=12, help='Maximum recursion depth for symbolic execution')
options.add_argument('--enable-physics', type=bool, default=False, help='enable graph physics simulation')
options.add_argument('-v', type=int, help='log level (0-2)', metavar='LOG_LEVEL')
@ -248,9 +249,9 @@ elif (args.graph) or (args.fire_lasers):
if (args.graph):
if (args.dynld):
states = StateSpace(contracts, dynloader=DynLoader(eth), simplified=True)
states = StateSpace(contracts, dynloader=DynLoader(eth), max_depth=args.max_depth)
else:
states = StateSpace(contracts, simplified=True)
states = StateSpace(contracts, max_depth=args.max_depth)
if args.enable_physics is not None:
physics = True
@ -266,9 +267,9 @@ elif (args.graph) or (args.fire_lasers):
else:
if (args.dynld):
states = StateSpace(contracts, dynloader=DynLoader(eth), simplified=False)
states = StateSpace(contracts, dynloader=DynLoader(eth), max_depth=args.max_depth)
else:
states = StateSpace(contracts, simplified=False)
states = StateSpace(contracts, max_depth=args.max_depth)
fire_lasers(states)

@ -11,7 +11,7 @@ class StateSpace:
Symbolic EVM wrapper
'''
def __init__(self, contracts, dynloader = None, simplified=False):
def __init__(self, contracts, dynloader = None, max_depth = 12):
# Convert ETHContract objects to LASER SVM "modules"
@ -20,7 +20,7 @@ class StateSpace:
for contract in contracts:
modules[contract.address] = contract.as_dict()
self.svm = svm.SVM(modules, simplified = simplified, dynamic_loader=dynloader)
self.svm = svm.SVM(modules, dynamic_loader=dynloader, max_depth=max_depth)
self.svm.sym_exec(contracts[0].address)

Loading…
Cancel
Save