|
|
|
@ -3,23 +3,27 @@ from mythril.support.support_utils import Singleton |
|
|
|
|
|
|
|
|
|
from mythril.analysis.module.modules.arbitrary_jump import ArbitraryJump |
|
|
|
|
from mythril.analysis.module.modules.arbitrary_write import ArbitraryStorage |
|
|
|
|
from mythril.analysis.module.modules.delegatecall import DelegateCallModule |
|
|
|
|
from mythril.analysis.module.modules.delegatecall import ArbitraryDelegateCall |
|
|
|
|
from mythril.analysis.module.modules.dependence_on_predictable_vars import ( |
|
|
|
|
PredictableDependenceModule, |
|
|
|
|
PredictableVariables, |
|
|
|
|
) |
|
|
|
|
from mythril.analysis.module.modules.deprecated_ops import DeprecatedOperationsModule |
|
|
|
|
from mythril.analysis.module.modules.deprecated_ops import DeprecatedOperations |
|
|
|
|
from mythril.analysis.module.modules.ether_thief import EtherThief |
|
|
|
|
from mythril.analysis.module.modules.exceptions import ReachableExceptionsModule |
|
|
|
|
from mythril.analysis.module.modules.exceptions import Exceptions |
|
|
|
|
from mythril.analysis.module.modules.external_calls import ExternalCalls |
|
|
|
|
from mythril.analysis.module.modules.integer import IntegerOverflowUnderflowModule |
|
|
|
|
from mythril.analysis.module.modules.multiple_sends import MultipleSendsModule |
|
|
|
|
from mythril.analysis.module.modules.state_change_external_calls import StateChange |
|
|
|
|
from mythril.analysis.module.modules.suicide import SuicideModule |
|
|
|
|
from mythril.analysis.module.modules.unchecked_retval import UncheckedRetvalModule |
|
|
|
|
from mythril.analysis.module.modules.integer import IntegerArithmetics |
|
|
|
|
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.suicide import AccidentallyKillable |
|
|
|
|
from mythril.analysis.module.modules.unchecked_retval import UncheckedRetval |
|
|
|
|
from mythril.analysis.module.modules.user_assertions import UserAssertions |
|
|
|
|
|
|
|
|
|
from mythril.analysis.module.base import EntryPoint |
|
|
|
|
|
|
|
|
|
from mythril.exceptions import DetectorNotFoundError |
|
|
|
|
|
|
|
|
|
from typing import Optional, List |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -53,11 +57,28 @@ class ModuleLoader(object, metaclass=Singleton): |
|
|
|
|
:param white_list: If specified: only return whitelisted detection modules |
|
|
|
|
:return: The selected detection 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: |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
def _register_mythril_modules(self): |
|
|
|
@ -65,17 +86,17 @@ class ModuleLoader(object, metaclass=Singleton): |
|
|
|
|
[ |
|
|
|
|
ArbitraryJump(), |
|
|
|
|
ArbitraryStorage(), |
|
|
|
|
DelegateCallModule(), |
|
|
|
|
PredictableDependenceModule(), |
|
|
|
|
DeprecatedOperationsModule(), |
|
|
|
|
ArbitraryDelegateCall(), |
|
|
|
|
PredictableVariables(), |
|
|
|
|
DeprecatedOperations(), |
|
|
|
|
EtherThief(), |
|
|
|
|
ReachableExceptionsModule(), |
|
|
|
|
Exceptions(), |
|
|
|
|
ExternalCalls(), |
|
|
|
|
IntegerOverflowUnderflowModule(), |
|
|
|
|
MultipleSendsModule(), |
|
|
|
|
StateChange(), |
|
|
|
|
SuicideModule(), |
|
|
|
|
UncheckedRetvalModule(), |
|
|
|
|
IntegerArithmetics(), |
|
|
|
|
MultipleSends(), |
|
|
|
|
StateChangeAfterCall(), |
|
|
|
|
AccidentallyKillable(), |
|
|
|
|
UncheckedRetval(), |
|
|
|
|
UserAssertions(), |
|
|
|
|
] |
|
|
|
|
) |
|
|
|
|