| com.pnfsoftware.jeb.core.units.code.asm.processor.IProcessor<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Known Indirect Subclasses
AbstractProcessor<InsnType extends IInstruction>
|
Definition of a simple machine code processor. It is recommended that implementors extend
AbstractProcessor instead of implementing this interface from scratch.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | MODE_16 | Processor mode constant for 16-bit processors | |||||||||
| int | MODE_32 | Processor mode constant for 32-bit processors | |||||||||
| int | MODE_64 | Processor mode constant for 64-bit processors | |||||||||
| int | MODE_DEFAULT | Default processor mode constant (unknown or standard mode) | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract int |
getDefaultMode()
Get the default processor mode.
| ||||||||||
| abstract int |
getInstructionAlignment()
Retrieve the instruction alignment, in bytes.
| ||||||||||
| abstract int |
getMode()
Get the processor mode.
| ||||||||||
| abstract ICodeResolver<InsnType> |
getResolver()
Retrieve a code resolver.
| ||||||||||
| abstract boolean |
isBigEndian()
Indicates if
IProcessor uses BigEndians
| ||||||||||
| abstract InsnType |
parseAt(byte[] bytes, int index, int end)
Parse a single instruction.
| ||||||||||
| abstract InsnType |
parseAt(IVirtualMemory vm, long address)
Parse a single instruction at the specified address in memory.
| ||||||||||
| abstract InsnType |
parseWithContext(IMachineContext context)
Parse a single instruction given a machine context.
| ||||||||||
| abstract void |
setBigEndian(boolean endianness)
Set endianness
| ||||||||||
| abstract void |
setInstructionAlignment(int align)
Set the instruction alignment, in bytes.
| ||||||||||
| abstract void |
setMode(int mode)
Set the processor mode.
| ||||||||||
Processor mode constant for 16-bit processors
Processor mode constant for 32-bit processors
Processor mode constant for 64-bit processors
Default processor mode constant (unknown or standard mode)
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.
| bytes | input code buffer |
|---|---|
| index | where to parse in the input buffer |
| end | exclusive end offset in the buffer: if parsing at the given index offset requires bytes past the end offset, an exception is raised |
| ProcessorException | on parsing error |
|---|---|
| RuntimeException | on miscellaneous error |
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 | on parsing error |
|---|---|
| RuntimeException | on miscellaneous error |
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
|
|---|