예제 #1
0
    
    for (k,v) in options:
        if k in ('-v', '--verbose'):
            verbose += 1
        elif k in ('-f', '--functions'):
            ffile.append(v)
        elif k in ('-h', '--help'):
            usage()
        elif k in ('-s', '--stop'):
            if v not in stages:
                usage()
            stop_after = v
        else:
            usage()

    if len(argv) != 1:
        usage()

    fflist = None
    for f in ffile:
        flist = makeFunctionList(f,verbose)
        
    byte_code = compileTSP(argv[0],flist,stop_after,verbose)
    print byte_code

    from decompileTSP import Decompiler
    d = Decompiler(flist)
    d.decompile(byte_code)
    

예제 #2
0
    try:
        (options,argv) = getopt.getopt(sys.argv[1:], 'vhf:', ['verbose', 'help', 'functions='])
    except Exception, e:
        print e
        usage()

    verbose    = 0
    ffile      = ""
    
    for (k,v) in options:
        if k in ('-v', '--verbose'):
            verbose += 1
        elif k in ('-f', '--functions'):
            ffile = v
        elif k in ('-h', '--help'):
            usage()
        else:
            usage()

    if len(argv) < 1:
        usage()

    if ffile:
        flist = makeFunctionList(ffile,verbose)
    else:
        flist = None

    d = Decompiler(flist)


예제 #3
0
def main(argv):
    outfile = 'web_site.h'
    verbose = 0
    
    try:
        (options,argv) = getopt.getopt(argv, 'f:o:v', ['functions=', 'output=', 'verbose'])
    except Exception, e:
        print e
        usage(outfile)

    for (k,v) in options:
        if k in ('-f', '--functions'):
            global g_FunctionList
            if g_FunctionList is None:
                g_FunctionList = makeFunctionList(v)
            else:
                g_FunctionList = makeFunctionList(v)
        elif k in ('-o', '--output'):
            outfile = v
        elif k in ('-v', '--verbose'):
            verbose += 1
        else:
            usage(outfile)
            
    if len(argv) != 2:
        usage(outfile)

    if verbose:
        print "Function list"
        g_FunctionList.dump()