uroboros-diversification/src/disasm/disassemble_process.py
def disassemble(filepath, funcs, secs):
        """
        Read disassemble dump, parse instrctions and reconstruct symbolic information
        :param filepath: path to target executable
        :param funcs: list of functions
        :param secs: list of sections
        :return: instruction list, updated function list, symbol reconstruction object
        """
        ailpar = AilParser()
        re = reassemble()
        dis_valid = dis_validator()
        il = []
        fl = []
        total = 0.0
        cond = False
        while not cond and total < 600.0:
            once = TR.get_utime()
            ailpar.set_funcs(funcs)
            ailpar.set_secs(secs)
            ailpar.processInstrs(read_file('instrs.info'))
            fl = ailpar.get_funcs()

            il = re.visit_heuristic_analysis(ailpar.get_instrs())
            il = re.lib32_processing(il, fl)
            il = re.add_func_label(Disam.get_userfuncs(fl), il)

            print colored('2: DISASSEMBLY VALIDATION', 'green')
            dis_valid.visit(il)
            adjust_list = dis_valid.trim_results()
            if len(adjust_list) != 0:
                print '     disassembly error found!'
                if config.arch == config.ARCH_ARMT: exit('Not implemented')
                Disam.disasm_skip(filepath, adjust_list[0][0], adjust_list[0][1])
                total += TR.elapsed(once)
            else:
                cond = True

        return (il, fl, re)

        Read disassemble dump, parse instrctions and reconstruct symbolic information
        :param filepath: path to target executable
        :param funcs: list of functions
        :param secs: list of sections
        :return: instruction list, updated function list, symbol reconstruction object
        
Read disassemble dump, parse instrctions and reconstruct symbolic information
Read disassemble dump parse instrctions and reconstruct symbolic information
def disassemble(filepath, funcs, secs):
        ailpar = AilParser()
        re = reassemble()
        dis_valid = dis_validator()
        il = []
        fl = []
        total = 0.0
        cond = False
        while not cond and total < 600.0:
            once = TR.get_utime()
            ailpar.set_funcs(funcs)
            ailpar.set_secs(secs)
            ailpar.processInstrs(read_file('instrs.info'))
            fl = ailpar.get_funcs()
            il = re.visit_heuristic_analysis(ailpar.get_instrs())
            il = re.lib32_processing(il, fl)
            il = re.add_func_label(Disam.get_userfuncs(fl), il)
            print colored('2: DISASSEMBLY VALIDATION', 'green')
            dis_valid.visit(il)
            adjust_list = dis_valid.trim_results()
            if len(adjust_list) != 0:
                print '     disassembly error found!'
                if config.arch == config.ARCH_ARMT: exit('Not implemented')
                Disam.disasm_skip(filepath, adjust_list[0][0], adjust_list[0][1])
                total += TR.elapsed(once)
            else:
                cond = True
        return (il, fl, re)
def disassemble ( filepath , funcs , secs ) : ailpar = AilParser ( ) re = reassemble ( ) dis_valid = dis_validator ( ) il = [ ] fl = [ ] total = 0.0 cond = False while not cond and total < 600.0 : once = TR . get_utime ( ) ailpar . set_funcs ( funcs ) ailpar . set_secs ( secs ) ailpar . processInstrs ( read_file ( 'instrs.info' ) ) fl = ailpar . get_funcs ( ) il = re . visit_heuristic_analysis ( ailpar . get_instrs ( ) ) il = re . lib32_processing ( il , fl ) il = re . add_func_label ( Disam . get_userfuncs ( fl ) , il ) print colored ( '2: DISASSEMBLY VALIDATION' , 'green' ) dis_valid . visit ( il ) adjust_list = dis_valid . trim_results ( ) if len ( adjust_list ) != 0 : print '     disassembly error found!' if config . arch == config . ARCH_ARMT : exit ( 'Not implemented' ) Disam . disasm_skip ( filepath , adjust_list [ 0 ] [ 0 ] , adjust_list [ 0 ] [ 1 ] ) total += TR . elapsed ( once ) else : cond = True return ( il , fl , re )
Read disassemble dump, parse instrctions and reconstruct symbolic information
Read disassemble dump parse instrctions and reconstruct symbolic information
"""
        Read disassemble dump, parse instrctions and reconstruct symbolic information
        :param filepath: path to target executable
        :param funcs: list of functions
        :param secs: list of sections
        :return: instruction list, updated function list, symbol reconstruction object
        """
instruction list, updated function list, symbol reconstruction object
instruction list updated function list symbol reconstruction object
filepath
path to target executable
path to target executable
funcs
list of functions
list of functions
secs
list of sections
list of sections