.. py:module:: instruction instruction -- Instruction module ================================= This module exposes a number of tools for interacting with an instruction defined within the database. There are three types of tools within this module and each can be distinguished by their prefixes which can be used to decode the operands for an instruction. At the present time, only the Intel, AArch32/AArch64 (ARM), and the MIPS32/MIPS64 architectures are currently supported. Although IDA internally uses the :py:obj:`idaapi.insn_t` and :py:obj:`idaapi.op_t` to represent an instruction and its operands, this module's base argument type is typically an address or an operand index. When dealing with an instruction's operands, the :py:obj:`ops_` prefix represents all of the instructions operands and typically will take only an address. Likewise when dealing with a single operand, the :py:obj:`op_` prefix is used and will take an address and the operand index. To request the actual IDA types (:py:obj:`idaapi.insn_t` and :py:obj:`idaapi.op_t`) there are two tools that are provided. The :py:obj:`instruction.at` tool will take an address and return an :py:obj:`idaapi.insn_t`. To get an operand type (:py:obj:`idaapi.op_t`), a user can use :py:obj:`instruction.operand`. This will take an address and an operand index and return the desired type. Some globals are also defined for the given architecture which can be used to query or access the registers that are currently available. Once IDA has determined the architecture for the database the :py:obj:`register_t` class is instantiated for each available register. This object allows one to reference any register that is defined for the architecture. Another object that is created is the :py:obj:`architecture_t` object. Searching for a register can be done by index and size or simply by its name. This object also allows one to promote or demote a register between its various sizes. This allows one to navigate between the 8-bit, 16-bit, 32-bit, or 64-bit versions of a register available in the architecture. ------------- Function list ------------- The functions that are available in this module use multicased functions and aliases. For more information on this, please see :ref:`multicase-aliases` and :ref:`multicase-functions`. .. py:function:: at() Returns the :py:obj:`idaapi.insn_t` instance at the current address. .. py:function:: at(ea) Returns the :py:obj:`idaapi.insn_t` instance at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: mnemonic() Returns the mnemonic of the instruction at the current address. Aliases: :py:func:`instruction.mnem` .. py:function:: mnemonic(ea) Returns the mnemonic of the instruction at the address ``ea``. Aliases: :py:func:`instruction.mnem` :param ea: the address of an instruction :type ea: int or long .. py:function:: op(opnum) Decodes the operand ``opnum`` for the current instruction. Aliases: :py:func:`instruction.op_value`, :py:func:`instruction.op_decode` :param opnum: the operand number of the current instruction to decode :type opnum: int or long .. py:function:: op(reference) Decodes the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_value`, :py:func:`instruction.op_decode` :param reference: the :py:obj:`opref_t` of the instruction and operand to decode :type reference: interface.opref_t .. py:function:: op(ea, opnum) Decodes the operand ``opnum`` for the instruction at the address ``ea``. Aliases: :py:func:`instruction.op_value`, :py:func:`instruction.op_decode` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction to decode :type opnum: int or long .. py:function:: op_binary(opnum) Set the type for operand ``opnum`` at the current instruction to binary and return it. Aliases: :py:func:`instruction.op_bin` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_binary(reference) Set the type for the operand pointed to by ``reference`` to binary and return it. Aliases: :py:func:`instruction.op_bin` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_binary(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to binary and return it. Aliases: :py:func:`instruction.op_bin` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_bits(opnum) Returns the size (in bits) for the operand ``opnum`` belonging to the current instruction. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_bits(reference) Returns the size (in bits) for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_bits(ea, opnum) Returns the size (in bits) for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_character(opnum) Set the type for operand ``opnum`` at the current instruction to a character and return it. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_character(reference) Set the type for the operand pointed to by ``reference`` to a character and return it. Aliases: :py:func:`instruction.op_char`, :py:func:`instruction.op_chr` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_character(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to a character and return it. Aliases: :py:func:`instruction.op_char`, :py:func:`instruction.op_chr` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_decimal(opnum) Set the type for operand ``opnum`` at the current instruction to decimal and return it. Aliases: :py:func:`instruction.op_dec` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_decimal(reference) Set the type for the operand pointed to by ``reference`` to decimal and return it. Aliases: :py:func:`instruction.op_dec` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_decimal(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to decimal and return it. Aliases: :py:func:`instruction.op_dec` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_decoder(opnum) Returns the name of the decoder that will be used when decoding the operand ``opnum`` belonging to the current instruction. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_decoder(reference) Returns the name of the decoder that will be used when decoding the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_decoder(ea, opnum) Returns the name of the decoder that will be used when decoding the operand ``opnum`` belonging to the instruction at the address ``ea``. The string that is returned is dependent on the processor module used by the database. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_enumeration(opnum) Return the enumeration member id for the operand ``opnum`` belonging to the current instruction. Aliases: :py:func:`instruction.op_enum` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_enumeration(reference) Return the enumeration member id for the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_enum` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_enumeration(ea, opnum) Return the enumeration member id for the operand ``opnum`` belonging to the instruction at ``ea``. Aliases: :py:func:`instruction.op_enum` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_enumeration(opnum, name) Apply the enumeration ``name`` to operand ``opnum`` for the current instruction. Aliases: :py:func:`instruction.op_enum` :param opnum: the operand number of the current instruction :type opnum: int or long :param name: the name of the enumeration to apply :type name: str .. py:function:: op_enumeration(reference, name_or_id) Apply the enumeration ``name_or_id`` to the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_enum` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param name_or_id: the enumeration name or identifier to apply .. py:function:: op_enumeration(ea, opnum, name) Apply the enumeration ``name`` to operand ``opnum`` for the instruction at ``ea``. Aliases: :py:func:`instruction.op_enum` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param name: the name of the enumeration to apply :type name: str .. py:function:: op_enumeration(ea, opnum, id) Apply the enumeration ``id`` to operand ``opnum`` of the instruction at ``ea``. Aliases: :py:func:`instruction.op_enum` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param id: the identifer of an enumeration to apply :type id: int or long or tuple or list .. py:function:: op_float(opnum) Set the type for operand ``opnum`` at the current instruction to floating-point and return it. Aliases: :py:func:`instruction.op_flt` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_float(reference) Set the type for the operand pointed to by ``reference`` to floating-point and return it. Aliases: :py:func:`instruction.op_flt` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_float(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to floating-point and return it. Aliases: :py:func:`instruction.op_flt` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_hexadecimal(opnum) Set the type for operand ``opnum`` at the current instruction to hexadecimal and return it. Aliases: :py:func:`instruction.op_hex` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_hexadecimal(reference) Set the type for the operand pointed to by ``reference`` to hexadecimal and return it. Aliases: :py:func:`instruction.op_hex` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_hexadecimal(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to hexadecimal and return it. Aliases: :py:func:`instruction.op_hex` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_modified(opnum) Return whether the operand ``opnum`` belonging to the current instruction is being modified (written to). Aliases: :py:func:`instruction.op_write`, :py:func:`instruction.op_written` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_modified(reference) Return whether the operand pointed to by ``reference`` is being modified (written to). Aliases: :py:func:`instruction.op_write`, :py:func:`instruction.op_written` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_modified(ea, opnum) Return whether the operand ``opnum`` belonging to the instruction at the address ``ea`` is being modified (written to). Aliases: :py:func:`instruction.op_write`, :py:func:`instruction.op_written` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_number(opnum) Set the type for operand ``opnum`` at the current instruction to a number and return it. Aliases: :py:func:`instruction.op_num` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_number(reference) Set the type for the operand pointed to by ``reference`` to a number and return it. Aliases: :py:func:`instruction.op_num` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_number(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to a number and return it. Aliases: :py:func:`instruction.op_num` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_octal(opnum) Set the type for operand ``opnum`` at the current instruction to octal and return it. Aliases: :py:func:`instruction.op_oct` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_octal(reference) Set the type for the operand pointed to by ``reference`` to octal and return it. Aliases: :py:func:`instruction.op_oct` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_octal(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to octal and return it. Aliases: :py:func:`instruction.op_oct` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_read(opnum) Return whether the operand ``opnum`` belonging to the current instruction is only being read from. Aliases: :py:func:`instruction.op_used` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_read(reference) Return whether the operand pointed to by ``reference`` is only being read from. Aliases: :py:func:`instruction.op_used` :param reference: :type reference: interface.opref_t .. py:function:: op_read(ea, opnum) Return whether the operand ``opnum`` belonging to the instruction at the address ``ea`` is only being read from. Aliases: :py:func:`instruction.op_used` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_reference(opnum) Return the address being referenced by the operand ``opnum`` belonging to the instruction at the current address. :param opnum: :type opnum: int or long .. py:function:: op_reference(reference) Return the address being referenced by the operand pointed to by ``reference``. :param reference: :type reference: interface.opref_t .. py:function:: op_reference(ea, opnum) Return the address being referenced by the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: :type ea: int or long :param opnum: :type opnum: int or long .. py:function:: op_refinfo(opnum) Return the :py:obj:`idaapi.refinfo_t` for the operand ``opnum`` belonging to the instruction at the current address. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_refinfo(reference) Return the :py:obj:`idaapi.refinfo_t` for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand to fetch the :py:obj:`idaapi.refinfo_t` from :type reference: interface.opref_t .. py:function:: op_refinfo(ea, opnum) Return the :py:obj:`idaapi.refinfo_t` for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction to fetch the :py:obj:`idaapi.refinfo_t` from :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_refs(opnum) Returns the ``(address, opnum, type)`` of all the instructions that reference the operand ``opnum`` for the current instruction. Aliases: :py:func:`instruction.op_ref` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_refs(reference) Returns the ``(address, opnum, type)`` of all the instructions that reference the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_ref` :param reference: the :py:obj:`opref_t` of the instruction and operand to return references for :type reference: interface.opref_t .. py:function:: op_refs(ea, opnum) Returns the ``(address, opnum, type)`` of all the instructions that reference the operand ``opnum`` for the instruction at ``ea``. Aliases: :py:func:`instruction.op_ref` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_repr(opnum) Returns the representation for the operand ``opnum`` belonging to the instruction at the current address. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_repr(reference) Returns the representation for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_repr(ea, opnum) Returns the representation for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_segment(opnum) Returns the segment register used by the operand ``opnum`` for the instruction at the current address. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_segment(reference) Returns the segment register used by the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_segment(ea, opnum) Returns the segment register used by the operand ``opnum`` for the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_size(opnum) Returns the size for the operand ``opnum`` belonging to the current instruction. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_size(reference) Returns the size for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_size(ea, opnum) Returns the size for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_stackvar(opnum) Set the type for operand ``opnum`` at the current instruction to a stack variable and return it. Aliases: :py:func:`instruction.op_stack`, :py:func:`instruction.op_stkvar` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_stackvar(reference) Set the type for the operand pointed to by ``reference`` to a stack variable and return it. Aliases: :py:func:`instruction.op_stack`, :py:func:`instruction.op_stkvar` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_stackvar(ea, opnum) Set the type for operand ``opnum`` belonging to the instruction at ``ea`` to a stack variable and return it. Aliases: :py:func:`instruction.op_stack`, :py:func:`instruction.op_stkvar` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_state(opnum) Returns the modification state for the operand ``opnum`` belonging to the current instruction. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_state(reference) Returns the modification state for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_state(ea, opnum) Returns the modification state for the operand ``opnum`` belonging to the instruction at the address ``ea``. The returned state is a string that can be "r", "w", or "rw" depending on whether the operand is being read from, written to, or modified (both). :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_string(opnum) Return the string type of operand ``opnum`` for the current instruction. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_string(reference) Return the string type (:py:obj:`idaapi.STRTYPE_`) of the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_string(ea, opnum) Return the string type (:py:obj:`idaapi.STRTYPE_`) of operand ``opnum`` for the instruction at ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_string(reference, strtype) Set the string type used by operand pointed to by ``reference`` to ``strtype``. :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param strtype: an IDA string type to apply to the operand :type strtype: int or long .. py:function:: op_string(ea, opnum, strtype) Set the string type used by operand ``opnum`` for the instruction at ``ea`` to ``strtype``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param strtype: an IDA string type to apply to the operand :type strtype: int or long .. py:function:: op_structure(opnum) Return the structure and members for operand ``opnum`` at the current instruction. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_structure(reference) Return the structure and members for the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_structure(ea, opnum) Return the structure and members for the operand ``opnum`` at the instruction ``ea``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_structure(opnum, structure, \*path) Apply the specified ``structure`` along with any members in ``path`` to the instruction operand ``opnum`` at the current address. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param opnum: the operand number of the current instruction :type opnum: int or long :param structure: the :py:obj:`structure_t` to apply :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(opnum, member, \*path) Apply the specified ``member`` along with any members in ``path`` to the instruction operand ``opnum`` at the current address. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param opnum: the operand number of the current instruction :type opnum: int or long :param member: the :py:obj:`member_t` to apply :type member: member_t or idaapi.member_t :param \*path: any structure members, names, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(ea, opnum, structure, \*path) Apply the specified ``structure`` along with the members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param structure: the :py:obj:`structure_t` to apply :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(ea, opnum, member, \*path) Apply the specified ``member`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param member: :type member: member_t or idaapi.member_t :param \*path: any structure members, names, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(reference, structure, \*path) Apply the specified ``structure`` along with the members in ``path`` to the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param structure: the structure to apply as a type or a name :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(reference, member, \*path) Apply the specified ``member`` along with the members in ``path`` to the instruction operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param member: :type member: member_t or idaapi.member_t :param \*path: an iterable containing structures, members, or integers that is used to specify the path to apply to the operand .. py:function:: op_structure(reference, path) Apply the structure members in ``path`` to the instruction operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param path: an iterable containing structures, members, or integers that is used to specify the path to apply to the operand :type path: tuple or list .. py:function:: op_structure(ea, opnum, path) Apply the structure members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param path: an iterable containing structures, members, or integers that is used to specify the path to apply to the operand :type path: tuple or list .. py:function:: op_structure(ea, opnum, sptr, path) Apply the structure identified by ``sptr`` along with the members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_struct`, :py:func:`instruction.op_struc` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the current instruction :type opnum: int or long :param sptr: the :py:obj:`idaapi.struc_t` to apply :type sptr: idaapi.struc_t :param path: an iterable containing any structure members, names, or integers that is used to specify the path to apply to the operand :type path: tuple or list .. py:function:: op_structurepath(opnum) Return the structure and members for operand ``opnum`` at the current instruction. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_structurepath(reference) Return the structure and members for the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_structurepath(ea, opnum) Return the structure and members for the operand ``opnum`` at the instruction ``ea``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: op_structurepath(opnum, structure, \*path, \*\*delta) Apply the specified ``structure`` along with any members in ``path`` to the instruction operand ``opnum`` at the current address. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param opnum: the operand number of the current instruction :type opnum: int or long :param structure: the :py:obj:`structure_t` to apply :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(opnum, member, \*path, \*\*delta) Apply the specified ``member`` along with any members in ``path`` to the instruction operand ``opnum`` at the current address. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param opnum: the operand number of the current instruction :type opnum: int or long :param member: the :py:obj:`member_t` to apply :type member: member_t or idaapi.member_t :param \*path: any structure members, names, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(ea, opnum, structure, \*path, \*\*delta) Apply the specified ``structure`` along with the members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param structure: the :py:obj:`structure_t` to apply :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(ea, opnum, member, \*path, \*\*delta) Apply the specified ``member`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param member: :type member: member_t or idaapi.member_t :param \*path: any structure members, names, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(reference, structure, \*path, \*\*delta) Apply the specified ``structure`` along with the members in ``path`` to the operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param structure: the structure to apply as a type or a name :type structure: structure_t or idaapi.struc_t or str :param \*path: any structure members, names, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(reference, member, \*path, \*\*delta) Apply the specified ``member`` along with the members in ``path`` to the instruction operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param member: :type member: member_t or idaapi.member_t :param \*path: an iterable containing structures, members, or integers that describes the full path to the member that gets applied to the operand :param \*\*delta: .. py:function:: op_structurepath(reference, path) Apply the structure members in ``path`` to the instruction operand pointed to by ``reference``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t :param path: an iterable containing structures, members, or integers that describes the full path to the member that gets applied to the operand :type path: tuple or list .. py:function:: op_structurepath(ea, opnum, path) Apply the structure members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param path: an iterable containing structures, members, or integers that describes the full path to the member that gets applied to the operand :type path: tuple or list .. py:function:: op_structurepath(ea, opnum, sptr, path) Apply the structure identified by ``sptr`` along with the members in ``path`` to the instruction operand ``opnum`` at the address ``ea``. Aliases: :py:func:`instruction.op_strpath`, :py:func:`instruction.op_strucpath` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the current instruction :type opnum: int or long :param sptr: the :py:obj:`idaapi.struc_t` to apply :type sptr: idaapi.struc_t :param path: an iterable containing any structure members, names, or integers that describes the full path to the member that gets applied to the operand :type path: tuple or list .. py:function:: op_type(opnum) Returns the pythonic type of the operand ``opnum`` belonging to the current instruction. Aliases: :py:func:`instruction.opt` :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: op_type(reference) Returns the pythonic type of the operand pointed to by ``reference``. Aliases: :py:func:`instruction.opt` :param reference: the :py:obj:`opref_t` of the instruction and operand :type reference: interface.opref_t .. py:function:: op_type(ea, opnum) Returns the pythonic type of the operand ``opnum`` belonging to the instruction at the address ``ea``. Aliases: :py:func:`instruction.opt` :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: operand(opnum) Returns the :py:obj:`idaapi.op_t` for the operand ``opnum`` belonging to the instruction at the current address. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: operand(reference) Returns the :py:obj:`idaapi.op_t` for the operand pointed to by ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand to return the :py:obj:`idaapi.op_t` for :type reference: interface.opref_t .. py:function:: operand(ea, opnum) Returns the :py:obj:`idaapi.op_t` for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: operands() Returns all of the :py:obj:`idaapi.op_t` instances for the instruction at the current address. .. py:function:: operands(ea) Returns all of the :py:obj:`idaapi.op_t` instances for the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: opinfo(opnum) Returns the :py:obj:`idaapi.opinfo_t` for the operand ``opnum`` belonging to the instruction at the current address. :param opnum: the operand number of the current instruction :type opnum: int or long .. py:function:: opinfo(opnum, info, \*\*flags) Set the opinfo for the operand ``opnum`` at the current address to the :py:obj:`idaapi.opinfo_t` provided by ``info``. :param opnum: the operand number of the current instruction :type opnum: int or long :param info: the :py:obj:`idaapi.opinfo_t` to assign to the operand :type info: idaapi.opinfo_t :param \*\*flags: any operand information flags to assign .. py:function:: opinfo(reference) Returns the :py:obj:`idaapi.opinfo_t` for the operand pointed to by the provided ``reference``. :param reference: the :py:obj:`opref_t` of the instruction and operand to return the :py:obj:`idaapi.opinfo_t` for :type reference: interface.opref_t .. py:function:: opinfo(ea, opnum) Returns the :py:obj:`idaapi.opinfo_t` for the operand ``opnum`` belonging to the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long .. py:function:: opinfo(reference, info, \*\*flags) Set the operand info for the operand specified by ``reference`` to the :py:obj:`idaapi.opinfo_t` provided by ``info``. :param reference: the :py:obj:`opref_t` of the instruction and operand to set the :py:obj:`idaapi.opinfo_t` for :type reference: interface.opref_t :param info: the :py:obj:`idaapi.opinfo_t` to assign to the operand :type info: idaapi.opinfo_t :param \*\*flags: any operand information flags to assign .. py:function:: opinfo(ea, opnum, info, \*\*flags) Set the operand info for the operand ``opnum`` at the address ``ea`` to the :py:obj:`idaapi.opinfo_t` provided by ``info``. If any ``flags`` have been specified, then also set the operand's flags to the provided value. :param ea: the address of an instruction :type ea: int or long :param opnum: the operand number of the instruction :type opnum: int or long :param info: the :py:obj:`idaapi.opinfo_t` to assign to the operand :type info: idaapi.opinfo_t :param \*\*flags: any operand information flags to assign .. py:function:: ops() Returns a tuple of all the operands for the instruction at the current address. Aliases: :py:func:`instruction.ops_value` .. py:function:: ops(ea) Returns a tuple of all the operands for the instruction at the address ``ea``. Aliases: :py:func:`instruction.ops_value` :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_constant() Return the operands that are being written to by the instruction at the current address. Aliases: :py:func:`instruction.ops_const` .. py:function:: ops_constant(ea) Return the operands that are being written to by the instruction at the current address. Aliases: :py:func:`instruction.ops_const` :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_count() Returns the number of operands of the instruction at the current address. .. py:function:: ops_count(ea) Returns the number of operands of the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_decoder() Return a tuple of the names of the decoders that will be used for all the operands in the instruction at the current address. .. py:function:: ops_decoder(ea) Return a tuple of the names of the decoders that will be used for all the operands in the instruction at the address ``ea``. :param ea: :type ea: int or long .. py:function:: ops_read() Return the operands that are being read from by the instruction at the current address. .. py:function:: ops_read(ea) Return the operands that are being read from by the instruction at the current address. :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_refinfo() Returns the :py:obj:`idaapi.refinfo_t` for the instruction at the current address. .. py:function:: ops_refinfo(ea) Returns the :py:obj:`idaapi.refinfo_t` for the instruction at the address ``ea``. :param ea: the address in the database to fetch the :py:obj:`idaapi.refinfo_t` from :type ea: int or long .. py:function:: ops_register(\*\*modifiers) Returns each register operand in the instruction at the current address. Aliases: :py:func:`instruction.ops_regs`, :py:func:`instruction.ops_reg`, :py:func:`instruction.ops_registers` :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: ops_register(ea, \*\*modifiers) Returns each register operand in the instruction at the current address. Aliases: :py:func:`instruction.ops_regs`, :py:func:`instruction.ops_reg`, :py:func:`instruction.ops_registers` :param ea: the address of an instruction :type ea: int or long :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: ops_register(reg, \*regs, \*\*modifiers) Returns each register operand in the instruction at the current address that is ``reg`` or any one of the registers in ``regs``. Aliases: :py:func:`instruction.ops_regs`, :py:func:`instruction.ops_reg`, :py:func:`instruction.ops_registers` :param reg: the register to search the operands for :type reg: str or register_t :param \*regs: any other registers to include :param \*\*modifiers: if ``write`` is specified, then only return operands that write to the specified registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: ops_register(ea, reg, \*regs, \*\*modifiers) Returns each register operand in the instruction at the address ``ea`` that is ``reg`` or any one of the registers in ``regs``.''' If the keyword ``write`` is true, then only return the result if it's writing to the register. Aliases: :py:func:`instruction.ops_regs`, :py:func:`instruction.ops_reg`, :py:func:`instruction.ops_registers` :param ea: the address of an instruction :type ea: int or long :param reg: the register to search the operands for :type reg: str or register_t :param \*regs: any other registers to include :param \*\*modifiers: if ``write`` is specified, then only return operands that write to the specified registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: ops_repr() Returns a tuple of the :py:obj:`op_repr` of all the operands for the instruction at the current address. .. py:function:: ops_repr(ea) Returns a tuple of the :py:obj:`op_repr` of all the operands for the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_size() Returns a tuple with all the sizes of each operand for the instruction at the current address. .. py:function:: ops_size(ea) Returns a tuple with all the sizes of each operand for the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_state() Returns a tuple for all the operands containing one of the states "r", "w", or "rw" .. py:function:: ops_state(ea) Returns a tuple of for all the operands containing one of the states "r", "w", or "rw" describing how the operands are modified for the instruction at address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: ops_write() Return the operands that are being written to by the instruction at the current address. .. py:function:: ops_write(ea) Return the operands that are being written to by the instruction at the current address. :param ea: the address of an instruction :type ea: int or long .. py:function:: opsi_constant() Return the indices of any operands in the current instruction that are constants. Aliases: :py:func:`instruction.opsi_const` .. py:function:: opsi_constant(ea) Return the indices of any operands in the instruction at ``ea`` that are constants. Aliases: :py:func:`instruction.opsi_const` :param ea: the address of an instruction :type ea: int or long .. py:function:: opsi_read() Returns the indices of any operands that are being read from by the instruction at the current address. .. py:function:: opsi_read(ea) Returns the indices of any operands that are being read from by the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: opsi_register(\*\*modifiers) Returns the index of each operand in the instruction at the current address which uses a register. Aliases: :py:func:`instruction.opsi_regs`, :py:func:`instruction.opsi_regi`, :py:func:`instruction.opsi_registers`, :py:func:`instruction.opsi_reg` :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: opsi_register(ea, \*\*modifiers) Returns the index of each operand in the instruction at the address ``ea`` which uses a register. Aliases: :py:func:`instruction.opsi_regs`, :py:func:`instruction.opsi_regi`, :py:func:`instruction.opsi_registers`, :py:func:`instruction.opsi_reg` :param ea: the address of an instruction :type ea: int or long :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: opsi_register(reg, \*regs, \*\*modifiers) Returns the index of each operand in the instruction at the current address that uses ``reg`` or any one of the registers in ``regs``. Aliases: :py:func:`instruction.opsi_regs`, :py:func:`instruction.opsi_regi`, :py:func:`instruction.opsi_registers`, :py:func:`instruction.opsi_reg` :param reg: the register to search the operands for :type reg: str or register_t :param \*regs: any other registers to include :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: opsi_register(ea, reg, \*regs, \*\*modifiers) Returns the index of each operand in the instruction at address ``ea`` that uses ``reg`` or any one of the registers in ``regs``. If the keyword ``write`` is true, then only return the result if it's writing to the register. Aliases: :py:func:`instruction.opsi_regs`, :py:func:`instruction.opsi_regi`, :py:func:`instruction.opsi_registers`, :py:func:`instruction.opsi_reg` :param ea: the address of an instruction :type ea: int or long :param reg: the register to search the operands for :type reg: str or register_t :param \*regs: any other registers to include :param \*\*modifiers: if ``write`` is specified, then only return operands that write to any registers. if ``read`` is specified then do the same but for operands that read from them. .. py:function:: opsi_write() Returns the indices of the operands that are being written to by the instruction at the current address. .. py:function:: opsi_write(ea) Returns the indices of the operands that are being written to by the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long .. py:function:: opts() Returns a tuple of the pythonic types for all the operands in the instruction at the current address. Aliases: :py:func:`instruction.ops_type` .. py:function:: opts(ea) Returns a tuple of the pythonic types for all the operands in the instruction at the address ``ea``. Aliases: :py:func:`instruction.ops_type` :param ea: the address of an instruction :type ea: int or long .. py:function:: size() Returns the length of the instruction at the current address. .. py:function:: size(ea) Returns the length of the instruction at the address ``ea``. :param ea: the address of an instruction :type ea: int or long -------------- Namespace list -------------- These are the namespaces available within this module. Namespaces group similar functions that can be used typically for the same concept. Please see :ref:`multicase-namespaces` for more information on namespaces. For more information on multicase functions or aliases, please see :ref:`multicase-functions` or :ref:`multicase-aliases`. .. _ns-instruction-armops: ****************** instruction.armops ****************** This internal namespace contains the different operand types that can be returned for the AArch32 and AArch64 architectures. ^^^^^^^^^^^^^^^^^^ armops.condition_t ^^^^^^^^^^^^^^^^^^ .. py:class:: armops.condition_t Bases: :py:class:`symbol_t` A symbol for representing a condition operand on either the AArch32 or AArch64 architectures. .. py:attribute:: flags :param getter: Return the required flags for the current condition to be true. .. py:attribute:: name :param getter: .. py:attribute:: symbols :param getter: A condition_t is actually a symbol that yields itself. ^^^^^^^^^^^ armops.flex ^^^^^^^^^^^ .. py:class:: armops.flex Bases: :py:class:`namedtuple`, :py:class:`symbol_t` A tuple representing a flexible operand type that can be decoded on either the AArch32 or AArch64 architectures. Has the format ``(Rn, shift, n)`` which allows the architecture to apply a binary shift or rotation to the value of a register ``Rn``. .. py:attribute:: symbols :param getter: Yield the ``Rn`` register from the tuple. ^^^^^^^^^^^^^^^^^^^^^^ armops.immediatephrase ^^^^^^^^^^^^^^^^^^^^^^ .. py:class:: armops.immediatephrase Bases: :py:class:`interface.integerish`, :py:class:`symbol_t` A tuple representing a memory displacement operand on either the AArch32 or AArch64 architectures. Has the format ``(Rn, Offset)`` where ``Rn`` is a register and ``Offset`` is the integer that is added to the register. .. py:attribute:: symbols :param getter: Yield the ``Rn`` register from the tuple. ^^^^^^^^^^^ armops.list ^^^^^^^^^^^ .. py:class:: armops.list Bases: :py:class:`namedtuple`, :py:class:`symbol_t` A tuple representing a register list operand on either the AArch32 or AArch64 architectures. Has the simple format ``(reglist)`` where ``reglist`` is a set of registers that can be explicitly tested as a set for membership. .. py:attribute:: symbols :param getter: Yield any of the registers within the ``reglist`` field belonging to the tuple. ^^^^^^^^^^^^^ armops.memory ^^^^^^^^^^^^^ .. py:class:: armops.memory Bases: :py:class:`namedtuple`, :py:class:`symbol_t` A tuple for representing a memory operand on either the AArch32 or AArch64 architectures. Has the format ``(address, value)`` where ``address`` is the actual value stored in the operand and ``value`` is the value that would be dereferenced. .. py:attribute:: symbols :param getter: This operand type is not composed of any symbols. ^^^^^^^^^^^^^^^^^^^^^ armops.registerphrase ^^^^^^^^^^^^^^^^^^^^^ .. py:class:: armops.registerphrase Bases: :py:class:`namedtuple`, :py:class:`symbol_t` A tuple for representing a memory phrase on either the AArch32 or AArch64 architectures. Has the format ``(Rn, Rm)`` where both values are registers that compose the phrase. .. py:attribute:: symbols :param getter: Yield the ``Rn`` and ``Rm`` registers from the tuple. .. _ns-instruction-intelops: ******************** instruction.intelops ******************** This internal namespace contains the different operand types that can be returned for the Intel architecture. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ intelops.OffsetBaseIndexScale ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. py:class:: intelops.OffsetBaseIndexScale Bases: :py:class:`interface.integerish`, :py:class:`symbol_t` A tuple representing a memory phrase for the Intel architecture. Has the format ``(offset, base, index, scale)`` where both ``base`` and ``index`` are both optional registers. .. py:attribute:: symbols :param getter: Yield the ``base``, and the ``index`` registers from the tuple if they are defined. ^^^^^^^^^^^^^^^^^^^^^^ intelops.SegmentOffset ^^^^^^^^^^^^^^^^^^^^^^ .. py:class:: intelops.SegmentOffset Bases: :py:class:`interface.integerish`, :py:class:`symbol_t` A tuple representing an address with a segment register attached on the Intel architecture. Has the format ``(segment, offset)`` where ``segment`` is a segment register. .. py:attribute:: symbols :param getter: Yield the ``segment`` register from the tuple if it is defined. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ intelops.SegmentOffsetBaseIndexScale ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. py:class:: intelops.SegmentOffsetBaseIndexScale Bases: :py:class:`interface.integerish`, :py:class:`symbol_t` A tuple representing a memory phrase operand on the Intel architecture. Has the format ``(segment, offset, base, index, scale)`` where ``segment`` includes the segment register and both the ``base`` and ``index`` registers are both optional. .. py:attribute:: symbols :param getter: Yield the ``segment``, ``base``, and the ``index`` registers from the tuple if they are defined. .. _ns-instruction-mipsops: ******************* instruction.mipsops ******************* This internal namespace contains the different operand types that are used by the MIPS architectures. ^^^^^^^^^^^^^^ mipsops.phrase ^^^^^^^^^^^^^^ .. py:class:: mipsops.phrase Bases: :py:class:`interface.integerish`, :py:class:`symbol_t` A tuple for representing a memory phrase operand on the MIPS architectures. Has the format ``(Rn, Offset)`` where ``Rn`` is the register and ``Offset`` is the immediate that is added to the ``Rn`` register. .. py:attribute:: symbols :param getter: Yield the ``Rn`` register from this tuple. ^^^^^^^^^^^^ mipsops.trap ^^^^^^^^^^^^ .. py:class:: mipsops.trap Bases: :py:class:`namedtuple`, :py:class:`symbol_t` A tuple for representing a trap code that can be encoded within certain instructions on the MIPS architectures. Simply wraps the encoded integer in a single-element tuple with the format of ``(code)``. .. py:attribute:: symbols :param getter: This operand type is not composed of any symbols. .. _ns-instruction-type: **************** instruction.type **************** This namespace is for fetching information about the instruction type at a given address within the database. The functions within this namespace return a boolean based on whether the instruction at the given address fits a particular type. It is prudent to note that the information that these functions expose are essentially flags for the instruction and is provided in order to allow a user to infer how IDA has processed the instruction. These flags are used by IDA in order to determine things such as whether or not it should continue disassembling, or if it should add the instruction's operand to its queue in order to recursively disassemble code witin the database. This namespace is also aliased as :py:obj:`instruction.t`. Some examples of using this namespace are:: > print( instruction.type.is_return(ea) ) > print( instruction.type.is_jxx(ea) ) > print( instruction.type.is_call(ea) ) > print( instruction.type.is_branch(ea) ) .. py:function:: type\.feature() Returns the feature bitmask of the instruction at the current address. Aliases: :py:func:`instruction.feature` .. py:function:: type\.feature(ea) Return the feature bitmask for the instruction at the address ``ea``. Aliases: :py:func:`instruction.feature` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.feature(ea, mask) Return the feature bitmask for the instruction at the address ``ea`` masked with ``mask``. Aliases: :py:func:`instruction.feature` :param ea: the address of an instruction :type ea: int or long :param mask: a bitmask used to select specific bits from the instruction feature :type mask: int or long .. py:function:: type\.is_branch() Returns true if the current instruction is any kind of branch. Aliases: :py:func:`instruction.type.branchQ`, :py:func:`instruction.branchQ`, :py:func:`instruction.is_branch`, :py:func:`instruction.type.isbranch` .. py:function:: type\.is_branch(ea) Returns true if the instruction at ``ea`` is any kind of branch. Aliases: :py:func:`instruction.type.branchQ`, :py:func:`instruction.branchQ`, :py:func:`instruction.is_branch`, :py:func:`instruction.type.isbranch` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_call() Returns true if the current instruction is a call. Aliases: :py:func:`instruction.callQ`, :py:func:`instruction.is_call`, :py:func:`instruction.type.iscall`, :py:func:`instruction.type.callQ` .. py:function:: type\.is_call(ea) Returns true if the instruction at ``ea`` is a call. Aliases: :py:func:`instruction.callQ`, :py:func:`instruction.is_call`, :py:func:`instruction.type.iscall`, :py:func:`instruction.type.callQ` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_calli() Return true if the current instruction is an indirect call. Aliases: :py:func:`instruction.is_calli`, :py:func:`instruction.type.calliQ`, :py:func:`instruction.calliQ`, :py:func:`instruction.type.iscalli` .. py:function:: type\.is_calli(ea) Returns true if the instruction at ``ea`` is an indirect call. Aliases: :py:func:`instruction.is_calli`, :py:func:`instruction.type.calliQ`, :py:func:`instruction.calliQ`, :py:func:`instruction.type.iscalli` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_jmp() Returns true if the current instruction is an immediate and indirect branch. Aliases: :py:func:`instruction.type.isjmp`, :py:func:`instruction.jmpQ`, :py:func:`instruction.type.jmpQ`, :py:func:`instruction.is_jmp` .. py:function:: type\.is_jmp(ea) Returns true if the instruction at ``ea`` is an immediate and indirect branch. Aliases: :py:func:`instruction.type.isjmp`, :py:func:`instruction.jmpQ`, :py:func:`instruction.type.jmpQ`, :py:func:`instruction.is_jmp` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_jmpi() Returns true if the instruction at the current address is an indirect branch. Aliases: :py:func:`instruction.jmpiQ`, :py:func:`instruction.type.isjmpi`, :py:func:`instruction.is_jmpi`, :py:func:`instruction.type.jmpiQ` .. py:function:: type\.is_jmpi(ea) Returns true if the instruction at ``ea`` is an indirect branch. Aliases: :py:func:`instruction.jmpiQ`, :py:func:`instruction.type.isjmpi`, :py:func:`instruction.is_jmpi`, :py:func:`instruction.type.jmpiQ` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_jxx() Returns true if the current instruction is a conditional branch. Aliases: :py:func:`instruction.type.jxxQ`, :py:func:`instruction.is_jxx`, :py:func:`instruction.jxxQ`, :py:func:`instruction.type.isjxx` .. py:function:: type\.is_jxx(ea) Returns true if the instruction at ``ea`` is a conditional branch. Aliases: :py:func:`instruction.type.jxxQ`, :py:func:`instruction.is_jxx`, :py:func:`instruction.jxxQ`, :py:func:`instruction.type.isjxx` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_return() Returns true if the current instruction is a return-type instruction. Aliases: :py:func:`instruction.type.returnQ`, :py:func:`instruction.type.retQ`, :py:func:`instruction.is_return`, :py:func:`instruction.returnQ`, :py:func:`instruction.retQ`, :py:func:`instruction.type.isreturn` .. py:function:: type\.is_return(ea) Returns true if the instruction at ``ea`` is a return-type instruction. Aliases: :py:func:`instruction.type.returnQ`, :py:func:`instruction.type.retQ`, :py:func:`instruction.is_return`, :py:func:`instruction.returnQ`, :py:func:`instruction.retQ`, :py:func:`instruction.type.isreturn` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_sentinel() Returns true if the current instruction is a sentinel-type instruction. Aliases: :py:func:`instruction.type.issentinel`, :py:func:`instruction.type.sentinelQ` .. py:function:: type\.is_sentinel(ea) Returns true if the instruction at ``ea`` is a sentinel-type instruction. Aliases: :py:func:`instruction.type.issentinel`, :py:func:`instruction.type.sentinelQ` :param ea: the address of an instruction :type ea: int or long .. py:function:: type\.is_shift() Returns true if the current instruction is a bit-shifting instruction. Aliases: :py:func:`instruction.type.shiftQ`, :py:func:`instruction.shiftQ`, :py:func:`instruction.is_shift`, :py:func:`instruction.type.isshift` .. py:function:: type\.is_shift(ea) Returns true if the instruction at ``ea`` is a bit-shifting instruction. Aliases: :py:func:`instruction.type.shiftQ`, :py:func:`instruction.shiftQ`, :py:func:`instruction.is_shift`, :py:func:`instruction.type.isshift` :param ea: the address of an instruction :type ea: int or long ---------- Class list ---------- Classes provide the definition necessary to instantiate an object. In most cases, a class is returned when calling one of the prior listed functions and thus have no need to be manually instantiated. Classes may also have aliases defined for them. Please refer to the documentation for the class to see what is available. For more information on aliases, please see :ref:`multicase-aliases`. ******* AArch32 ******* .. py:class:: AArch32 Bases: :py:class:`AArch` An implementation of all the registers available on the AArch32 (ARM) architecture. This is used to locate or manage the different registers that are available. An instance of this class can be accessed as :py:obj:`instruction.architecture` (or :py:obj:`instruction.arch`) when the current architecture of the database is AArch32. ******* AArch64 ******* .. py:class:: AArch64 Bases: :py:class:`AArch` An implementation of all the registers available on the AArch64 (ARM) architecture. This is used to locate or manage the different registers that are available. An instance of this class can be accessed as :py:obj:`instruction.architecture` (or :py:obj:`instruction.arch`) when the current architecture of the database is AArch64. ***** Intel ***** .. py:class:: Intel Bases: :py:class:`architecture_t` An implementation of all the registers available on the Intel architecture. This keeps track of the relationships between registers to allow one to promote or demote a register to the different sizes that are available. An instance of this class can be accessed as :py:obj:`instruction.architecture` (or :py:obj:`instruction.arch`) when the current architecture of the database is Intel. .. py:method:: by_control(self, index) Return the desired control register by the specified ``index``. :param index: the index of the control register .. py:method:: by_float(self, index) Return the desired floating-point stack register by the specified ``index``. :param index: the index of the floating-point register .. py:method:: by_mmx(self, index) Return the desired MultiMedia eXtension register of the specified ``index``. :param index: the index of the MMX register .. py:method:: by_xmm(self, index) Return the desired SSE vector register of the specified ``index``. :param index: the index of the XMM register .. py:method:: by_ymm(self, index) Return the desired 256-bit Advanced Vector Extensions register of the specified ``index``. :param index: the index of the YMM register .. py:method:: by_zmm(self, index) Return the desired 512-bit Advanced Vector Extensions register of the specified ``index``. :param index: the index of the ZMM register ****** MIPS32 ****** .. py:class:: MIPS32 Bases: :py:class:`MIPS` An implementation of all the registers available on the MIPS32 architecture. This includes the different coprocessor registers that are also available but are treated as special instructions by IDA. An instance of this class can be accessed as :py:obj:`instruction.architecture` (or :py:obj:`instruction.arch`) when the current architecture of the database is MIPS. ****** MIPS64 ****** .. py:class:: MIPS64 Bases: :py:class:`MIPS` An implementation of all the registers available on the MIPS64 architecture. This includes the different coprocessor registers that are also available but are treated as special instructions by IDA. An instance of this class can be accessed as :py:obj:`instruction.architecture` (or :py:obj:`instruction.arch`) when the current architecture of the database is MIPS.