| java.lang.Object | |
| ↳ | com.pnfsoftware.jeb.core.units.code.asm.processor.AbstractProcessor<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
An abstract implementation of a processor. It is recommended to inherit from
this class. The implementor simply needs to implement a
parseAt() method. Instruction alignment is enforced.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor
| |||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| protected int | defaultMode | ||||||||||
| protected int | mode | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
AbstractProcessor(int parseCacheLength)
Create a processor with default options: MODE_DEFAULT, little-endian, 1-byte instruction
alignment.
| |||||||||||
|
AbstractProcessor(int parseCacheLength, int defaultMode, boolean bigEndian, int instructionAlign)
Create a processor.
| |||||||||||
|
AbstractProcessor(int parseCacheLength, int defaultMode, IUnitCreator parent, int instructionAlign)
Create a processor, retrieving Endianness from parent
IUnitCreator. | |||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| AbstractProcessor() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int |
getDefaultMode()
Get the default processor mode.
| ||||||||||
| int |
getInstructionAlignment()
Retrieve the instruction alignment, in bytes.
| ||||||||||
| int |
getMode()
Get the processor mode.
| ||||||||||
| ICodeResolver<InsnType> |
getResolver()
Retrieve a code resolver.
| ||||||||||
| boolean |
isBigEndian()
Indicates if
IProcessor uses BigEndians
| ||||||||||
| InsnType |
parseAt(IVirtualMemory vm, long address)
Parse a single instruction at the specified address in memory.
| ||||||||||
| InsnType |
parseWithContext(IMachineContext context)
Parse a single instruction given a machine context.
| ||||||||||
| void |
setBigEndian(boolean endianness)
Set endianness
| ||||||||||
| void |
setInstructionAlignment(int align)
Set the instruction alignment, in bytes.
| ||||||||||
| void |
setMode(int mode)
Set the processor mode.
| ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
setDefaultMode(int defaultMode)
Set the default mode.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor
| |||||||||||
Create a processor with default options: MODE_DEFAULT, little-endian, 1-byte instruction alignment.
Create a processor.
Create a processor, retrieving Endianness from parent IUnitCreator.
Get the default processor mode.
MODE_DEFAULT (0)
Retrieve the instruction alignment, in bytes.
Get the processor mode. Typically, the processor mode is a size in bits that indicates how
instructions are parsed and/or how addresses are calculated and addressed. Typical processor
modes are 16, 32, or 64 (bits). Note: A 'processor mode' could have a different semantic, but
anything non-standard is unlikely to be understood by client code. This function will never
return 0 See MODE_Xxx for common constants.
MODE_DEFAULT (0)
Retrieve a code resolver. A resolver is optional; implementors may decide to not provide one, and return null.
Parse a single instruction at the specified address in memory.
| vm | the input virtual memory |
|---|---|
| address | the address to read at, with permission of read+write |
| ProcessorException |
|---|
Parse a single instruction given a machine context. The context provides access to at least:
| ProcessorException |
|---|
Set endianness
| endianness | true if Big Endian, false if Little Endian (default) |
|---|
Set the instruction alignment, in bytes. The implementation may decide to enforce alignment,
or ignore it. If alignment is enforced, attempting to parse an unaligned instruction should
raise a ProcessorException.
| align | the alignment, must be a strictly positive power of 2 |
|---|
Set the processor mode. Implementors may override this class, if they have other/better/proper ways to determine the processor operating mode. In that case, the mode provided by thi method may be regarded as a hint - or disregarded entirely.
| mode | the mode, the value MODE_DEFAULT (0) can be provided to revert to the
default processor mode
|
|---|
Set the default mode. Only for implementors. This method is and should be called just once (at construction time).
| defaultMode | the default processor mode, cannot be 0 |
|---|