Class AbstractInstruction<T extends IInstructionOperand>
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.AbstractInstruction<T>
- All Implemented Interfaces:
IInstruction
@Ser
public abstract class AbstractInstruction<T extends IInstructionOperand>
extends Object
implements IInstruction
A skeleton implementation for
instructions.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractInstruction(BytesBlock code, String mnemonic, T[] operands, int processorMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected CodePointerbuildNextEntryPoint(long instructionAddress) booleanFormat the instruction for printingbyte[]getCode()Get the binary code that makes up this instruction.byte[]intThe instruction mnemonic.getOperand(int index) Get an operand by index.T[]Get the list of operands for this instruction.Get the instruction's optional prefix(es).intGet the mode the processor was in when it parsed and created this instruction.intgetSize()Get the instruction size in bytes.inthashCode()protected booleanisBreakingFlow(IInsnEmulator<T> emulator) protected booleanisJump(IInsnEmulator<T> emulator) protected booleanisRoutineCall(IInsnEmulator<T> emulator) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.code.IInstruction
canThrow, collectIndirectCallReferences, getACS, getBreakingFlow, getDefUse, getDefUse, getDefUseInfo, getPrimaryBranchAddress, getRoutineCall
-
Field Details
-
operands
-
processorMode
protected int processorMode
-
-
Constructor Details
-
AbstractInstruction
-
-
Method Details
-
getSize
public int getSize()Description copied from interface:IInstructionGet the instruction size in bytes.- Specified by:
getSizein interfaceIInstruction- Returns:
- the instruction size
-
getCodeBlock
-
getCode
public byte[] getCode()Description copied from interface:IInstructionGet the binary code that makes up this instruction.- Specified by:
getCodein interfaceIInstruction- Returns:
- an array of bytes, or null if the instruction is abstract
-
getCode
-
getPrefix
Description copied from interface:IInstructionGet the instruction's optional prefix(es).- Specified by:
getPrefixin interfaceIInstruction- Returns:
- the prefix (or prefix string list), null if none
-
getMnemonic
Description copied from interface:IInstructionThe instruction mnemonic.- Specified by:
getMnemonicin interfaceIInstruction- Returns:
-
getOperands
Description copied from interface:IInstructionGet the list of operands for this instruction.- Specified by:
getOperandsin interfaceIInstruction- Returns:
- a list (possibly empty) of operands, or null if operands are not applicable to the instruction set
-
getOperand
Description copied from interface:IInstructionGet an operand by index.- Specified by:
getOperandin interfaceIInstruction- Returns:
-
getCountOfOperands
public int getCountOfOperands()- Specified by:
getCountOfOperandsin interfaceIInstruction
-
getProcessorMode
public int getProcessorMode()Description copied from interface:IInstructionGet the mode the processor was in when it parsed and created this instruction. Refer toIProcessorMODE_xxx.- Specified by:
getProcessorModein interfaceIInstruction- Returns:
- the mode, 0 for none/default
-
buildNextEntryPoint
-
isBreakingFlow
-
isRoutineCall
-
isJump
-
getInstructionFlags
- Specified by:
getInstructionFlagsin interfaceIInstruction- Returns:
- instruction flags, never null
-
format
Description copied from interface:IInstructionFormat the instruction for printing- Specified by:
formatin interfaceIInstruction- Parameters:
context- optional context, used to provide a better representation of the instruction (for instance, resolving strings or method names.) The implementor should do its best to return a decent result even if context is null.- Returns:
-
hashCode
public int hashCode() -
equals
-
toString
-