In association with heise online




Commented P-Code Listing


class Main extends flash.display::Sprite
{
function Main():* /* disp_id -1*/
{
activation {
var ii:Number /* slot_id 5 */
var i:Number /* slot_id 3 */
var j:Number /* slot_id 2 */
var bytes:flash.utils::ByteArray /* slot_id 1 */
var Gaa:flash.display::Loader /* slot_id 4 */
}
// local_count=3 max_scope=5 max_stack=7 code_len=283
0 debugfile "C:\Documents and Settings\dev\Desktop\exp;;Main.as"
2 debugline 12
4 getlocal0
5 pushscope
6 newactivation
7 dup
8 setlocal1
9 pushscope
10 debug 1 23 0 12

// set Gaa = NULL

15 getscopeobject 1
17 pushnull
18 coerce flash.display::Loader
20 set Gaa

22 debugline 13
24 getlocal0
25 constructsuper (0)
27 debugline 14

// initialize bytes as a new ByteArray

29 getscopeobject 1
31 findpropstrict flash.utils::ByteArray
33 constructprop flash.utils::ByteArray (0)
36 coerce flash.utils::ByteArray
38 set bytes

40 debugline 16
42 getscopeobject 1

// set j = 0

44 pushbyte 0
46 convert_d
47 set j

49 debugline 17
51 getscopeobject 1

// set i = 0

53 pushbyte 0
55 convert_d
56 set i

58 jump L1

L2:
62 label
63 debugline 19

// push bytes[i] on stack

65 getscopeobject 1
67 get bytes
69 getscopeobject 1
71 get i

// push Eys.data[i] on stack

73 getlex Eys
75 getproperty data
77 getscopeobject 1
79 get i
81 getproperty null

// push Eys.Dae on stack

83 getlex Eys
85 getproperty Dae

// push (j = j + 1) on stack

87 getscopeobject 1
89 get j
91 convert_d
92 dup
93 increment
94 convert_d
95 getscopeobject 1
97 swap
98 set j

// pop j from stack and take Eys.Dae.charCodeAt[j]

100 callproperty http://adobe.com/AS3/2006/builtin::charCodeAt (1)

// pop from Eys.data[i] and Eys.Dae.charCodeAt(j) from stack,
// XOR them, and store the result in bytes[i]:
// bytes[i] = (Eys.data[i] XOR Eys.Dae.charCodeAt(j));

103 bitxor

104 setproperty null
106 debugline 20

// push j on stack

108 getscopeobject 1
110 get j

// push Eys.Dae.lehgth on stack

112 getlex Eys
114 getproperty Dae
116 getproperty length

// pop j and Eys.Dae.length from stack, compare them,
// and jump to L3 if (i < Eys.Dae.length)

118 ifnge L3

// set j = 0
// that is, if j is still less than Eys.Dae.length,
// then skip this block and jump to L3, otherwise, set j = 0

122 getscopeobject 1
124 pushbyte 0
126 convert_d
127 set j

L3:
129 debugline 17

// i = i + 1

131 getscopeobject 1
133 get i
135 increment
136 convert_d
137 getscopeobject 1
139 swap
140 set i

L1:
// push i into stack

142 getscopeobject 1
144 get i

// push Eys.data.length into stack

146 getlex Eys
148 getproperty data
150 getproperty length

// pop i and Eys.data.length from stack
// and jump to L2 if (i < Eys.data.length)

152 iflt L2

// initialize Gaa as new Loader

156 debugline 23
158 getscopeobject 1
160 findpropstrict flash.display::Loader
162 constructprop flash.display::Loader (0)
165 coerce flash.display::Loader
167 set Gaa
169 debugline 24

// set ii = 0

171 getscopeobject 1
173 pushbyte 0
175 convert_d
176 set ii
178 jump L4

L5:

// ii = ii + 1

182 label
183 getscopeobject 1
185 get ii
187 increment
188 convert_d
189 getscopeobject 1
191 swap
192 set ii

L4:
// push ii on stack

194 getscopeobject 1
196 get ii

// push 2 on stack

198 pushbyte 2

// pop 2 and ii from stack, compare, jump to L5 if (i < 2)

200 iflt L5

204 debugline 25
206 findpropstrict addChild
208 getscopeobject 1

// call addChild(Gaa)

210 get Gaa
212 callpropvoid addChild (1)

// push Gaa.loaderInfo on stack

215 debugline 28
217 getscopeobject 1
219 get Gaa
221 getproperty loaderInfo

// push Event.COMPLETE on stack

223 getlex flash.events::Event
225 getproperty COMPLETE

// create new function with a parameter of Event type, e.g. e

227 newfunction var undefined(flash.events::Event):void /* disp_id 0*/

// pop function(e:Event), Event.COMPLETE and Gaa.loaderInfo
// from stack, then call addEventListener():
// Gaa.loaderInfo.addEventListener(Event.COMPLETE, function(e:Event))

229 callpropvoid addEventListener (2)

232 debugfile "C:\Documents and Settings\dev\Desktop\exp;;Main.as"

// push Gaa on stack

234 debugline 29
236 getscopeobject 1
238 get Gaa
240 getscopeobject 1

// push bytes on stack

242 get bytes

// pop bytes, Gaa from stack and call loadBytes():
// Gaa.loadBytes(bytes)

244 callpropvoid loadBytes (1)
247 debugline 31
249 jump L6

253 getlocal0
254 pushscope
255 getlocal1
256 pushscope
257 newcatch 0
259 dup
260 setlocal2
261 dup
262 pushscope
263 swap
264 set bytes
266 debugline 33
268 findpropstrict trace
270 getscopeobject 2
272 get bytes
274 callpropvoid trace (1)
277 popscope
278 kill 2
L6:
280 debugline 35
282 returnvoid
}
}

Next: Decode.cpp

Print Version | Permalink: http://h-online.com/-1057907
  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit