def display_STRINGS(a, x, classes):
    print "STRINGS"
    prefix = '_Get_App_Strings_result_'
    #Get time
    time_string = time.strftime("%m-%d-%Y at %H-%M-%S")

    '''
    for s, _ in x.get_tainted_variables().get_strings():
        print "String : ", repr(s.get_info())
        analysis.show_PathVariable( a, s.get_paths() )
    '''
    try:
        file_handle = os.open('output/' + app_name.upper() + prefix + time_string  + sub_fix, flags)
    except OSError as e:
        if e.errno == errno.EEXIST:  # Failed as the file already exists.
            pass
        else:  # Something unexpected went wrong so reraise the exception.
            raise
    else:  # No exception, so the file must have been created successfully.
        with os.fdopen(file_handle, 'w') as file_obj:
            for s, _ in x.get_tainted_variables().get_strings():
                stringHeader =  repr(s.get_info())
                stringDetail = analysis.show_PathVariable( a, s.get_paths() )
                if stringHeader is not None:
                    file_obj.write("\n" + "STIRNG_HEADER: " + stringHeader + "\n")
                if stringDetail is not None:
                    file_obj.write("STRING_DETAIL: " + stringDetail)
            file_obj.close()
Пример #2
0
def display_FIELDS(a, x, classes):
    print("FIELDS")
    for f, _ in x.get_tainted_variables().get_fields():
        print("field : ", repr(f.get_info()))
        analysis.show_PathVariable( a, f.get_paths() )
Пример #3
0
def display_STRINGS(a, x, classes):
    print("STRINGS")
    for s, _ in x.get_tainted_variables().get_strings():
        print("String : ", repr(s.get_info()))
        analysis.show_PathVariable( a, s.get_paths() )