diff --git a/mythril/analysis/symbolic.py b/mythril/analysis/symbolic.py index e4099469..c41fb28e 100644 --- a/mythril/analysis/symbolic.py +++ b/mythril/analysis/symbolic.py @@ -46,6 +46,7 @@ class SymExecWrapper: modules=(), compulsory_statespace=True, enable_iprof=False, + disable_dependency_pruning=False, run_analysis_modules=True, ): """ @@ -96,9 +97,11 @@ class SymExecWrapper: plugin_loader = LaserPluginLoader(self.laser) plugin_loader.load(PluginFactory.build_mutation_pruner_plugin()) - plugin_loader.load(PluginFactory.build_dependency_pruner_plugin()) plugin_loader.load(PluginFactory.build_instruction_coverage_plugin()) + if not disable_dependency_pruning: + plugin_loader.load(PluginFactory.build_dependency_pruner_plugin()) + if run_analysis_modules: self.laser.register_hooks( hook_type="pre", diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 2d3a63e1..4c9d4222 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -249,6 +249,11 @@ def create_parser(parser: argparse.ArgumentParser) -> None: options.add_argument( "--enable-iprof", action="store_true", help="enable the instruction profiler" ) + options.add_argument( + "--disable-dependency-pruning", + action="store_true", + help="Deactivate dependency-based pruning", + ) rpc = parser.add_argument_group("RPC options") @@ -417,6 +422,7 @@ def execute_command( loop_bound=args.loop_bound, create_timeout=args.create_timeout, enable_iprof=args.enable_iprof, + disable_dependency_pruning=args.disable_dependency_pruning, onchain_storage_access=not args.no_onchain_storage_access, ) diff --git a/mythril/mythril/mythril_analyzer.py b/mythril/mythril/mythril_analyzer.py index 9433278e..d6267a94 100644 --- a/mythril/mythril/mythril_analyzer.py +++ b/mythril/mythril/mythril_analyzer.py @@ -38,6 +38,7 @@ class MythrilAnalyzer: loop_bound: Optional[int] = None, create_timeout: Optional[int] = None, enable_iprof: bool = False, + disable_dependency_pruning: bool = False, ): """ @@ -57,6 +58,7 @@ class MythrilAnalyzer: self.loop_bound = loop_bound self.create_timeout = create_timeout self.enable_iprof = enable_iprof + self.disable_dependency_pruning = disable_dependency_pruning def dump_statespace(self, contract: EVMContract = None) -> str: """ @@ -77,6 +79,7 @@ class MythrilAnalyzer: execution_timeout=self.execution_timeout, create_timeout=self.create_timeout, enable_iprof=self.enable_iprof, + disable_dependency_pruning=self.disable_dependency_pruning, run_analysis_modules=False, ) @@ -111,6 +114,7 @@ class MythrilAnalyzer: transaction_count=transaction_count, create_timeout=self.create_timeout, enable_iprof=self.enable_iprof, + disable_dependency_pruning=self.disable_dependency_pruning, run_analysis_modules=False, ) return generate_graph(sym, physics=enable_physics, phrackify=phrackify) @@ -150,6 +154,7 @@ class MythrilAnalyzer: modules=modules, compulsory_statespace=False, enable_iprof=self.enable_iprof, + disable_dependency_pruning=self.disable_dependency_pruning, ) issues = fire_lasers(sym, modules)