Public Member Functions | Static Public Member Functions

com.google.security.zynamics.binnavi.API.disassembly.Instruction Class Reference

Inherits com::google::security::zynamics::binnavi::APIHelpers::ApiObject< INaviInstruction >.

List of all members.

Public Member Functions

void addListener (final IInstructionListener listener)
List< IComment > appendComment (final String commentText) throws CouldntSaveDataException, CouldntLoadDataException
void deleteComment (final IComment comment) throws CouldntDeleteException
IComment editComment (final IComment comment, final String newComment) throws CouldntSaveDataException
Address getAddress ()
String getArchitecture ()
List< IComment > getComment ()
byte[] getData ()
String getMnemonic ()
List< OperandgetOperands ()
ReilGraph getReilCode () throws InternalTranslationException
void initializeComment (final ArrayList< IComment > comment)
void removeListener (final IInstructionListener listener)
String toString ()

Static Public Member Functions

static Instruction create (final Module module, final Address address, final String mnemonic, final List< Operand > operands, final byte[] data, final String architecture)

Detailed Description

An Instruction object represents a single instruction of a disassembled module.


Member Function Documentation

void com.google.security.zynamics.binnavi.API.disassembly.Instruction.addListener ( final IInstructionListener  listener  ) 

Adds an object that is notified about changes in the instruction.

Parameters:
listener The listener object that is notified about changes in the instruction.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object is already listening on the instruction.
List<IComment> com.google.security.zynamics.binnavi.API.disassembly.Instruction.appendComment ( final String  commentText  )  throws CouldntSaveDataException, CouldntLoadDataException

Appends a comment to the list of global instruction comments.

Parameters:
comment The comment which is appended to the list of global instruction comments.
Exceptions:
CouldntSaveDataException if the comment could not be saved to the database.
CouldntLoadDataException 
static Instruction com.google.security.zynamics.binnavi.API.disassembly.Instruction.create ( final Module  module,
final Address  address,
final String  mnemonic,
final List< Operand operands,
final byte[]  data,
final String  architecture 
) [static]

Creates a new instruction which is part of this module. The new instruction is immediately stored in the database.

Parameters:
module The module the instruction belongs to.
address The address of the instruction.
mnemonic The mnemonic of the instruction.
operands The operands that belong to the instruction.
data The binary data of the instruction.
architecture The architecture of the instruction.
Returns:
The created instruction object.
void com.google.security.zynamics.binnavi.API.disassembly.Instruction.deleteComment ( final IComment  comment  )  throws CouldntDeleteException

Deletes a comment from the list of global instruction comments.

Parameters:
comment The comment which will be deleted.
Exceptions:
CouldntSaveDataException if the changes could not be saved to the database.
IComment com.google.security.zynamics.binnavi.API.disassembly.Instruction.editComment ( final IComment  comment,
final String  newComment 
) throws CouldntSaveDataException

Edits a global instruction comment.

Parameters:
comment The comment which is edited.
Exceptions:
CouldntSaveDataException if the changes could not be saved to the database.
Address com.google.security.zynamics.binnavi.API.disassembly.Instruction.getAddress (  ) 

Returns the address of the instruction.

Returns:
The address of the instruction.
String com.google.security.zynamics.binnavi.API.disassembly.Instruction.getArchitecture (  ) 

Returns the architecture of the instruction.

Returns:
The architecture of the instruction.
List<IComment> com.google.security.zynamics.binnavi.API.disassembly.Instruction.getComment (  ) 

Returns the comment of the instruction. This comment is the string that is displayed in views as the global instruction comment of the instruction.

Returns:
The comment of the instruction.
byte [] com.google.security.zynamics.binnavi.API.disassembly.Instruction.getData (  ) 

Returns the original bytes of the instruction.

Returns:
The original bytes of the instruction.
String com.google.security.zynamics.binnavi.API.disassembly.Instruction.getMnemonic (  ) 

Returns the mnemonic of the instruction.

Returns:
The mnemonic of the instruction.
List<Operand> com.google.security.zynamics.binnavi.API.disassembly.Instruction.getOperands (  ) 

Returns the operands of the instruction.

Returns:
The operands of the instruction.
ReilGraph com.google.security.zynamics.binnavi.API.disassembly.Instruction.getReilCode (  )  throws InternalTranslationException

Converts the instruction to REIL code.

Using this function over manual translation via ReilTranslator has the advantage that REIL translation results are automatically cached. Subsequent uses of this function requires no additional re-translation of the instruction provided that nothing relevant (like added/removed code nodes) changed.

Returns:
The REIL representation of the instruction.
Exceptions:
InternalTranslationException Thrown if the REIL translation failed.
void com.google.security.zynamics.binnavi.API.disassembly.Instruction.initializeComment ( final ArrayList< IComment >  comment  ) 

Initializes the comment of an instruction.

Parameters:
comment The new comment of the instruction.
Exceptions:
IllegalArgumentException Thrown if the comment argument is null.
CouldntSaveDataException Thrown if the comment could not be changed.
void com.google.security.zynamics.binnavi.API.disassembly.Instruction.removeListener ( final IInstructionListener  listener  ) 

Removes a listener object from the instruction.

Parameters:
listener The listener object to remove from the instruction.
Exceptions:
IllegalArgumentException Thrown if the listener argument is null.
IllegalStateException Thrown if the listener object was not listening on the instruction.
String com.google.security.zynamics.binnavi.API.disassembly.Instruction.toString (  ) 

Returns the string representation of the instruction.

Returns:
The string representation of the instruction.