Module index

Module ida_ua

IDA Plugin SDK API wrapper: ua

Global variables

var BINOPSTATE_DONE
BINOPSTATE_DONE = 524288
var BINOPSTATE_GO
BINOPSTATE_GO = 262144
var BINOPSTATE_NONE
BINOPSTATE_NONE = 0
var COMMSTATE_DONE
COMMSTATE_DONE = 512
var COMMSTATE_GO
COMMSTATE_GO = 256
var COMMSTATE_NONE
COMMSTATE_NONE = 0
var CTXF_BINOP_STATE
CTXF_BINOP_STATE = 786432
var CTXF_CMT_STATE
CTXF_CMT_STATE = 768
var CTXF_CODE
CTXF_CODE = 4
var CTXF_DBLIND_OPND
CTXF_DBLIND_OPND = 131072
var CTXF_DEMANGLED_LABEL
CTXF_DEMANGLED_LABEL = 4096
var CTXF_DEMANGLED_OK
CTXF_DEMANGLED_OK = 16384
var CTXF_GEN_CMT
CTXF_GEN_CMT = 128
var CTXF_GEN_XREFS
CTXF_GEN_XREFS = 16
var CTXF_LABEL_OK
CTXF_LABEL_OK = 8192
var CTXF_MAIN
CTXF_MAIN = 1
var CTXF_MULTI
CTXF_MULTI = 2
var CTXF_NORMAL_LABEL
CTXF_NORMAL_LABEL = 2048
var CTXF_OUTCTX_T
CTXF_OUTCTX_T = 65536
var CTXF_OVSTORE_PRNT
CTXF_OVSTORE_PRNT = 32768
var CTXF_STACK
CTXF_STACK = 8
var CTXF_VOIDS
CTXF_VOIDS = 1024
var CTXF_XREF_STATE
CTXF_XREF_STATE = 96
var DEFAULT_INDENT
DEFAULT_INDENT = 65535
var FCBF_CONT
don't stop on decoding, or any other kind of error
var FCBF_DELIM
add the 'ash'-specified delimiters around the generated data. Note: if those are not defined and the INFFL_ALLASM is not set, 'format_charlit()' will return an error
var FCBF_ERR_REPL
in case of an error, use a CP_REPLCHAR instead of a hex representation of the problematic byte
var FCBF_FF_LIT
in case of codepoints == 0xFF, use it as-is (i.e., LATIN SMALL LETTER Y WITH DIAERESIS) If both this, and FCBF_REPL are specified, this will take precedence
var GH_BYTESEX_HAS_HIGHBYTE
GH_BYTESEX_HAS_HIGHBYTE = 16
var GH_PRINT_ALL
GH_PRINT_ALL = 15
var GH_PRINT_ALL_BUT_BYTESEX
GH_PRINT_ALL_BUT_BYTESEX = 11
var GH_PRINT_ASM
GH_PRINT_ASM = 2
var GH_PRINT_BYTESEX
GH_PRINT_BYTESEX = 4
var GH_PRINT_HEADER
GH_PRINT_HEADER = 8
var GH_PRINT_PROC
GH_PRINT_PROC = 1
var GH_PRINT_PROC_AND_ASM
GH_PRINT_PROC_AND_ASM = 3
var GH_PRINT_PROC_ASM_AND_BYTESEX
GH_PRINT_PROC_ASM_AND_BYTESEX = 7
var INSN_64BIT
belongs to 64bit segment?
var INSN_MACRO
macro instruction
var INSN_MODMAC
may modify the database to make room for the macro insn
var MAKELINE_BINPREF
MAKELINE_BINPREF = 1
var MAKELINE_NONE
MAKELINE_NONE = 0
var MAKELINE_STACK
MAKELINE_STACK = 4
var MAKELINE_VOID
MAKELINE_VOID = 2
var OF_NO_BASE_DISP
base displacement doesn't exist. meaningful only for 'o_displ' type. if set, base displacement ( 'op_t::addr' ) doesn't exist.
var OF_NUMBER
the operand can be converted to a number only
var OF_OUTER_DISP
outer displacement exists. meaningful only for 'o_displ' type. if set, outer displacement ( 'op_t::value' ) exists.
var OF_SHOW
should the operand be displayed?
var OOFS_IFSIGN
output sign if needed
var OOFS_NEEDSIGN
always out sign (+-)
var OOFS_NOSIGN
don't output sign, forbid the user to change the sign
var OOFW_16
16 bit width
var OOFW_24
24 bit width
var OOFW_32
32 bit width
var OOFW_64
64 bit width
var OOFW_8
8 bit width
var OOFW_IMM
take from x.dtype
var OOF_ADDR
output x.addr, otherwise x.value
var OOF_ANYSERIAL
if enum: select first available serial
var OOF_NOBNOT
prohibit use of binary not
var OOF_NUMBER
always as a number
var OOF_OUTER
output outer operand
var OOF_SIGNED
output as signed if < 0
var OOF_SIGNMASK
sign symbol (+/-) output
var OOF_SPACES
do not suppress leading spaces currently works only for floating point numbers
var OOF_WIDTHMASK
width of value in bits
var OOF_ZSTROFF
meaningful only if is_stroff(uFlag) append a struct field name if the field offset is zero? if 'AFL_ZSTROFF' is set, then this flag is ignored.
var PACK_FORM_DEF
packed factor defined. (! 'o_reg' + 'dt_packreal' )
var STKVAR_VALID_SIZE
STKVAR_VALID_SIZE = 1
var XREFSTATE_DONE
XREFSTATE_DONE = 64
var XREFSTATE_GO
XREFSTATE_GO = 32
var XREFSTATE_NONE
XREFSTATE_NONE = 0
var dt_bitfild
bit field (mc680x0)
var dt_byte
8 bit integer
var dt_byte16
128 bit integer
var dt_byte32
256 bit integer
var dt_byte64
512 bit integer
var dt_code
ptr to code (not used?)
var dt_double
8 byte floating point
var dt_dword
32 bit integer
var dt_float
4 byte floating point
var dt_fword
48 bit
var dt_half
2-byte floating point
var dt_ldbl
long double (which may be different from tbyte)
var dt_packreal
packed real format for mc68040
var dt_qword
64 bit integer
var dt_string
pointer to asciiz string
var dt_tbyte
variable size (\ph{tbyte_size} ) floating point
var dt_unicode
pointer to unicode string
var dt_void
none
var dt_word
16 bit integer
var o_displ
o_displ = 4
var o_far
o_far = 6
var o_idpspec0
o_idpspec0 = 8
var o_idpspec1
o_idpspec1 = 9
var o_idpspec2
o_idpspec2 = 10
var o_idpspec3
o_idpspec3 = 11
var o_idpspec4
o_idpspec4 = 12
var o_idpspec5
o_idpspec5 = 13
var o_imm
o_imm = 5
var o_mem
o_mem = 2
var o_near
o_near = 7
var o_phrase
o_phrase = 3
var o_reg
o_reg = 1
var o_void
o_void = 0

Functions

def calc_dataseg(*args) ‑> ea_t
Get data segment for the instruction operand. 'opnum' and 'rgnum' are meaningful only if the processor has segment registers.
calc_dataseg(insn, n=-1, rgnum=-1) -> ea_t
insn - an ida_ua.insn_t, or an address (C++: const insn_t &)
n (C++: int)
rgnum (C++: int)
def can_decode(*args) ‑> bool
Can the bytes at address 'ea' be decoded as instruction?
can_decode(ea) -> bool
ea: linear address (C++: ea_t)
return: whether or not the contents at that address could be a valid
instruction
def construct_macro(*args) ‑> bool
construct_macro(insn, enable, build_macro) -> bool
See ua.hpp's construct_macro().
def construct_macro2(*args) ‑> bool
construct_macro2(_this, insn, enable) -> bool
_this (C++: macro_constructor_t *)
insn (C++: insn_t *)
enable (C++: bool)
def create_insn(*args) ‑> int
Create an instruction at the specified address. This function checks if an instruction is present at the specified address and will try to create one if there is none. It will fail if there is a data item or other items hindering the creation of the new instruction. This function will also fill the 'out' structure.
create_insn(ea, out=None) -> int
ea: linear address (C++: ea_t)
out: the resulting instruction (C++: insn_t *)
return: the length of the instruction or 0
def create_outctx(*args) ‑> outctx_base_t *
Create a new output context. To delete it, just use "delete pctx"
create_outctx(ea, F=0, suspop=0) -> outctx_base_t
ea (C++: ea_t)
F (C++: flags_t)
suspop (C++: int)
def decode_insn(*args) ‑> int
Analyze the specified address and fill 'out'. This function does not modify the database. It just tries to interpret the specified address as an instruction and fills the 'out' structure.
decode_insn(out, ea) -> int
out: the resulting instruction (C++: insn_t *)
ea: linear address (C++: ea_t)
return: the length of the (possible) instruction or 0
def decode_preceding_insn(*args) ‑> PyObject *
decode_preceding_insn(out, ea) -> PyObject *
Decodes the preceding instruction. Please check ua.hpp / decode_preceding_insn()
ea: current ea
out: instruction storage
return: tuple(preceeding_ea or BADADDR, farref = Boolean)
def decode_prev_insn(*args) ‑> ea_t
Decode previous instruction if it exists, fill 'out'.
decode_prev_insn(out, ea) -> ea_t
out: the resulting instruction (C++: insn_t *)
ea: the address to decode the previous instruction from (C++:
ea_t)
return: the previous instruction address ( BADADDR -no such insn)
def get_dtype_by_size(*args) ‑> int
Get 'op_t::dtype' from size.
get_dtype_by_size(size) -> int
size (C++: asize_t)
def get_dtype_flag(*args) ‑> flags_t
Get flags for 'op_t::dtype' field.
get_dtype_flag(dtype) -> flags_t
dtype (C++: op_dtype_t)
def get_dtype_size(*args) ‑> size_t
Get size of opt_::dtype field.
get_dtype_size(dtype) -> size_t
dtype (C++: op_dtype_t)
def get_immvals(*args) ‑> PyObject *
Get immediate values at the specified address. This function decodes instruction at the specified address or inspects the data item. It finds immediate values and copies them to 'out'. This function will store the original value of the operands in 'out', unless the last bits of 'F' are "...0 11111111", in which case the transformed values (as needed for printing) will be stored instead.
get_immvals(ea, n, F=0) -> PyObject *
ea: address to analyze (C++: ea_t)
n: number of operand (0.. UA_MAXOP -1), -1 means all operands
(C++: int)
F: flags for the specified address (C++: flags_t)
return: number of immediate values (0..2* UA_MAXOP )
def get_lookback(*args) ‑> int
Number of instructions to look back. This variable is not used by the kernel. Its value may be specified in ida.cfg: LOOKBACK = <number>. IDP may use it as you like it. (TMS module uses it)
def get_printable_immvals(*args) ‑> PyObject *
Get immediate ready-to-print values at the specified address
get_printable_immvals(ea, n, F=0) -> PyObject *
ea: address to analyze (C++: ea_t)
n: number of operand (0.. UA_MAXOP -1), -1 means all operands
(C++: int)
F: flags for the specified address (C++: flags_t)
return: number of immediate values (0..2* UA_MAXOP )
def insn_add_cref(*args) ‑> void
insn_add_cref(insn, to, opoff, type)
insn: an ida_ua.insn_t, or an address (C++: const insn_t &) to: ea_t opoff: int type: enum cref_t
def insn_add_dref(*args) ‑> void
insn_add_dref(insn, to, opoff, type)
insn: an ida_ua.insn_t, or an address (C++: const insn_t &) to: ea_t opoff: int type: enum dref_t
def insn_add_off_drefs(*args) ‑> ea_t
insn_add_off_drefs(insn, x, type, outf) -> ea_t
insn: an ida_ua.insn_t, or an address (C++: const insn_t &) x: op_t const & type: enum dref_t outf: int
def insn_create_stkvar(*args) ‑> bool
insn_create_stkvar(insn, x, v, flags) -> bool
insn: an ida_ua.insn_t, or an address (C++: const insn_t &) x: op_t const & v: adiff_t flags: int
def insn_t__from_ptrval__(*args) ‑> insn_t *
insn_t__from_ptrval__(ptrval) -> insn_t
ptrval: size_t
def is_floating_dtype(*args) ‑> bool
Is a floating type operand?
is_floating_dtype(dtype) -> bool
dtype (C++: op_dtype_t)
def map_code_ea(*args) ‑> ea_t
Map a code address. This function takes into account the segment translations.
map_code_ea(insn, addr, opnum) -> ea_t
insn: the current instruction - an ida_ua.insn_t, or an
address (C++: const insn_t &)
addr: the referenced address to map (C++: ea_t)
opnum: operand number (C++: int)
map_code_ea(insn, op) -> ea_t
insn: the current instruction - an ida_ua.insn_t, or an
address (C++: const insn_t &)
op: op_t const &
def map_data_ea(*args) ‑> ea_t
Map a data address.
map_data_ea(insn, addr, opnum=-1) -> ea_t
insn: the current instruction - an ida_ua.insn_t, or an
address (C++: const insn_t &)
addr: the referenced address to map (C++: ea_t)
opnum: operand number (C++: int)
map_data_ea(insn, op) -> ea_t
insn: the current instruction - an ida_ua.insn_t, or an
address (C++: const insn_t &)
op: op_t const &
def map_ea(*args) ‑> ea_t
map_ea(insn, op, iscode) -> ea_t
insn - an ida_ua.insn_t, or an address (C++: const insn_t &)
op (C++: const op_t &)
iscode (C++: bool)
map_ea(insn, addr, opnum, iscode) -> ea_t
insn - an ida_ua.insn_t, or an address (C++: const insn_t &) addr: ea_t opnum: int
iscode (C++: bool)
def op_t__from_ptrval__(*args) ‑> op_t *
op_t__from_ptrval__(ptrval) -> op_t
ptrval: size_t
def outctx_base_t__from_ptrval__(*args) ‑> outctx_base_t *
outctx_base_t__from_ptrval__(ptrval) -> outctx_base_t
ptrval: size_t
def outctx_t__from_ptrval__(*args) ‑> outctx_t *
outctx_t__from_ptrval__(ptrval) -> outctx_t
ptrval: size_t
def print_insn_mnem(*args) ‑> qstring *
Print instruction mnemonics.
print_insn_mnem(ea) -> str
ea: linear address of the instruction (C++: ea_t)
return: success
def print_operand(*args) ‑> qstring *
Generate text representation for operand #n. This function will generate the text representation of the specified operand (includes color codes.)
print_operand(ea, n, getn_flags=0, newtype=None) -> str
ea: the item address (instruction or data) (C++: ea_t)
n: operand number (0,1,2...). meaningful only for instructions
(C++: int)
getn_flags (C++: int)
newtype: if specified, print the operand using the specified
type (C++: struct printop_t *)
return: success
def ua_mnem(*args) ‑> qstring *
Print instruction mnemonics.
print_insn_mnem(ea) -> str
ea: linear address of the instruction (C++: ea_t)
return: success

Classes

class insn_t (*args)
Proxy of C++ insn_t class.
__init__(self) -> insn_t

Instance variables

var Op1
var Op2
var Op3
var Op4
var Op5
var Op6
var Op7
var Op8
var auxpref : uint32
__get_auxpref__(self) -> uint32
var cs
insn_t_cs_get(self) -> ea_t
var ea
insn_t_ea_get(self) -> ea_t
var flags
insn_t_flags_get(self) -> int16
var insnpref
insn_t_insnpref_get(self) -> char
var ip
insn_t_ip_get(self) -> ea_t
var itype
insn_t_itype_get(self) -> uint16
var ops : wrapped_array_t< op_t,8 >
__get_ops__(self) -> operands_array
var segpref
insn_t_segpref_get(self) -> char
var size
insn_t_size_get(self) -> uint16

Methods

def add_cref(self, *args) ‑> void
Add a code cross-reference from the instruction.
add_cref(self, to, opoff, type)
to: target linear address (C++: ea_t)
opoff: offset of the operand from the start of instruction. if
the offset is unknown, then 0. (C++: int)
type: type of xref (C++: cref_t)
def add_dref(self, *args) ‑> void
Add a data cross-reference from the instruction. See 'add_off_drefs()'
  • usually it can be used in most cases.
add_dref(self, to, opoff, type)
to: target linear address (C++: ea_t)
opoff: offset of the operand from the start of instruction if
the offset is unknown, then 0 (C++: int)
type: type of xref (C++: dref_t)
def add_off_drefs(self, *args) ‑> ea_t
Add xrefs for an operand of the instruction. This function creates all cross references for 'enum', 'offset' and 'structure offset' operands. Use 'add_off_drefs()' in the presence of negative offsets.
add_off_drefs(self, x, type, outf) -> ea_t
x: reference to operand (C++: const op_t &)
type: type of xref (C++: dref_t)
outf: out_value() flags. These flags should match the flags
used to output the operand (C++: int)
return: if is_off() : the reference target address (the same as
calc_reference_data). if is_stroff() : BADADDR because for stroffs the target address is unknown else: BADADDR because enums do not represent addresses
def assign(self, *args) ‑> void
assign(self, other)
other: an ida_ua.insn_t, or an address (C++: const insn_t &)
def create_op_data(self, *args) ‑> bool
create_op_data(self, ea_, opoff, dtype) -> bool
ea_: ea_t opoff: int dtype: op_dtype_t
create_op_data(self, ea_, op) -> bool
ea_: ea_t op: op_t const &
def create_stkvar(self, *args) ‑> bool
create_stkvar(self, x, v, flags_) -> bool
x: op_t const & v: adiff_t flags_: int
def get_canon_feature(self, *args) ‑> uint32
see 'instruc_t::feature'
get_canon_feature(self, ph) -> uint32
ph (C++: const processor_t &)
def get_canon_mnem(self, *args) ‑> char const *
see 'instruc_t::name'
get_canon_mnem(self, ph) -> char const
ph (C++: const processor_t &)
def get_next_byte(self, *args) ‑> uint8
get_next_byte(self) -> uint8
def get_next_dword(self, *args) ‑> uint32
get_next_dword(self) -> uint32
def get_next_qword(self, *args) ‑> uint64
get_next_qword(self) -> uint64
def get_next_word(self, *args) ‑> uint16
get_next_word(self) -> uint16
def is_64bit(self, *args) ‑> bool
Belongs to a 64bit segment?
def is_canon_insn(self, *args) ‑> bool
see \ph{ 'is_canon_insn()' }
is_canon_insn(self, ph) -> bool
ph (C++: const processor_t &)
def is_macro(self, *args) ‑> bool
Is a macro instruction?
class macro_constructor_t (*args)
Proxy of C++ macro_constructor_t class.
__init__(self) -> macro_constructor_t
self: PyObject *

Instance variables

var reserved
macro_constructor_t_reserved_get(self) -> size_t

Methods

def build_macro(self, *args) ‑> bool
Try to extend the instruction.
build_macro(self, insn, may_go_forward) -> bool
insn: Instruction to modify, usually the first instruction of
the macro (C++: insn_t *)
may_go_forward: Is it ok to consider the next instruction for
the macro? This argument may be false, for example, if there is a cross reference to the end of INSN. In this case creating a macro is not desired. However, it may still be useful to perform minor tweaks to the instruction using the information about the surrounding instructions. (C++: bool)
return: true if created an macro instruction. This function may
modify 'insn' and return false; these changes will be accepted by the kernel but the instruction will not be considered as a macro.
class op_t (*args)
Proxy of C++ op_t class.
__init__(self) -> op_t

Instance variables

var addr : ea_t
__get_addr__(self) -> ea_t
var dtype
op_t_dtype_get(self) -> op_dtype_t
var flags
op_t_flags_get(self) -> uchar
var n
op_t_n_get(self) -> uchar
var offb
op_t_offb_get(self) -> char
var offo
op_t_offo_get(self) -> char
var phrase : uint16
__get_reg_phrase__(self) -> uint16
var reg : uint16
__get_reg_phrase__(self) -> uint16
var specflag1
op_t_specflag1_get(self) -> char
var specflag2
op_t_specflag2_get(self) -> char
var specflag3
op_t_specflag3_get(self) -> char
var specflag4
op_t_specflag4_get(self) -> char
var specval : ea_t
__get_specval__(self) -> ea_t
var type
op_t_type_get(self) -> optype_t
var value : ea_t
__get_value__(self) -> ea_t

Methods

def assign(self, *args) ‑> void
assign(self, other)
other: op_t const &
def clr_shown(self, *args) ‑> void
Set operand to hidden.
def has_reg(self, r)
Checks if the operand accesses the given processor register
def is_imm(self, *args) ‑> bool
Is immediate operand?
is_imm(self, v) -> bool
v (C++: uval_t)
def is_reg(self, *args) ‑> bool
Is register operand?
is_reg(self, r) -> bool
r (C++: int)
def set_shown(self, *args) ‑> void
Set operand to be shown.
def shown(self, *args) ‑> bool
Is operand set to be shown?
class operands_array (*args)
Proxy of C++ wrapped_array_t< op_t,8 > class.
__init__(self, data) -> operands_array
data: op_t (&)[8]

Instance variables

var bytes : bytevec_t
_get_bytes(self) -> bytevec_t
var data
operands_array_data_get(self) -> op_t (&)[8]
class outctx_base_t (*args, **kwargs)
Proxy of C++ outctx_base_t class.

Subclasses

Instance variables

var default_lnnum
outctx_base_t_default_lnnum_get(self) -> int
var insn_ea
outctx_base_t_insn_ea_get(self) -> ea_t
var outbuf
outctx_base_t_outbuf_get(self) -> qstring *

Methods

def close_comment(self, *args) ‑> void
close_comment(self)
def clr_gen_label(self, *args) ‑> void
clr_gen_label(self)
def display_voids(self, *args) ‑> bool
display_voids(self) -> bool
def flush_buf(self, *args) ‑> bool
Append contents of 'buf' to the line array. Behaves like flush_outbuf but accepts an arbitrary buffer
flush_buf(self, buf, indent=-1) -> bool
buf (C++: const char *)
indent (C++: int)
def flush_outbuf(self, *args) ‑> bool
Functions to populate the output line array (lnar) Move the contents of the output buffer to the line array (outbuf->lnar) The kernel augments the outbuf contents with additional text like the line prefix, user-defined comments, xrefs, etc at this call.
flush_outbuf(self, indent=-1) -> bool
indent (C++: int)
def forbid_annotations(self, *args) ‑> int
forbid_annotations(self) -> int
def force_code(self, *args) ‑> bool
force_code(self) -> bool
def gen_block_cmt(self, *args) ‑> bool
Generate big non-indented comment lines.
gen_block_cmt(self, cmt, color) -> bool
cmt: comment text. may contain \n characters to denote new
lines. should not contain comment character (;) (C++: const char *)
color: color of comment text (one of Color tags ) (C++:
color_t)
return: overflow, lnar_maxsize has been reached
def gen_border_line(self, *args) ‑> bool
Generate thin border line. This function does nothing if generation of border lines is disabled.
gen_border_line(self, solid=False) -> bool
solid: generate solid border line (with =), otherwise with -
(C++: bool)
return: overflow, lnar_maxsize has been reached
def gen_cmt_line(self, *args) ‑> bool
Generate one non-indented comment line, colored with 'COLOR_AUTOCMT' .
gen_cmt_line(self, format) -> bool
format: printf() style format line. The resulting comment line
should not include comment character (;) (C++: const char *)
return: overflow, lnar_maxsize has been reached
def gen_collapsed_line(self, *args) ‑> bool
Generate one non-indented comment line, colored with 'COLOR_COLLAPSED' .
gen_collapsed_line(self, format) -> bool
format: printf() style format line. The resulting comment line
should not include comment character (;) (C++: const char *)
return: overflow, lnar_maxsize has been reached
def gen_empty_line(self, *args) ‑> bool
Generate empty line. This function does nothing if generation of empty lines is disabled.
def gen_empty_line_without_annotations(self, *args) ‑> void
gen_empty_line_without_annotations(self)
def gen_printf(self, *args) ‑> bool
printf-like function to add lines to the line array.
gen_printf(self, indent, format) -> bool
indent: indention of the line. if indent == -1, the kernel will
indent the line at \inf{indent} . if indent < 0, -indent will be used for indention. The first line printed with indent < 0 is considered as the most important line at the current address. Usually it is the line with the instruction itself. This line will be displayed in the cross-reference lists and other places. If you need to output an additional line before the main line then pass DEFAULT_INDENT instead of -1. The kernel will know that your line is not the most important one. (C++: int)
format: printf style colored line to generate (C++: const char
*)
return: overflow, lnar_maxsize has been reached
def gen_xref_lines(self, *args) ‑> bool
gen_xref_lines(self) -> bool
def get_stkvar(self, *args) ‑> member_t *
get_stkvar(self, arg2, arg3, arg4, arg5) -> member_t *
arg2: op_t const & arg3: uval_t arg4: sval_t * arg5: int *
def init_lines_array(self, *args) ‑> void
init_lines_array(self, answers, maxsize)
answers (C++: qstrvec_t *)
maxsize (C++: int)
def multiline(self, *args) ‑> bool
multiline(self) -> bool
def only_main_line(self, *args) ‑> bool
only_main_line(self) -> bool
def out_addr_tag(self, *args) ‑> void
Output "address" escape sequence.
out_addr_tag(self, ea)
ea (C++: ea_t)
def out_btoa(self, *args) ‑> void
Output a number with the specified base (binary, octal, decimal, hex) The number is output without color codes. see also 'out_long()'
out_btoa(self, Word, radix=0)
Word (C++: uval_t)
radix (C++: char)
def out_char(self, *args) ‑> void
Output one character. The character is output without color codes. see also 'out_symbol()'
out_char(self, c)
c (C++: char)
def out_chars(self, *args) ‑> void
Append a character multiple times.
out_chars(self, c, n)
c (C++: char)
n (C++: int)
def out_colored_register_line(self, *args) ‑> void
Output a colored line with register names in it. The register names will be substituted by user-defined names ( 'regvar_t' ) Please note that out_tagoff tries to make substitutions too (when called with COLOR_REG)
out_colored_register_line(self, str)
str (C++: const char *)
def out_keyword(self, *args) ‑> void
Output a string with 'COLOR_KEYWORD' color.
out_keyword(self, str)
str (C++: const char *)
def out_line(self, *args) ‑> void
Output a string with the specified color.
out_line(self, str, color=0)
str (C++: const char *)
color (C++: color_t)
def out_long(self, *args) ‑> void
Output a number with appropriate color. Low level function. Use 'out_value()' if you can. if 'suspop' is set then this function uses 'COLOR_VOIDOP' instead of 'COLOR_NUMBER' . 'suspop' is initialized:in out_one_operand()in ..\ida\gl.cpp (before calling \ph{d_out()} )
out_long(self, v, radix)
v (C++: sval_t)
radix (C++: char)
def out_name_expr(self, *args) ‑> bool
Output a name expression.
out_name_expr(self, x, ea, off=BADADDR) -> bool
x: instruction operand referencing the name expression (C++:
const op_t &)
ea: address to convert to name expression (C++: ea_t)
off: the value of name expression. this parameter is used only
to check that the name expression will have the wanted value. You may pass BADADDR for this parameter but I discourage it because it prohibits checks. (C++: adiff_t)
return: true if the name expression has been produced
def out_printf(self, *args) ‑> void
Functions to append text to the current output buffer (outbuf) Append a formatted string to the output string.
out_printf(self, format)
format (C++: const char *)
return: the number of characters appended
def out_register(self, *args) ‑> void
Output a character with 'COLOR_REG' color.
out_register(self, str)
str (C++: const char *)
def out_spaces(self, *args) ‑> void
Appends spaces to outbuf until its tag_strlen becomes 'len'.
out_spaces(self, len)
len (C++: ssize_t)
def out_symbol(self, *args) ‑> void
Output a character with 'COLOR_SYMBOL' color.
out_symbol(self, c)
c (C++: char)
def out_tagoff(self, *args) ‑> void
Output "turn color off" escape sequence.
out_tagoff(self, tag)
tag (C++: color_t)
def out_tagon(self, *args) ‑> void
Output "turn color on" escape sequence.
out_tagon(self, tag)
tag (C++: color_t)
def out_value(self, *args) ‑> flags_t
Output immediate value. Try to use this function to output all constants of instruction operands. This function outputs a number from x.addr or x.value in the form determined by ::uFlag. It outputs a colored text.-1 is output with 'COLOR_ERROR' 0 is output as a number or character or segment
out_value(self, x, outf=0) -> flags_t
x (C++: const op_t &)
outf (C++: int)
return: flags of the output value
def print_label_now(self, *args) ‑> bool
print_label_now(self) -> bool
def restore_ctxflags(self, *args) ‑> void
restore_ctxflags(self, saved_flags)
saved_flags (C++: int)
def retrieve_cmt(self, *args) ‑> ssize_t
retrieve_cmt(self) -> ssize_t
def retrieve_name(self, *args) ‑> ssize_t
retrieve_name(self, arg2, arg3) -> ssize_t
arg2: qstring * arg3: color_t *
def set_comment_addr(self, *args) ‑> void
set_comment_addr(self, ea)
ea (C++: ea_t)
def set_dlbind_opnd(self, *args) ‑> void
set_dlbind_opnd(self)
def set_gen_cmt(self, *args) ‑> void
set_gen_cmt(self, on=True)
on (C++: bool)
def set_gen_demangled_label(self, *args) ‑> void
set_gen_demangled_label(self)
def set_gen_label(self, *args) ‑> void
set_gen_label(self)
def set_gen_xrefs(self, *args) ‑> void
set_gen_xrefs(self, on=True)
on (C++: bool)
def setup_outctx(self, *args) ‑> void
Initialization; normally used only by the kernel.
setup_outctx(self, prefix, makeline_flags)
prefix (C++: const char *)
makeline_flags (C++: int)
def stack_view(self, *args) ‑> bool
stack_view(self) -> bool
def term_outctx(self, *args) ‑> int
Finalize the output context.
term_outctx(self, prefix=None) -> int
prefix (C++: const char *)
return: the number of generated lines.
class outctx_t (*args, **kwargs)
Proxy of C++ outctx_t class.

Ancestors

Instance variables

var ash
outctx_t_ash_get(self) -> asm_t
var bin_ea
outctx_t_bin_ea_get(self) -> ea_t
var bin_state
outctx_t_bin_state_get(self) -> char
var bin_width
outctx_t_bin_width_get(self) -> int
var curlabel
outctx_t_curlabel_get(self) -> qstring *
var gl_bpsize
outctx_t_gl_bpsize_get(self) -> int
var insn
outctx_t_insn_get(self) -> insn_t
var ph
outctx_t_ph_get(self) -> processor_t
var procmod
outctx_t_procmod_get(self) -> procmod_t
var saved_immvals
outctx_t_saved_immvals_get(self) -> uval_t [8]
var wif
outctx_t_wif_get(self) -> printop_t

Methods

gen_func_footer(self, pfn)
pfn (C++: const func_t *)
def gen_func_header(self, *args) ‑> void
gen_func_header(self, pfn)
pfn (C++: func_t *)
def gen_header(self, *args) ‑> void
gen_header(self, flags=((1 << 0)|(1 << 1)), proc_name=None, proc_flavour=None)
flags (C++: int)
proc_name (C++: const char *)
proc_flavour (C++: const char *)
def gen_header_extra(self, *args) ‑> void
gen_header_extra(self)
def out_custom_mnem(self, *args) ‑> void
Output custom mnemonic for 'insn'. E.g. if it should differ from the one in 'ph.instruc'. This function outputs colored text. See 'out_mnem'
out_custom_mnem(self, mnem, width=8, postfix=None)
mnem: custom mnemonic (C++: const char *)
width: width of field with mnemonic. if < 0, then 'postfix'
will be output before the mnemonic, i.e. as a prefix (C++: int)
postfix: optional postfix added to 'mnem' (C++: const char *)
def out_data(self, *args) ‑> void
out_data(self, analyze_only)
analyze_only (C++: bool)
def out_immchar_cmts(self, *args) ‑> void
Print all operand values as commented character constants. This function is used to comment void operands with their representation in the form of character constants. This function outputs a colored text.
def out_mnem(self, *args) ‑> void
Output instruction mnemonic for 'insn' using information in 'ph.instruc' array. This function outputs a colored text. It should be called from \ph{ev_out_insn()} or \ph{ev_out_mnem()} handler. It will output at least one space after the instruction. mnemonic even if the specified 'width' is not enough.
out_mnem(self, width=8, postfix=None)
width: width of field with mnemonic. if < 0, then 'postfix'
will be output before the mnemonic, i.e. as a prefix (C++: int)
postfix: optional postfix added to the instruction mnemonic
(C++: const char *)
def out_mnemonic(self, *args) ‑> void
Output instruction mnemonic using information in 'insn'. It should be called from \ph{ev_out_insn()} and it will call \ph{ev_out_mnem()} or 'out_mnem' . This function outputs a colored text.
def out_one_operand(self, *args) ‑> bool
Use this function to output an operand of an instruction. This function checks for the existence of a manually defined operand and will output it if it exists. It should be called from
\ph{ev_out_insn()}
and it will call \ph{ev_out_operand()}. This function outputs a colored text.
out_one_operand(self, n) -> bool
n: number of operand (C++: int)
retval: 1 - operand is displayed
retval: 0 - operand is hidden
def out_specea(self, *args) ‑> bool
out_specea(self, segtype) -> bool
segtype (C++: uchar)
def set_bin_state(self, *args) ‑> void
set_bin_state(self, value)
value (C++: int)
def setup_outctx(self, *args) ‑> void
Initialization; normally used only by the kernel.
setup_outctx(self, prefix, flags)
prefix (C++: const char *) flags: int

Inherited members