From 994c57bf61fc17fb9130a6d22f4e4f4b16648d02 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Tue, 6 Aug 2019 09:09:24 +0530 Subject: [PATCH] Use crude KECCAK function check --- mythril/analysis/modules/arbitrary_write.py | 6 +++++- mythril/laser/smt/bitvecfunc.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mythril/analysis/modules/arbitrary_write.py b/mythril/analysis/modules/arbitrary_write.py index dbd1c974..3a9f61b8 100644 --- a/mythril/analysis/modules/arbitrary_write.py +++ b/mythril/analysis/modules/arbitrary_write.py @@ -33,7 +33,7 @@ class AribtraryWriteAnnotation(StateAnnotation): 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): """""" @@ -82,6 +82,10 @@ class ArbitraryStorage(DetectionModule): if ( not isinstance(write_slot, BitVecFunc) 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 annotation.storage_write_slots.append( diff --git a/mythril/laser/smt/bitvecfunc.py b/mythril/laser/smt/bitvecfunc.py index 31c4c3de..68daeb00 100644 --- a/mythril/laser/smt/bitvecfunc.py +++ b/mythril/laser/smt/bitvecfunc.py @@ -34,7 +34,7 @@ def _arithmetic_helper( return BitVecFunc( raw=raw, - func_name=a.func_name + "_hybrid", + func_name=a.func_name, input_=a.input_, annotations=union, nested_functions=a.nested_functions + [a],