# Path: sibyl/engine/engine.py
# class Engine(object):
#     """Wrapper on execution engine"""
# 
#     def __init__(self, machine):
#         """Instanciate an Engine
#         @machine: miasm2.analysis.machine:Machine instance"""
#         self.logger = init_logger(self.__class__.__name__)
# 
#     def take_snapshot(self):
#         self.vm_mem = self.jitter.vm.get_all_memory()
#         self.vm_regs = self.jitter.cpu.get_gpreg()
# 
#     def restore_snapshot(self, memory=True):
#         raise NotImplementedError("Abstract method")
# 
#     def run(self, address, timeout_seconds):
#         raise NotImplementedError("Abstract method")
# 
#     def prepare_run(self):
#         pass
# 
#     def restore_snapshot(self, memory=True):
#         raise NotImplementedError("Abstract method")
# 
# Path: sibyl/commons.py
# END_ADDR = 0x1337babe
# 
# def init_logger(name):
#     logger = logging.getLogger(name)
# 
#     console_handler = logging.StreamHandler()
#     log_format = "%(levelname)-5s: %(message)s"
#     console_handler.setFormatter(logging.Formatter(log_format))
#     logger.addHandler(console_handler)
# 
#     logger.setLevel(logging.ERROR)
#     return logger


from miasm2.core.utils import pck32, pck64
from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE
from sibyl.engine.engine import Engine
from sibyl.commons import END_ADDR, init_logger
    import unicorn
        import unicorn.x86_const as csts
        import unicorn.x86_const as csts
        import unicorn.arm_const as csts
        import unicorn.arm_const as csts
        import unicorn.mips_const as csts
try:
except ImportError:
    unicorn = None



class UnexpectedStopException(Exception):
    """Exception to be called on timeouts"""
    pass


# Path: sibyl/engine/engine.py
# class Engine(object):
#     """Wrapper on execution engine"""
# 
#     def __init__(self, machine):
#         """Instanciate an Engine
#         @machine: miasm2.analysis.machine:Machine instance"""
#         self.logger = init_logger(self.__class__.__name__)
# 
#     def take_snapshot(self):
#         self.vm_mem = self.jitter.vm.get_all_memory()
#         self.vm_regs = self.jitter.cpu.get_gpreg()
# 
#     def restore_snapshot(self, memory=True):
#         raise NotImplementedError("Abstract method")
# 
#     def run(self, address, timeout_seconds):
#         raise NotImplementedError("Abstract method")
# 
#     def prepare_run(self):
#         pass
# 
#     def restore_snapshot(self, memory=True):
#         raise NotImplementedError("Abstract method")
# 
# Path: sibyl/commons.py
# END_ADDR = 0x1337babe
# 
# def init_logger(name):
#     logger = logging.getLogger(name)
# 
#     console_handler = logging.StreamHandler()
#     log_format = "%(levelname)-5s: %(message)s"
#     console_handler.setFormatter(logging.Formatter(log_format))
#     logger.addHandler(console_handler)
# 
#     logger.setLevel(logging.ERROR)
#     return logger


# Path: sibyl/engine/qemu.py
from miasm2.core.utils import pck32, pck64
from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE
from sibyl.engine.engine import Engine
from sibyl.commons import END_ADDR, init_logger
    import unicorn
        import unicorn.x86_const as csts
        import unicorn.x86_const as csts
        import unicorn.arm_const as csts
        import unicorn.arm_const as csts
        import unicorn.mips_const as csts

try:
except ImportError:
    unicorn = None



class UnexpectedStopException(Exception):
    """Exception to be called on timeouts"""
    pass


class QEMUEngine(Engine):