jreversepro.revengine
Class JDecompiler

java.lang.Object
  extended by jreversepro.revengine.JDecompiler
All Implemented Interfaces:
JJvmOpcodes, KeyWords, BranchConstants, JReverseEngineer, OperandConstants

public class JDecompiler
extends java.lang.Object
implements BranchConstants, KeyWords, JReverseEngineer, JJvmOpcodes, OperandConstants

This decompiles the source code.

Author:
Karthik Kumar

Field Summary
 
Fields inherited from interface jreversepro.revengine.BranchConstants
TYPE_BRANCH, TYPE_CASE, TYPE_CATCH, TYPE_CATCH_ANY, TYPE_DO_WHILE, TYPE_ELSE, TYPE_ELSE_IF, TYPE_GOTO, TYPE_IF, TYPE_INVALID, TYPE_JSR, TYPE_RET, TYPE_SWITCH, TYPE_SYNC, TYPE_TRY, TYPE_TRY_ANY, TYPE_WHILE
 
Fields inherited from interface jreversepro.common.KeyWords
ANY, BOOLEAN, BREAK, BYTE, CASE, CHAR, CLASS, CLASS_STRING, CLINIT, CLOSE_BRACKET, COND_AND, COND_NOT, COND_OR, CONTINUE, DEFAULT, DEFAULT_PACKAGE, DOUBLE, EQUALTO, FALSE, FLOAT, FOREIGN_CLASS, FOREIGN_OBJ, GOTO, INIT, INSTANCEOF, INT, INTERFACE, JVM_BOOLEAN, JVM_CHAR, JVM_VOID, LANG_OBJECT, LENGTH, LONG, NEW, NULL, OPEN_BRACKET, OPR_EQ, OPR_GE, OPR_GT, OPR_LE, OPR_LT, OPR_NE, OPR_NOT, REFERENCE, RET_ADDR, RETURN, SHORT, SPACE, STATIC, SUPER, SWITCH, THIS, THISCLASS, THROW, TRUE, VOID
 
Fields inherited from interface jreversepro.revengine.JReverseEngineer
DECOMPILE_FAILED_MSG
 
Fields inherited from interface jreversepro.common.JJvmOpcodes
OPCODE_AALOAD, OPCODE_AASTORE, OPCODE_ACONST_NULL, OPCODE_ALOAD, OPCODE_ALOAD_0, OPCODE_ALOAD_1, OPCODE_ALOAD_2, OPCODE_ALOAD_3, OPCODE_ANEWARRAY, OPCODE_ARETURN, OPCODE_ARRAYLENGTH, OPCODE_ASTORE, OPCODE_ASTORE_0, OPCODE_ASTORE_1, OPCODE_ASTORE_2, OPCODE_ASTORE_3, OPCODE_ATHROW, OPCODE_BALOAD, OPCODE_BASTORE, OPCODE_BIPUSH, OPCODE_CALOAD, OPCODE_CASTORE, OPCODE_CHECKCAST, OPCODE_D2F, OPCODE_D2I, OPCODE_D2L, OPCODE_DADD, OPCODE_DALOAD, OPCODE_DASTORE, OPCODE_DCMPG, OPCODE_DCMPL, OPCODE_DCONST_0, OPCODE_DCONST_1, OPCODE_DDIV, OPCODE_DLOAD, OPCODE_DLOAD_0, OPCODE_DLOAD_1, OPCODE_DLOAD_2, OPCODE_DLOAD_3, OPCODE_DMUL, OPCODE_DNEG, OPCODE_DREM, OPCODE_DRETURN, OPCODE_DSTORE, OPCODE_DSTORE_0, OPCODE_DSTORE_1, OPCODE_DSTORE_2, OPCODE_DSTORE_3, OPCODE_DSUB, OPCODE_DUP, OPCODE_DUP_X1, OPCODE_DUP_X2, OPCODE_DUP2, OPCODE_DUP2_X1, OPCODE_DUP2_X2, OPCODE_F2D, OPCODE_F2I, OPCODE_F2L, OPCODE_FADD, OPCODE_FALOAD, OPCODE_FASTORE, OPCODE_FCMPG, OPCODE_FCMPL, OPCODE_FCONST_0, OPCODE_FCONST_1, OPCODE_FCONST_2, OPCODE_FDIV, OPCODE_FLOAD, OPCODE_FLOAD_0, OPCODE_FLOAD_1, OPCODE_FLOAD_2, OPCODE_FLOAD_3, OPCODE_FMUL, OPCODE_FNEG, OPCODE_FREM, OPCODE_FRETURN, OPCODE_FSTORE, OPCODE_FSTORE_0, OPCODE_FSTORE_1, OPCODE_FSTORE_2, OPCODE_FSTORE_3, OPCODE_FSUB, OPCODE_GETFIELD, OPCODE_GETSTATIC, OPCODE_GOTO, OPCODE_GOTOW, OPCODE_I2B, OPCODE_I2C, OPCODE_I2D, OPCODE_I2F, OPCODE_I2L, OPCODE_I2S, OPCODE_IADD, OPCODE_IALOAD, OPCODE_IAND, OPCODE_IASTORE, OPCODE_ICONST_0, OPCODE_ICONST_1, OPCODE_ICONST_2, OPCODE_ICONST_3, OPCODE_ICONST_4, OPCODE_ICONST_5, OPCODE_ICONST_M1, OPCODE_IDIV, OPCODE_IF_ACMPEQ, OPCODE_IF_ACMPNE, OPCODE_IF_ICMPEQ, OPCODE_IF_ICMPGE, OPCODE_IF_ICMPGT, OPCODE_IF_ICMPLE, OPCODE_IF_ICMPLT, OPCODE_IF_ICMPNE, OPCODE_IFEQ, OPCODE_IFGE, OPCODE_IFGT, OPCODE_IFLE, OPCODE_IFLT, OPCODE_IFNE, OPCODE_IFNONNULL, OPCODE_IFNULL, OPCODE_IINC, OPCODE_ILOAD, OPCODE_ILOAD_0, OPCODE_ILOAD_1, OPCODE_ILOAD_2, OPCODE_ILOAD_3, OPCODE_IMUL, OPCODE_INEG, OPCODE_INSTANCEOF, OPCODE_INVOKEINTERFACE, OPCODE_INVOKESPECIAL, OPCODE_INVOKESTATIC, OPCODE_INVOKEVIRTUAL, OPCODE_IOR, OPCODE_IREM, OPCODE_IRETURN, OPCODE_ISHL, OPCODE_ISHR, OPCODE_ISTORE, OPCODE_ISTORE_0, OPCODE_ISTORE_1, OPCODE_ISTORE_2, OPCODE_ISTORE_3, OPCODE_ISUB, OPCODE_IUSHR, OPCODE_IXOR, OPCODE_JSR, OPCODE_JSRW, OPCODE_L2D, OPCODE_L2F, OPCODE_L2I, OPCODE_LADD, OPCODE_LALOAD, OPCODE_LAND, OPCODE_LASTORE, OPCODE_LCMP, OPCODE_LCONST_0, OPCODE_LCONST_1, OPCODE_LDC, OPCODE_LDC_W, OPCODE_LDC2_W, OPCODE_LDIV, OPCODE_LLOAD, OPCODE_LLOAD_0, OPCODE_LLOAD_1, OPCODE_LLOAD_2, OPCODE_LLOAD_3, OPCODE_LMUL, OPCODE_LNEG, OPCODE_LOOKUPSWITCH, OPCODE_LOR, OPCODE_LREM, OPCODE_LRETURN, OPCODE_LSHL, OPCODE_LSHR, OPCODE_LSTORE, OPCODE_LSTORE_0, OPCODE_LSTORE_1, OPCODE_LSTORE_2, OPCODE_LSTORE_3, OPCODE_LSUB, OPCODE_LUSHR, OPCODE_LXOR, OPCODE_MONITORENTER, OPCODE_MONITOREXIT, OPCODE_MULTIANEWARRAY, OPCODE_NEW, OPCODE_NEWARRAY, OPCODE_NOP, OPCODE_POP, OPCODE_POP2, OPCODE_PUTFIELD, OPCODE_PUTSTATIC, OPCODE_RET, OPCODE_RETURN, OPCODE_SALOAD, OPCODE_SASTORE, OPCODE_SIPUSH, OPCODE_SWAP, OPCODE_TABLESWITCH, OPCODE_WIDE, OPCODE_XXXUNUSEDXXX
 
Fields inherited from interface jreversepro.runtime.OperandConstants
L_ADD, L_BITAND, L_BITOR, L_BITXOR, L_CAST, L_COMMA, L_DIV, L_EVAL, L_INDEX, L_LOGAND, L_LOGEQ, L_LOGIOF, L_LOGNEQ, L_LOGOR, L_LOGREL, L_MOD, L_MUL, L_REF, L_SHIFT, L_SUB, L_TERN, L_UNARY, VALUE
 
Constructor Summary
JDecompiler(JMethod rhsMethod, JConstantPool rhsCpInfo)
          JDecompiler constructor.
 
Method Summary
protected  void finalize()
          Finalizer of the class.
 void genCode()
          Don't depend on LineNumberTable Attribute of a method, as it is optional.
 int getLastIns()
           
 int getLastInsPos()
           
 JSymbolTable getSymbolTable()
           
 void loadSymbolTable()
          Loads the Local Symbol Table information.
 void setLastIns(int li)
          set bytecode offset of current stmt
 void setLastInsPos(int lip)
          set index offset into bytecode array of current stmt.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDecompiler

public JDecompiler(JMethod rhsMethod,
                   JConstantPool rhsCpInfo)
JDecompiler constructor.

Parameters:
rhsMethod - Method to be decompiled.
rhsCpInfo - ConstantPool of the class to be decompiled.
Method Detail

finalize

protected void finalize()
Finalizer of the class.

Overrides:
finalize in class java.lang.Object

setLastIns

public void setLastIns(int li)
set bytecode offset of current stmt

Parameters:
li - Last Instruction Offset

getLastIns

public int getLastIns()
Returns:
Returns get bytecode offset of current stmt

setLastInsPos

public void setLastInsPos(int lip)
set index offset into bytecode array of current stmt.

Parameters:
lip - Last Instruction Position.

getLastInsPos

public int getLastInsPos()
Returns:
Returns index offset into bytecode array of current stmt.

getSymbolTable

public JSymbolTable getSymbolTable()
Returns:
Returns the SymbolTable.

genCode

public void genCode()
             throws RevEngineException,
                    java.io.IOException
Don't depend on LineNumberTable Attribute of a method, as it is optional. Available only if compiled with debugging options on. ( -g ).

Specified by:
genCode in interface JReverseEngineer
Throws:
RevEngineException - Encountered when the decompiler could not decompile the code. Specific to decompiling engine.
java.io.IOException - thrown in case of a generic i/o error.

loadSymbolTable

public void loadSymbolTable()
                     throws RevEngineException
Loads the Local Symbol Table information.

Throws:
RevEngineException - Thrown in case of any error loading the symbol table.


Submit Feedback to akkumar@users.sourceforge.net