|
|
@ -9,17 +9,21 @@ from mythril.analysis.module.modules.dependence_on_predictable_vars import ( |
|
|
|
) |
|
|
|
) |
|
|
|
from mythril.analysis.module.modules.deprecated_ops import DeprecatedOperations |
|
|
|
from mythril.analysis.module.modules.deprecated_ops import DeprecatedOperations |
|
|
|
from mythril.analysis.module.modules.ether_thief import EtherThief |
|
|
|
from mythril.analysis.module.modules.ether_thief import EtherThief |
|
|
|
from mythril.analysis.module.modules.exceptions import ReachableExceptions |
|
|
|
from mythril.analysis.module.modules.exceptions import Exceptions |
|
|
|
from mythril.analysis.module.modules.external_calls import ExternalCalls |
|
|
|
from mythril.analysis.module.modules.external_calls import ExternalCalls |
|
|
|
from mythril.analysis.module.modules.integer import IntegerArithmetics |
|
|
|
from mythril.analysis.module.modules.integer import IntegerArithmetics |
|
|
|
from mythril.analysis.module.modules.multiple_sends import MultipleSends |
|
|
|
from mythril.analysis.module.modules.multiple_sends import MultipleSends |
|
|
|
from mythril.analysis.module.modules.state_change_external_calls import StateChangeAfterCall |
|
|
|
from mythril.analysis.module.modules.state_change_external_calls import ( |
|
|
|
|
|
|
|
StateChangeAfterCall, |
|
|
|
|
|
|
|
) |
|
|
|
from mythril.analysis.module.modules.suicide import AccidentallyKillable |
|
|
|
from mythril.analysis.module.modules.suicide import AccidentallyKillable |
|
|
|
from mythril.analysis.module.modules.unchecked_retval import UncheckedRetval |
|
|
|
from mythril.analysis.module.modules.unchecked_retval import UncheckedRetval |
|
|
|
from mythril.analysis.module.modules.user_assertions import UserAssertions |
|
|
|
from mythril.analysis.module.modules.user_assertions import UserAssertions |
|
|
|
|
|
|
|
|
|
|
|
from mythril.analysis.module.base import EntryPoint |
|
|
|
from mythril.analysis.module.base import EntryPoint |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from mythril.exceptions import DetectorNotFoundError |
|
|
|
|
|
|
|
|
|
|
|
from typing import Optional, List |
|
|
|
from typing import Optional, List |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -53,11 +57,28 @@ class ModuleLoader(object, metaclass=Singleton): |
|
|
|
:param white_list: If specified: only return whitelisted detection modules |
|
|
|
:param white_list: If specified: only return whitelisted detection modules |
|
|
|
:return: The selected detection modules |
|
|
|
:return: The selected detection modules |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
result = self._modules[:] |
|
|
|
result = self._modules[:] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if white_list: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Sanity check |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
available_names = [type(module).__name__ for module in result] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for name in white_list: |
|
|
|
|
|
|
|
if name not in available_names: |
|
|
|
|
|
|
|
raise DetectorNotFoundError( |
|
|
|
|
|
|
|
"Invalid detection module: {}".format(name) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = [ |
|
|
|
|
|
|
|
module for module in result if type(module).__name__ in white_list |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
if entry_point: |
|
|
|
if entry_point: |
|
|
|
result = [module for module in result if module.entry_point == entry_point] |
|
|
|
result = [module for module in result if module.entry_point == entry_point] |
|
|
|
if white_list: |
|
|
|
|
|
|
|
result = [module for module in result if module.name in white_list] |
|
|
|
|
|
|
|
return result |
|
|
|
return result |
|
|
|
|
|
|
|
|
|
|
|
def _register_mythril_modules(self): |
|
|
|
def _register_mythril_modules(self): |
|
|
@ -69,7 +90,7 @@ class ModuleLoader(object, metaclass=Singleton): |
|
|
|
PredictableVariables(), |
|
|
|
PredictableVariables(), |
|
|
|
DeprecatedOperations(), |
|
|
|
DeprecatedOperations(), |
|
|
|
EtherThief(), |
|
|
|
EtherThief(), |
|
|
|
ReachableExceptions(), |
|
|
|
Exceptions(), |
|
|
|
ExternalCalls(), |
|
|
|
ExternalCalls(), |
|
|
|
IntegerArithmetics(), |
|
|
|
IntegerArithmetics(), |
|
|
|
MultipleSends(), |
|
|
|
MultipleSends(), |
|
|
|