File: swf.h

package info (click to toggle)
clamav 0.98.7+dfsg-0+deb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 60,204 kB
  • ctags: 49,129
  • sloc: cpp: 267,090; ansic: 152,211; sh: 35,196; python: 2,630; makefile: 2,220; perl: 1,690; pascal: 1,218; lisp: 184; csh: 117; xml: 38; asm: 32; exp: 4
file content (223 lines) | stat: -rw-r--r-- 8,700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
 *  Copyright (C) 2011 Sourcefire, Inc.
 *  Authors: Tomasz Kojm <tkojm@clamav.net>
 *
 *  The code is based on Flasm, command line assembler & disassembler of Flash
 *  ActionScript bytecode Copyright (c) 2001 Opaque Industries, (c) 2002-2007
 *  Igor Kogan, (c) 2005 Wang Zhen. All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without modification,
 *  are permitted provided that the following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list
 *  of conditions and the following disclaimer.
 *  - Redistributions in binary form must reproduce the above copyright notice, this
 *  list of conditions and the following disclaimer in the documentation and/or other
 *  materials provided with the distribution.
 *  - Neither the name of the Opaque Industries nor the names of its contributors may
 *  be used to endorse or promote products derived from this software without specific
 *  prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
 *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
 *  SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
 *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
 *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
 *  WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef __SWF_H
#define __SWF_H

#include "others.h"

int cli_scanswf(cli_ctx *ctx);

typedef enum
{
    TAG_END			= 0,
    TAG_SHOWFRAME		= 1,
    TAG_DEFINESHAPE		= 2,
    TAG_FREECHARACTER		= 3,
    TAG_PLACEOBJECT		= 4,
    TAG_REMOVEOBJECT		= 5,
    TAG_DEFINEBITS		= 6,
    TAG_DEFINEBUTTON		= 7,
    TAG_JPEGTABLES		= 8,
    TAG_SETBACKGROUNDCOLOR	= 9,
    TAG_DEFINEFONT		= 10,
    TAG_DEFINETEXT		= 11,
    TAG_DOACTION		= 12,
    TAG_DEFINEFONTINFO		= 13,
    TAG_DEFINESOUND		= 14,
    TAG_STARTSOUND		= 15,
    TAG_STOPSOUND		= 16,
    TAG_DEFINEBUTTONSOUND	= 17,
    TAG_SOUNDSTREAMHEAD		= 18,
    TAG_SOUNDSTREAMBLOCK	= 19,
    TAG_DEFINEBITSLOSSLESS	= 20,
    TAG_DEFINEBITSJPEG2		= 21,
    TAG_DEFINESHAPE2		= 22,
    TAG_DEFINEBUTTONCXFORM	= 23,
    TAG_PROTECT			= 24,
    TAG_PATHSAREPOSTSCRIPT	= 25,
    TAG_PLACEOBJECT2		= 26,
    TAG_REMOVEOBJECT2		= 28,
    TAG_SYNCFRAME		= 29,
    TAG_FREEALL			= 31,
    TAG_DEFINESHAPE3		= 32,
    TAG_DEFINETEXT2		= 33,
    TAG_DEFINEBUTTON2		= 34,
    TAG_DEFINEBITSJPEG3		= 35,
    TAG_DEFINEBITSLOSSLESS2	= 36,
    TAG_DEFINEEDITTEXT		= 37,
    TAG_DEFINEVIDEO		= 38,
    TAG_DEFINEMOVIECLIP		= 39,
    TAG_NAMECHARACTER		= 40,
    TAG_SERIALNUMBER		= 41,
    TAG_DEFINETEXTFORMAT	= 42,
    TAG_FRAMELABEL		= 43,
    TAG_SOUNDSTREAMHEAD2	= 45,
    TAG_DEFINEMORPHSHAPE	= 46,
    TAG_GENFRAME		= 47,
    TAG_DEFINEFONT2		= 48,
    TAG_GENCOMMAND		= 49,
    TAG_DEFINECOMMANDOBJ	= 50,
    TAG_CHARACTERSET		= 51,
    TAG_FONTREF			= 52,
    TAG_EXPORTASSETS		= 56,
    TAG_IMPORTASSETS		= 57,
    TAG_ENABLEDEBUGGER		= 58,
    TAG_INITMOVIECLIP		= 59,
    TAG_DEFINEVIDEOSTREAM	= 60,
    TAG_VIDEOFRAME		= 61,
    TAG_DEFINEFONTINFO2		= 62,
    TAG_DEBUGID			= 63,
    TAG_ENABLEDEBUGGER2		= 64,
    TAG_SCRIPTLIMITS		= 65,
    TAG_SETTABINDEX		= 66,
    TAG_DEFINESHAPE4		= 67,
    TAG_FILEATTRIBUTES		= 69,
    TAG_PLACEOBJECT3		= 70,
    TAG_IMPORTASSETS2		= 71,
    TAG_DEFINEFONTINFO3		= 73,
    TAG_DEFINETEXTINFO		= 74,
    TAG_DEFINEFONT3		= 75,
    TAG_AVM2DECL		= 76,
    TAG_METADATA		= 77,
    TAG_SLICE9			= 78,
    TAG_AVM2ACTION		= 82,
    TAG_DEFINESHAPE5		= 83,
    TAG_DEFINEMORPHSHAPE2	= 84,
    TAG_DEFINESFLABELDATA	= 86,
    TAG_DEFINEBINARYDATA	= 87,
    TAG_DEFINEFONTNAME		= 88,
    TAG_STARTSOUND2		= 89,
    TAG_DEFINEBITSJPEG4		= 90,
    TAG_DEFINEFONT4		= 91,
    TAG_ENABLETELEMETRY		= 93,
    TAG_DEFINEBITSPTR		= 1023,
    TAG_UNKNOWN			= 9999
} tag_id;

static const struct tag_names_s {
    const char *name;
    tag_id  id;
} tag_names[] = {
    { "TAG_END",			TAG_END			},
    { "TAG_SHOWFRAME",			TAG_SHOWFRAME		},
    { "TAG_DEFINESHAPE",		TAG_DEFINESHAPE		},
    { "TAG_FREECHARACTER",		TAG_FREECHARACTER	},
    { "TAG_PLACEOBJECT",		TAG_PLACEOBJECT		},
    { "TAG_REMOVEOBJECT",		TAG_REMOVEOBJECT	},
    { "TAG_DEFINEBITS",			TAG_DEFINEBITS		},
    { "TAG_DEFINEBUTTON",		TAG_DEFINEBUTTON	},
    { "TAG_JPEGTABLES",			TAG_JPEGTABLES		},
    { "TAG_SETBACKGROUNDCOLOR",		TAG_SETBACKGROUNDCOLOR	},
    { "TAG_DEFINEFONT",			TAG_DEFINEFONT		},
    { "TAG_DEFINETEXT",			TAG_DEFINETEXT		},
    { "TAG_DOACTION",			TAG_DOACTION		},
    { "TAG_DEFINEFONTINFO",		TAG_DEFINEFONTINFO	},
    { "TAG_DEFINESOUND",		TAG_DEFINESOUND		},
    { "TAG_STARTSOUND",			TAG_STARTSOUND		},
    { "TAG_STOPSOUND",			TAG_STOPSOUND		},
    { "TAG_DEFINEBUTTONSOUND",		TAG_DEFINEBUTTONSOUND	},
    { "TAG_SOUNDSTREAMHEAD",		TAG_SOUNDSTREAMHEAD	},
    { "TAG_SOUNDSTREAMBLOCK",		TAG_SOUNDSTREAMBLOCK	},
    { "TAG_DEFINEBITSLOSSLESS",		TAG_DEFINEBITSLOSSLESS	},
    { "TAG_DEFINEBITSJPEG2",		TAG_DEFINEBITSJPEG2	},
    { "TAG_DEFINESHAPE2",		TAG_DEFINESHAPE2	},
    { "TAG_DEFINEBUTTONCXFORM",		TAG_DEFINEBUTTONCXFORM	},
    { "TAG_PROTECT",			TAG_PROTECT		},
    { "TAG_PATHSAREPOSTSCRIPT",		TAG_PATHSAREPOSTSCRIPT	},
    { "TAG_PLACEOBJECT2",		TAG_PLACEOBJECT2	},
    { "TAG_REMOVEOBJECT2",		TAG_REMOVEOBJECT2	},
    { "TAG_SYNCFRAME",			TAG_SYNCFRAME		},
    { "TAG_FREEALL",			TAG_FREEALL		},
    { "TAG_DEFINESHAPE3",		TAG_DEFINESHAPE3	},
    { "TAG_DEFINETEXT2",		TAG_DEFINETEXT2		},
    { "TAG_DEFINEBUTTON2",		TAG_DEFINEBUTTON2	},
    { "TAG_DEFINEBITSJPEG3",		TAG_DEFINEBITSJPEG3	},
    { "TAG_DEFINEBITSLOSSLESS2",	TAG_DEFINEBITSLOSSLESS2	},
    { "TAG_DEFINEEDITTEXT",		TAG_DEFINEEDITTEXT	},
    { "TAG_DEFINEVIDEO",		TAG_DEFINEVIDEO		},
    { "TAG_DEFINEMOVIECLIP",		TAG_DEFINEMOVIECLIP	},
    { "TAG_NAMECHARACTER",		TAG_NAMECHARACTER	},
    { "TAG_SERIALNUMBER",		TAG_SERIALNUMBER	},
    { "TAG_DEFINETEXTFORMAT",		TAG_DEFINETEXTFORMAT	},
    { "TAG_FRAMELABEL",			TAG_FRAMELABEL		},
    { "TAG_SOUNDSTREAMHEAD2",		TAG_SOUNDSTREAMHEAD2	},
    { "TAG_DEFINEMORPHSHAPE",		TAG_DEFINEMORPHSHAPE	},
    { "TAG_GENFRAME",			TAG_GENFRAME		},
    { "TAG_DEFINEFONT2",		TAG_DEFINEFONT2		},
    { "TAG_GENCOMMAND",			TAG_GENCOMMAND		},
    { "TAG_DEFINECOMMANDOBJ",		TAG_DEFINECOMMANDOBJ	},
    { "TAG_CHARACTERSET",		TAG_CHARACTERSET	},
    { "TAG_FONTREF",			TAG_FONTREF		},
    { "TAG_EXPORTASSETS",		TAG_EXPORTASSETS	},
    { "TAG_IMPORTASSETS",		TAG_IMPORTASSETS	},
    { "TAG_ENABLEDEBUGGER",		TAG_ENABLEDEBUGGER	},
    { "TAG_INITMOVIECLIP",		TAG_INITMOVIECLIP	},
    { "TAG_DEFINEVIDEOSTREAM",		TAG_DEFINEVIDEOSTREAM	},
    { "TAG_VIDEOFRAME",			TAG_VIDEOFRAME		},
    { "TAG_DEFINEFONTINFO2",		TAG_DEFINEFONTINFO2	},
    { "TAG_DEBUGID",			TAG_DEBUGID		},
    { "TAG_ENABLEDEBUGGER2",		TAG_ENABLEDEBUGGER2	},
    { "TAG_SCRIPTLIMITS",		TAG_SCRIPTLIMITS	},
    { "TAG_SETTABINDEX",		TAG_SETTABINDEX		},
    { "TAG_DEFINESHAPE4",		TAG_DEFINESHAPE4	},
    { "TAG_FILEATTRIBUTES",		TAG_FILEATTRIBUTES	},
    { "TAG_PLACEOBJECT3",		TAG_PLACEOBJECT3	},
    { "TAG_IMPORTASSETS2",		TAG_IMPORTASSETS2	},
    { "TAG_DEFINEFONTINFO3",		TAG_DEFINEFONTINFO3	},
    { "TAG_DEFINETEXTINFO",		TAG_DEFINETEXTINFO	},
    { "TAG_DEFINEFONT3",		TAG_DEFINEFONT3		},
    { "TAG_AVM2DECL",			TAG_AVM2DECL		},
    { "TAG_METADATA",			TAG_METADATA		},
    { "TAG_SLICE9",			TAG_SLICE9		},
    { "TAG_AVM2ACTION",			TAG_AVM2ACTION		},
    { "TAG_DEFINESHAPE5",		TAG_DEFINESHAPE5	},
    { "TAG_DEFINEMORPHSHAPE2",		TAG_DEFINEMORPHSHAPE2	},
    { "TAG_DEFINESFLABELDATA",		TAG_DEFINESFLABELDATA	},
    { "TAG_DEFINEBINARYDATA",		TAG_DEFINEBINARYDATA	},
    { "TAG_DEFINEFONTNAME",		TAG_DEFINEFONTNAME	},
    { "TAG_STARTSOUND2",		TAG_STARTSOUND2		},
    { "TAG_DEFINEBITSJPEG4",		TAG_DEFINEBITSJPEG4	},
    { "TAG_DEFINEFONT4",		TAG_DEFINEFONT4		},
    { "TAG_ENABLETELEMETRY",		TAG_ENABLETELEMETRY	},
    { "TAG_DEFINEBITSPTR",		TAG_DEFINEBITSPTR	},
    { NULL,				TAG_UNKNOWN		},
};

#define SWF_ATTR_USENETWORK                 0x01
#define SWF_ATTR_RELATIVEURLS               0x02
#define SWF_ATTR_SUPPRESSCROSSDOMAINCACHE   0x04
#define SWF_ATTR_ACTIONSCRIPT3              0x08
#define SWF_ATTR_HASMETADATA                0x10
#define SWF_ATTR_USEDIRECTBLIT		    0x20
#define SWF_ATTR_USEGPU			    0x40

#endif