示例#1
0
def main():
    test_file = sys.argv[1]
    f = open(os.path.join(os.getcwd(), test_file), "rb")
    s = ConstBitStream(f)
    try:
        file_type = s.read("bytes:3")
        if file_type == "FWS":
            print "Standard SWF"
            print "Version:", s.read("uintle:8")
            print "Size:", s.read("uintle:32"), "bytes"
            s = datatypes.rect(s)
            print "Frame rate: %d.%d" % datatypes.fixed_8(s)
            print "Frame count:", s.read("uintle:16")
            read_tag_headers(s)
        elif file_type == "CWS":
            print "Compressed SWF"
            print "Version:", s.read("uintle:8")
            print "Uncompressed size:", s.read("uintle:32"), "bytes"
            to_decompress = s[64:].tobytes()
            s = ConstBitStream(bytes=zlib.decompress(to_decompress))
            s = datatypes.rect(s)
            print "Frame rate: %d.%d" % datatypes.fixed_8(s)
            print "Frame count:", s.read("uintle:16")
            read_tag_headers(s)
            # print "[Cannot currently parse]"
    finally:
        f.close()
示例#2
0
def define_shape_4(stream):
    print "ShapeId:",stream.read('uintle:16')
    print "ShapeBounds:"
    stream = datatypes.rect(stream)
    print "EdgeBounds:"
    stream = datatypes.rect(stream)
    stream.pos += 5
    print "UsesFillWindingRule:",stream.read('bool')
    print "UsesNonScalingStrokes:",stream.read('bool')
    print "UsesScalingStrokes:",stream.read('bool')
    datatypes.shape_with_style(stream,"DefineShape4")
示例#3
0
def define_shape_3(stream):
    print "ShapeId:",stream.read('uintle:16')
    print "ShapeBounds:"
    stream = datatypes.rect(stream)
    datatypes.shape_with_style(stream,"DefineShape3")