reven.api.Instruction(object)
class documentationreven.api
(View In Hierarchy)
A basic block instruction.
Method | __init__ | |
Method | comment | Get the instruction comment. |
Method | set_comment | Set the instruction comment. |
Method | index | Property: Instruction index in the basic block. |
Method | address | Property: The instruction virtual address. |
Method | size | Property: The instruction size in bytes. |
Method | prefixes | Property: The instruction prefixes. |
Method | mnemonic | Property: The instruction mnemonic. |
Method | operands | The instruction operands. |
Method | operand | Get operand by index. |
Method | raw_bytes | Property: Return a bytearray containing the raw, still assembled instruction. |
Method | __repr__ | Undocumented |
Method | _rvn | Undocumented |
Method | _instr | Undocumented |
Parameters | block | A BasicBlock instance. |
index | The instruction index in its basic block. | |
Raises | ValueError | if the instruction index is greater than the size of the basic block. |
Get the instruction comment.
Although this object is cached like the others, its value is
still updated by the local modifications performed using this instance's set_comment
method.
Set the instruction comment.
To prevent accidental loss of data, you cannot modify the comment of an
instruction if the comment of any instruction in this instruction's basic
block was modified by another connection since you created this Instruction
instance. If
you get a ConcurrentAccessError
when trying to call this method, then perform the following step to refresh
your Instruction
instance:
project.refresh()
project.trace(your_trace_name)
point = trace.point(sequence_index,
instruction_index)
instruction =
point.instruction
Of course, you should check how the comments were modified by the other connection before trying to modify them again.
Raises | reven_api.ServiceNotAllowedDuringExecutionError | If this method is called during the execution. |
RuntimeError | If the connection is lost, in case of bad input, or in case of internal service error. | |
ConcurrentAccessError | If the method is called after the comments where modified by another connection, without any prior refresh of the comment cache. |
Get operand by index.
Returns | The operand at the specified index. If 0 > index > len(operands), None. |