public class

InstructionUtil

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

Class Overview

Utility methods for IInstruction objects.

Summary

Public Constructors
InstructionUtil()
Public Methods
static IInstructionOperand getOperand(IInstruction insn, int index)
Safely retrieve an operand.
static <T extends IInstructionOperand> T getOperand(IInstruction insn, int index, Class<T> c)
Safely retrieve an operand of the expected type.
static int getSizeOf(List<? extends IInstruction> insns)
Compute the size of all the instruction list.
static int getSizeUntil(List<? extends IInstruction> insns, int limit)
Compute the size of the instruction list until nth index.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public InstructionUtil ()

Public Methods

public static IInstructionOperand getOperand (IInstruction insn, int index)

Safely retrieve an operand.

Returns
  • null on error

public static T getOperand (IInstruction insn, int index, Class<T> c)

Safely retrieve an operand of the expected type.

Parameters
c expected operand type
Returns
  • null on error

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

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