# Path: malwareconfig/common.py
# class Decoder(object):
#     decoder_name = ""
#     decoder_version = 1
#     decoder_author = ""
#     decoder_description = ""
#     file_info = object
# 
#     def set_file(self, file_info):
#         self.file_info = file_info
# 
#     def get_config(self):
#         pass
# 
# class PreProcessor(object):
#     preprocessor_name = ""
#     preprocessor_version = 1
#     preprocessor_author = ""
#     preprocessor_description = ""
#     file_info = object
# 
#     def set_file(self, file_info):
#         self.file_info = file_info
# 
#     def pre_process(self):
#         pass


import importlib
import inspect
import pkgutil
from malwareconfig.common import Decoder, PreProcessor
from malwareconfig import decoders
from malwareconfig import preprocessors


def load_decoders():

    dec_modules = dict()

    # Walk recursively through all modules and packages.
    for loader, module_name, ispkg in pkgutil.walk_packages(decoders.__path__, decoders.__name__ + '.'):
        # If current item is a package, skip.
        if ispkg:
            continue
        # Try to import the module, otherwise skip.
        try:
            module = importlib.import_module(module_name)
        except ImportError as e:
            print("Unable to import Module {0}: {1}".format(module_name, e))
            continue

        for mod_name, mod_object in inspect.getmembers(module):
            if inspect.isclass(mod_object):

# Path: malwareconfig/common.py
# class Decoder(object):
#     decoder_name = ""
#     decoder_version = 1
#     decoder_author = ""
#     decoder_description = ""
#     file_info = object
# 
#     def set_file(self, file_info):
#         self.file_info = file_info
# 
#     def get_config(self):
#         pass
# 
# class PreProcessor(object):
#     preprocessor_name = ""
#     preprocessor_version = 1
#     preprocessor_author = ""
#     preprocessor_description = ""
#     file_info = object
# 
#     def set_file(self, file_info):
#         self.file_info = file_info
# 
#     def pre_process(self):
#         pass


# Path: malwareconfig/modules.py
import importlib
import inspect
import pkgutil
from malwareconfig.common import Decoder, PreProcessor
from malwareconfig import decoders
from malwareconfig import preprocessors



def load_decoders():

    dec_modules = dict()

    # Walk recursively through all modules and packages.
    for loader, module_name, ispkg in pkgutil.walk_packages(decoders.__path__, decoders.__name__ + '.'):
        # If current item is a package, skip.
        if ispkg:
            continue
        # Try to import the module, otherwise skip.
        try:
            module = importlib.import_module(module_name)
        except ImportError as e:
            print("Unable to import Module {0}: {1}".format(module_name, e))
            continue

        for mod_name, mod_object in inspect.getmembers(module):
            if inspect.isclass(mod_object):

                if issubclass(mod_object, Decoder) and mod_object is not Decoder: