And use address for comparison in taint analysis

pull/375/head^2
Joran Honig 6 years ago
parent 7c839b9825
commit b7c67962d8
  1. 18
      mythril/laser/ethereum/state.py
  2. 2
      mythril/laser/ethereum/taint_analysis.py

@ -38,13 +38,14 @@ class Account:
def add_balance(self, balance):
self.balance += balance
def get_storage(self, index):
if index in self.storage.keys():
return self.storage[index]
else:
symbol = BitVec("storage_" + str(index), 256)
self.storage[index] = symbol
return symbol
# def get_storage(self, index):
# return BitVec("storage_" + str(index), 256)
# if index in self.storage.keys():
# return self.storage[index]
# else:
# symbol = BitVec("storage_" + str(index), 256)
# self.storage[index] = symbol
# return symbol
@property
def as_dict(self):
@ -83,6 +84,7 @@ class Environment:
def __str__(self):
return str(self.as_dict)
@property
def as_dict(self):
return dict(active_account=self.active_account, sender=self.sender, calldata=self.calldata,
@ -150,7 +152,7 @@ class GlobalState:
def __copy__(self):
accounts = self.accounts
accounts = copy(self.accounts)
environment = copy(self.environment)
mstate = deepcopy(self.mstate)
call_stack = copy(self.call_stack)

@ -118,7 +118,7 @@ class TaintRunner:
direct_children = [statespace.nodes[edge.node_to] for edge in statespace.edges if edge.node_from == node.uid]
children = []
for child in direct_children:
if child.states[0].environment.active_account == environment.active_account:
if child.states[0].environment.active_account.address == environment.active_account.address:
children.append(child)
else:
children += TaintRunner.children(child, statespace, environment)

Loading…
Cancel
Save