Migrate fuzzer frontends to submodule
* Move frontends to deepstate.frontend * Add dynamic loading in __init__.py for future frontends * Refactor setup.py.in
This commit is contained in:
parent
a7ae8e8991
commit
9789a1dd29
21
bin/deepstate/frontend/__init__.py
Normal file
21
bin/deepstate/frontend/__init__.py
Normal file
@ -0,0 +1,21 @@
|
||||
import sys
|
||||
import pkgutil
|
||||
import importlib
|
||||
|
||||
from .frontend import DeepStateFrontend
|
||||
|
||||
def import_fuzzers(pkg_name):
|
||||
"""
|
||||
dynamically load fuzzer frontends using importlib
|
||||
|
||||
TODO(alan): find way to alias modnames so we can check
|
||||
them before importing (ie. fuzzer submods need to start with `front_*`)
|
||||
"""
|
||||
package = sys.modules[pkg_name]
|
||||
return [
|
||||
importlib.import_module(pkg_name + '.' + submod)
|
||||
for _, submod, _ in pkgutil.walk_packages(package.__path__)
|
||||
#if submod != "frontend"
|
||||
]
|
||||
|
||||
__all__ = import_fuzzers(__name__)
|
||||
@ -119,7 +119,6 @@ class DeepStateFrontend(object):
|
||||
if cli_other is not None:
|
||||
self.cmd += cli_other
|
||||
|
||||
|
||||
def execute_fuzzer(self):
|
||||
"""
|
||||
takes constructed cli command and executes fuzzer with subprocess.call
|
||||
@ -23,7 +23,7 @@ setuptools.setup(
|
||||
name="deepstate",
|
||||
version="0.1",
|
||||
package_dir={"": "${CMAKE_SOURCE_DIR}/bin"},
|
||||
packages=['deepstate'],
|
||||
packages=['deepstate', 'deepstate.frontend'],
|
||||
description="DeepState augments C/C++ Test-Driven Development with Symbolic Execution",
|
||||
url="https://github.com/trailofbits/deepstate",
|
||||
author="Peter Goodman",
|
||||
@ -37,7 +37,8 @@ setuptools.setup(
|
||||
'deepstate-angr = deepstate.main_angr:main',
|
||||
'deepstate-manticore = deepstate.main_manticore:main',
|
||||
'deepstate-reduce = deepstate.reducer:main',
|
||||
'deepstate-eclipser = deepstate.eclipser:main',
|
||||
'deepstate-angora = deepstate.angora:main'
|
||||
'deepstate-afl = deepstate.frontend.afl:main',
|
||||
'deepstate-eclipser = deepstate.frontend.eclipser:main',
|
||||
'deepstate-angora = deepstate.frontend.angora:main'
|
||||
]
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user