Beispiel #1
0
    def __init__(self, io):
        if isinstance(io, str):
            io = StringIO(io)

        self.signature, self.version, self.filesize = struct.unpack(
            '<3sBL', io.read(8))
        self.frame_size = StructRect(io)
        self.frame_rate, self.frame_count = struct.unpack('<HH', io.read(4))
        self.frame_rate /= 0x100

        # if self.is_compressed():
        #     body = io.read()
        #     io = StringIO(zlib.decompress(io.read()))
        #     self.signature = 'FWS'

        self.tags = []
        tag = None
        while tag is None or not isinstance(tag, swftag.End):
            tag = SWFTag(io)
            self.tags.append(tag)
Beispiel #2
0
 def bounds(self):
     if self.__bounds is None:
         self.body_bits.seekbyte(2)
         self.__bounds = StructRect(bits=self.body_bits)
     return self.__bounds
Beispiel #3
0
 def setUp(self):
     self.rect = StructRect(cws_bytes[8:])
     self.original_bytes = cws_bytes[8:8 + len(self.rect)]