pull/780/head
Nathan 6 years ago
parent 0335a71a45
commit e2557432a5
  1. 4
      mythril/analysis/modules/dependence_on_predictable_vars.py
  2. 1
      mythril/analysis/modules/exceptions.py
  3. 1
      mythril/analysis/modules/transaction_order_dependence.py
  4. 1
      mythril/analysis/modules/unchecked_retval.py
  5. 4
      mythril/ethereum/interface/leveldb/accountindexing.py
  6. 14
      mythril/interfaces/cli.py
  7. 4
      mythril/laser/ethereum/instructions.py
  8. 8
      mythril/laser/ethereum/svm.py
  9. 1
      mythril/laser/ethereum/taint_analysis.py
  10. 1
      mythril/mythril.py
  11. 5
      mythril/support/loader.py
  12. 1
      mythril/support/truffle.py

@ -33,9 +33,7 @@ class PredictableDependenceModule(DetectionModule):
for call in statespace.calls:
if "callvalue" in str(call.value):
log.debug(
"[DEPENDENCE_ON_PREDICTABLE_VARS] Skipping refund function"
)
log.debug("[DEPENDENCE_ON_PREDICTABLE_VARS] Skipping refund function")
continue
# We're only interested in calls that send Ether

@ -8,6 +8,7 @@ import logging
log = logging.getLogger(__name__)
class ReachableExceptionsModule(DetectionModule):
def __init__(self):
super().__init__(

@ -12,6 +12,7 @@ from mythril.exceptions import UnsatError
log = logging.getLogger(__name__)
class TxOrderDependenceModule(DetectionModule):
def __init__(self):
super().__init__(

@ -8,6 +8,7 @@ import re
log = logging.getLogger(__name__)
class UncheckedRetvalModule(DetectionModule):
def __init__(self):
super().__init__(

@ -78,9 +78,7 @@ class AccountIndexer(object):
"""
Processesing method
"""
log.debug(
"Processing blocks %d to %d" % (startblock, startblock + BATCH_SIZE)
)
log.debug("Processing blocks %d to %d" % (startblock, startblock + BATCH_SIZE))
addresses = []

@ -191,7 +191,9 @@ def main():
options.add_argument(
"--enable-physics", action="store_true", help="enable graph physics simulation"
)
options.add_argument("-v", type=int, help="log level (0-2)", metavar="LOG_LEVEL", default=0)
options.add_argument(
"-v", type=int, help="log level (0-2)", metavar="LOG_LEVEL", default=0
)
options.add_argument(
"-q",
"--query-signature",
@ -247,18 +249,20 @@ def main():
if args.v:
if 0 <= args.v < 3:
'''
"""
logging.basicConfig(
format="%(name)s[%(process)d] %(levelname)s %(message)s",
level=[logging.NOTSET, logging.INFO, logging.DEBUG][args.v],
)
'''
"""
coloredlogs.install(
#fmt="%(filename)s[%(process)d] %(levelname)s %(message)s",
# fmt="%(filename)s[%(process)d] %(levelname)s %(message)s",
fmt="%(name)s[%(process)d] %(levelname)s %(message)s",
level=[logging.NOTSET, logging.INFO, logging.DEBUG][args.v],
)
logging.getLogger("mythril").setLevel([logging.NOTSET, logging.INFO, logging.DEBUG][args.v])
logging.getLogger("mythril").setLevel(
[logging.NOTSET, logging.INFO, logging.DEBUG][args.v]
)
else:
exit_with_error(
args.outform, "Invalid -v value, you can find valid values in usage"

@ -865,9 +865,7 @@ class Instruction:
try:
state.mem_extend(mstart, 32)
except Exception:
log.debug(
"Error extending memory, mstart = " + str(mstart) + ", size = 32"
)
log.debug("Error extending memory, mstart = " + str(mstart) + ", size = 32")
log.debug("MSTORE to mem[" + str(mstart) + "]: " + str(value))

@ -78,9 +78,7 @@ class LaserEVM:
self.pre_hooks = defaultdict(list)
self.post_hooks = defaultdict(list)
log.info(
"LASER EVM initialized with dynamic loader: " + str(dynamic_loader)
)
log.info("LASER EVM initialized with dynamic loader: " + str(dynamic_loader))
def register_hooks(self, hook_type: str, hook_dict: Dict[str, List[Callable]]):
if hook_type == "pre":
@ -224,9 +222,7 @@ class LaserEVM:
# In this case we don't put an unmodified world state in the open_states list Since in the case of an
# exceptional halt all changes should be discarded, and this world state would not provide us with a
# previously unseen world state
log.debug(
"Encountered a VmException, ending path: `{}`".format(str(e))
)
log.debug("Encountered a VmException, ending path: `{}`".format(str(e)))
new_global_states = []
else:
# First execute the post hook for the transaction ending instruction

@ -10,6 +10,7 @@ from mythril.analysis.symbolic import SymExecWrapper
log = logging.getLogger(__name__)
class TaintRecord:
"""
TaintRecord contains tainting information for a specific (state, node)

@ -36,6 +36,7 @@ from mythril.ethereum.interface.leveldb.client import EthLevelDB
log = logging.getLogger(__name__)
class Mythril(object):
"""
Mythril main interface class.

@ -4,6 +4,7 @@ import re
log = logging.getLogger(__name__)
class DynLoader:
def __init__(self, eth, contract_loading=True, storage_loading=True):
self.eth = eth
@ -47,9 +48,7 @@ class DynLoader:
if not self.contract_loading:
raise ValueError("Cannot load contract when contract_loading flag is false")
log.debug(
"Dynld at contract " + contract_address + ": " + dependency_address
)
log.debug("Dynld at contract " + contract_address + ": " + dependency_address)
m = re.match(r"^(0x[0-9a-fA-F]{40})$", dependency_address)

@ -16,6 +16,7 @@ from mythril.laser.ethereum.util import get_instruction_index
log = logging.getLogger(__name__)
def analyze_truffle_project(sigs, args):
project_root = os.getcwd()

Loading…
Cancel
Save