コード例 #1
0
    def __init__(self, basic_block):
        self.basic_block = basic_block
        self.buff = ""
        for i in self.basic_block.ins:
            self.buff += dvm.clean_name_instruction(i)
            self.buff += dvm.static_operand_instruction(i)

        #self.hash = hashlib.sha256( self.buff + "%d%d" % (len(basic_block.childs), len(basic_block.fathers)) ).hexdigest()
        self.hash = hashlib.sha256(self.buff).hexdigest()
コード例 #2
0
ファイル: diff.py プロジェクト: Bludge0n/AREsoft
    def __init__(self, basic_block) :
        self.basic_block = basic_block
        self.buff = ""
        for i in self.basic_block.ins :
            self.buff += dvm.clean_name_instruction( i )
            self.buff += dvm.static_operand_instruction( i )

        #self.hash = hashlib.sha256( self.buff + "%d%d" % (len(basic_block.childs), len(basic_block.fathers)) ).hexdigest()
        self.hash = hashlib.sha256( self.buff ).hexdigest()
コード例 #3
0
ファイル: sign.py プロジェクト: HuSunMyan/CodeForAndroid
    def _get_hex(self, analysis_method) :
        code = analysis_method.get_method().get_code()
        if code == None :
            return ""

        buff = ""
        for i in code.get_bc().get_instructions() :
            buff += dvm.clean_name_instruction( i )
            buff += dvm.static_operand_instruction( i )

        return buff
コード例 #4
0
ファイル: sign.py プロジェクト: Liberinexp/cuckoo-droid
    def _get_hex(self, analysis_method):
        code = analysis_method.get_method().get_code()
        if code == None:
            return ""

        buff = ""
        for i in code.get_bc().get_instructions():
            buff += dvm.clean_name_instruction(i)
            buff += dvm.static_operand_instruction(i)

        return buff
コード例 #5
0
    def __init__(self, m1, sim):
        self.buff = ""
        self.entropy = 0.0

        code = m1.get_code()
        if code != None:
            bc = code.get_bc()

            for i in bc.get():
                self.buff += dvm.clean_name_instruction(i)
                self.buff += dvm.static_operand_instruction(i)

            self.entropy = sim.entropy(self.buff)
コード例 #6
0
ファイル: diff.py プロジェクト: Bludge0n/AREsoft
    def __init__(self, m1, sim) :
        self.buff = ""
        self.entropy = 0.0
        
        code = m1.get_code()
        if code != None :
            bc = code.get_bc()

            for i in bc.get() :
                self.buff += dvm.clean_name_instruction( i )
                self.buff += dvm.static_operand_instruction( i )

            self.entropy = sim.entropy( self.buff )
コード例 #7
0
    def _get_hex(self, analysis_method):
        code = analysis_method.get_method().get_code()
        if code == None:
            return ""

        buff = ""
        for i in code.get_bc().get():
            buff += dvm.clean_name_instruction(i)
            buff += dvm.static_operand_instruction(i)

        #raw = code.get_bc().get_raw()
        #buff = ""
        #for i in raw :
        #    buff += "%02x" % ord(i)
        return buff
コード例 #8
0
def toString(bb, hS, rS):
    S = ""

    for i in bb.ins:
        ident = dvm.clean_name_instruction(i)
        ident += dvm.static_operand_instruction(i)

        #       print i.get_name(), i.get_operands()
        if ident not in hS:
            hS[ident] = len(hS)
            rS[chr(hS[ident])] = ident

        S += chr(hS[ident])

    return S
コード例 #9
0
ファイル: sign.py プロジェクト: Bludge0n/AREsoft
    def _get_hex(self, analysis_method) :
        code = analysis_method.get_method().get_code()
        if code == None :
            return ""
        
        buff = ""
        for i in code.get_bc().get() :
            buff += dvm.clean_name_instruction( i )
            buff += dvm.static_operand_instruction( i )

        #raw = code.get_bc().get_raw()
        #buff = ""
        #for i in raw :
        #    buff += "%02x" % ord(i)
        return buff
コード例 #10
0
ファイル: diff.py プロジェクト: Bludge0n/AREsoft
def toString( bb, hS, rS ) :
    S = ""

    for i in bb.ins :
        ident = dvm.clean_name_instruction( i )
        ident += dvm.static_operand_instruction( i )

#       print i.get_name(), i.get_operands()
        if ident not in hS :
            hS[ ident ] = len(hS)
            rS[ chr( hS[ ident ] ) ] = ident

        S += chr( hS[ ident ] )

    return S