Use crude KECCAK function check

arbitrary_storage
Nikhil 5 years ago
parent 4830509be6
commit 994c57bf61
  1. 6
      mythril/analysis/modules/arbitrary_write.py
  2. 2
      mythril/laser/smt/bitvecfunc.py

@ -33,7 +33,7 @@ class AribtraryWriteAnnotation(StateAnnotation):
class ArbitraryStorage(DetectionModule): class ArbitraryStorage(DetectionModule):
"""This module searches for a feasable write to an arbitrary storage slot.""" """This module searches for a feasible write to an arbitrary storage slot."""
def __init__(self): def __init__(self):
"""""" """"""
@ -82,6 +82,10 @@ class ArbitraryStorage(DetectionModule):
if ( if (
not isinstance(write_slot, BitVecFunc) not isinstance(write_slot, BitVecFunc)
or write_slot.func_name != "keccak256" or write_slot.func_name != "keccak256"
or "KECCAK"
not in str(
write_slot
) # TODO: This KECCAK should be used in variable everywhere, Which can't be done now without inducing a backward dependence in bvfs
): ):
# Non maps # Non maps
annotation.storage_write_slots.append( annotation.storage_write_slots.append(

@ -34,7 +34,7 @@ def _arithmetic_helper(
return BitVecFunc( return BitVecFunc(
raw=raw, raw=raw,
func_name=a.func_name + "_hybrid", func_name=a.func_name,
input_=a.input_, input_=a.input_,
annotations=union, annotations=union,
nested_functions=a.nested_functions + [a], nested_functions=a.nested_functions + [a],

Loading…
Cancel
Save