Class InstructionUtil
java.lang.Object
com.pnfsoftware.jeb.core.units.code.InstructionUtil
Utility methods for
IInstruction objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IInstructionOperandgetOperand(IInstruction insn, int index) Safely retrieve an operand.static <T extends IInstructionOperand>
TgetOperand(IInstruction insn, int index, Class<T> c) Safely retrieve an operand of the expected type.static intgetSizeOf(List<? extends IInstruction> insns) Compute the size of all the instruction list.static intgetSizeUntil(List<? extends IInstruction> insns, int limit) Compute the size of the instruction list until nth index.
-
Constructor Details
-
InstructionUtil
public InstructionUtil()
-
-
Method Details
-
getOperand
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
Compute the size of all the instruction list.- Parameters:
insns- instruction list- Returns:
- the size, in bytes
-
getSizeUntil
Compute the size of the instruction list until nth index.- Parameters:
insns- instruction listlimit- nth index.- Returns:
- the size, in bytes
-