pt.tumba.parser.swf
Class Decompiler

java.lang.Object
  extended by pt.tumba.parser.swf.SWFActionsImpl
      extended by pt.tumba.parser.swf.Decompiler
All Implemented Interfaces:
SWFActions

public class Decompiler
extends SWFActionsImpl
implements SWFActions

An implementation of SWFActions that decompiles the Action Code

Author:
unknown

Field Summary
protected  boolean duplicated
          Description of the Field
protected  java.lang.String gotoFrame
          Description of the Field
protected  int indent
          Description of the Field
protected  java.util.Stack labelStack
          Description of the Field
protected  java.lang.String[] lookupTable
          Description of the Field
protected  java.lang.Object[] registers
          Description of the Field
protected  java.util.Stack stack
          Description of the Field
protected  java.io.Writer writer
          Description of the Field
protected  java.util.Stack writerStack
          Description of the Field
 
Fields inherited from class pt.tumba.parser.swf.SWFActionsImpl
acts
 
Fields inherited from interface pt.tumba.parser.swf.SWFActions
GET_URL_MODE_LOAD_MOVIE_INTO_LEVEL, GET_URL_MODE_LOAD_MOVIE_INTO_SPRITE, GET_URL_MODE_LOAD_VARS_INTO_LEVEL, GET_URL_MODE_LOAD_VARS_INTO_SPRITE, GET_URL_SEND_VARS_GET, GET_URL_SEND_VARS_NONE, GET_URL_SEND_VARS_POST
 
Constructor Summary
Decompiler(java.io.Writer writer)
          Constructor for the Decompiler object
Decompiler(java.io.Writer writer, int indent)
          Constructor for the Decompiler object
 
Method Summary
 void add()
          Description of the Method
 void and()
          Description of the Method
 void bitAnd()
          Description of the Method
 void bitOr()
          Description of the Method
 void bitXor()
          Description of the Method
 void blob(byte[] blob)
          Pass through a blob of actions
 void callFunction()
          Description of the Method
 void callMethod()
          Description of the Method
 void comment(java.lang.String comment)
          Comment Text - useful for debugging purposes
 void convertToNumber()
          Description of the Method
 void convertToString()
          Description of the Method
 void decrement()
          Description of the Method
 void defineLocal()
          Description of the Method
 void defineLocalValue()
          Description of the Method
protected  java.lang.String destring(java.lang.String s2)
          Description of the Method
 void divide()
          Description of the Method
 void done()
          End of all action blocks
 void duplicate()
          Description of the Method
 void end()
          End of actions
 void endBlock()
          Description of the Method
 void equals()
          Description of the Method
 void getTime()
          Gets the time attribute of the Decompiler object
 void getURL(java.lang.String url2, java.lang.String target)
          Gets the uRL attribute of the Decompiler object
 void getVariable()
          Gets the variable attribute of the Decompiler object
 void gotoFrame(int frameNumber)
          Description of the Method
 void gotoFrame(java.lang.String label)
          Description of the Method
 void increment()
          Description of the Method
protected  void indent()
          Description of the Method
 void jumpLabel(java.lang.String label)
          Target label for a jump - this method call immediately precedes the target action.
 void lessThan()
          Description of the Method
 void lookup(int dictionaryIndex)
          Description of the Method
 void lookupTable(java.lang.String[] values)
          Description of the Method
 void modulo()
          Description of the Method
 void multiply()
          Description of the Method
 void nextFrame()
          Description of the Method
 void not()
          Description of the Method
protected  void operator(java.lang.String op)
          Description of the Method
 void or()
          Description of the Method
protected  java.lang.Object peek()
          Description of the Method
 void play()
          Description of the Method
 void pop()
          Description of the Method
protected  java.lang.Object pop2()
          Description of the Method
 void prevFrame()
          Description of the Method
 void push(boolean value)
          Description of the Method
 void push(double value)
          Description of the Method
 void push(float value)
          Description of the Method
 void push(int value)
          Description of the Method
 void push(java.lang.String value)
          Description of the Method
 void pushNull()
          Description of the Method
 void pushRegister(int registerNumber)
          Description of the Method
 void randomNumber()
          Description of the Method
 void setTarget(java.lang.String target)
          Sets the target attribute of the Decompiler object
 void setVariable()
          Sets the variable attribute of the Decompiler object
 void shiftLeft()
          Description of the Method
 void shiftRight()
          Description of the Method
 void shiftRightUnsigned()
          Description of the Method
 void start(int flags)
          Start of actions
 void startFunction(java.lang.String name, java.lang.String[] paramNames2)
          Description of the Method
 void startWith()
          Description of the Method
 void stop()
          Description of the Method
 void stopSounds()
          Description of the Method
 void storeInRegister(int registerNumber)
          Description of the Method
protected  java.lang.String string(java.lang.String s)
          Description of the Method
 void substract()
          Description of the Method
 void swap()
          Description of the Method
 void toggleQuality()
          Description of the Method
 void toInteger()
          Description of the Method
 void trace()
          Description of the Method
 void typedAdd()
          Description of the Method
 void typedEquals()
          Description of the Method
 void typedLessThan()
          Description of the Method
 void typeOf()
          Description of the Method
 void unknown(int code, byte[] data)
          Unrecognized action code
 void waitForFrame(int frameNumber, java.lang.String jumpLabel)
          Description of the Method
protected  void writeConditions(int flags)
          Description of the Method
 
Methods inherited from class pt.tumba.parser.swf.SWFActionsImpl
asciiToChar, asciiToCharMB, call, charMBToAscii, charToAscii, cloneSprite, concat, deleteProperty, deleteThreadVars, endDrag, enumerate, getMember, getProperty, getTargetPath, getURL, gotoFrame, ifJump, initArray, initObject, jump, newMethod, newObject, removeSprite, returnValue, setMember, setProperty, setSWFActions, setTarget, startDrag, stringEquals, stringLength, stringLengthMB, stringLessThan, substring, substringMB, waitForFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pt.tumba.parser.swf.SWFActions
asciiToChar, asciiToCharMB, call, charMBToAscii, charToAscii, cloneSprite, concat, deleteProperty, deleteThreadVars, endDrag, enumerate, getMember, getProperty, getTargetPath, getURL, gotoFrame, ifJump, initArray, initObject, jump, newMethod, newObject, removeSprite, returnValue, setMember, setProperty, setTarget, startDrag, stringEquals, stringLength, stringLengthMB, stringLessThan, substring, substringMB, waitForFrame
 

Field Detail

writer

protected java.io.Writer writer
Description of the Field


indent

protected int indent
Description of the Field


labelStack

protected java.util.Stack labelStack
Description of the Field


stack

protected java.util.Stack stack
Description of the Field


lookupTable

protected java.lang.String[] lookupTable
Description of the Field


registers

protected java.lang.Object[] registers
Description of the Field


writerStack

protected java.util.Stack writerStack
Description of the Field


duplicated

protected boolean duplicated
Description of the Field


gotoFrame

protected java.lang.String gotoFrame
Description of the Field

Constructor Detail

Decompiler

public Decompiler(java.io.Writer writer)
Constructor for the Decompiler object

Parameters:
writer - Description of the Parameter

Decompiler

public Decompiler(java.io.Writer writer,
                  int indent)
Constructor for the Decompiler object

Parameters:
writer - Description of the Parameter
indent - Description of the Parameter
Method Detail

indent

protected void indent()
               throws java.io.IOException
Description of the Method

Throws:
java.io.IOException - Description of the Exception

destring

protected java.lang.String destring(java.lang.String s2)
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

string

protected java.lang.String string(java.lang.String s)
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

start

public void start(int flags)
           throws java.io.IOException
Start of actions

Specified by:
start in interface SWFActions
Overrides:
start in class SWFActionsImpl
Parameters:
flags - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

writeConditions

protected void writeConditions(int flags)
                        throws java.io.IOException
Description of the Method

Parameters:
flags - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

pop2

protected java.lang.Object pop2()
Description of the Method

Returns:
Description of the Return Value

peek

protected java.lang.Object peek()
Description of the Method

Returns:
Description of the Return Value

done

public void done()
End of all action blocks

Specified by:
done in interface SWFActions
Overrides:
done in class SWFActionsImpl

end

public void end()
         throws java.io.IOException
End of actions

Specified by:
end in interface SWFActions
Overrides:
end in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

blob

public void blob(byte[] blob)
Pass through a blob of actions

Specified by:
blob in interface SWFActions
Overrides:
blob in class SWFActionsImpl
Parameters:
blob - Description of the Parameter

unknown

public void unknown(int code,
                    byte[] data)
Unrecognized action code

Specified by:
unknown in interface SWFActions
Overrides:
unknown in class SWFActionsImpl
Parameters:
data - may be null
code - Description of the Parameter

jumpLabel

public void jumpLabel(java.lang.String label)
               throws java.io.IOException
Target label for a jump - this method call immediately precedes the target action.

Specified by:
jumpLabel in interface SWFActions
Overrides:
jumpLabel in class SWFActionsImpl
Parameters:
label - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

comment

public void comment(java.lang.String comment)
             throws java.io.IOException
Comment Text - useful for debugging purposes

Specified by:
comment in interface SWFActions
Overrides:
comment in class SWFActionsImpl
Parameters:
comment - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

gotoFrame

public void gotoFrame(int frameNumber)
               throws java.io.IOException
Description of the Method

Specified by:
gotoFrame in interface SWFActions
Overrides:
gotoFrame in class SWFActionsImpl
Parameters:
frameNumber - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

gotoFrame

public void gotoFrame(java.lang.String label)
               throws java.io.IOException
Description of the Method

Specified by:
gotoFrame in interface SWFActions
Overrides:
gotoFrame in class SWFActionsImpl
Parameters:
label - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

getURL

public void getURL(java.lang.String url2,
                   java.lang.String target)
            throws java.io.IOException
Gets the uRL attribute of the Decompiler object

Specified by:
getURL in interface SWFActions
Overrides:
getURL in class SWFActionsImpl
Parameters:
url - Description of the Parameter
target - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

nextFrame

public void nextFrame()
               throws java.io.IOException
Description of the Method

Specified by:
nextFrame in interface SWFActions
Overrides:
nextFrame in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

prevFrame

public void prevFrame()
               throws java.io.IOException
Description of the Method

Specified by:
prevFrame in interface SWFActions
Overrides:
prevFrame in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

play

public void play()
          throws java.io.IOException
Description of the Method

Specified by:
play in interface SWFActions
Overrides:
play in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

stop

public void stop()
          throws java.io.IOException
Description of the Method

Specified by:
stop in interface SWFActions
Overrides:
stop in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

toggleQuality

public void toggleQuality()
                   throws java.io.IOException
Description of the Method

Specified by:
toggleQuality in interface SWFActions
Overrides:
toggleQuality in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

stopSounds

public void stopSounds()
                throws java.io.IOException
Description of the Method

Specified by:
stopSounds in interface SWFActions
Overrides:
stopSounds in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

waitForFrame

public void waitForFrame(int frameNumber,
                         java.lang.String jumpLabel)
                  throws java.io.IOException
Description of the Method

Specified by:
waitForFrame in interface SWFActions
Overrides:
waitForFrame in class SWFActionsImpl
Parameters:
frameNumber - Description of the Parameter
jumpLabel - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

setTarget

public void setTarget(java.lang.String target)
               throws java.io.IOException
Sets the target attribute of the Decompiler object

Specified by:
setTarget in interface SWFActions
Overrides:
setTarget in class SWFActionsImpl
Parameters:
target - The new target value
Throws:
java.io.IOException - Description of the Exception

operator

protected void operator(java.lang.String op)
                 throws java.io.IOException
Description of the Method

Parameters:
op - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

add

public void add()
         throws java.io.IOException
Description of the Method

Specified by:
add in interface SWFActions
Overrides:
add in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

substract

public void substract()
               throws java.io.IOException
Description of the Method

Specified by:
substract in interface SWFActions
Overrides:
substract in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

multiply

public void multiply()
              throws java.io.IOException
Description of the Method

Specified by:
multiply in interface SWFActions
Overrides:
multiply in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

divide

public void divide()
            throws java.io.IOException
Description of the Method

Specified by:
divide in interface SWFActions
Overrides:
divide in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

equals

public void equals()
            throws java.io.IOException
Description of the Method

Specified by:
equals in interface SWFActions
Overrides:
equals in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

lessThan

public void lessThan()
              throws java.io.IOException
Description of the Method

Specified by:
lessThan in interface SWFActions
Overrides:
lessThan in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

and

public void and()
         throws java.io.IOException
Description of the Method

Specified by:
and in interface SWFActions
Overrides:
and in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

or

public void or()
        throws java.io.IOException
Description of the Method

Specified by:
or in interface SWFActions
Overrides:
or in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

not

public void not()
         throws java.io.IOException
Description of the Method

Specified by:
not in interface SWFActions
Overrides:
not in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

toInteger

public void toInteger()
               throws java.io.IOException
Description of the Method

Specified by:
toInteger in interface SWFActions
Overrides:
toInteger in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

getVariable

public void getVariable()
                 throws java.io.IOException
Gets the variable attribute of the Decompiler object

Specified by:
getVariable in interface SWFActions
Overrides:
getVariable in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

setVariable

public void setVariable()
                 throws java.io.IOException
Sets the variable attribute of the Decompiler object

Specified by:
setVariable in interface SWFActions
Overrides:
setVariable in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

trace

public void trace()
           throws java.io.IOException
Description of the Method

Specified by:
trace in interface SWFActions
Overrides:
trace in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

getTime

public void getTime()
             throws java.io.IOException
Gets the time attribute of the Decompiler object

Specified by:
getTime in interface SWFActions
Overrides:
getTime in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

randomNumber

public void randomNumber()
                  throws java.io.IOException
Description of the Method

Specified by:
randomNumber in interface SWFActions
Overrides:
randomNumber in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

callFunction

public void callFunction()
                  throws java.io.IOException
Description of the Method

Specified by:
callFunction in interface SWFActions
Overrides:
callFunction in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

callMethod

public void callMethod()
                throws java.io.IOException
Description of the Method

Specified by:
callMethod in interface SWFActions
Overrides:
callMethod in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

lookupTable

public void lookupTable(java.lang.String[] values)
                 throws java.io.IOException
Description of the Method

Specified by:
lookupTable in interface SWFActions
Overrides:
lookupTable in class SWFActionsImpl
Parameters:
values - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

startFunction

public void startFunction(java.lang.String name,
                          java.lang.String[] paramNames2)
                   throws java.io.IOException
Description of the Method

Specified by:
startFunction in interface SWFActions
Overrides:
startFunction in class SWFActionsImpl
Parameters:
name - Description of the Parameter
paramNames - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

endBlock

public void endBlock()
              throws java.io.IOException
Description of the Method

Specified by:
endBlock in interface SWFActions
Overrides:
endBlock in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

defineLocalValue

public void defineLocalValue()
                      throws java.io.IOException
Description of the Method

Specified by:
defineLocalValue in interface SWFActions
Overrides:
defineLocalValue in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

defineLocal

public void defineLocal()
                 throws java.io.IOException
Description of the Method

Specified by:
defineLocal in interface SWFActions
Overrides:
defineLocal in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

typedEquals

public void typedEquals()
                 throws java.io.IOException
Description of the Method

Specified by:
typedEquals in interface SWFActions
Overrides:
typedEquals in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

startWith

public void startWith()
               throws java.io.IOException
Description of the Method

Specified by:
startWith in interface SWFActions
Overrides:
startWith in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

convertToNumber

public void convertToNumber()
                     throws java.io.IOException
Description of the Method

Specified by:
convertToNumber in interface SWFActions
Overrides:
convertToNumber in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

convertToString

public void convertToString()
                     throws java.io.IOException
Description of the Method

Specified by:
convertToString in interface SWFActions
Overrides:
convertToString in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

typeOf

public void typeOf()
            throws java.io.IOException
Description of the Method

Specified by:
typeOf in interface SWFActions
Overrides:
typeOf in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

typedAdd

public void typedAdd()
              throws java.io.IOException
Description of the Method

Specified by:
typedAdd in interface SWFActions
Overrides:
typedAdd in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

typedLessThan

public void typedLessThan()
                   throws java.io.IOException
Description of the Method

Specified by:
typedLessThan in interface SWFActions
Overrides:
typedLessThan in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

modulo

public void modulo()
            throws java.io.IOException
Description of the Method

Specified by:
modulo in interface SWFActions
Overrides:
modulo in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

bitAnd

public void bitAnd()
            throws java.io.IOException
Description of the Method

Specified by:
bitAnd in interface SWFActions
Overrides:
bitAnd in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

bitOr

public void bitOr()
           throws java.io.IOException
Description of the Method

Specified by:
bitOr in interface SWFActions
Overrides:
bitOr in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

bitXor

public void bitXor()
            throws java.io.IOException
Description of the Method

Specified by:
bitXor in interface SWFActions
Overrides:
bitXor in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

shiftLeft

public void shiftLeft()
               throws java.io.IOException
Description of the Method

Specified by:
shiftLeft in interface SWFActions
Overrides:
shiftLeft in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

shiftRight

public void shiftRight()
                throws java.io.IOException
Description of the Method

Specified by:
shiftRight in interface SWFActions
Overrides:
shiftRight in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

shiftRightUnsigned

public void shiftRightUnsigned()
                        throws java.io.IOException
Description of the Method

Specified by:
shiftRightUnsigned in interface SWFActions
Overrides:
shiftRightUnsigned in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

decrement

public void decrement()
               throws java.io.IOException
Description of the Method

Specified by:
decrement in interface SWFActions
Overrides:
decrement in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

increment

public void increment()
               throws java.io.IOException
Description of the Method

Specified by:
increment in interface SWFActions
Overrides:
increment in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

duplicate

public void duplicate()
               throws java.io.IOException
Description of the Method

Specified by:
duplicate in interface SWFActions
Overrides:
duplicate in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

swap

public void swap()
          throws java.io.IOException
Description of the Method

Specified by:
swap in interface SWFActions
Overrides:
swap in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

storeInRegister

public void storeInRegister(int registerNumber)
                     throws java.io.IOException
Description of the Method

Specified by:
storeInRegister in interface SWFActions
Overrides:
storeInRegister in class SWFActionsImpl
Parameters:
registerNumber - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

push

public void push(double value)
          throws java.io.IOException
Description of the Method

Specified by:
push in interface SWFActions
Overrides:
push in class SWFActionsImpl
Parameters:
value - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

pushNull

public void pushNull()
              throws java.io.IOException
Description of the Method

Specified by:
pushNull in interface SWFActions
Overrides:
pushNull in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

pushRegister

public void pushRegister(int registerNumber)
                  throws java.io.IOException
Description of the Method

Specified by:
pushRegister in interface SWFActions
Overrides:
pushRegister in class SWFActionsImpl
Parameters:
registerNumber - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

push

public void push(boolean value)
          throws java.io.IOException
Description of the Method

Specified by:
push in interface SWFActions
Overrides:
push in class SWFActionsImpl
Parameters:
value - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

push

public void push(int value)
          throws java.io.IOException
Description of the Method

Specified by:
push in interface SWFActions
Overrides:
push in class SWFActionsImpl
Parameters:
value - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

push

public void push(java.lang.String value)
          throws java.io.IOException
Description of the Method

Specified by:
push in interface SWFActions
Overrides:
push in class SWFActionsImpl
Parameters:
value - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

push

public void push(float value)
          throws java.io.IOException
Description of the Method

Specified by:
push in interface SWFActions
Overrides:
push in class SWFActionsImpl
Parameters:
value - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

pop

public void pop()
         throws java.io.IOException
Description of the Method

Specified by:
pop in interface SWFActions
Overrides:
pop in class SWFActionsImpl
Throws:
java.io.IOException - Description of the Exception

lookup

public void lookup(int dictionaryIndex)
            throws java.io.IOException
Description of the Method

Specified by:
lookup in interface SWFActions
Overrides:
lookup in class SWFActionsImpl
Parameters:
dictionaryIndex - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception