Class InstructionUtil

java.lang.Object
com.pnfsoftware.jeb.core.units.code.InstructionUtil

public class InstructionUtil extends Object
Utility methods for IInstruction objects.
  • Constructor Details

    • InstructionUtil

      public InstructionUtil()
  • Method Details

    • getOperand

      public static IInstructionOperand getOperand(IInstruction insn, int index)
      Safely retrieve an operand.
      Parameters:
      insn -
      index -
      Returns:
      null on error
    • getOperand

      public static <T extends IInstructionOperand> T getOperand(IInstruction insn, int index, Class<T> c)
      Safely retrieve an operand of the expected type.
      Parameters:
      insn -
      index -
      c - expected operand type
      Returns:
      null on error
    • getSizeOf

      public static int getSizeOf(List<? extends IInstruction> insns)
      Compute the size of all the instruction list.
      Parameters:
      insns - instruction list
      Returns:
      the size, in bytes
    • getSizeUntil

      public static int getSizeUntil(List<? extends IInstruction> insns, int limit)
      Compute the size of the instruction list until nth index.
      Parameters:
      insns - instruction list
      limit - nth index.
      Returns:
      the size, in bytes