# Path: malwareconfig/crypto.py
# def decrypt_arc4(key, data):
#     cipher = ARC4.new(key)
#     return cipher.decrypt(data)
# 
# 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
# 
# Path: malwareconfig/common.py
# def string_printable(line):
#     line = str(line)
#     new_line = ''
#     for c in line:
#         if c in string.printable:
#             new_line += c
#         else:
#             new_line += '\\x' + c.encode("utf-8").hex()
#     return new_line


from malwareconfig.crypto import decrypt_arc4
from malwareconfig.common import Decoder
from malwareconfig.common import string_printable
from binascii import unhexlify
        first = data.split(b"*EDIT_SERVER*")
        if len(first) == 2:
            second = first[1].split(b"\r\n")
            if len(second) > 14 < 30:
                print("[+] Found Version < 8")
                return self.new_decoder(second)
        first = data.split(b"[DATA]")
        if len(first) == 21:
            print("[+] Found Version 8")
            return self.ver_80(first)
        if len(first) == 30:
            print("[+] Found Version 8.01")
            return self.ver_801(first)
        return None

    def new_decoder(self, split_list):
        raw_dict = {}
        for line in split_list:
            try:
                line = line.decode('UTF-8')
                k,v = line.split(' = ')
                raw_dict[k.strip('*')] = v.strip('%')
            except Exception as e:
                continue
        return self.config_cleaner(raw_dict)

    def config_cleaner(self, raw_dict):
        clean_dict = {}
        for k,v in raw_dict.items():
            if k == 'ip':

# Path: malwareconfig/crypto.py
# def decrypt_arc4(key, data):
#     cipher = ARC4.new(key)
#     return cipher.decrypt(data)
# 
# 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
# 
# Path: malwareconfig/common.py
# def string_printable(line):
#     line = str(line)
#     new_line = ''
#     for c in line:
#         if c in string.printable:
#             new_line += c
#         else:
#             new_line += '\\x' + c.encode("utf-8").hex()
#     return new_line


# Path: malwareconfig/decoders/LostDoor.py
from malwareconfig.crypto import decrypt_arc4
from malwareconfig.common import Decoder
from malwareconfig.common import string_printable
from binascii import unhexlify

        first = data.split(b"*EDIT_SERVER*")
        if len(first) == 2:
            second = first[1].split(b"\r\n")
            if len(second) > 14 < 30:
                print("[+] Found Version < 8")
                return self.new_decoder(second)
        first = data.split(b"[DATA]")
        if len(first) == 21:
            print("[+] Found Version 8")
            return self.ver_80(first)
        if len(first) == 30:
            print("[+] Found Version 8.01")
            return self.ver_801(first)
        return None

    def new_decoder(self, split_list):
        raw_dict = {}
        for line in split_list:
            try:
                line = line.decode('UTF-8')
                k,v = line.split(' = ')
                raw_dict[k.strip('*')] = v.strip('%')
            except Exception as e:
                continue
        return self.config_cleaner(raw_dict)

    def config_cleaner(self, raw_dict):
        clean_dict = {}
        for k,v in raw_dict.items():
            if k == 'ip':

                clean_dict['Domain'] = decrypt_arc4('oussamio', unhexlify(v))