Exemplo n.º 1
0
Arquivo: SEA.py Projeto: nemopwn/SEA
        (fvars, sol) = getJumpConditions(trace, address)

        if sol <> None:
            print "SAT!"
            for var in fvars:
                print "sol[" + str(var) + "] =", sol[var]
        else:
            print "UNSAT!"


elif mode == "path":

    first = int(args.first)
    last = int(args.last)

    address = args.address
    path = mkPath(args.trace_filename, first, last)
    trace = mkTrace(path, args.iconditions, debug=True)
    fvars, sol = getPathConditions(trace, False)

    if sol <> None:
        print "SAT!"
        for var in fvars:
            print "sol[" + str(var) + "] =", sol[var]
    else:
        print "UNSAT!"

elif mode == "generation":
    program = mkProgram(args.trace_filename)
    generatePaths(program, args.first, args.last, 2000)
Exemplo n.º 2
0
Arquivo: SEA.py Projeto: YHVHvx/SEA
  exit(1)

if (mode <> "selection"):
  address = args.address
  trace = mkTrace(args.trace_filename, args.first, args.last, args.iconditions)

if (mode == "jump"):
  if (address == None):
    print "An address to jump to should be specified!"
  else:
    getJumpConditions(trace, address)

elif (mode == 'path'): 
  
  # TODO: move to PathConditions.py?
  sol = getPathConditions(trace)
  if (sol <> None):
    print "SAT conditions found!"
    input_vars = ["stdin:", "arg[0]@0:", "arg[1]@0:", "arg[2]@0:"]
    pos = trace["code"].last - 1
    
    filename = "path." + "[" + str(pos)  +"]"
    
    dumped = sol.dump(filename,input_vars)
    for filename in dumped:
      print filename, "dumped."
      
elif (mode == 'selection'): 
  selectPath(args.trace_filename)
    
elif (mode == 'debug'):
Exemplo n.º 3
0
if (mode <> "selection"):
    address = args.address
    trace = mkTrace(args.trace_filename, args.first, args.last,
                    args.iconditions)

if (mode == "jump"):
    if (address == None):
        print "An address to jump to should be specified!"
    else:
        getJumpConditions(trace, address)

elif (mode == 'path'):

    # TODO: move to PathConditions.py?
    sol = getPathConditions(trace)
    if (sol <> None):
        print "SAT conditions found!"
        input_vars = ["stdin:", "arg[0]@0:", "arg[1]@0:", "arg[2]@0:"]
        pos = trace["code"].last - 1

        filename = "path." + "[" + str(pos) + "]"

        dumped = sol.dump(filename, input_vars)
        for filename in dumped:
            print filename, "dumped."

elif (mode == 'selection'):
    selectPath(args.trace_filename)

elif (mode == 'debug'):
Exemplo n.º 4
0
    if sol <> None:
      print "SAT!"
      for var in fvars:
        print "sol["+str(var)+"] =", sol[var]
    else:
      print "UNSAT!"


elif (mode == 'path'): 

  first = int(args.first)
  last  = int(args.last) 
  
  address = args.address
  path = mkPath(args.trace_filename, first, last)
  trace = mkTrace(path, args.iconditions, debug = True)
  fvars, sol = getPathConditions(trace, False)

  if sol <> None:
    print "SAT!"
    for var in fvars:
      print "sol["+str(var)+"] =", sol[var]
  else:
    print "UNSAT!"
      
elif (mode == 'generation'):
  program = mkProgram(args.trace_filename) 
  generatePaths(program,args.first, args.last, 2000)