def saveResult(self):
        AsmUnit.saveResult(self)  #if result is None, throw Exception
        resultPath = os.path.join(self.resDir, self.fileName)

        fd = open(resultPath + '.' + self.symbol, 'w')
        for key in self.result.keys():
            fd.write('%s,%s,%s' % (key, ','.join(self.result[key])))
        fd.close()
Beispiel #2
0
    def __init__(self):
        AsmUnit.__init__(self, self.__class__.__name__)

        self.instSet = {
            'push', 'pop', 'mov', 'lea', 'inc', 'dec', 'add', 'sub', 'call',
            'ret', 'cmp', 'jmp', 'int', 'nop'
        }

        self.instCntDict = dict()
        self.result = None
        self.fileName = None
Beispiel #3
0
    def saveResult(self):
        AsmUnit.saveResult(self)  # if result is None, throw Exception
        resultPath = os.path.join(self.resDir, self.fileName)

        fd = open(resultPath + '.' + self.symbol, 'w')
        resultInst = [self.fileName]
        for key in self.result.keys():
            resultInst.append('%s:%d' % (key, self.result[key]))

        fd.write(' '.join(resultInst))
        fd.close()
    def __init__(self):
        AsmUnit.__init__(self, self.__class__.__name__)

        self.fileName = None
        self.result = None

        self.MALWARE_DLL = [
            'User32.dll', 'Kernel32.dll', 'Advapi32.dll', 'Ntdll.dll',
            'Ws2_32.dll', 'Wininet.dll', 'wsock32.dll', 'Shell32.dll',
            'Msvcrt.dll', 'Ole32.dll', 'Oleaut32.dll'
        ]

        self.PREFIX = '__imp_'
Beispiel #5
0
    def saveResult(self):
        AsmUnit.saveResult(self)  # if result is None, throw Exception
        resultPath = os.path.join(self.resDir, self.fileName)

        res = self.result
        res = res.reshape(1, -1).flatten()

        fd = open(resultPath + '.' + self.symbol, 'w')
        resultInst = [self.fileName]

        for i in range(len(res)):
            resultInst.append('%s:%d' % (i + 1, res[i]))

        fd.write(' '.join(resultInst))
        fd.close()
Beispiel #6
0
    def __init__(self):
        AsmUnit.__init__(self, self.__class__.__name__)

        self.instDict = {
            'add': 0,
            'mov': 1,
            'push': 2,
            'call': 3,
            'pop': 4,
            'inc': 5,
            'cmp': 6,
            'xor': 7,
            'dec': 8,
            'je': 9,
            'lea': 10,
            'test': 11,
            'int3': 12,
            'jmp': 13,
            'sub': 14,
            'nop': 15,
            'and': 16,
            'or': 17,
            'ret': 18,
            'jne': 19,
            'adc': 20,
            'xchg': 21,
            'sbb': 22,
            'imul': 23,
            'jb': 24,
            'out': 25,
            'in': 26,
            'jae': 27,
            'outsd': 28,
            'outsb': 29,
            'popal': 30,
            'movzx': 31
        }

        self.result = None
        self.fileName = None
Beispiel #7
0
    def __init__(self):
        AsmUnit.__init__(self, self.__class__.__name__)

        self.result = None
        self.fileName = None