Fix output of unchecked_suicide module

pull/79/head
Bernhard Mueller 7 years ago
parent 40073f708f
commit 45a4cb6c8e
  1. 14
      mythril/analysis/modules/suicide.py
  2. 3
      mythril/analysis/symbolic.py

@ -32,21 +32,21 @@ def execute(statespace):
logging.debug("[UNCHECKED_SUICIDE] suicide in function " + node.function_name)
description = "The function " + node.function_name + " executes the SUICIDE instruction."
description = "The function " + node.function_name + " executes the SUICIDE instruction. "
stack = copy.deepcopy(state.mstate.stack)
to = stack.pop()
if ("caller" in str(to)):
description += "\nThe remaining Ether is sent to the caller's address.\n"
description += "The remaining Ether is sent to the caller's address."
elif ("storage" in str(to)):
description += "\nThe remaining Ether is sent to a stored address\n"
description += "The remaining Ether is sent to a stored address."
elif ("calldata" in str(to)):
description += "\nThe remaining Ether is sent to an address provided as a function argument."
description += "The remaining Ether is sent to an address provided as a function argument."
elif (type(to) == BitVecNumRef):
description += "\nThe remaining Ether is sent to: " + hex(to.as_long())
description += "The remaining Ether is sent to: " + hex(to.as_long())
else:
description += "\nThe remaining Ether is sent to: " + str(to) + "\n"
description += "The remaining Ether is sent to: " + str(to) + "\n"
constrained = False
can_solve = True
@ -66,6 +66,8 @@ def execute(statespace):
constrained = True
idx = m.group(1)
logging.debug("STORAGE CONSTRAINT FOUND: " + idx)
func = statespace.find_storage_write(idx)
if func:

@ -1,6 +1,7 @@
from mythril import ether
from laser.ethereum import svm
import copy
import logging
from .ops import get_variable, SStore, Call, VarType
@ -67,6 +68,8 @@ class SymExecWrapper:
index, value = stack.pop(), stack.pop()
logging.debug("FOUND SSTORE TO INDEX: " + str(index))
try:
self.sstors[str(index)].append(SStore(self.nodes[key], state, state_index, value))
except KeyError:

Loading…
Cancel
Save