-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patterns: Added SWF header pattern (#219)
* patterns: Added pattern for SWF files. * Added test file for SWF header. * Update README with SWF file type.
- Loading branch information
1 parent
35cc685
commit e7d1973
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma author saturnaliam | ||
#pragma description SWF file header | ||
#pragma endian little | ||
#include <type/magic.pat> | ||
|
||
|
||
// RECTs are more complicated, but for the header, | ||
// this works fine. | ||
bitfield Rect { | ||
nSize : 5 [[name("N Size")]]; | ||
signed xMin : 15 [[name("X Min")]]; | ||
signed xMax : 15 [[name("X Max")]]; | ||
signed yMin : 15 [[name("Y Min")]]; | ||
signed yMax : 15 [[name("Y Max")]]; | ||
}; | ||
|
||
|
||
struct Header { | ||
char compressionSignature [[name("Compression"), comment("F - Uncompressed\nC - zlib Compressed\nZ - LZMA compressed")]]; | ||
type::Magic<"WS"> signature [[name("Signature")]]; | ||
u8 swfVersion [[name("SWF Version")]]; | ||
u32 bytesSize [[name("Uncompressed Size")]]; | ||
be Rect rect [[name("Frame Size"), comment("Needs to be uncompressed to have the correct value.")]]; | ||
padding[1]; | ||
u8 frameRate [[name("Framerate"), comment("Needs to be uncompressed to have the correct value.")]]; | ||
u16 frameCount [[name("Frame Count"), comment("Needs to be uncompressed to have the correct value.")]]; | ||
}; | ||
|
||
Header header @ 0x00; |
Binary file not shown.