Example #1
0
File: SEA.py Project: nemopwn/SEA
    trace = mkTrace(path, args.iconditions, debug=True)

if mode == "jump":

    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)

    if address == None:
        print "An address to jump to should be specified!"
    else:
        (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
Example #2
0
File: SEA.py Project: YHVHvx/SEA
mode  = args.type

if not (mode in ["jump", "path", "debug", "selection"]):
  print "\""+mode+"\" is an invalid type of operation for 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."
Example #3
0
mode = args.type

if not (mode in ["jump", "path", "debug", "selection"]):
    print "\"" + mode + "\" is an invalid type of operation for 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."
Example #4
0
  trace = mkTrace(path, args.iconditions, debug = True)
  
if (mode == "jump"):
  
  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)

  if (address == None):
    print "An address to jump to should be specified!"
  else:
    (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