Class AbstractInstructionManager<T extends IInstruction>
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.AbstractInstructionManager<T>
- Type Parameters:
T- instruction type managed by this object
- All Implemented Interfaces:
CFBytesTrie.IKeyExtractor<T>
public abstract class AbstractInstructionManager<T extends IInstruction>
extends Object
implements CFBytesTrie.IKeyExtractor<T>
A skeleton class used to create instruction managers.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an instruction manager with an empty cache. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]buildKey(BytesBlock block) voidClear the decoded instruction cache.byte[]Extract a key from an object.protected abstract TfindInstruction(BytesBlock block) getInstruction(BytesBlock block) Retrieve or decode an instruction for the provided byte block.protected static StringgetUndefinedMessage(byte[] code) protected static StringgetUnpredictableMessage(byte[] code, String mnemonic) protected static voidraiseUndefined(byte[] code) protected TretrieveInstructionFromCache(T instruction) protected booleanuseCache(BytesBlock block)
-
Constructor Details
-
AbstractInstructionManager
public AbstractInstructionManager()Create an instruction manager with an empty cache.
-
-
Method Details
-
getInstruction
Retrieve or decode an instruction for the provided byte block.- Parameters:
block- instruction bytes- Returns:
- decoded instruction
- Throws:
ProcessorException- on decoding error
-
retrieveInstructionFromCache
-
findInstruction
- Throws:
ProcessorException
-
useCache
-
buildKey
-
raiseUndefined
- Throws:
ProcessorException
-
getUndefinedMessage
-
getUnpredictableMessage
-
extract
Description copied from interface:CFBytesTrie.IKeyExtractorExtract a key from an object.- Specified by:
extractin interfaceCFBytesTrie.IKeyExtractor<T extends IInstruction>- Parameters:
object- object- Returns:
- key bytes
-
clearCache
public void clearCache()Clear the decoded instruction cache.
-