コード例 #1
0
ファイル: river.py プロジェクト: YHVHvx/ocean
      traces.add(x)
      if len(traces) >= max_subtraces:
        break

    sys.stdout.flush()
  print "\t"+rclass


if __name__ == "__main__":

  
  prog = sys.argv[1]
  ignored_mods = None

  if len(sys.argv) == 3:
    ignored_mods = readmodfile(sys.argv[2]) 
  elif len(sys.argv) > 3 or len(sys.argv) < 2:
    sys.exit(-1)

  elf = ELF(prog)
  extract_raw_static_features(elf, 100)

  #if ignored_mods is not None:
  
  #  elf._populate_libraries_ldd()
  #  libs = filter(lambda mod: not (any(map(lambda l: l in mod, ignored_mods))),  elf._libs.keys())

  #  #print libs
  #  for lib in libs:
  #     elf = ELF(lib)
  #     extract_raw_static_features(elf, 1000)
コード例 #2
0
ファイル: ocean.py プロジェクト: neuromancer/ocean
    width = options.width

    csvfile = sys.stdout

    os.chdir(GetDir(testcase))
    program = GetCmd(None)

    os.chdir("crash")

    timeout = options.timeout
    envs = dict()
    args = GetArgs()
    files = GetFiles()

    # modules to include or ignore
    included_mods = readmodfile(incmodfile)
    ignored_mods = readmodfile(ignmodfile)

    original_inputs = RandomInputMutator(args + files, NullMutator)
    expanded_input_generator = RandomInputMutator(args + files,
                                                  RandomExpanderMutator)
    mutated_input_generator = RandomInputMutator(args + files,
                                                 RandomByteMutator)

    app = Process(program,
                  envs,
                  timeout,
                  included_mods,
                  ignored_mods,
                  no_stdout=not show_stdout)
コード例 #3
0
            print r + " .",
            traces.add(x)
            if len(traces) >= max_subtraces:
                break

        sys.stdout.flush()
    print "\t" + rclass


if __name__ == "__main__":

    prog = sys.argv[1]
    ignored_mods = None

    if len(sys.argv) == 3:
        ignored_mods = readmodfile(sys.argv[2])
    elif len(sys.argv) > 3 or len(sys.argv) < 2:
        sys.exit(-1)

    elf = ELF(prog)
    extract_raw_static_features(elf, 100)

    #if ignored_mods is not None:

    #  elf._populate_libraries_ldd()
    #  libs = filter(lambda mod: not (any(map(lambda l: l in mod, ignored_mods))),  elf._libs.keys())

    #  #print libs
    #  for lib in libs:
    #     elf = ELF(lib)
    #     extract_raw_static_features(elf, 1000)
コード例 #4
0
ファイル: ocean.py プロジェクト: YHVHvx/ocean
    width = options.width

    csvfile = sys.stdout

    os.chdir(GetDir(testcase))
    program = GetCmd(None)

    os.chdir("crash")

    timeout = options.timeout
    envs = dict()
    args = GetArgs()
    files = GetFiles()

    # modules to include or ignore
    included_mods = readmodfile(incmodfile)
    ignored_mods = readmodfile(ignmodfile)

    original_inputs = RandomInputMutator(args + files, NullMutator)
    expanded_input_generator = RandomInputMutator(args + files, RandomExpanderMutator)
    mutated_input_generator = RandomInputMutator(args + files, RandomByteMutator)

    app = Process(program, envs, timeout, included_mods, ignored_mods, no_stdout=not show_stdout)

    prt = TypePrinter("/dev/stdout", program)

    # unchanged input
    null_mutt, original_input = original_inputs.next()
    original_events = app.getData(prepare_inputs(original_input))

    if original_events is None: