Menu

[r11]: / trunk / SWFInvestigator / src / decompiler / swfdump / Action.as  Maximize  Restore  History

Download this file

167 lines (152 with data), 7.9 kB

  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
////////////////////////////////////////////////////////////////////////////////
//
// ADOBE SYSTEMS INCORPORATED
// Copyright 2003-2006 Adobe Systems Incorporated
// All Rights Reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package decompiler.swfdump
{
import decompiler.swfdump.SWFFormatError;
import decompiler.swfdump.ActionConstants;
import decompiler.swfdump.ActionHandler;
import flash.utils.getQualifiedClassName;
public class Action
{
public var code:int;
public function Action(code:int)
{
this.code = code;
}
/**
* Subclasses implement this method to callback one of the methods in ActionHandler...
* @param h
*/
public function visit(h:ActionHandler):void
{
switch (this.code)
{
case (ActionConstants.sactionNextFrame): h.nextFrame(this); break;
case (ActionConstants.sactionPrevFrame): h.prevFrame(this); break;
case (ActionConstants.sactionPlay): h.play(this); break;
case (ActionConstants.sactionStop): h.stop(this); break;
case (ActionConstants.sactionToggleQuality): h.toggleQuality(this); break;
case (ActionConstants.sactionStopSounds): h.stopSounds(this); break;
case (ActionConstants.sactionAdd): h.add(this); break;
case (ActionConstants.sactionSubtract): h.subtract(this); break;
case (ActionConstants.sactionMultiply): h.multiply(this); break;
case (ActionConstants.sactionDivide): h.divide(this); break;
case (ActionConstants.sactionEquals): h.equalsAction(this); break;
case (ActionConstants.sactionLess): h.less(this); break;
case (ActionConstants.sactionAnd): h.and(this); break;
case (ActionConstants.sactionOr): h.or(this); break;
case (ActionConstants.sactionNot): h.not(this); break;
case (ActionConstants.sactionStringEquals): h.stringEquals(this); break;
case (ActionConstants.sactionStringLength): h.stringLength(this); break;
case (ActionConstants.sactionStringExtract): h.stringExtract(this); break;
case (ActionConstants.sactionPop): h.pop(this); break;
case (ActionConstants.sactionToInteger): h.toInteger(this); break;
case (ActionConstants.sactionGetVariable): h.getVariable(this); break;
case (ActionConstants.sactionSetVariable): h.setVariable(this); break;
case (ActionConstants.sactionSetTarget2): h.setTarget2(this); break;
case (ActionConstants.sactionStringAdd): h.stringAdd(this); break;
case (ActionConstants.sactionGetProperty): h.getProperty(this); break;
case (ActionConstants.sactionSetProperty): h.setProperty(this); break;
case (ActionConstants.sactionCloneSprite): h.cloneSprite(this); break;
case (ActionConstants.sactionRemoveSprite): h.removeSprite(this); break;
case (ActionConstants.sactionTrace): h.trace(this); break;
case (ActionConstants.sactionStartDrag): h.startDrag(this); break;
case (ActionConstants.sactionEndDrag): h.endDrag(this); break;
case (ActionConstants.sactionStringLess): h.stringLess(this); break;
case (ActionConstants.sactionThrow): h.throwAction(this); break;
case (ActionConstants.sactionCastOp): h.castOp(this); break;
case (ActionConstants.sactionImplementsOp): h.implementsOp(this); break;
case (ActionConstants.sactionRandomNumber): h.randomNumber(this); break;
case (ActionConstants.sactionMBStringLength): h.mbStringLength(this); break;
case (ActionConstants.sactionCharToAscii): h.charToASCII(this); break;
case (ActionConstants.sactionAsciiToChar): h.asciiToChar(this); break;
case (ActionConstants.sactionGetTime): h.getTime(this); break;
case (ActionConstants.sactionMBStringExtract): h.mbStringExtract(this); break;
case (ActionConstants.sactionMBCharToAscii): h.mbCharToASCII(this); break;
case (ActionConstants.sactionMBAsciiToChar): h.mbASCIIToChar(this); break;
case (ActionConstants.sactionDelete): h.deleteAction(this); break;
case (ActionConstants.sactionDelete2): h.delete2(this); break;
case (ActionConstants.sactionDefineLocal): h.defineLocal(this); break;
case (ActionConstants.sactionCallFunction): h.callFunction(this); break;
case (ActionConstants.sactionReturn): h.returnAction(this); break;
case (ActionConstants.sactionModulo): h.modulo(this); break;
case (ActionConstants.sactionNewObject): h.newObject(this); break;
case (ActionConstants.sactionDefineLocal2): h.defineLocal2(this); break;
case (ActionConstants.sactionInitArray): h.initArray(this); break;
case (ActionConstants.sactionInitObject): h.initObject(this); break;
case (ActionConstants.sactionTypeOf): h.typeOf(this); break;
case (ActionConstants.sactionTargetPath): h.targetPath(this); break;
case (ActionConstants.sactionEnumerate): h.enumerate(this); break;
case (ActionConstants.sactionAdd2): h.add2(this); break;
case (ActionConstants.sactionLess2): h.less2(this); break;
case (ActionConstants.sactionEquals2): h.equals2(this); break;
case (ActionConstants.sactionToNumber): h.toNumber(this); break;
case (ActionConstants.sactionToString): h.toStringAction(this); break;
case (ActionConstants.sactionPushDuplicate): h.pushDuplicate(this); break;
case (ActionConstants.sactionStackSwap): h.stackSwap(this); break;
case (ActionConstants.sactionGetMember): h.getMember(this); break;
case (ActionConstants.sactionSetMember): h.setMember(this); break;
case (ActionConstants.sactionIncrement): h.increment(this); break;
case (ActionConstants.sactionDecrement): h.decrement(this); break;
case (ActionConstants.sactionCallMethod): h.callMethod(this); break;
case (ActionConstants.sactionNewMethod): h.newMethod(this); break;
case (ActionConstants.sactionInstanceOf): h.instanceOf(this); break;
case (ActionConstants.sactionEnumerate2): h.enumerate2(this); break;
case (ActionConstants.sactionBitAnd): h.bitAnd(this); break;
case (ActionConstants.sactionBitOr): h.bitOr(this); break;
case (ActionConstants.sactionBitXor): h.bitXor(this); break;
case (ActionConstants.sactionBitLShift): h.bitLShift(this); break;
case (ActionConstants.sactionBitRShift): h.bitRShift(this); break;
case (ActionConstants.sactionBitURShift): h.bitURShift(this); break;
case (ActionConstants.sactionStrictEquals): h.strictEquals(this); break;
case (ActionConstants.sactionGreater): h.greater(this); break;
case (ActionConstants.sactionStringGreater): h.stringGreater(this); break;
case (ActionConstants.sactionCall): h.call(this); break;
case (ActionConstants.sactionQuickTime): h.quickTime(this); break;
case (ActionConstants.sactionExtends): h.extendsOp(this); break;
case (ActionConstants.sactionNop): h.nop(this); break;
case (ActionConstants.sactionHalt): h.halt(this); break;
default:
throw new SWFFormatError("unexpected action "+code);
//assert false : ("unexpected action "+code);// should not get here
}
}
public function equals(object:*):Boolean
{
var isEqual:Boolean = false;
if (object is Action)
{
var action:Action = object as Action;
if (action.code == this.code)
{
isEqual = true;
}
}
return isEqual;
}
public function objectEquals(a:*, b:*):Boolean
{
return a == b || a != null && a.equals(b);
}
public function hashCode():int
{
return this.code;
}
public function objectHashCode():int
{
return super.hashCode();
}
public function toString():String
{
return (getQualifiedClassName(this) + "[ code = " + this.code + " ]");
}
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.