(self)
Generate the smart md5 signature for the function
Generate the smart md5 signature for the function
Generate the smart md5 signature for the function
def generate_smart_md5(self):
        '''
        Generate the smart md5 signature for the function
        '''
        alpha = []
        for inst in self.pida_basic_block.sorted_instructions():
            instruction = inst.mnem
            if len(instruction) <= 1 or instruction == "nop":
                continue
            elif instruction == "cmp" or instruction == "test":
                alpha.append("comparision")
            elif instruction[0] == "j":
                if instruction == "jg" or instruction == "jge" or instruction == "jl" or instruction == "jle" or instruction == "jng" or instruction == "jnge" or instruction == "jnl" or instruction == "jnle" or instruction == "jno" or instruction == "jns" or instruction == "jo" or instruction == "js":
                    alpha.append("jmp_signed")
                else:
                    alpha.append("jmp_unsigned")
            else:
                alpha.append(instruction)
        alpha.sort()
        digest_str = ""
        m = md5.new()
        for char in alpha:
            digest_str += char
        m.update( digest_str ) 
        self.smart_md5 = m.hexdigest()
def generate_smart_md5 ( self ) : alpha = [ ] for inst in self . pida_basic_block . sorted_instructions ( ) : instruction = inst . mnem if len ( instruction ) <= 1 or instruction == "nop" : continue elif instruction == "cmp" or instruction == "test" : alpha . append ( "comparision" ) elif instruction [ 0 ] == "j" : if instruction == "jg" or instruction == "jge" or instruction == "jl" or instruction == "jle" or instruction == "jng" or instruction == "jnge" or instruction == "jnl" or instruction == "jnle" or instruction == "jno" or instruction == "jns" or instruction == "jo" or instruction == "js" : alpha . append ( "jmp_signed" ) else : alpha . append ( "jmp_unsigned" ) else : alpha . append ( instruction ) alpha . sort ( ) digest_str = "" m = md5 . new ( ) for char in alpha : digest_str += char m . update ( digest_str ) self . smart_md5 = m . hexdigest ( )