Wybourne wrote...
For RECORDHEADER(long), does the 32 bit field add to the length in the 16 bit field? Edit: I'm guessing it doesn't, because when I do that I get a bunch of tags with numbers in the thousands. Edit again: well, actually, when I don't do that, a bunch of tags have lengths that could fit in RECORDHEADER(short)...But at least all the tags so far make sense this way... >_>
You never add those two fields.
Are you taking little-endian format into account when you're trying to get the tag ID or size? I take it you're looking at Adobe's SWF file format PDF.
If it's a short tag (< 63 bytes of data), then there is no 32 bit field on disk (i.e., you'd be reading the data payload instead of the tag length info if you tried reading the next four bytes).
Edit: What you could be seeing is the short's size says 63 decimal and then the 32 bit field has a value less than 63. Technically I guess it could do that without breaking anything.
The tag is contained in the upper 10 bits of the short and the length is in the lower 6 bits. If the length *here* is 63 decimal, then you have to look at the 32 bit field for the actual length. Unlike other bitfields in the SWF format, you have to read the short in little-endian format instead of as just another sequence of bytes.
The non-standard tags are 1000 and 1001, and then there's some more after the SWF end-tag.
Tag 1000 seems to define the resource name "e.g., conversation for conversation.gfx", and tag 1001 seems to define DDS textures to use (which are further defined in XML files cutting out pieces in a texture atlas), which seem to be filled in a defineshape and also usable by a pseudo "img://" uri in their ActionScript MovieUtils (IIRC) class (but I'm not sure off-hand if that requires them to be defined upfront).
There's also a GUI framework that's used, but I'm not sure how much you have to use of that or how much is just the CLIK library or something else. But usually things seem to happen in the StartScene function, where the main clip does some stuff and assigns initialization callbacks to the other clips.
But if you have sswf installed, swf_dump should also show you the tags (although it's a bit out of date, I found it's format better than the swftools dump program).
Modifié par FollowTheGourd, 24 novembre 2009 - 12:45 .