Enum Class DOpcodeType

java.lang.Object
java.lang.Enum<DOpcodeType>
com.pnfsoftware.jeb.core.units.code.android.ir.DOpcodeType
All Implemented Interfaces:
Serializable, Comparable<DOpcodeType>, Constable

public enum DOpcodeType extends Enum<DOpcodeType>
This enumeration defines the opcode types of the intermediate representation (IR) instructions used by dexdec. An IR instruction has two optional operands, noted opnd1 and opnd2.

Note that the IR_STORE_EXCEPTION opcode can only be the first instruction of an exception handler block. The IR_JUMP, IR_JCOND, IR_SWITCH, IR_RETURN, IR_THROW can only be the last instruction of a basic block.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Assignment.
    - opnd1: destination (left) member, IDExpression
    - opnd2: source (right) member, IDExpression
    General method invocation
    - opnd1: null
    - opnd2: an IDInvokeInfo expression (call, new, new-array, alloc-object)
    Conditional jump
    - opnd1: the IDTarget, branched to if the conditional expression is true
    - opnd2: the predicate, an IDExpression typed as boolean
    Unconditional jump
    - opnd1: the IDTarget
    - opnd2: null
    Notify the beginning of a synchronized block of code.
    Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
    However, if this is not possible, invalid statements (similar to 'goto') should be issued.
    - opnd1: null
    - opnd2: the lock object IDExpression
    Notify the end of a synchronized block of code.
    Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
    However, if this is not possible, invalid statements (similar to 'goto') should be issued.
    - opnd1: null
    - opnd2: the lock object IDExpression
    No-operation instruction
    - opnd1: null
    - opnd2: null
    Method return
    - opnd1: null
    - opnd2: optional IDExpression return value (may be null)
    Store a caught typed exception to a variable
    Very restrictive opcode, to be used only at the beginning of exception handlers blocks.
    Switch (n-way conditional jump)
    - opnd1: the IDSwitchData
    - opnd2: the switched-on IDExpression
    Raise an error or exception
    - opnd1: null
    - opnd2: non-null throwable, an IDExpression (should be typed as java.lang.Throwable or any of its sub-types)
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    indexOf(DOpcodeType... candidates)
    Determine whether this opcode matches one of the provided candidate opcodes.
    final boolean
    isAnyOf(DOpcodeType... candidates)
    Determine whether this opcode matches one of the provided candidate opcodes.
    Returns the enum constant of this class with the specified name.
    static DOpcodeType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • IR_NOP

      public static final DOpcodeType IR_NOP
      No-operation instruction
      - opnd1: null
      - opnd2: null
    • IR_ASSIGN

      public static final DOpcodeType IR_ASSIGN
      Assignment.
      - opnd1: destination (left) member, IDExpression
      - opnd2: source (right) member, IDExpression
    • IR_INVOKE

      public static final DOpcodeType IR_INVOKE
      General method invocation
      - opnd1: null
      - opnd2: an IDInvokeInfo expression (call, new, new-array, alloc-object)
    • IR_JUMP

      public static final DOpcodeType IR_JUMP
      Unconditional jump
      - opnd1: the IDTarget
      - opnd2: null
    • IR_JCOND

      public static final DOpcodeType IR_JCOND
      Conditional jump
      - opnd1: the IDTarget, branched to if the conditional expression is true
      - opnd2: the predicate, an IDExpression typed as boolean
    • IR_SWITCH

      public static final DOpcodeType IR_SWITCH
      Switch (n-way conditional jump)
      - opnd1: the IDSwitchData
      - opnd2: the switched-on IDExpression
    • IR_RETURN

      public static final DOpcodeType IR_RETURN
      Method return
      - opnd1: null
      - opnd2: optional IDExpression return value (may be null)
    • IR_THROW

      public static final DOpcodeType IR_THROW
      Raise an error or exception
      - opnd1: null
      - opnd2: non-null throwable, an IDExpression (should be typed as java.lang.Throwable or any of its sub-types)
    • IR_STORE_EXCEPTION

      public static final DOpcodeType IR_STORE_EXCEPTION
      Store a caught typed exception to a variable
      Very restrictive opcode, to be used only at the beginning of exception handlers blocks. (equivalent to Dalvik's move-exception.)
      - opnd1: IDVar
      - opnd2: null
    • IR_MONITOR_ENTER

      public static final DOpcodeType IR_MONITOR_ENTER
      Notify the beginning of a synchronized block of code.
      Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
      However, if this is not possible, invalid statements (similar to 'goto') should be issued.
      - opnd1: null
      - opnd2: the lock object IDExpression
    • IR_MONITOR_EXIT

      public static final DOpcodeType IR_MONITOR_EXIT
      Notify the end of a synchronized block of code.
      Ideally, should not be translated to opcodes: instead the structurer should combine these opcodes with try-catch block to build synchronized code blocks.
      However, if this is not possible, invalid statements (similar to 'goto') should be issued.
      - opnd1: null
      - opnd2: the lock object IDExpression
  • Method Details

    • values

      public static DOpcodeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DOpcodeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isAnyOf

      public final boolean isAnyOf(DOpcodeType... candidates)
      Determine whether this opcode matches one of the provided candidate opcodes.
      Parameters:
      candidates - candidate opcodes
      Returns:
    • indexOf

      public final int indexOf(DOpcodeType... candidates)
      Determine whether this opcode matches one of the provided candidate opcodes.
      Parameters:
      candidates - candidate opcodes
      Returns:
      an index, -1 if not found