# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: lib/VMRepresentation.py
# def get_vmr():
#     """
#     Get the VMR instance.
#     :return: vmr
#     """
#     global vmr
#     if vmr is None:
#         vmr = VMRepresentation()
#     return vmr
# 
# Path: ui/NotifyProgress.py
# class NotifyProgress(QtWidgets.QWidget):
#     def __init__(self, name='current', *args, **kwargs):
#         super(NotifyProgress, self).__init__(*args, **kwargs)
#         self.analysis = name
#         self.pbar = QtWidgets.QProgressBar(self)
#         self.pbar.setGeometry(30, 40, 370, 25)
#         self.value = 0
#         self.setFixedSize(400, 100)
#         self.setWindowTitle('Running %s Analysis...' % self.analysis)
# 
#     def pbar_update(self, value):
#         self.value += value
#         if self.value > 100:
#             self.value = 100
#             self.close()
#         self.pbar.setValue(self.value)
# 
#     def pbar_set(self, value):
#         self.pbar.setValue(value)
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):


from threading import Thread
from ui.UIManager import GradingViewer
from ui.UIManager import OptimizationViewer
from ui.UIManager import StackChangeViewer
from ui.UIManager import VMInputOuputViewer
from DebuggerHandler import load, save, get_dh
from lib.TraceAnalysis import *
from lib.VMRepresentation import get_vmr
from ui.NotifyProgress import NotifyProgress
from ui.UIManager import ClusterViewer
    from IDADebugger import IDADebugger
    from OllyDebugger import OllyDebugger
    from IDADebugger import IDADebugger
    from IDADebugger import IDADebugger
    from IDADebugger import IDADebugger
    LoadDebugger('Bochs', 0)
    return IDADebugger()

# Win32 Dbg
def load_win32dbg(self):
    LoadDebugger('win32', 0)
    return IDADebugger()

# Immunity Dbg
def load_immunitydbg(self):
    return IDADebugger()


# Working with Win32Dbg, BochsDbg, OllyDbg
available_debuggers = [load_idadbg, load_olly, load_bochsdbg, load_win32dbg, load_immunitydbg]


### INIT AND LOAD CONTEXT ###

def prepare_trace():
    vmr = get_vmr()
    if vmr.trace is None:
        vmr.trace = load()
    return deepcopy(vmr.trace)

def prepare_vm_ctx():
    vmr = get_vmr()
    return deepcopy(vmr.vm_ctx)

def prepare_vm_operands():

# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):
# 
# Path: lib/VMRepresentation.py
# def get_vmr():
#     """
#     Get the VMR instance.
#     :return: vmr
#     """
#     global vmr
#     if vmr is None:
#         vmr = VMRepresentation()
#     return vmr
# 
# Path: ui/NotifyProgress.py
# class NotifyProgress(QtWidgets.QWidget):
#     def __init__(self, name='current', *args, **kwargs):
#         super(NotifyProgress, self).__init__(*args, **kwargs)
#         self.analysis = name
#         self.pbar = QtWidgets.QProgressBar(self)
#         self.pbar.setGeometry(30, 40, 370, 25)
#         self.value = 0
#         self.setFixedSize(400, 100)
#         self.setWindowTitle('Running %s Analysis...' % self.analysis)
# 
#     def pbar_update(self, value):
#         self.value += value
#         if self.value > 100:
#             self.value = 100
#             self.close()
#         self.pbar.setValue(self.value)
# 
#     def pbar_set(self, value):
#         self.pbar.setValue(value)
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):


# Path: dynamic/dynamic_deobfuscate.py
from threading import Thread
from ui.UIManager import GradingViewer
from ui.UIManager import OptimizationViewer
from ui.UIManager import StackChangeViewer
from ui.UIManager import VMInputOuputViewer
from DebuggerHandler import load, save, get_dh
from lib.TraceAnalysis import *
from lib.VMRepresentation import get_vmr
from ui.NotifyProgress import NotifyProgress
from ui.UIManager import ClusterViewer
    from IDADebugger import IDADebugger
    from OllyDebugger import OllyDebugger
    from IDADebugger import IDADebugger
    from IDADebugger import IDADebugger
    from IDADebugger import IDADebugger

    LoadDebugger('Bochs', 0)
    return IDADebugger()

# Win32 Dbg
def load_win32dbg(self):
    LoadDebugger('win32', 0)
    return IDADebugger()

# Immunity Dbg
def load_immunitydbg(self):
    return IDADebugger()


# Working with Win32Dbg, BochsDbg, OllyDbg
available_debuggers = [load_idadbg, load_olly, load_bochsdbg, load_win32dbg, load_immunitydbg]


### INIT AND LOAD CONTEXT ###

def prepare_trace():
    vmr = get_vmr()
    if vmr.trace is None:
        vmr.trace = load()
    return deepcopy(vmr.trace)

def prepare_vm_ctx():
    vmr = get_vmr()
    return deepcopy(vmr.vm_ctx)

def prepare_vm_operands():

    vmr = get_vmr()