uroboros-diversification/src/uroboros.py
def check(filepath, assumptions, gccopt='', excludedata='', instrument=False):
    """
    Perform basic check on analyzed executable and set configuration values
    :param filepath: path to executable
    :param assumptions: list of assumption codes
    :param gccopt: additional options for the compiler
    :param excludedata: path to file of address exclusions
    :param instrument: True if instrumentation enabled
    :return: True if everything ok
    """
    if not assumptions: assumptions = []

    if not os.path.isfile(filepath):
        sys.stderr.write("Cannot find input binary\n")
        return False

    if len(excludedata) != 0 and not os.path.isfile(excludedata):
        sys.stderr.write("File with exclusions not found\n")
        return False

    for f in glob.glob('*'): os.remove(f)

    if os.path.dirname(filepath) != os.getcwd():
        shutil.copy(filepath, '.')

    os.system('file ' + filepath + ' > elf.info')
    config.setup(filepath, gccopt, excludedata, instrument)

    if config.is_lib:
        sys.stderr.write("Uroboros doesn't support shared libraries\n")
        return False

    # if assumption three is utilized, then input binary should be unstripped.
    if ('3' in assumptions or instrument) and not config.is_unstrip:
        print colored('Warning:', 'yellow'), 'binary is stripped, function boundaries evaluation may not be precise'

    return True

    Perform basic check on analyzed executable and set configuration values
    :param filepath: path to executable
    :param assumptions: list of assumption codes
    :param gccopt: additional options for the compiler
    :param excludedata: path to file of address exclusions
    :param instrument: True if instrumentation enabled
    :return: True if everything ok
    
Perform basic check on analyzed executable and set configuration values
Perform basic check on analyzed executable and set configuration values
def check(filepath, assumptions, gccopt='', excludedata='', instrument=False):
    if not assumptions: assumptions = []
    if not os.path.isfile(filepath):
        sys.stderr.write("Cannot find input binary\n")
        return False
    if len(excludedata) != 0 and not os.path.isfile(excludedata):
        sys.stderr.write("File with exclusions not found\n")
        return False
    for f in glob.glob('*'): os.remove(f)
    if os.path.dirname(filepath) != os.getcwd():
        shutil.copy(filepath, '.')
    os.system('file ' + filepath + ' > elf.info')
    config.setup(filepath, gccopt, excludedata, instrument)
    if config.is_lib:
        sys.stderr.write("Uroboros doesn't support shared libraries\n")
        return False
    if ('3' in assumptions or instrument) and not config.is_unstrip:
        print colored('Warning:', 'yellow'), 'binary is stripped, function boundaries evaluation may not be precise'
    return True
def check ( filepath , assumptions , gccopt = '' , excludedata = '' , instrument = False ) : if not assumptions : assumptions = [ ] if not os . path . isfile ( filepath ) : sys . stderr . write ( "Cannot find input binary\n" ) return False if len ( excludedata ) != 0 and not os . path . isfile ( excludedata ) : sys . stderr . write ( "File with exclusions not found\n" ) return False for f in glob . glob ( '*' ) : os . remove ( f ) if os . path . dirname ( filepath ) != os . getcwd ( ) : shutil . copy ( filepath , '.' ) os . system ( 'file ' + filepath + ' > elf.info' ) config . setup ( filepath , gccopt , excludedata , instrument ) if config . is_lib : sys . stderr . write ( "Uroboros doesn't support shared libraries\n" ) return False if ( '3' in assumptions or instrument ) and not config . is_unstrip : print colored ( 'Warning:' , 'yellow' ) , 'binary is stripped, function boundaries evaluation may not be precise' return True
Perform basic check on analyzed executable and set configuration values
Perform basic check on analyzed executable and set configuration values
"""
    Perform basic check on analyzed executable and set configuration values
    :param filepath: path to executable
    :param assumptions: list of assumption codes
    :param gccopt: additional options for the compiler
    :param excludedata: path to file of address exclusions
    :param instrument: True if instrumentation enabled
    :return: True if everything ok
    """ # if assumption three is utilized, then input binary should be unstripped.
True if everything ok
True if everything ok
filepath
path to executable
path to executable
assumptions
list of assumption codes
list of assumption codes
gccopt
additional options for the compiler
additional options for the compiler
excludedata
path to file of address exclusions
path to file of address exclusions
instrument
True if instrumentation enabled
True if instrumentation enabled