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
instruction
s.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractInstruction
(BytesBlock code, String mnemonic, T[] operands, int processorMode) -
Method Summary
Modifier and TypeMethodDescriptionprotected CodePointer
buildNextEntryPoint
(long instructionAddress) boolean
Format the instruction for printingbyte[]
getCode()
Get the binary code that makes up this instruction.byte[]
int
The 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).int
Get the mode the processor was in when it parsed and created this instruction.int
getSize()
Get the instruction size in bytes.int
hashCode()
protected boolean
isBreakingFlow
(IInsnEmulator<T> emulator) protected boolean
isJump
(IInsnEmulator<T> emulator) protected boolean
isRoutineCall
(IInsnEmulator<T> emulator) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:IInstruction
Get the instruction size in bytes.- Specified by:
getSize
in interfaceIInstruction
- Returns:
- the instruction size
-
getCodeBlock
-
getCode
public byte[] getCode()Description copied from interface:IInstruction
Get the binary code that makes up this instruction.- Specified by:
getCode
in interfaceIInstruction
- Returns:
- an array of bytes, or null if the instruction is abstract
-
getCode
-
getPrefix
Description copied from interface:IInstruction
Get the instruction's optional prefix(es).- Specified by:
getPrefix
in interfaceIInstruction
- Returns:
- the prefix (or prefix string list), null if none
-
getMnemonic
Description copied from interface:IInstruction
The instruction mnemonic.- Specified by:
getMnemonic
in interfaceIInstruction
- Returns:
-
getOperands
Description copied from interface:IInstruction
Get the list of operands for this instruction.- Specified by:
getOperands
in interfaceIInstruction
- Returns:
- a list (possibly empty) of operands, or null if operands are not applicable to the instruction set
-
getOperand
Description copied from interface:IInstruction
Get an operand by index.- Specified by:
getOperand
in interfaceIInstruction
- Returns:
-
getCountOfOperands
public int getCountOfOperands()- Specified by:
getCountOfOperands
in interfaceIInstruction
-
getProcessorMode
public int getProcessorMode()Description copied from interface:IInstruction
Get the mode the processor was in when it parsed and created this instruction. Refer toIProcessor
MODE_xxx
.- Specified by:
getProcessorMode
in interfaceIInstruction
- Returns:
- the mode, 0 for none/default
-
buildNextEntryPoint
-
isBreakingFlow
-
isRoutineCall
-
isJump
-
getInstructionFlags
- Specified by:
getInstructionFlags
in interfaceIInstruction
- Returns:
- instruction flags, never null
-
format
Description copied from interface:IInstruction
Format the instruction for printing- Specified by:
format
in 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
-