java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.render.GenericCodeFormatter<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Formatter used by the INativeCodeUnit
. Client plugins may override some public and
protected methods to customize their disassembly.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | MNEMONIC_RIGHT_PADDING_LENGTH_DEFAULT |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GenericCodeFormatter() | |||||||||||
GenericCodeFormatter(IVirtualMemory mem)
FOR TESTING ONLY
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final long | createItemIdForAddress(long address) | ||||||||||
final long | createItemIdForImmediate(long insnAddress, int opndIndexGlobal) | ||||||||||
final long | createItemIdForRegister(long regCode) | ||||||||||
final void | formatAddress(long address, CodeDocumentPart out) | ||||||||||
void |
formatAddress(long address, IInstructionOperandGeneric opnd, CodeDocumentPart out)
Format an address regarding
getDefaultAddressFormatter() | ||||||||||
void | formatDataDeclarator(int size, CodeDocumentPart out) | ||||||||||
void |
formatInstruction(long address, IInstruction insn, CodeDocumentPart out)
Displays only pure assembly code: Mnemonic and Operands.
| ||||||||||
void |
formatOperand(long address, IInstruction insn, IInstructionOperand opnd, int opndIndexGlobal, int opndDepth, CodeDocumentPart out)
Generic operand formatter.
| ||||||||||
final void | formatRelativeAddress(IInstructionOperandGeneric opnd, long address, CodeDocumentPart out) | ||||||||||
String |
generateExtraMethodComment(long address)
Generate an optional string that will be prepended to a function header comment.
| ||||||||||
int |
getArrayElementPerLine()
The default implementation returns 10.
| ||||||||||
ItemClassIdentifiers | getBestClassIdForAddress(long address) | ||||||||||
INativeCodeUnit<InsnType> | getCodeUnit() | ||||||||||
String |
getDataSeparator()
The default implementation returns the comma string.
| ||||||||||
AddressFormatter | getDefaultAddressFormatter() | ||||||||||
NumberFormatter | getDefaultNumberFormatter() | ||||||||||
Endianness | getEndianness() | ||||||||||
String |
getInlineCommentString()
The default implementation returns a semi-column string.
| ||||||||||
String |
getLabelPrefix()
Get the assembly label prefix.
| ||||||||||
String |
getLabelSuffix()
Can be overridden.
| ||||||||||
IVirtualMemory | getMemory() | ||||||||||
String |
getMemoryAccessPrefix()
The default implementation returns the opening square bracket.
| ||||||||||
String |
getMemoryAccessSegmentInfo(IInstruction insn, IInstructionOperand opnd)
The default implementation returns the empty string.
| ||||||||||
String |
getMemoryAccessSizeInfo(IInstruction insn, IInstructionOperandSized opnd)
Can be overridden.
| ||||||||||
String |
getMemoryAccessSuffix()
The default implementation returns the closing square bracket.
| ||||||||||
final int | getMnemonicRightPaddingLength() | ||||||||||
String |
getMultiLineCommentBegin()
The default implementation returns "slash-*".
| ||||||||||
String |
getMultiLineCommentEnd()
The default implementation returns "*-slash".
| ||||||||||
NumberFormatter | getNumberFormatter(IInstructionOperand opnd, boolean createIfNone) | ||||||||||
NumberFormatter | getNumberFormatter(INativeDataItem item) | ||||||||||
String |
getOperandSeparator()
Can be overridden.
| ||||||||||
String | getProcedureDefinitionEnd() | ||||||||||
String | getProcedureDefinitionStart() | ||||||||||
String |
getRawDataDeclarator(int bitsize)
The default implementation returns "dX".
| ||||||||||
String |
getRegisterName(long registerIdentifier)
The default implementation returns "rX".
| ||||||||||
boolean | isDoNotAttemptImmediateToAddressResolution() | ||||||||||
void | setCodeUnit(INativeCodeUnit<InsnType> pbcu) | ||||||||||
void | setDoNotAttemptImmediateToAddressResolution(boolean doNotResolveImmAsAddr) | ||||||||||
final void | setMnemonicRightPaddingLength(int length) |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final void | addPrefix(IInstruction insn, IInstructionOperandGeneric opnd, CodeDocumentPart out) | ||||||||||
final void | addSuffix(IInstruction insn, IInstructionOperandGeneric opnd, CodeDocumentPart out) | ||||||||||
void | formatMnemonic(long address, IInstruction insn, boolean prependPrefix, CodeDocumentPart out) | ||||||||||
void | formatOperands(long address, IInstruction insn, CodeDocumentPart out) | ||||||||||
int | formatPrefix(long address, IInstruction insn, CodeDocumentPart out) | ||||||||||
void | formatRegister(long regValue, CodeDocumentPart out) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Format an address regarding getDefaultAddressFormatter()
address | address to represent |
---|---|
opnd | optional; IFF address is a relative address |
Displays only pure assembly code: Mnemonic and Operands. If you need to display the address and bytecode, refer to #formatInstruction(ProcessorBasedCodeUnit, long, IInstruction, CodeDocumentPart)
Generic operand formatter. Can be overridden, although not recommended. If the processor uses
custom instructions, that is, instructions that are neither
IInstructionOperandGeneric
or IInstructionOperandCMA
, the processor should
override this method.
Generate an optional string that will be prepended to a function header comment. The default implementation returns null.
address | function address |
---|
The default implementation returns 10. Can be overridden.
The default implementation returns the comma string. Can be overridden.
The default implementation returns a semi-column string. Can be overridden.
Get the assembly label prefix. Can be overridden.
Can be overridden.
The default implementation returns the opening square bracket. Can be overridden.
The default implementation returns the empty string. Can be overridden.
Can be overridden.
The default implementation returns the closing square bracket. Can be overridden.
The default implementation returns "slash-*". Can be overridden.
The default implementation returns "*-slash". Can be overridden.
Can be overridden.
The default implementation returns "dX". Can be overridden.
The default implementation returns "rX". Should be overridden.