Add a check for analysis modules run (#1064)

pull/1071/head
Nikhil Parasaram 6 years ago committed by GitHub
parent d51d8fd871
commit 85c599d832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      mythril/analysis/symbolic.py
  2. 2
      mythril/mythril/mythril_analyzer.py

@ -42,6 +42,7 @@ class SymExecWrapper:
modules=(), modules=(),
compulsory_statespace=True, compulsory_statespace=True,
enable_iprof=False, enable_iprof=False,
run_analysis_modules=True,
): ):
""" """
@ -90,14 +91,15 @@ class SymExecWrapper:
plugin_loader.load(PluginFactory.build_mutation_pruner_plugin()) plugin_loader.load(PluginFactory.build_mutation_pruner_plugin())
plugin_loader.load(PluginFactory.build_instruction_coverage_plugin()) plugin_loader.load(PluginFactory.build_instruction_coverage_plugin())
self.laser.register_hooks( if run_analysis_modules:
hook_type="pre", self.laser.register_hooks(
hook_dict=get_detection_module_hooks(modules, hook_type="pre"), hook_type="pre",
) hook_dict=get_detection_module_hooks(modules, hook_type="pre"),
self.laser.register_hooks( )
hook_type="post", self.laser.register_hooks(
hook_dict=get_detection_module_hooks(modules, hook_type="post"), hook_type="post",
) hook_dict=get_detection_module_hooks(modules, hook_type="post"),
)
if isinstance(contract, SolidityContract): if isinstance(contract, SolidityContract):
self.laser.sym_exec( self.laser.sym_exec(

@ -75,6 +75,7 @@ class MythrilAnalyzer:
execution_timeout=self.execution_timeout, execution_timeout=self.execution_timeout,
create_timeout=self.create_timeout, create_timeout=self.create_timeout,
enable_iprof=self.enable_iprof, enable_iprof=self.enable_iprof,
run_analysis_modules=False,
) )
return get_serializable_statespace(sym) return get_serializable_statespace(sym)
@ -108,6 +109,7 @@ class MythrilAnalyzer:
transaction_count=transaction_count, transaction_count=transaction_count,
create_timeout=self.create_timeout, create_timeout=self.create_timeout,
enable_iprof=self.enable_iprof, enable_iprof=self.enable_iprof,
run_analysis_modules=False,
) )
return generate_graph(sym, physics=enable_physics, phrackify=phrackify) return generate_graph(sym, physics=enable_physics, phrackify=phrackify)

Loading…
Cancel
Save