This document discusses the anatomy and structure of SWF (Shockwave Flash) files. It begins by explaining the basic components of a SWF header and tags. It then provides examples of different data types used within tags, such as integers, numbers, bit arrays, and strings. In particular, it examines the RECT and bit array data types, demonstrating how values are encoded and concatenated into a compact bit stream representation. Overall, the document provides technical details about the low-level format and encoding of SWF files.
This document discusses the anatomy and structure of SWF (Shockwave Flash) files. It begins by explaining the basic components of a SWF header and tags. It then provides examples of different data types used within tags, such as integers, numbers, bit arrays, and strings. In particular, it examines the RECT and bit array data types, demonstrating how values are encoded and concatenated into a compact bit stream representation. Overall, the document provides technical details about the low-level format and encoding of SWF files.
Detingut un pedòfil a Sabadell que contactava amb nens per FacebookJosep Gregori
Els Mossos d'Esquadra han detingut a un pedòfil de 24 anys com a presumpte autor de 40 delictes de corrupció de menors i pornografia infantil a l'haver aconseguit que 40 menors li enviessin imatges seves despullats i de contingut sexual després de guanyar-se la seva confiança a través de la xarxa social Facebook.
13. 12
SWFバイナリの基本
ShowFrame ShowFrame ShowFrame
Header Tag Tag Tag Tag Tag Tag Tag Tag
1フレーム目 2フレーム目 Nフレーム目 End
SWFファイルはヘッダとそれに続く複数のタグからなる
ヘッダ:バージョン, ファイルサイズ, ステージサイズ,
フレームレート, 総フレーム数,
タグ: Definitionタグ ShapeやMCなどのキャラクタを定義
Controlタグ 定義したキャラクタの取り扱い
SWF全体の流れのコントロール
19. 18
パラメタ埋め込み動的SWFの例(1)
ShowFrame End
Header Tag Tag Tag Tag Tag Tag Tag
0x96 0x06 … タグヘッダ
バイト DoAction
= Tag
name =
0x96 0x08 …
“niwauu”;
0x1d 0x00 コード
スクリプト バイトコード タグ
New
Tag
20. 19
パラメタ埋め込み動的SWFの例(1)
ShowFrame End
Header Tag Tag Tag Tag Tag Tag Tag
1フレーム目
0x96 0x06 … タグヘッダ
バイト DoAction
= Tag
name =
0x96 0x08 …
“niwauu”;
0x1d 0x00 コード
スクリプト バイトコード タグ
New
Header Tag Tag Tag Tag Tag Tag Tag Tag
• 1フレーム目へのDoActionタグの挿入
21. 20
パラメタ埋め込み動的SWFの例(1)
ShowFrame End
Header Tag Tag Tag Tag Tag Tag Tag
1フレーム目
0x96 0x06 … タグヘッダ
バイト DoAction
= Tag
name =
0x96 0x08 …
“niwauu”;
0x1d 0x00 コード
スクリプト バイトコード タグ
Modified New
Header Tag Tag Tag Tag Tag Tag Tag Tag
• 1フレーム目へのDoActionタグの挿入
• 全体のサイズ変更によるSWFヘッダの更新
66. 65
エレメントの対応
・画像の挿入(置換でない)
⇒ ▪ DefineBitsLossless2, DefineShape,PlaceObejct2タグを
新規に作ってSWF内にタグ挿入する必要がある
▪ Depthを表示順に合わせて決める
重複しないように注意
Tag Tag Tag Tag Tag Tag
DefintBitsLossless2 DefintBitsLossless2
DefineShape DefineShape
PlaceObject PlaceObject
67. 66
エレメントの対応
Header Tag Tag Tag Tag Tag Tag Tag Tag
Tag Tag
DefineBitsLossless2 Header … Tag Tag Tag Tag
DefineShape
キャラクターMCの
Tag Tag Tag Tag
DefineSpriteタグ RemoveObject2 RemoveObject2
PlaceObject2 PlaceObject2
▮キャラクターMCのDefineSpriteより前に画像定義を挿入
▮表示順に注意してDepthの設定をしたPlaceObject2を
キャラクターMCの適当なフレームに挿入
(必要に応じてRemoveObject2タグも)
68. 67
DefineSpriteタグ(Tag type=39)
▮ムービークリップを定義する
・タグの塊を内部に持つ
Header ⇒置換の際にこのタグ内タグを見る必要もある
・Control系のタグのみ(Definition系は丌可)
SpriteID ⇒配置するキャラクタはこのタグより前で定義
FrameCount 1 2 3 4 5 6 7 8
ControlTags a a
tag
tag 1 2 3 4 5 6 7 8
タグ E
tag N
D
…
: DoAction : PlaceObject2
tag : ShowFrame : RemoveObject2
69. 68
アニメーションの対応
1 5 10
a a
こういうMCをつくって埋め込む
(つくるMCの数は任意個)
・必要な画像のDefineBitsLossless2, DefineShapeタグを登録
・DefineSpriteタグでMC定義、その中に
1. 表示する画像のDefineShapeタグを設置するPlaceObject2タグ
2. 各画像表示時間の調整用にフレーム稼ぎのShowFrameタグ
3. くりかえ(す|さない)などの制御用スクリプトのDoActionタグ
・DefineSpriteで定義したMCを名前付きでPlaceObject2タグで設置
70. 69
アニメーションの対応
Header Tag Tag Tag Tag Tag Tag Tag Tag
Tag Tag Tag
DefineBitsLossless2 Header … Tag Tag Tag Tag
DefineShape
DefineSprite
キャラクターMCの Tag Tag Tag Tag
DefineSpriteタグ
RemoveObject2 RemoveObject2
PlaceObject2 PlaceObject2
▮キャラクターMCのDefineSpriteより前に画像定義を挿入
▮表示順に注意してDepthの設定をしたPlaceObject2を
キャラクターMCの適当なフレームに挿入して
アニメーションをDefineしたSpriteをPlaceする
71. 70
DefineSpriteについて
1. DefinSprite内におけるタグはControlTagだけなので
入れ子になったムービークリップでもDefineSprite
タグは入れ子にはなりません(子は親よりも前に定義する)
MC2 Header Tag Tag Tag Tag Tag
MC1 DefineSprite(MC2) DefineSprite(MC1)
2. それぞれ独立したDepth空間を持っています
Display List Display List
(Main) (Sprite)
Depth: 8 Shape Depth:4 Text
3 Sprite 3 Shape
2 Text 2 Shape
1 Shape 1 Text