Add 'support' for symbolic storage addresses

dependency_prune_v2
Bernhard Mueller 6 years ago
parent 337d3e7ea9
commit 57883f2d63
  1. 10
      mythril/laser/ethereum/plugins/implementations/dependency_pruner.py

@ -168,7 +168,7 @@ class DependencyPruner(LaserPlugin):
:return: :return:
""" """
if self.iteration < 2: if self.iteration < 1:
return return
annotation.path.append(address) annotation.path.append(address)
@ -194,12 +194,10 @@ class DependencyPruner(LaserPlugin):
index = get_concrete_int(state.mstate.stack[-1]) index = get_concrete_int(state.mstate.stack[-1])
except TypeError: except TypeError:
m = hashlib.md5() m = hashlib.md5()
m.update(str(state.mstate.stack[-1]).encode('utf-8')) m.update(str(state.mstate.stack[-1]).encode("utf-8"))
index = m.digest().hex() index = m.digest().hex()
annotation.extend_storage_write_cache( annotation.extend_storage_write_cache(self.iteration, index)
self.iteration, index
)
@symbolic_vm.pre_hook("SLOAD") @symbolic_vm.pre_hook("SLOAD")
def sload_hook(state: GlobalState): def sload_hook(state: GlobalState):
@ -208,7 +206,7 @@ class DependencyPruner(LaserPlugin):
index = get_concrete_int(state.mstate.stack[-1]) index = get_concrete_int(state.mstate.stack[-1])
except TypeError: except TypeError:
m = hashlib.md5() m = hashlib.md5()
m.update(str(state.mstate.stack[-1]).encode('utf-8')) m.update(str(state.mstate.stack[-1]).encode("utf-8"))
index = m.digest().hex() index = m.digest().hex()
annotation = get_dependency_annotation(state) annotation = get_dependency_annotation(state)

Loading…
Cancel
Save