Ejemplo n.º 1
0
Archivo: SEA.py Proyecto: nemopwn/SEA
args = parser.parse_args()

mode = args.type
valid_modes = ["jump", "path", "debug", "selection", "generation"]

if not (mode in valid_modes):
    print '"' + mode + '" is an invalid type of operation for SEA'
    exit(1)

if mode == "debug":

    first = int(args.first)
    last = int(args.last)
    path = mkPath(args.trace_filename, first, last)
    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)
Ejemplo n.º 2
0
Archivo: SEA.py Proyecto: YHVHvx/SEA
                   default=None, help='which address to jump in jump mode')

parser.add_argument('iconditions', metavar='operator,value', type=str, nargs='*',
                   help='initial conditions for the trace')

args = parser.parse_args()

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
Ejemplo n.º 3
0
                    metavar='operator,value',
                    type=str,
                    nargs='*',
                    help='initial conditions for the trace')

args = parser.parse_args()

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
Ejemplo n.º 4
0
args = parser.parse_args()

mode  = args.type
valid_modes = ["jump", "path", "debug", "selection", "generation"]

if not (mode in valid_modes):
  print "\""+mode+"\" is an invalid type of operation for SEA"
  exit(1)  

if (mode == 'debug'):
  
  first = int(args.first)
  last  = int(args.last) 
  path = mkPath(args.trace_filename, first, last)
  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)