Module ida_bytes

Each byte of the disassembled program is represented by a 32-bit value. We will call this value 'flags'. The structure of the flags is here.

You are not allowed to inspect individual bits of flags and modify them directly. Use special functions to inspect and/or modify flags.

Flags are kept in a virtual array file (*.id1). Addresses (ea) are all 32-bit (or 64-bit) quantities.

Global Variables

ALOPT_APPEND

ALOPT_APPEND = 32

ALOPT_IGNCLT

ALOPT_IGNCLT = 4

ALOPT_IGNHEADS

ALOPT_IGNHEADS = 1

ALOPT_IGNPRINT

ALOPT_IGNPRINT = 2

ALOPT_MAX4K

ALOPT_MAX4K = 8

ALOPT_ONLYTERM

ALOPT_ONLYTERM = 16

BIN_SEARCH_BACKWARD

BIN_SEARCH_BACKWARD = 16

BIN_SEARCH_BITMASK

BIN_SEARCH_BITMASK = 32

BIN_SEARCH_CASE

BIN_SEARCH_CASE = 1

BIN_SEARCH_FORWARD

BIN_SEARCH_FORWARD = 0

BIN_SEARCH_INITED

BIN_SEARCH_INITED = 4

BIN_SEARCH_NOBREAK

BIN_SEARCH_NOBREAK = 2

BIN_SEARCH_NOCASE

BIN_SEARCH_NOCASE = 0

BIN_SEARCH_NOSHOW

BIN_SEARCH_NOSHOW = 8

DELIT_DELNAMES

DELIT_DELNAMES = 2

DELIT_EXPAND

DELIT_EXPAND = 1

DELIT_KEEPFUNC

DELIT_KEEPFUNC = 32

DELIT_NOCMT

DELIT_NOCMT = 16

DELIT_NOTRUNC

DELIT_NOTRUNC = 4

DELIT_NOUNAME

DELIT_NOUNAME = 8

DELIT_SIMPLE

DELIT_SIMPLE = 0

DTP_NODUP

DTP_NODUP = 1

DT_TYPE

DT_TYPE = -268435456

FF_0CHAR

FF_0CHAR = 3145728

FF_0CUST

FF_0CUST = 13631488

FF_0ENUM

FF_0ENUM = 8388608

FF_0FLT

FF_0FLT = 12582912

FF_0FOP

FF_0FOP = 9437184

FF_0NUMB

FF_0NUMB = 6291456

FF_0NUMD

FF_0NUMD = 2097152

FF_0NUMH

FF_0NUMH = 1048576

FF_0NUMO

FF_0NUMO = 7340032

FF_0OFF

FF_0OFF = 5242880

FF_0SEG

FF_0SEG = 4194304

FF_0STK

FF_0STK = 11534336

FF_0STRO

FF_0STRO = 10485760

FF_0VOID

FF_0VOID = 0

FF_1CHAR

FF_1CHAR = 50331648

FF_1CUST

FF_1CUST = 218103808

FF_1ENUM

FF_1ENUM = 134217728

FF_1FLT

FF_1FLT = 201326592

FF_1FOP

FF_1FOP = 150994944

FF_1NUMB

FF_1NUMB = 100663296

FF_1NUMD

FF_1NUMD = 33554432

FF_1NUMH

FF_1NUMH = 16777216

FF_1NUMO

FF_1NUMO = 117440512

FF_1OFF

FF_1OFF = 83886080

FF_1SEG

FF_1SEG = 67108864

FF_1STK

FF_1STK = 184549376

FF_1STRO

FF_1STRO = 167772160

FF_1VOID

FF_1VOID = 0

FF_ALIGN

FF_ALIGN = -1342177280

FF_ANYNAME

FF_ANYNAME = 49152

FF_BNOT

FF_BNOT = 262144

FF_BYTE

FF_BYTE = 0

FF_CODE

FF_CODE = 1536

FF_COMM

FF_COMM = 2048

FF_CUSTOM

FF_CUSTOM = -805306368

FF_DATA

FF_DATA = 1024

FF_DOUBLE

FF_DOUBLE = -1879048192

FF_DWORD

FF_DWORD = 536870912

FF_FLOAT

FF_FLOAT = -2147483648

FF_FLOW

FF_FLOW = 65536

FF_FUNC

FF_FUNC = 268435456

FF_IMMD

FF_IMMD = 1073741824

FF_IVL

FF_IVL = 256

FF_JUMP

FF_JUMP = -2147483648

FF_LABL

FF_LABL = 32768

FF_LINE

FF_LINE = 8192

FF_NAME

FF_NAME = 16384

FF_N_CHAR

FF_N_CHAR = 3

FF_N_CUST

FF_N_CUST = 13

FF_N_ENUM

FF_N_ENUM = 8

FF_N_FLT

FF_N_FLT = 12

FF_N_FOP

FF_N_FOP = 9

FF_N_NUMB

FF_N_NUMB = 6

FF_N_NUMD

FF_N_NUMD = 2

FF_N_NUMH

FF_N_NUMH = 1

FF_N_NUMO

FF_N_NUMO = 7

FF_N_OFF

FF_N_OFF = 5

FF_N_SEG

FF_N_SEG = 4

FF_N_STK

FF_N_STK = 11

FF_N_STRO

FF_N_STRO = 10

FF_N_VOID

FF_N_VOID = 0

FF_OWORD

FF_OWORD = 1879048192

FF_PACKREAL

FF_PACKREAL = -1610612736

FF_QWORD

FF_QWORD = 805306368

FF_REF

FF_REF = 4096

FF_SIGN

FF_SIGN = 131072

FF_STRLIT

FF_STRLIT = 1342177280

FF_STRUCT

FF_STRUCT = 1610612736

FF_TAIL

FF_TAIL = 512

FF_TBYTE

FF_TBYTE = 1073741824

FF_UNK

FF_UNK = 0

FF_UNUSED

FF_UNUSED = 524288

FF_WORD

FF_WORD = 268435456

FF_YWORD

FF_YWORD = -536870912

FF_ZWORD

FF_ZWORD = -268435456

GFE_IDB_VALUE

GFE_IDB_VALUE = 2

GFE_VALUE

GFE_VALUE = 1

GMB_READALL

GMB_READALL = 1

GMB_WAITBOX

GMB_WAITBOX = 2

ITEM_END_CANCEL

ITEM_END_CANCEL = 16

ITEM_END_FIXUP

ITEM_END_FIXUP = 1

ITEM_END_INITED

ITEM_END_INITED = 2

ITEM_END_NAME

ITEM_END_NAME = 4

ITEM_END_XREF

ITEM_END_XREF = 8

MS_0TYPE

MS_0TYPE = 15728640

MS_1TYPE

MS_1TYPE = 251658240

MS_CLS

MS_CLS = 1536

MS_CODE

MS_CODE = -268435456

MS_COMM

MS_COMM = 1046528

MS_N_TYPE

MS_N_TYPE = 15

MS_VAL

MS_VAL = 255

OPND_ALL

OPND_ALL = 15

OPND_MASK

OPND_MASK = 15

OPND_OUTER

OPND_OUTER = 128

PBSENC_ALL

PBSENC_ALL = -1

PBSENC_DEF1BPU

PBSENC_DEF1BPU = 0

PSTF_ATTRIB

PSTF_ATTRIB = 16

PSTF_ENC

PSTF_ENC = 8

PSTF_HOTKEY

PSTF_HOTKEY = 4

PSTF_ONLY_ENC

PSTF_ONLY_ENC = 11

PSTF_TBRIEF

PSTF_TBRIEF = 1

PSTF_TINLIN

PSTF_TINLIN = 2

PSTF_TMASK

PSTF_TMASK = 3

PSTF_TNORM

PSTF_TNORM = 0

STRCONV_ESCAPE

STRCONV_ESCAPE = 1

STRCONV_INCLLEN

STRCONV_INCLLEN = 4

STRCONV_REPLCHAR

STRCONV_REPLCHAR = 2

Functions

add_byte(ea: ea_t, value: uint32) ‑> void

add_byte(ea, value) Add a value to one byte of the program. This function works for wide byte processors too.

ea: (C++: ea_t) linear address
value: (C++: uint32) byte value

add_dword(ea: ea_t, value: uint64) ‑> void

add_dword(ea, value) Add a value to one dword of the program. This function works for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be() note: this function works incorrectly if processor_t::nbits > 16

ea: (C++: ea_t) linear address
value: (C++: uint64) byte value

add_hidden_range(*args) ‑> bool

add_hidden_range(ea1, ea2, description, header, footer, color=bgcolor_t(-1)) -> bool Mark a range of addresses as hidden. The range will be created in the invisible state with the default color

ea1: (C++: ea_t) linear address of start of the address range
ea2: (C++: ea_t) linear address of end of the address range
description: (C++: const char *) ,header,footer: range parameters
header: (C++: const char *) char const *
footer: (C++: const char *) char const *
color: (C++: bgcolor_t) the range color
return: success

add_mapping(_from: ea_t, to: ea_t, size: asize_t) ‑> bool

add_mapping(_from, to, size) -> bool IDA supports memory mapping. References to the addresses from the mapped range use data and meta-data from the mapping range. note: You should set flag PR2_MAPPING in ph.flag2 to use memory mapping Add memory mapping range.

from: (C++: ea_t) start of the mapped range (nonexistent address)
to: (C++: ea_t) start of the mapping range (existent address)
size: (C++: asize_t) size of the range
return: success

add_qword(ea: ea_t, value: uint64) ‑> void

add_qword(ea, value) Add a value to one qword of the program. This function does not work for wide byte processors. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t) linear address
value: (C++: uint64) byte value

add_word(ea: ea_t, value: uint64) ‑> void

add_word(ea, value) Add a value to one word of the program. This function works for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t) linear address
value: (C++: uint64) byte value

align_flag() ‑> flags64_t

align_flag() -> flags64_t Get a flags64_t representing an alignment directive.

append_cmt(ea: ea_t, str: char const *, rptble: bool) ‑> bool

append_cmt(ea, str, rptble) -> bool Append to an indented comment. Creates a new comment if none exists. Appends a newline character and the specified string otherwise.

ea: (C++: ea_t) linear address
str: (C++: const char *) comment string to append
rptble: (C++: bool) append to repeatable comment?
return: success

attach_custom_data_format(dtid: int, dfid: int) ‑> bool

attach_custom_data_format(dtid, dfid) -> bool Attach the data format to the data type.

dtid: (C++: int) data type id that can use the data format. 0 means all standard
            data types. Such data formats can be applied to any data item or
            instruction operands. For instruction operands, the
            data_format_t::value_size check is not performed by the kernel.
dfid: (C++: int) data format id
retval true: ok
retval false: no such `dtid', or no such `dfid', or the data format has already
              been attached to the data type

bin_flag() ‑> flags64_t

bin_flag() -> flags64_t Get number flag of the base, regardless of current processor - better to use num_flag()

bin_search3(*args) ‑> ea_t

bin_search3(start_ea, end_ea, data, flags) -> ea_t

start_ea: ea_t
end_ea: ea_t
data: compiled_binpat_vec_t const &
flags: int

bin_search3(start_ea, end_ea, image, mask, len, flags) -> ea_t

start_ea: ea_t
end_ea: ea_t
image: uchar const *
mask: uchar const *
len: size_t
flags: int

byte_flag() ‑> flags64_t

byte_flag() -> flags64_t Get a flags64_t representing a byte.

bytesize(ea: ea_t) ‑> int

bytesize(ea) -> int Get number of bytes required to store a byte at the given address.

ea: (C++: ea_t)

calc_def_align(ea: ea_t, mina: int, maxa: int) ‑> int

calc_def_align(ea, mina, maxa) -> int Calculate the default alignment exponent.

ea: (C++: ea_t) linear address
mina: (C++: int) minimal possible alignment exponent.
maxa: (C++: int) minimal possible alignment exponent.

calc_dflags(f: flags64_t, force: bool) ‑> flags64_t

calc_dflags(f, force) -> flags64_t

f: flags64_t
force: bool

calc_max_align(endea: ea_t) ‑> int

calc_max_align(endea) -> int Calculate the maximal possible alignment exponent.

endea: (C++: ea_t) end address of the alignment item.
return: a value in the 0..32 range

calc_max_item_end(ea: ea_t, how: int = 15) ‑> ea_t

calc_max_item_end(ea, how=15) -> ea_t Calculate maximal reasonable end address of a new item. This function will limit the item with the current segment bounds.

ea: (C++: ea_t) linear address
how: (C++: int) when to stop the search. A combination of Item end search flags
return: end of new item. If it is not possible to create an item, it will
        return 'ea'. If operation was cancelled by user, it will return 'ea'

calc_min_align(length: asize_t) ‑> int

calc_min_align(length) -> int Calculate the minimal possible alignment exponent.

length: (C++: asize_t) size of the item in bytes.
return: a value in the 1..32 range

can_define_item(ea: ea_t, length: asize_t, flags: flags64_t) ‑> bool

can_define_item(ea, length, flags) -> bool Can define item (instruction/data) of the specified 'length', starting at 'ea'? note: if there is an item starting at 'ea', this function ignores it note: this function converts to unexplored all encountered data items with fixup information. Should be fixed in the future.

ea: (C++: ea_t) start of the range for the new item
length: (C++: asize_t) length of the new item in bytes
flags: (C++: flags64_t) if not 0, then the kernel will ignore the data types specified by
             the flags and destroy them. For example:

1000 dw 5 1002 db 5 ; undef 1003 db 5 ; undef 1004 dw 5 1006 dd 5 can_define_item(1000, 6, 0) - false because of dw at 1004 can_define_item(1000, 6, word_flag()) - true, word at 1004 is destroyed return: 1-yes, 0-no

  • a new item would cross segment boundaries

  • a new item would overlap with existing items (except items specified by 'flags')

change_storage_type(start_ea: ea_t, end_ea: ea_t, stt: storage_type_t) ‑> error_t

change_storage_type(start_ea, end_ea, stt) -> error_t Change flag storage type for address range.

start_ea: (C++: ea_t) should be lower than end_ea.
end_ea: (C++: ea_t) does not belong to the range.
stt: (C++: storage_type_t)
return: error code

char_flag() ‑> flags64_t

char_flag() -> flags64_t see FF_opbits

chunk_size(ea: ea_t) ‑> asize_t

chunk_size(ea) -> asize_t Get size of the contiguous address block containing 'ea'.

ea: (C++: ea_t)
return: 0 if 'ea' doesn't belong to the program.

chunk_start(ea: ea_t) ‑> ea_t

chunk_start(ea) -> ea_t Get start of the contiguous address block containing 'ea'.

ea: (C++: ea_t)
return: BADADDR if 'ea' doesn't belong to the program.

clr_lzero(ea: ea_t, n: int) ‑> bool

clr_lzero(ea, n) -> bool Clear toggle lzero bit. This function reset the display of leading zeroes for the specified operand to the default. If the default is not to display leading zeroes, leading zeroes will not be displayed, as vice versa.

ea: (C++: ea_t) the item (insn/data) address
n: (C++: int) the operand number (0-first operand, 1-other operands)
return: success

clr_op_type(ea: ea_t, n: int) ‑> bool

clr_op_type(ea, n) -> bool Remove operand representation information. (set operand representation to be 'undefined')

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
return: success

code_flag() ‑> flags64_t

code_flag() -> flags64_t FF_CODE

combine_flags(F: flags64_t) ‑> flags64_t

combine_flags(F) -> flags64_t

F: flags64_t

create_16bit_data(ea: ea_t, length: asize_t) ‑> bool

create_16bit_data(ea, length) -> bool Convert to 16-bit quantity (take the byte size into account)

ea: (C++: ea_t)
length: (C++: asize_t)

create_32bit_data(ea: ea_t, length: asize_t) ‑> bool

create_32bit_data(ea, length) -> bool Convert to 32-bit quantity (take the byte size into account)

ea: (C++: ea_t)
length: (C++: asize_t)

create_align(ea: ea_t, length: asize_t, alignment: int) ‑> bool

create_align(ea, length, alignment) -> bool Create an alignment item.

ea: (C++: ea_t) linear address
length: (C++: asize_t) size of the item in bytes. 0 means to infer from ALIGNMENT
alignment: (C++: int) alignment exponent. Example: 3 means align to 8 bytes. 0 means
                 to infer from LENGTH It is forbidden to specify both LENGTH
                 and ALIGNMENT as 0.
return: success

create_byte(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_byte(ea, length, force=False) -> bool Convert to byte.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_custdata(ea: ea_t, length: asize_t, dtid: int, fid: int, force: bool = False) ‑> bool

create_custdata(ea, length, dtid, fid, force=False) -> bool Convert to custom data type.

ea: (C++: ea_t)
length: (C++: asize_t)
dtid: (C++: int)
fid: (C++: int)
force: (C++: bool)

create_data(ea: ea_t, dataflag: flags64_t, size: asize_t, tid: tid_t) ‑> bool

create_data(ea, dataflag, size, tid) -> bool Convert to data (byte, word, dword, etc). This function may be used to create arrays.

ea: (C++: ea_t) linear address
dataflag: (C++: flags64_t) type of data. Value of function byte_flag(), word_flag(), etc.
size: (C++: asize_t) size of array in bytes. should be divisible by the size of one item
            of the specified type. for variable sized items it can be specified
            as 0, and the kernel will try to calculate the size.
tid: (C++: tid_t) type id. If the specified type is a structure, then tid is structure
           id. Otherwise should be BADNODE.
return: success

create_double(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_double(ea, length, force=False) -> bool Convert to double.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_dword(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_dword(ea, length, force=False) -> bool Convert to dword.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_float(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_float(ea, length, force=False) -> bool Convert to float.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_oword(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_oword(ea, length, force=False) -> bool Convert to octaword/xmm word.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_packed_real(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_packed_real(ea, length, force=False) -> bool Convert to packed decimal real.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_qword(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_qword(ea, length, force=False) -> bool Convert to quadword.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_strlit(start: ea_t, len: size_t, strtype: int32) ‑> bool

create_strlit(start, len, strtype) -> bool Convert to string literal and give a meaningful name. 'start' may be higher than 'end', the kernel will swap them in this case

start: (C++: ea_t) starting address
len: (C++: size_t) length of the string in bytes. if 0, then get_max_strlit_length()
           will be used to determine the length
strtype: (C++: int32) string type. one of String type codes
return: success

create_struct(ea: ea_t, length: asize_t, tid: tid_t, force: bool = False) ‑> bool

create_struct(ea, length, tid, force=False) -> bool Convert to struct.

ea: (C++: ea_t)
length: (C++: asize_t)
tid: (C++: tid_t)
force: (C++: bool)

create_tbyte(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_tbyte(ea, length, force=False) -> bool Convert to tbyte.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_word(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_word(ea, length, force=False) -> bool Convert to word.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_yword(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_yword(ea, length, force=False) -> bool Convert to ymm word.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

create_zword(ea: ea_t, length: asize_t, force: bool = False) ‑> bool

create_zword(ea, length, force=False) -> bool Convert to zmm word.

ea: (C++: ea_t)
length: (C++: asize_t)
force: (C++: bool)

cust_flag() ‑> flags64_t

cust_flag() -> flags64_t Get a flags64_t representing custom type data.

custfmt_flag() ‑> flags64_t

custfmt_flag() -> flags64_t see FF_opbits

dec_flag() ‑> flags64_t

dec_flag() -> flags64_t Get number flag of the base, regardless of current processor - better to use num_flag()

del_hidden_range(ea: ea_t) ‑> bool

del_hidden_range(ea) -> bool Delete hidden range.

ea: (C++: ea_t) any address in the hidden range
return: success

del_items(ea: ea_t, flags: int = 0, nbytes: asize_t = 1, may_destroy: may_destroy_cb_t * = None) ‑> bool

del_items(ea, flags=0, nbytes=1, may_destroy=None) -> bool Convert item (instruction/data) to unexplored bytes. The whole item (including the head and tail bytes) will be destroyed. It is allowed to pass any address in the item to this function

ea: (C++: ea_t) any address within the first item to delete
flags: (C++: int) combination of Unexplored byte conversion flags
nbytes: (C++: asize_t) number of bytes in the range to be undefined
may_destroy: (C++: may_destroy_cb_t *) optional routine invoked before deleting a head item. If
                   callback returns false then item is not to be deleted and
                   operation fails
return: true on sucessful operation, otherwise false

del_mapping(ea: ea_t) ‑> void

del_mapping(ea) Delete memory mapping range.

ea: (C++: ea_t) any address in the mapped range

del_value(ea: ea_t) ‑> void

del_value(ea) Delete byte value from flags. The corresponding byte becomes uninitialized.

ea: (C++: ea_t)

detach_custom_data_format(dtid: int, dfid: int) ‑> bool

detach_custom_data_format(dtid, dfid) -> bool Detach the data format from the data type. Unregistering a custom data type detaches all attached data formats, no need to detach them explicitly. You still need unregister them. Unregistering a custom data format detaches it from all attached data types.

dtid: (C++: int) data type id to detach data format from
dfid: (C++: int) data format id to detach
retval true: ok
retval false: no such `dtid', or no such `dfid', or the data format was not
              attached to the data type

disable_flags(start_ea: ea_t, end_ea: ea_t) ‑> error_t

disable_flags(start_ea, end_ea) -> error_t Deallocate flags for address range. Exit with an error message if not enough disk space (this may occur too).

start_ea: (C++: ea_t) should be lower than end_ea.
end_ea: (C++: ea_t) does not belong to the range.
return: 0 if ok, otherwise return error code

double_flag() ‑> flags64_t

double_flag() -> flags64_t Get a flags64_t representing a double.

dword_flag() ‑> flags64_t

dword_flag() -> flags64_t Get a flags64_t representing a double word.

enable_flags(start_ea: ea_t, end_ea: ea_t, stt: storage_type_t) ‑> error_t

enable_flags(start_ea, end_ea, stt) -> error_t Allocate flags for address range. This function does not change the storage type of existing ranges. Exit with an error message if not enough disk space.

start_ea: (C++: ea_t) should be lower than end_ea.
end_ea: (C++: ea_t) does not belong to the range.
stt: (C++: storage_type_t)
return: 0 if ok, otherwise an error code

enum_flag() ‑> flags64_t

enum_flag() -> flags64_t see FF_opbits

equal_bytes(ea: ea_t, image: uchar const *, mask: uchar const *, len: size_t, bin_search_flags: int) ‑> bool

equal_bytes(ea, image, mask, len, bin_search_flags) -> bool Compare 'len' bytes of the program starting from 'ea' with 'image'.

ea: (C++: ea_t) linear address
image: (C++: const uchar *) bytes to compare with
mask: (C++: const uchar *) array of mask bytes, it's length is 'len'. if the flag
            BIN_SEARCH_BITMASK is passsed, 'bitwise AND' is used to compare. if
            not; 1 means to perform the comparison of the corresponding byte. 0
            means not to perform. if mask == nullptr, then all bytes of 'image'
            will be compared. if mask == SKIP_FF_MASK then 0xFF bytes will be
            skipped
len: (C++: size_t) length of block to compare in bytes.
bin_search_flags: (C++: int) combination of Search flags
retval 1: equal
retval 0: not equal

f_has_cmt(f: flags64_t, arg2: void *) ‑> bool

f_has_cmt(f, arg2) -> bool

f: flags64_t
arg2: void *

f_has_dummy_name(f: flags64_t, arg2: void *) ‑> bool

f_has_dummy_name(f, arg2) -> bool Does the current byte have dummy (auto-generated, with special prefix) name?

f: (C++: flags64_t)
arg2: void *

f_has_extra_cmts(f: flags64_t, arg2: void *) ‑> bool

f_has_extra_cmts(f, arg2) -> bool

f: flags64_t
arg2: void *

f_has_name(f: flags64_t, arg2: void *) ‑> bool

f_has_name(f, arg2) -> bool Does the current byte have non-trivial (non-dummy) name?

f: (C++: flags64_t)
arg2: void *

f_has_user_name(F: flags64_t, arg2: void *) ‑> bool

f_has_user_name(F, arg2) -> bool Does the current byte have user-specified name?

F: (C++: flags64_t)
arg2: void *

f_has_xref(f: flags64_t, arg2: void *) ‑> bool

f_has_xref(f, arg2) -> bool Does the current byte have cross-references to it?

f: (C++: flags64_t)
arg2: void *

f_is_align(F: flags64_t, arg2: void *) ‑> bool

f_is_align(F, arg2) -> bool See is_align()

F: (C++: flags64_t)
arg2: void *

f_is_byte(F: flags64_t, arg2: void *) ‑> bool

f_is_byte(F, arg2) -> bool See is_byte()

F: (C++: flags64_t)
arg2: void *

f_is_code(F: flags64_t, arg2: void *) ‑> bool

f_is_code(F, arg2) -> bool Does flag denote start of an instruction?

F: (C++: flags64_t)
arg2: void *

f_is_custom(F: flags64_t, arg2: void *) ‑> bool

f_is_custom(F, arg2) -> bool See is_custom()

F: (C++: flags64_t)
arg2: void *

f_is_data(F: flags64_t, arg2: void *) ‑> bool

f_is_data(F, arg2) -> bool Does flag denote start of data?

F: (C++: flags64_t)
arg2: void *

f_is_double(F: flags64_t, arg2: void *) ‑> bool

f_is_double(F, arg2) -> bool See is_double()

F: (C++: flags64_t)
arg2: void *

f_is_dword(F: flags64_t, arg2: void *) ‑> bool

f_is_dword(F, arg2) -> bool See is_dword()

F: (C++: flags64_t)
arg2: void *

f_is_float(F: flags64_t, arg2: void *) ‑> bool

f_is_float(F, arg2) -> bool See is_float()

F: (C++: flags64_t)
arg2: void *

f_is_head(F: flags64_t, arg2: void *) ‑> bool

f_is_head(F, arg2) -> bool Does flag denote start of instruction OR data?

F: (C++: flags64_t)
arg2: void *

f_is_not_tail(F: flags64_t, arg2: void *) ‑> bool

f_is_not_tail(F, arg2) -> bool Does flag denote tail byte?

F: (C++: flags64_t)
arg2: void *

f_is_oword(F: flags64_t, arg2: void *) ‑> bool

f_is_oword(F, arg2) -> bool See is_oword()

F: (C++: flags64_t)
arg2: void *

f_is_pack_real(F: flags64_t, arg2: void *) ‑> bool

f_is_pack_real(F, arg2) -> bool See is_pack_real()

F: (C++: flags64_t)
arg2: void *

f_is_qword(F: flags64_t, arg2: void *) ‑> bool

f_is_qword(F, arg2) -> bool See is_qword()

F: (C++: flags64_t)
arg2: void *

f_is_strlit(F: flags64_t, arg2: void *) ‑> bool

f_is_strlit(F, arg2) -> bool See is_strlit()

F: (C++: flags64_t)
arg2: void *

f_is_struct(F: flags64_t, arg2: void *) ‑> bool

f_is_struct(F, arg2) -> bool See is_struct()

F: (C++: flags64_t)
arg2: void *

f_is_tail(F: flags64_t, arg2: void *) ‑> bool

f_is_tail(F, arg2) -> bool Does flag denote tail byte?

F: (C++: flags64_t)
arg2: void *

f_is_tbyte(F: flags64_t, arg2: void *) ‑> bool

f_is_tbyte(F, arg2) -> bool See is_tbyte()

F: (C++: flags64_t)
arg2: void *

f_is_word(F: flags64_t, arg2: void *) ‑> bool

f_is_word(F, arg2) -> bool See is_word()

F: (C++: flags64_t)
arg2: void *

f_is_yword(F: flags64_t, arg2: void *) ‑> bool

f_is_yword(F, arg2) -> bool See is_yword()

F: (C++: flags64_t)
arg2: void *

find_byte(sEA: ea_t, size: asize_t, value: uchar, bin_search_flags: int) ‑> ea_t

find_byte(sEA, size, value, bin_search_flags) -> ea_t Find forward a byte with the specified value (only 8-bit value from the database). example: ea=4 size=3 will inspect addresses 4, 5, and 6

sEA: (C++: ea_t) linear address
size: (C++: asize_t) number of bytes to inspect
value: (C++: uchar) value to find
bin_search_flags: (C++: int) combination of Search flags
return: address of byte or BADADDR

find_byter(sEA: ea_t, size: asize_t, value: uchar, bin_search_flags: int) ‑> ea_t

find_byter(sEA, size, value, bin_search_flags) -> ea_t Find reverse a byte with the specified value (only 8-bit value from the database). example: ea=4 size=3 will inspect addresses 6, 5, and 4

sEA: (C++: ea_t) the lower address of the search range
size: (C++: asize_t) number of bytes to inspect
value: (C++: uchar) value to find
bin_search_flags: (C++: int) combination of Search flags
return: address of byte or BADADDR

find_bytes(bs: Union[bytes, bytearray, str], range_start: int, range_size: Optional[int] = None, range_end: Optional[int] = 18446744073709551615, mask: Union[bytes, bytearray, NoneType] = None, flags: Optional[int] = 8, radix: Optional[int] = 16, strlit_encoding: Union[int, str, NoneType] = 0) ‑> int

find_custom_data_format(name: char const *) ‑> int

find_custom_data_format(name) -> int Get id of a custom data format.

name: (C++: const char *) name of the custom data format
return: id or -1

find_custom_data_type(name: char const *) ‑> int

find_custom_data_type(name) -> int Get id of a custom data type.

name: (C++: const char *) name of the custom data type
return: id or -1

find_free_chunk(start: ea_t, size: asize_t, alignment: asize_t) ‑> ea_t

find_free_chunk(start, size, alignment) -> ea_t Search for a hole in the addressing space of the program.

start: (C++: ea_t) Address to start searching from
size: (C++: asize_t) Size of the desired empty range
alignment: (C++: asize_t) Alignment bitmask, must be a pow2-1. (for example, 0xF would
                 align the returned range to 16 bytes).
return: Start of the found empty range or BADADDR

find_string(_str: str, range_start: int, range_end: Optional[int] = 18446744073709551615, range_size: Optional[int] = None, strlit_encoding: Union[int, str, NoneType] = 0, flags: Optional[int] = 8) ‑> int

float_flag() ‑> flags64_t

float_flag() -> flags64_t Get a flags64_t representing a float.

flt_flag() ‑> flags64_t

flt_flag() -> flags64_t see FF_opbits

get_16bit(ea: ea_t) ‑> uint32

get_16bit(ea) -> uint32 Get 16bits of the program at 'ea'.

ea: (C++: ea_t)
return: 1 byte (getFullByte()) if the current processor has 16-bit byte,
        otherwise return get_word()

get_32bit(ea: ea_t) ‑> uint32

get_32bit(ea) -> uint32 Get not more than 32bits of the program at 'ea'.

ea: (C++: ea_t)
return: 32 bit value, depending on processor_t::nbits:
  • if ( nbits <= 8 ) return get_dword(ea);

  • if ( nbits <= 16) return get_wide_word(ea);

  • return get_wide_byte(ea);

get_64bit(ea: ea_t) ‑> uint64

get_64bit(ea) -> uint64 Get not more than 64bits of the program at 'ea'.

ea: (C++: ea_t)
return: 64 bit value, depending on processor_t::nbits:
  • if ( nbits <= 8 ) return get_qword(ea);

  • if ( nbits <= 16) return get_wide_dword(ea);

  • return get_wide_byte(ea);

get_byte(ea: ea_t) ‑> uchar

get_byte(ea) -> uchar Get one byte (8-bit) of the program at 'ea'. This function works only for 8bit byte processors.

ea: (C++: ea_t)

get_bytes(ea: ea_t, size: unsigned int, gmb_flags: int = 1) ‑> PyObject *

get_bytes(ea, size, gmb_flags=0x01) -> PyObject Get the specified number of bytes of the program.

ea: program address
size: number of bytes to return
gmb_flags: int
return: the bytes (as bytes object), or None in case of failure

get_bytes_and_mask(ea: ea_t, size: unsigned int, gmb_flags: int = 1) ‑> PyObject *

get_bytes_and_mask(ea, size, gmb_flags=0x01) -> PyObject Get the specified number of bytes of the program, and a bitmask specifying what bytes are defined and what bytes are not.

ea: program address
size: number of bytes to return
gmb_flags: int
return: a tuple (bytes, mask), or None in case of failure.
        Both 'bytes' and 'mask' are 'str' instances.

get_cmt(ea: ea_t, rptble: bool) ‑> qstring *

get_cmt(ea, rptble) -> str Get an indented comment.

ea: (C++: ea_t) linear address. may point to tail byte, the function will find start
          of the item
rptble: (C++: bool) get repeatable comment?
return: size of comment or -1

get_custom_data_format(dfid: int) ‑> data_format_t const *

get_custom_data_format(dfid) -> data_format_t Get definition of a registered custom data format.

dfid: (C++: int) data format id
return: data format definition or nullptr

get_custom_data_formats(out: intvec_t *, dtid: int) ‑> int

get_custom_data_formats(out, dtid) -> int Get list of attached custom data formats for the specified data type.

out: (C++: intvec_t *) buffer for the output. may be nullptr
dtid: (C++: int) data type id
return: number of returned custom data formats. if error, returns -1

get_custom_data_type(dtid: int) ‑> data_type_t const *

get_custom_data_type(dtid) -> data_type_t Get definition of a registered custom data type.

dtid: (C++: int) data type id
return: data type definition or nullptr

get_custom_data_types(*args) ‑> int

get_custom_data_types(out, min_size=0, max_size=BADADDR) -> int Get list of registered custom data type ids.

out: (C++: intvec_t *) buffer for the output. may be nullptr
min_size: (C++: asize_t) minimum value size
max_size: (C++: asize_t) maximum value size
return: number of custom data types with the specified size limits

get_data_elsize(ea: ea_t, F: flags64_t, ti: opinfo_t = None) ‑> asize_t

get_data_elsize(ea, F, ti=None) -> asize_t Get size of data type specified in flags 'F'.

ea: (C++: ea_t) linear address of the item
F: (C++: flags64_t) flags
ti: (C++: const opinfo_t *) additional information about the data type. For example, if the
          current item is a structure instance, then ti->tid is structure id.
          Otherwise is ignored (may be nullptr). If specified as nullptr, will
          be automatically retrieved from the database
return: * byte : 1
  • word : 2

  • etc...

get_data_value(v: uval_t *, ea: ea_t, size: asize_t) ‑> bool

get_data_value(v, ea, size) -> bool Get the value at of the item at 'ea'. This function works with entities up to sizeof(ea_t) (bytes, word, etc)

v: (C++: uval_t *) pointer to the result. may be nullptr
ea: (C++: ea_t) linear address
size: (C++: asize_t) size of data to read. If 0, then the item type at 'ea' will be used
return: success

get_db_byte(ea: ea_t) ‑> uchar

get_db_byte(ea) -> uchar Get one byte (8-bit) of the program at 'ea' from the database. Works even if the debugger is active. See also get_dbg_byte() to read the process memory directly. This function works only for 8bit byte processors.

ea: (C++: ea_t)

get_default_radix() ‑> int

get_default_radix() -> int Get default base of number for the current processor.

return: 2, 8, 10, 16

get_dword(ea: ea_t) ‑> uint32

get_dword(ea) -> uint32 Get one dword (32-bit) of the program at 'ea'. This function takes into account order of bytes specified in idainfo::is_be() This function works only for 8bit byte processors.

ea: (C++: ea_t)

get_enum_id(ea: ea_t, n: int) ‑> uchar *

get_enum_id(ea, n) -> tid_t Get enum id of 'enum' operand.

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL one of the operands
return: id of enum or BADNODE

get_first_hidden_range() ‑> hidden_range_t *

get_first_hidden_range() -> hidden_range_t Get pointer to the first hidden range.

return: ptr to hidden range or nullptr

get_flags(ea: ea_t) ‑> flags64_t

get_flags(ea) -> flags64_t get flags with FF_IVL & MS_VAL. It is much slower under remote debugging because the kernel needs to read the process memory.

ea: (C++: ea_t)

get_flags_by_size(size: size_t) ‑> flags64_t

get_flags_by_size(size) -> flags64_t Get flags from size (in bytes). Supported sizes: 1, 2, 4, 8, 16, 32. For other sizes returns 0

size: (C++: size_t)

get_flags_ex(ea: ea_t, how: int) ‑> flags64_t

get_flags_ex(ea, how) -> flags64_t Get flags for the specified address, extended form.

ea: (C++: ea_t)
how: (C++: int)

get_forced_operand(ea: ea_t, n: int) ‑> qstring *

get_forced_operand(ea, n) -> str Get forced operand.

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number
return: size of forced operand or -1

get_full_data_elsize(ea: ea_t, F: flags64_t, ti: opinfo_t = None) ‑> asize_t

get_full_data_elsize(ea, F, ti=None) -> asize_t Get full size of data type specified in flags 'F'. takes into account processors with wide bytes e.g. returns 2 for a byte element with 16-bit bytes

ea: (C++: ea_t)
F: (C++: flags64_t)
ti: (C++: const opinfo_t *) opinfo_t const *

get_full_flags(ea: ea_t) ‑> flags64_t

get_full_flags(ea) -> flags64_t Get flags value for address 'ea'.

ea: (C++: ea_t)
return: 0 if address is not present in the program

get_hidden_range(ea: ea_t) ‑> hidden_range_t *

get_hidden_range(ea) -> hidden_range_t Get pointer to hidden range structure, in: linear address.

ea: (C++: ea_t) any address in the hidden range

get_hidden_range_num(ea: ea_t) ‑> int

get_hidden_range_num(ea) -> int Get number of a hidden range.

ea: (C++: ea_t) any address in the hidden range
return: number of hidden range (0..get_hidden_range_qty()-1)

get_hidden_range_qty() ‑> int

get_hidden_range_qty() -> int Get number of hidden ranges.

get_item_end(ea: ea_t) ‑> ea_t

get_item_end(ea) -> ea_t Get the end address of the item at 'ea'. The returned address doesn't belong to the current item. Unexplored bytes are counted as 1 byte entities.

ea: (C++: ea_t)

get_item_flag(_from: ea_t, n: int, ea: ea_t, appzero: bool) ‑> flags64_t

get_item_flag(_from, n, ea, appzero) -> flags64_t Get flag of the item at 'ea' even if it is a tail byte of some array or structure. This function is used to get flags of structure members or array elements.

from: (C++: ea_t) linear address of the instruction which refers to 'ea'
n: (C++: int) operand number which refers to 'ea' or OPND_ALL for one of the
         operands
ea: (C++: ea_t) the referenced address
appzero: (C++: bool) append a struct field name if the field offset is zero?
               meaningful only if the name refers to a structure.
return: flags or 0 (if failed)

get_item_head(ea: ea_t) ‑> ea_t

get_item_head(ea) -> ea_t Get the start address of the item at 'ea'. If there is no current item, then 'ea' will be returned (see definition at the end of bytes.hpp source)

ea: (C++: ea_t)

get_item_refinfo(ri: refinfo_t, ea: ea_t, n: int) ‑> bool

get_item_refinfo(ri, ea, n) -> bool Get refinfo of the item at 'ea'. This function works for a regular offset operand as well as for a tail byte of a structure variable (in this case refinfo to corresponding structure member will be returned)

ri: (C++: refinfo_t *) refinfo holder
ea: (C++: ea_t) the item address
n: (C++: int) operand number which refers to 'ea' or OPND_ALL for one of the
         operands
return: success

get_item_size(ea: ea_t) ‑> asize_t

get_item_size(ea) -> asize_t Get size of item (instruction/data) in bytes. Unexplored bytes have length of 1 byte. This function returns 0 only for BADADDR.

ea: (C++: ea_t)

get_last_hidden_range() ‑> hidden_range_t *

get_last_hidden_range() -> hidden_range_t Get pointer to the last hidden range.

return: ptr to hidden range or nullptr

get_manual_insn(ea: ea_t) ‑> qstring *

get_manual_insn(ea) -> str Retrieve the user-specified string for the manual instruction.

ea: (C++: ea_t) linear address of the instruction or data item
return: size of manual instruction or -1

get_mapping(n: size_t) ‑> ea_t *, ea_t *, asize_t *

get_mapping(n) -> bool Get memory mapping range by its number.

n: (C++: size_t) number of mapping range (0..get_mappings_qty()-1)
return: false if the specified range doesn't exist, otherwise returns `from',
        `to', `size'

get_mappings_qty() ‑> size_t

get_mappings_qty() -> size_t Get number of mappings.

get_max_strlit_length(ea: ea_t, strtype: int32, options: int = 0) ‑> size_t

get_max_strlit_length(ea, strtype, options=0) -> size_t Determine maximum length of string literal.

If the string literal has a length prefix (e.g., STRTYPE_LEN2 has a two-byte length prefix), the length of that prefix (i.e., 2) will be part of the returned value.

ea: (C++: ea_t) starting address
strtype: (C++: int32) string type. one of String type codes
options: (C++: int) combination of string literal length options
return: length of the string in octets (octet==8bit)

get_next_hidden_range(ea: ea_t) ‑> hidden_range_t *

get_next_hidden_range(ea) -> hidden_range_t Get pointer to next hidden range.

ea: (C++: ea_t) any address in the program
return: ptr to hidden range or nullptr if next hidden range doesn't exist

get_octet(ogen: octet_generator_t) ‑> uchar *

get_octet(ogen) -> bool

ogen: octet_generator_t *

get_operand_flag(typebits: uint8, n: int) ‑> flags64_t

get_operand_flag(typebits, n) -> flags64_t Place operand n's type flag in the right nibble of a 64-bit flags set.

typebits: (C++: uint8) the type bits (one of `FF_N_`)
n: (C++: int) the operand number
return: the shift to the nibble

get_operand_type_shift(n: uint32) ‑> int

get_operand_type_shift(n) -> int Get the shift in flags64_t for the nibble representing operand n's type

Note: n must be < UA_MAXOP, and is not checked

n: (C++: uint32) the operand number
return: the shift to the nibble

get_opinfo(buf: opinfo_t, ea: ea_t, n: int, flags: flags64_t) ‑> opinfo_t *

get_opinfo(buf, ea, n, flags) -> opinfo_t Get additional information about an operand representation.

buf: (C++: opinfo_t *) buffer to receive the result. may not be nullptr
ea: (C++: ea_t) linear address of item
n: (C++: int) number of operand, 0 or 1
flags: (C++: flags64_t) flags of the item
return: nullptr if no additional representation information

get_optype_flags0(F: flags64_t) ‑> flags64_t

get_optype_flags0(F) -> flags64_t Get flags for first operand.

F: (C++: flags64_t)

get_optype_flags1(F: flags64_t) ‑> flags64_t

get_optype_flags1(F) -> flags64_t Get flags for second operand.

F: (C++: flags64_t)

get_original_byte(ea: ea_t) ‑> uint64

get_original_byte(ea) -> uint64 Get original byte value (that was before patching). This function works for wide byte processors too.

ea: (C++: ea_t)

get_original_dword(ea: ea_t) ‑> uint64

get_original_dword(ea) -> uint64 Get original dword (that was before patching) This function works for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t)

get_original_qword(ea: ea_t) ‑> uint64

get_original_qword(ea) -> uint64 Get original qword value (that was before patching) This function DOESN'T work for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t)

get_original_word(ea: ea_t) ‑> uint64

get_original_word(ea) -> uint64 Get original word value (that was before patching). This function works for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t)

get_possible_item_varsize(ea: ea_t, tif: tinfo_t) ‑> asize_t

get_possible_item_varsize(ea, tif) -> asize_t Return the possible size of the item at EA of type TIF if TIF is the variable structure.

ea: (C++: ea_t) the linear address of the item
tif: (C++: const tinfo_t &) the item type
return: the possible size
retval asize_t(-1): TIF is not a variable structure

get_predef_insn_cmt(ins: insn_t const &) ‑> qstring *

get_predef_insn_cmt(ins) -> str Get predefined comment.

ins: (C++: const insn_t &) current instruction information
return: size of comment or -1

get_prev_hidden_range(ea: ea_t) ‑> hidden_range_t *

get_prev_hidden_range(ea) -> hidden_range_t Get pointer to previous hidden range.

ea: (C++: ea_t) any address in the program
return: ptr to hidden range or nullptr if previous hidden range doesn't exist

get_qword(ea: ea_t) ‑> uint64

get_qword(ea) -> uint64 Get one qword (64-bit) of the program at 'ea'. This function takes into account order of bytes specified in idainfo::is_be() This function works only for 8bit byte processors.

ea: (C++: ea_t)

get_radix(F: flags64_t, n: int) ‑> int

get_radix(F, n) -> int Get radix of the operand, in: flags. If the operand is not a number, returns get_default_radix()

F: (C++: flags64_t) flags
n: (C++: int) number of operand (0, 1, -1)
return: 2, 8, 10, 16

get_strlit_contents(ea: ea_t, py_len: PyObject *, type: int32, flags: int = 0) ‑> PyObject *

get_strlit_contents(ea, py_len, type, flags=0) -> PyObject Get contents of string literal, as UTF-8-encoded codepoints. It works even if the string has not been created in the database yet.

Note that the returned value will be of type 'bytes'; if you want auto-conversion to unicode strings (that is: real Python strings), you should probably be using the idautils.Strings class.

ea: linear address of the string
py_len: length of the string in bytes (including terminating 0)
type: type of the string. Represents both the character encoding,
            <u>and</u> the 'type' of string at the given location.
flags: combination of STRCONV_..., to perform output conversion.
return: a bytes-filled str object.

get_stroff_path(path: tid_t *, delta: adiff_t *, ea: ea_t, n: int) ‑> int

get_stroff_path(path, delta, ea, n) -> int Get struct path of operand.

path: (C++: tid_t *) buffer for structure path (strpath). see nalt.hpp for more info.
delta: (C++: adiff_t *) struct offset delta
ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL one of the operands
return: length of strpath

get_wide_byte(ea: ea_t) ‑> uint64

get_wide_byte(ea) -> uint64 Get one wide byte of the program at 'ea'. Some processors may access more than 8bit quantity at an address. These processors have 32-bit byte organization from the IDA's point of view.

ea: (C++: ea_t)

get_wide_dword(ea: ea_t) ‑> uint64

get_wide_dword(ea) -> uint64 Get two wide words (4 'bytes') of the program at 'ea'. Some processors may access more than 8bit quantity at an address. These processors have 32-bit byte organization from the IDA's point of view. This function takes into account order of bytes specified in idainfo::is_be() note: this function works incorrectly if processor_t::nbits > 16

ea: (C++: ea_t)

get_wide_word(ea: ea_t) ‑> uint64

get_wide_word(ea) -> uint64 Get one wide word (2 'byte') of the program at 'ea'. Some processors may access more than 8bit quantity at an address. These processors have 32-bit byte organization from the IDA's point of view. This function takes into account order of bytes specified in idainfo::is_be()

ea: (C++: ea_t)

get_word(ea: ea_t) ‑> ushort

get_word(ea) -> ushort Get one word (16-bit) of the program at 'ea'. This function takes into account order of bytes specified in idainfo::is_be() This function works only for 8bit byte processors.

ea: (C++: ea_t)

get_zero_ranges(zranges: rangeset_t, range: range_t) ‑> bool

get_zero_ranges(zranges, range) -> bool Return set of ranges with zero initialized bytes. The returned set includes only big zero initialized ranges (at least >1KB). Some zero initialized byte ranges may be not included. Only zero bytes that use the sparse storage method (STT_MM) are reported.

zranges: (C++: rangeset_t *) pointer to the return value. cannot be nullptr
range: (C++: const range_t *) the range of addresses to verify. can be nullptr - means all
             ranges
return: true if the result is a non-empty set

getn_hidden_range(n: int) ‑> hidden_range_t *

getn_hidden_range(n) -> hidden_range_t Get pointer to hidden range structure, in: number of hidden range.

n: (C++: int) number of hidden range, is in range 0..get_hidden_range_qty()-1

has_any_name(F: flags64_t) ‑> bool

has_any_name(F) -> bool Does the current byte have any name?

F: (C++: flags64_t)

has_auto_name(F: flags64_t) ‑> bool

has_auto_name(F) -> bool Does the current byte have auto-generated (no special prefix) name?

F: (C++: flags64_t)

has_cmt(F: flags64_t) ‑> bool

has_cmt(F) -> bool Does the current byte have an indented comment?

F: (C++: flags64_t)

has_dummy_name(F: flags64_t) ‑> bool

has_dummy_name(F) -> bool Does the current byte have dummy (auto-generated, with special prefix) name?

F: (C++: flags64_t)

has_extra_cmts(F: flags64_t) ‑> bool

has_extra_cmts(F) -> bool Does the current byte have additional anterior or posterior lines?

F: (C++: flags64_t)

has_immd(F: flags64_t) ‑> bool

has_immd(F) -> bool Has immediate value?

F: (C++: flags64_t)

has_name(F: flags64_t) ‑> bool

has_name(F) -> bool Does the current byte have non-trivial (non-dummy) name?

F: (C++: flags64_t)

has_user_name(F: flags64_t) ‑> bool

has_user_name(F) -> bool Does the current byte have user-specified name?

F: (C++: flags64_t)

has_value(F: flags64_t) ‑> bool

has_value(F) -> bool Do flags contain byte value?

F: (C++: flags64_t)

has_xref(F: flags64_t) ‑> bool

has_xref(F) -> bool Does the current byte have cross-references to it?

F: (C++: flags64_t)

hex_flag() ‑> flags64_t

hex_flag() -> flags64_t Get number flag of the base, regardless of current processor - better to use num_flag()

is_align(F: flags64_t) ‑> bool

is_align(F) -> bool FF_ALIGN

F: (C++: flags64_t)

is_attached_custom_data_format(dtid: int, dfid: int) ‑> bool

is_attached_custom_data_format(dtid, dfid) -> bool Is the custom data format attached to the custom data type?

dtid: (C++: int) data type id
dfid: (C++: int) data format id
return: true or false

is_bnot(ea: ea_t, F: flags64_t, n: int) ‑> bool

is_bnot(ea, F, n) -> bool Should we negate the operand?. asm_t::a_bnot should be defined in the idp module in order to work with this function

ea: (C++: ea_t)
F: (C++: flags64_t)
n: (C++: int)

is_byte(F: flags64_t) ‑> bool

is_byte(F) -> bool FF_BYTE

F: (C++: flags64_t)

is_char(F: flags64_t, n: int) ‑> bool

is_char(F, n) -> bool is character constant?

F: (C++: flags64_t)
n: (C++: int)

is_char0(F: flags64_t) ‑> bool

is_char0(F) -> bool Is the first operand character constant? (example: push 'a')

F: (C++: flags64_t)

is_char1(F: flags64_t) ‑> bool

is_char1(F) -> bool Is the second operand character constant? (example: mov al, 'a')

F: (C++: flags64_t)

is_code(F: flags64_t) ‑> bool

is_code(F) -> bool Does flag denote start of an instruction?

F: (C++: flags64_t)

is_custfmt(F: flags64_t, n: int) ‑> bool

is_custfmt(F, n) -> bool is custom data format?

F: (C++: flags64_t)
n: (C++: int)

is_custfmt0(F: flags64_t) ‑> bool

is_custfmt0(F) -> bool Does the first operand use a custom data representation?

F: (C++: flags64_t)

is_custfmt1(F: flags64_t) ‑> bool

is_custfmt1(F) -> bool Does the second operand use a custom data representation?

F: (C++: flags64_t)

is_custom(F: flags64_t) ‑> bool

is_custom(F) -> bool FF_CUSTOM

F: (C++: flags64_t)

is_data(F: flags64_t) ‑> bool

is_data(F) -> bool Does flag denote start of data?

F: (C++: flags64_t)

is_defarg(F: flags64_t, n: int) ‑> bool

is_defarg(F, n) -> bool is defined?

F: (C++: flags64_t)
n: (C++: int)

is_defarg0(F: flags64_t) ‑> bool

is_defarg0(F) -> bool Is the first operand defined? Initially operand has no defined representation.

F: (C++: flags64_t)

is_defarg1(F: flags64_t) ‑> bool

is_defarg1(F) -> bool Is the second operand defined? Initially operand has no defined representation.

F: (C++: flags64_t)

is_double(F: flags64_t) ‑> bool

is_double(F) -> bool FF_DOUBLE

F: (C++: flags64_t)

is_dword(F: flags64_t) ‑> bool

is_dword(F) -> bool FF_DWORD

F: (C++: flags64_t)

is_enum(F: flags64_t, n: int) ‑> bool

is_enum(F, n) -> bool is enum?

F: (C++: flags64_t)
n: (C++: int)

is_enum0(F: flags64_t) ‑> bool

is_enum0(F) -> bool Is the first operand a symbolic constant (enum member)?

F: (C++: flags64_t)

is_enum1(F: flags64_t) ‑> bool

is_enum1(F) -> bool Is the second operand a symbolic constant (enum member)?

F: (C++: flags64_t)

is_flag_for_operand(F: flags64_t, typebits: uint8, n: int) ‑> bool

is_flag_for_operand(F, typebits, n) -> bool Check that the 64-bit flags set has the expected type for operand n.

F: (C++: flags64_t) the flags
typebits: (C++: uint8) the type bits (one of `FF_N_`)
n: (C++: int) the operand number
return: success

is_float(F: flags64_t) ‑> bool

is_float(F) -> bool FF_FLOAT

F: (C++: flags64_t)

is_float0(F: flags64_t) ‑> bool

is_float0(F) -> bool Is the first operand a floating point number?

F: (C++: flags64_t)

is_float1(F: flags64_t) ‑> bool

is_float1(F) -> bool Is the second operand a floating point number?

F: (C++: flags64_t)

is_flow(F: flags64_t) ‑> bool

is_flow(F) -> bool Does the previous instruction exist and pass execution flow to the current byte?

F: (C++: flags64_t)

is_fltnum(F: flags64_t, n: int) ‑> bool

is_fltnum(F, n) -> bool is floating point number?

F: (C++: flags64_t)
n: (C++: int)

is_forced_operand(ea: ea_t, n: int) ‑> bool

is_forced_operand(ea, n) -> bool Is operand manually defined?.

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number

is_func(F: flags64_t) ‑> bool

is_func(F) -> bool Is function start?

F: (C++: flags64_t)

is_head(F: flags64_t) ‑> bool

is_head(F) -> bool Does flag denote start of instruction OR data?

F: (C++: flags64_t)

is_invsign(ea: ea_t, F: flags64_t, n: int) ‑> bool

is_invsign(ea, F, n) -> bool Should sign of n-th operand inverted during output?. allowed values of n: 0-first operand, 1-other operands

ea: (C++: ea_t)
F: (C++: flags64_t)
n: (C++: int)

is_loaded(ea: ea_t) ‑> bool

is_loaded(ea) -> bool Does the specified address have a byte value (is initialized?)

ea: (C++: ea_t)

is_lzero(ea: ea_t, n: int) ‑> bool

is_lzero(ea, n) -> bool Display leading zeroes? Display leading zeroes in operands. The global switch for the leading zeroes is in idainfo::s_genflags Note: the leading zeroes doesn't work if for the target assembler octal numbers start with 0.

ea: (C++: ea_t) the item (insn/data) address
n: (C++: int) the operand number (0-first operand, 1-other operands)
return: success

is_manual(F: flags64_t, n: int) ‑> bool

is_manual(F, n) -> bool is forced operand? (use is_forced_operand())

F: (C++: flags64_t)
n: (C++: int)

is_manual_insn(ea: ea_t) ‑> bool

is_manual_insn(ea) -> bool Is the instruction overridden?

ea: (C++: ea_t) linear address of the instruction or data item

is_mapped(ea: ea_t) ‑> bool

is_mapped(ea) -> bool Is the specified address 'ea' present in the program?

ea: (C++: ea_t)

is_not_tail(F: flags64_t) ‑> bool

is_not_tail(F) -> bool Does flag denote tail byte?

F: (C++: flags64_t)

is_numop(F: flags64_t, n: int) ‑> bool

is_numop(F, n) -> bool is number (bin, oct, dec, hex)?

F: (C++: flags64_t)
n: (C++: int)

is_numop0(F: flags64_t) ‑> bool

is_numop0(F) -> bool Is the first operand a number (i.e. binary, octal, decimal or hex?)

F: (C++: flags64_t)

is_numop1(F: flags64_t) ‑> bool

is_numop1(F) -> bool Is the second operand a number (i.e. binary, octal, decimal or hex?)

F: (C++: flags64_t)

is_off(F: flags64_t, n: int) ‑> bool

is_off(F, n) -> bool is offset?

F: (C++: flags64_t)
n: (C++: int)

is_off0(F: flags64_t) ‑> bool

is_off0(F) -> bool Is the first operand offset? (example: push offset xxx)

F: (C++: flags64_t)

is_off1(F: flags64_t) ‑> bool

is_off1(F) -> bool Is the second operand offset? (example: mov ax, offset xxx)

F: (C++: flags64_t)

is_oword(F: flags64_t) ‑> bool

is_oword(F) -> bool FF_OWORD

F: (C++: flags64_t)

is_pack_real(F: flags64_t) ‑> bool

is_pack_real(F) -> bool FF_PACKREAL

F: (C++: flags64_t)

is_qword(F: flags64_t) ‑> bool

is_qword(F) -> bool FF_QWORD

F: (C++: flags64_t)

is_same_data_type(F1: flags64_t, F2: flags64_t) ‑> bool

is_same_data_type(F1, F2) -> bool Do the given flags specify the same data type?

F1: (C++: flags64_t)
F2: (C++: flags64_t)

is_seg(F: flags64_t, n: int) ‑> bool

is_seg(F, n) -> bool is segment?

F: (C++: flags64_t)
n: (C++: int)

is_seg0(F: flags64_t) ‑> bool

is_seg0(F) -> bool Is the first operand segment selector? (example: push seg seg001)

F: (C++: flags64_t)

is_seg1(F: flags64_t) ‑> bool

is_seg1(F) -> bool Is the second operand segment selector? (example: mov dx, seg dseg)

F: (C++: flags64_t)

is_stkvar(F: flags64_t, n: int) ‑> bool

is_stkvar(F, n) -> bool is stack variable?

F: (C++: flags64_t)
n: (C++: int)

is_stkvar0(F: flags64_t) ‑> bool

is_stkvar0(F) -> bool Is the first operand a stack variable?

F: (C++: flags64_t)

is_stkvar1(F: flags64_t) ‑> bool

is_stkvar1(F) -> bool Is the second operand a stack variable?

F: (C++: flags64_t)

is_strlit(F: flags64_t) ‑> bool

is_strlit(F) -> bool FF_STRLIT

F: (C++: flags64_t)

is_stroff(F: flags64_t, n: int) ‑> bool

is_stroff(F, n) -> bool is struct offset?

F: (C++: flags64_t)
n: (C++: int)

is_stroff0(F: flags64_t) ‑> bool

is_stroff0(F) -> bool Is the first operand an offset within a struct?

F: (C++: flags64_t)

is_stroff1(F: flags64_t) ‑> bool

is_stroff1(F) -> bool Is the second operand an offset within a struct?

F: (C++: flags64_t)

is_struct(F: flags64_t) ‑> bool

is_struct(F) -> bool FF_STRUCT

F: (C++: flags64_t)

is_suspop(ea: ea_t, F: flags64_t, n: int) ‑> bool

is_suspop(ea, F, n) -> bool is suspicious operand?

ea: (C++: ea_t)
F: (C++: flags64_t)
n: (C++: int)

is_tail(F: flags64_t) ‑> bool

is_tail(F) -> bool Does flag denote tail byte?

F: (C++: flags64_t)

is_tbyte(F: flags64_t) ‑> bool

is_tbyte(F) -> bool FF_TBYTE

F: (C++: flags64_t)

is_unknown(F: flags64_t) ‑> bool

is_unknown(F) -> bool Does flag denote unexplored byte?

F: (C++: flags64_t)

is_varsize_item(ea: ea_t, F: flags64_t, ti: opinfo_t = None, itemsize: asize_t * = None) ‑> int

is_varsize_item(ea, F, ti=None, itemsize=None) -> int Is the item at 'ea' variable size?.

ea: (C++: ea_t) linear address of the item
F: (C++: flags64_t) flags
ti: (C++: const opinfo_t *) additional information about the data type. For example, if the
          current item is a structure instance, then ti->tid is structure id.
          Otherwise is ignored (may be nullptr). If specified as nullptr, will
          be automatically retrieved from the database
itemsize: (C++: asize_t *) if not nullptr and the item is varsize, itemsize will contain
                the calculated item size (for struct types, the minimal size is
                returned)
retval 1: varsize item
retval 0: fixed item
retval -1: error (bad data definition)

is_word(F: flags64_t) ‑> bool

is_word(F) -> bool FF_WORD

F: (C++: flags64_t)

is_yword(F: flags64_t) ‑> bool

is_yword(F) -> bool FF_YWORD

F: (C++: flags64_t)

is_zword(F: flags64_t) ‑> bool

is_zword(F) -> bool FF_ZWORD

F: (C++: flags64_t)

leading_zero_important(ea: ea_t, n: int) ‑> bool

leading_zero_important(ea, n) -> bool Check if leading zeroes are important.

ea: (C++: ea_t)
n: (C++: int)

nbits(ea: ea_t) ‑> int

nbits(ea) -> int Get number of bits in a byte at the given address.

ea: (C++: ea_t)
return: processor_t::dnbits() if the address doesn't belong to a segment,
        otherwise the result depends on the segment type

next_addr(ea: ea_t) ‑> ea_t

next_addr(ea) -> ea_t Get next address in the program (i.e. next address which has flags).

ea: (C++: ea_t)
return: BADADDR if no such address exist.

next_chunk(ea: ea_t) ‑> ea_t

next_chunk(ea) -> ea_t Get the first address of next contiguous chunk in the program.

ea: (C++: ea_t)
return: BADADDR if next chunk doesn't exist.

next_head(ea: ea_t, maxea: ea_t) ‑> ea_t

next_head(ea, maxea) -> ea_t Get start of next defined item.

ea: (C++: ea_t) begin search at this address
maxea: (C++: ea_t) not included in the search range
return: BADADDR if none exists.

next_inited(ea: ea_t, maxea: ea_t) ‑> ea_t

next_inited(ea, maxea) -> ea_t Find the next initialized address.

ea: (C++: ea_t)
maxea: (C++: ea_t)

next_not_tail(ea: ea_t) ‑> ea_t

next_not_tail(ea) -> ea_t Get address of next non-tail byte.

ea: (C++: ea_t)
return: BADADDR if none exists.

next_that(ea: ea_t, maxea: ea_t, testf: testf_t *) ‑> ea_t

next_that(ea, maxea, testf) -> ea_t Find next address with a flag satisfying the function 'testf'. note: do not pass is_unknown() to this function to find unexplored bytes. It will fail under the debugger. To find unexplored bytes, use next_unknown().

ea: (C++: ea_t) start searching at this address + 1
maxea: (C++: ea_t) not included in the search range.
testf: (C++: testf_t *) test function to find next address
return: the found address or BADADDR.

next_unknown(ea: ea_t, maxea: ea_t) ‑> ea_t

next_unknown(ea, maxea) -> ea_t Similar to next_that(), but will find the next address that is unexplored.

ea: (C++: ea_t)
maxea: (C++: ea_t)

next_visea(ea: ea_t) ‑> ea_t

next_visea(ea) -> ea_t Get next visible address.

ea: (C++: ea_t)
return: BADADDR if none exists.

num_flag() ‑> flags64_t

num_flag() -> flags64_t Get number of default base (bin, oct, dec, hex)

oct_flag() ‑> flags64_t

oct_flag() -> flags64_t Get number flag of the base, regardless of current processor - better to use num_flag()

off_flag() ‑> flags64_t

off_flag() -> flags64_t see FF_opbits

op_adds_xrefs(F: flags64_t, n: int) ‑> bool

op_adds_xrefs(F, n) -> bool Should processor module create xrefs from the operand?. Currently 'offset' and 'structure offset' operands create xrefs

F: (C++: flags64_t)
n: (C++: int)

op_based_stroff(insn: insn_t const &, n: int, opval: adiff_t, base: ea_t) ‑> bool

op_based_stroff(insn, n, opval, base) -> bool Set operand representation to be 'struct offset' if the operand likely points to a structure member. For example, let's there is a structure at 1000 1000 stru_1000 Elf32_Sym <...> the operand #8 will be represented as '#Elf32_Sym.st_size' after the call of 'op_based_stroff(..., 8, 0x1000)' By the way, after the call of 'op_plain_offset(..., 0x1000)' it will be represented as '#(stru_1000.st_size - 0x1000)'

insn: (C++: const insn_t &) the instruction
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
opval: (C++: adiff_t) operand value (usually op_t::value or op_t::addr)
base: (C++: ea_t) base reference
return: success

op_bin(ea: ea_t, n: int) ‑> bool

op_bin(ea, n) -> bool set op type to bin_flag()

ea: (C++: ea_t)
n: (C++: int)

op_chr(ea: ea_t, n: int) ‑> bool

op_chr(ea, n) -> bool set op type to char_flag()

ea: (C++: ea_t)
n: (C++: int)

op_custfmt(ea: ea_t, n: int, fid: int) ‑> bool

op_custfmt(ea, n, fid) -> bool Set custom data format for operand (fid-custom data format id)

ea: (C++: ea_t)
n: (C++: int)
fid: (C++: int)

op_dec(ea: ea_t, n: int) ‑> bool

op_dec(ea, n) -> bool set op type to dec_flag()

ea: (C++: ea_t)
n: (C++: int)

op_enum(ea: ea_t, n: int, id: tid_t, serial: uchar = 0) ‑> bool

op_enum(ea, n, id, serial=0) -> bool Set operand representation to be enum type If applied to unexplored bytes, converts them to 16/32bit word data

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
id: (C++: tid_t) id of enum
serial: (C++: uchar) the serial number of the constant in the enumeration, usually 0.
              the serial numbers are used if the enumeration contains several
              constants with the same value
return: success

op_flt(ea: ea_t, n: int) ‑> bool

op_flt(ea, n) -> bool set op type to flt_flag()

ea: (C++: ea_t)
n: (C++: int)

op_hex(ea: ea_t, n: int) ‑> bool

op_hex(ea, n) -> bool set op type to hex_flag()

ea: (C++: ea_t)
n: (C++: int)

op_num(ea: ea_t, n: int) ‑> bool

op_num(ea, n) -> bool set op type to num_flag()

ea: (C++: ea_t)
n: (C++: int)

op_oct(ea: ea_t, n: int) ‑> bool

op_oct(ea, n) -> bool set op type to oct_flag()

ea: (C++: ea_t)
n: (C++: int)

op_seg(ea: ea_t, n: int) ‑> bool

op_seg(ea, n) -> bool Set operand representation to be 'segment'. If applied to unexplored bytes, converts them to 16/32bit word data

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
return: success

op_stkvar(ea: ea_t, n: int) ‑> bool

op_stkvar(ea, n) -> bool Set operand representation to be 'stack variable'. Should be applied to an instruction within a function. Should be applied after creating a stack var using insn_t::create_stkvar().

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
return: success

op_stroff(*args) ‑> bool

op_stroff(insn, n, path, path_len, delta) -> bool Set operand representation to be 'struct offset'.

insn: (C++: const insn_t &) the instruction
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
path: (C++: const tid_t *) structure path (strpath). see nalt.hpp for more info.
path_len: (C++: int) length of the structure path
delta: (C++: adiff_t) struct offset delta. usually 0. denotes the difference between the
             structure base and the pointer into the structure.
return: success

op_stroff(insn, n, path, delta) -> bool

insn: an ida_ua.insn_t, or an address (C++: const insn_t &)
n: int
path: qvector< tid_t > const &
delta: adiff_t

oword_flag() ‑> flags64_t

oword_flag() -> flags64_t Get a flags64_t representing a octaword.

packreal_flag() ‑> flags64_t

packreal_flag() -> flags64_t Get a flags64_t representing a packed decimal real.

parse_binpat_str(out: compiled_binpat_vec_t, ea: ea_t, _in: char const *, radix: int, strlits_encoding: int = 0) ‑> bool

parse_binpat_str(out, ea, _in, radix, strlits_encoding=0) -> bool Convert user-specified binary string to internal representation. The 'in' parameter contains space-separated tokens:

  • numbers (numeric base is determined by 'radix')

  • if value of number fits a byte, it is considered as a byte

  • if value of number fits a word, it is considered as 2 bytes

  • if value of number fits a dword,it is considered as 4 bytes

  • "..." string constants

  • 'x' single-character constants

  • ? variable bytes

Note that string constants are surrounded with double quotes.

Here are a few examples (assuming base 16): CD 21 - bytes 0xCD, 0x21 21CD - bytes 0xCD, 0x21 (little endian ) or 0x21, 0xCD (big-endian) "Hello", 0 - the null terminated string "Hello" L"Hello" - 'H', 0, 'e', 0, 'l', 0, 'l', 0, 'o', 0 B8 ? ? ? ? 90 - byte 0xB8, 4 bytes with any value, byte 0x90

out: (C++: compiled_binpat_vec_t *) a vector of compiled binary patterns, for use with bin_search()
ea: (C++: ea_t) linear address to convert for (the conversion depends on the address,
          because the number of bits in a byte depend on the segment type)
in: (C++: const char *) input text string
radix: (C++: int) numeric base of numbers (8,10,16)
strlits_encoding: (C++: int) the target encoding into which the string literals
                        present in 'in', should be encoded. Can be any from [1,
                        get_encoding_qty()), or the special values PBSENC_*
return: false either in case of parsing error, or if at least one requested
        target encoding couldn't encode the string literals present in "in".

patch_byte(ea: ea_t, x: uint64) ‑> bool

patch_byte(ea, x) -> bool Patch a byte of the program. The original value of the byte is saved and can be obtained by get_original_byte(). This function works for wide byte processors too. retval true: the database has been modified, retval false: the debugger is running and the process' memory has value 'x' at address 'ea', or the debugger is not running, and the IDB has value 'x' at address 'ea already.

ea: (C++: ea_t)
x: (C++: uint64)

patch_bytes(ea: ea_t, buf: void const *) ‑> void

patch_bytes(ea, buf) Patch the specified number of bytes of the program. Original values of bytes are saved and are available with get_original...() functions. See also put_bytes().

ea: (C++: ea_t) linear address
buf: (C++: const void *) buffer with new values of bytes

patch_dword(ea: ea_t, x: uint64) ‑> bool

patch_dword(ea, x) -> bool Patch a dword of the program. The original value of the dword is saved and can be obtained by get_original_dword(). This function DOESN'T work for wide byte processors. This function takes into account order of bytes specified in idainfo::is_be() retval true: the database has been modified, retval false: the debugger is running and the process' memory has value 'x' at address 'ea', or the debugger is not running, and the IDB has value 'x' at address 'ea already.

ea: (C++: ea_t)
x: (C++: uint64)

patch_qword(ea: ea_t, x: uint64) ‑> bool

patch_qword(ea, x) -> bool Patch a qword of the program. The original value of the qword is saved and can be obtained by get_original_qword(). This function DOESN'T work for wide byte processors. This function takes into account order of bytes specified in idainfo::is_be() retval true: the database has been modified, retval false: the debugger is running and the process' memory has value 'x' at address 'ea', or the debugger is not running, and the IDB has value 'x' at address 'ea already.

ea: (C++: ea_t)
x: (C++: uint64)

patch_word(ea: ea_t, x: uint64) ‑> bool

patch_word(ea, x) -> bool Patch a word of the program. The original value of the word is saved and can be obtained by get_original_word(). This function works for wide byte processors too. This function takes into account order of bytes specified in idainfo::is_be() retval true: the database has been modified, retval false: the debugger is running and the process' memory has value 'x' at address 'ea', or the debugger is not running, and the IDB has value 'x' at address 'ea already.

ea: (C++: ea_t)
x: (C++: uint64)

prev_addr(ea: ea_t) ‑> ea_t

prev_addr(ea) -> ea_t Get previous address in the program.

ea: (C++: ea_t)
return: BADADDR if no such address exist.

prev_chunk(ea: ea_t) ‑> ea_t

prev_chunk(ea) -> ea_t Get the last address of previous contiguous chunk in the program.

ea: (C++: ea_t)
return: BADADDR if previous chunk doesn't exist.

prev_head(ea: ea_t, minea: ea_t) ‑> ea_t

prev_head(ea, minea) -> ea_t Get start of previous defined item.

ea: (C++: ea_t) begin search at this address
minea: (C++: ea_t) included in the search range
return: BADADDR if none exists.

prev_inited(ea: ea_t, minea: ea_t) ‑> ea_t

prev_inited(ea, minea) -> ea_t Find the previous initialized address.

ea: (C++: ea_t)
minea: (C++: ea_t)

prev_not_tail(ea: ea_t) ‑> ea_t

prev_not_tail(ea) -> ea_t Get address of previous non-tail byte.

ea: (C++: ea_t)
return: BADADDR if none exists.

prev_that(ea: ea_t, minea: ea_t, testf: testf_t *) ‑> ea_t

prev_that(ea, minea, testf) -> ea_t Find previous address with a flag satisfying the function 'testf'. note: do not pass is_unknown() to this function to find unexplored bytes It will fail under the debugger. To find unexplored bytes, use prev_unknown().

ea: (C++: ea_t) start searching from this address - 1.
minea: (C++: ea_t) included in the search range.
testf: (C++: testf_t *) test function to find previous address
return: the found address or BADADDR.

prev_unknown(ea: ea_t, minea: ea_t) ‑> ea_t

prev_unknown(ea, minea) -> ea_t Similar to prev_that(), but will find the previous address that is unexplored.

ea: (C++: ea_t)
minea: (C++: ea_t)

prev_visea(ea: ea_t) ‑> ea_t

prev_visea(ea) -> ea_t Get previous visible address.

ea: (C++: ea_t)
return: BADADDR if none exists.

print_strlit_type(strtype, flags=0) -> PyObject Get string type information: the string type name (possibly decorated with hotkey markers), and the tooltip.

strtype: (C++: int32) the string type
flags: (C++: int) or'ed PSTF_* constants
return: length of generated text

put_byte(ea: ea_t, x: uint64) ‑> bool

put_byte(ea, x) -> bool Set value of one byte of the program. This function modifies the database. If the debugger is active then the debugged process memory is patched too. note: The original value of the byte is completely lost and can't be recovered by the get_original_byte() function. See also put_dbg_byte() to write to the process memory directly when the debugger is active. This function can handle wide byte processors.

ea: (C++: ea_t) linear address
x: (C++: uint64) byte value
return: true if the database has been modified

put_bytes(ea: ea_t, buf: void const *) ‑> void

put_bytes(ea, buf) Modify the specified number of bytes of the program. This function does not save the original values of bytes. See also patch_bytes().

ea: (C++: ea_t) linear address
buf: (C++: const void *) buffer with new values of bytes

put_dword(ea: ea_t, x: uint64) ‑> void

put_dword(ea, x) Set value of one dword of the program. This function takes into account order of bytes specified in idainfo::is_be() This function works for wide byte processors too.

ea: (C++: ea_t) linear address
x: (C++: uint64) dword value
note: the original value of the dword is completely lost and can't be recovered
      by the get_original_dword() function.

put_qword(ea: ea_t, x: uint64) ‑> void

put_qword(ea, x) Set value of one qword (8 bytes) of the program. This function takes into account order of bytes specified in idainfo::is_be() This function DOESN'T works for wide byte processors.

ea: (C++: ea_t) linear address
x: (C++: uint64) qword value

put_word(ea: ea_t, x: uint64) ‑> void

put_word(ea, x) Set value of one word of the program. This function takes into account order of bytes specified in idainfo::is_be() This function works for wide byte processors too. note: The original value of the word is completely lost and can't be recovered by the get_original_word() function. ea - linear address x - word value

ea: (C++: ea_t)
x: (C++: uint64)

qword_flag() ‑> flags64_t

qword_flag() -> flags64_t Get a flags64_t representing a quad word.

register_custom_data_format(py_df: PyObject *) ‑> int

register_custom_data_format(py_df) -> int Registers a custom data format with a given data type.

py_df: an instance of data_format_t
return:     < 0 if failed to register
   > 0 data format id

register_custom_data_type(py_dt: PyObject *) ‑> int

register_custom_data_type(py_dt) -> int Registers a custom data type.

py_dt: an instance of the data_type_t class
return:     < 0 if failed to register
   > 0 data type id

register_data_types_and_formats(formats)

Registers multiple data types and formats at once. To register one type/format at a time use register_custom_data_type/register_custom_data_format

It employs a special table of types and formats described below:

The 'formats' is a list of tuples. If a tuple has one element then it is the format to be registered with dtid=0 If the tuple has more than one element, then tuple[0] is the data type and tuple[1:] are the data formats. For example: many_formats = [ (pascal_data_type(), pascal_data_format()), (simplevm_data_type(), simplevm_data_format()), (makedword_data_format(),), (simplevm_data_format(),) ] The first two tuples describe data types and their associated formats. The last two tuples describe two data formats to be used with built-in data types. The data format may be attached to several data types. The id of the data format is stored in the first data_format_t object. For example: assert many_formats[1][1] != -1 assert many_formats[2][0] != -1 assert many_formats[3][0] == -1

revert_byte(ea: ea_t) ‑> bool

revert_byte(ea) -> bool Revert patched byte retval true: byte was patched before and reverted now

ea: (C++: ea_t)

seg_flag() ‑> flags64_t

seg_flag() -> flags64_t see FF_opbits

set_cmt(ea: ea_t, comm: char const *, rptble: bool) ‑> bool

set_cmt(ea, comm, rptble) -> bool Set an indented comment.

ea: (C++: ea_t) linear address
comm: (C++: const char *) comment string
  • nullptr: do nothing (return 0)

  • "" : delete comment rptble: (C++: bool) is repeatable? return: success

set_forced_operand(ea: ea_t, n: int, op: char const *) ‑> bool

set_forced_operand(ea, n, op) -> bool Set forced operand.

ea: (C++: ea_t) linear address
n: (C++: int) 0..UA_MAXOP-1 operand number
op: (C++: const char *) text of operand
  • nullptr: do nothing (return 0)

  • "" : delete forced operand return: success

set_immd(ea: ea_t) ‑> bool

set_immd(ea) -> bool Set 'has immediate operand' flag. Returns true if the FF_IMMD bit was not set and now is set

ea: (C++: ea_t)

set_lzero(ea: ea_t, n: int) ‑> bool

set_lzero(ea, n) -> bool Set toggle lzero bit. This function changes the display of leading zeroes for the specified operand. If the default is not to display leading zeroes, this function will display them and vice versa.

ea: (C++: ea_t) the item (insn/data) address
n: (C++: int) the operand number (0-first operand, 1-other operands)
return: success

set_manual_insn(ea: ea_t, manual_insn: char const *) ‑> void

set_manual_insn(ea, manual_insn) Set manual instruction string.

ea: (C++: ea_t) linear address of the instruction or data item
manual_insn: (C++: const char *) "" - delete manual string. nullptr - do nothing

set_op_type(ea: ea_t, type: flags64_t, n: int) ‑> bool

set_op_type(ea, type, n) -> bool (internal function) change representation of operand(s).

ea: (C++: ea_t) linear address
type: (C++: flags64_t) new flag value (should be obtained from char_flag(), num_flag() and
            similar functions)
n: (C++: int) 0..UA_MAXOP-1 operand number, OPND_ALL all operands
retval 1: ok
retval 0: failed (applied to a tail byte)

set_opinfo(ea: ea_t, n: int, flag: flags64_t, ti: opinfo_t, suppress_events: bool = False) ‑> bool

set_opinfo(ea, n, flag, ti, suppress_events=False) -> bool Set additional information about an operand representation. This function is a low level one. Only the kernel should use it.

ea: (C++: ea_t) linear address of the item
n: (C++: int) number of operand, 0 or 1 (see the note below)
flag: (C++: flags64_t) flags of the item
ti: (C++: const opinfo_t *) additional representation information
suppress_events: (C++: bool) do not generate changing_op_type and op_type_changed
                       events
return: success
note: for custom formats (if is_custfmt(flag, n) is true) or for offsets (if
      is_off(flag, n) is true) N can be in range 0..UA_MAXOP-1 or equal to
      OPND_ALL. In the case of OPND_ALL the additional information about all
      operands will be set.

stkvar_flag() ‑> flags64_t

stkvar_flag() -> flags64_t see FF_opbits

strlit_flag() ‑> flags64_t

strlit_flag() -> flags64_t Get a flags64_t representing a string literal.

stroff_flag() ‑> flags64_t

stroff_flag() -> flags64_t see FF_opbits

stru_flag() ‑> flags64_t

stru_flag() -> flags64_t Get a flags64_t representing a struct.

tbyte_flag() ‑> flags64_t

tbyte_flag() -> flags64_t Get a flags64_t representing a tbyte.

toggle_bnot(ea: ea_t, n: int) ‑> bool

toggle_bnot(ea, n) -> bool Toggle binary negation of operand. also see is_bnot()

ea: (C++: ea_t)
n: (C++: int)

toggle_lzero(ea: ea_t, n: int) ‑> bool

toggle_lzero(ea, n) -> bool Toggle lzero bit.

ea: (C++: ea_t) the item (insn/data) address
n: (C++: int) the operand number (0-first operand, 1-other operands)
return: success

toggle_sign(ea: ea_t, n: int) ‑> bool

toggle_sign(ea, n) -> bool Toggle sign of n-th operand. allowed values of n: 0-first operand, 1-other operands

ea: (C++: ea_t)
n: (C++: int)

unregister_custom_data_format(dfid: int) ‑> bool

unregister_custom_data_format(dfid) -> bool Unregisters a custom data format

dfid: data format id
return: Boolean

unregister_custom_data_type(dtid: int) ‑> bool

unregister_custom_data_type(dtid) -> bool Unregisters a custom data type.

dtid: the data type id
return: Boolean

unregister_data_types_and_formats(formats)

As opposed to register_data_types_and_formats(), this function unregisters multiple data types and formats at once.

update_hidden_range(ha: hidden_range_t) ‑> bool

update_hidden_range(ha) -> bool Update hidden range information in the database. You cannot use this function to change the range boundaries

ha: (C++: const hidden_range_t *) range to update
return: success

use_mapping(ea: ea_t) ‑> ea_t

use_mapping(ea) -> ea_t Translate address according to current mappings.

ea: (C++: ea_t) address to translate
return: translated address

visit_patched_bytes(ea1: ea_t, ea2: ea_t, py_callable: PyObject *) ‑> int

visit_patched_bytes(ea1, ea2, py_callable) -> int Enumerates patched bytes in the given range and invokes a callable

ea1: start address
ea2: end address
py_callable: a Python callable with the following prototype:
                callable(ea, fpos, org_val, patch_val).
                If the callable returns non-zero then that value will be
                returned to the caller and the enumeration will be
                interrupted.
return: Zero if the enumeration was successful or the return
        value of the callback if enumeration was interrupted.

word_flag() ‑> flags64_t

word_flag() -> flags64_t Get a flags64_t representing a word.

yword_flag() ‑> flags64_t

yword_flag() -> flags64_t Get a flags64_t representing a ymm word.

zword_flag() ‑> flags64_t

zword_flag() -> flags64_t Get a flags64_t representing a zmm word.

Classes

compiled_binpat_t()

: Proxy of C++ compiled_binpat_t class.

__init__(self) -> compiled_binpat_t

Instance variables

  • bytes: bytevec_t bytes


  • encidx: int encidx


  • mask: bytevec_t mask


  • strlits: rangevec_t strlits


Methods

  • all_bytes_defined(self) ‑> bool all_bytes_defined(self) -> bool


  • qclear(self) ‑> void qclear(self)


compiled_binpat_vec_t(*args)

: Proxy of C++ qvector< compiled_binpat_t > class.

__init__(self) -> compiled_binpat_vec_t
__init__(self, x) -> compiled_binpat_vec_t

 x: qvector< compiled_binpat_t > const &

Methods

  • add_unique(self, x: compiled_binpat_t) ‑> bool add_unique(self, x) -> bool

    x: compiled_binpat_t const &


  • at(self, _idx: size_t) ‑> compiled_binpat_t const & at(self, _idx) -> compiled_binpat_t

    _idx: size_t


  • back(self)


  • begin(self, *args) ‑> qvector< compiled_binpat_t >::const_iterator begin(self) -> compiled_binpat_t


  • capacity(self) ‑> size_t capacity(self) -> size_t


  • clear(self) ‑> void clear(self)


  • empty(self) ‑> bool empty(self) -> bool


  • end(self, *args) ‑> qvector< compiled_binpat_t >::const_iterator end(self) -> compiled_binpat_t


  • erase(self, *args) ‑> qvector< compiled_binpat_t >::iterator erase(self, it) -> compiled_binpat_t

    it: qvector< compiled_binpat_t >::iterator

    erase(self, first, last) -> compiled_binpat_t

    first: qvector< compiled_binpat_t >::iterator last: qvector< compiled_binpat_t >::iterator


  • extract(self) ‑> compiled_binpat_t * extract(self) -> compiled_binpat_t


  • find(self, *args) ‑> qvector< compiled_binpat_t >::const_iterator find(self, x) -> compiled_binpat_t

    x: compiled_binpat_t const &


  • front(self)


  • grow(self, *args) ‑> void grow(self, x=compiled_binpat_t())

    x: compiled_binpat_t const &


  • has(self, x: compiled_binpat_t) ‑> bool has(self, x) -> bool

    x: compiled_binpat_t const &


  • inject(self, s: compiled_binpat_t, len: size_t) ‑> void inject(self, s, len)

    s: compiled_binpat_t * len: size_t


  • insert(self, it: compiled_binpat_t, x: compiled_binpat_t) ‑> qvector< compiled_binpat_t >::iterator insert(self, it, x) -> compiled_binpat_t

    it: qvector< compiled_binpat_t >::iterator x: compiled_binpat_t const &


  • pop_back(self) ‑> void pop_back(self)


  • push_back(self, *args) ‑> compiled_binpat_t & push_back(self, x)

    x: compiled_binpat_t const &

    push_back(self) -> compiled_binpat_t


  • qclear(self) ‑> void qclear(self)


  • reserve(self, cnt: size_t) ‑> void reserve(self, cnt)

    cnt: size_t


  • resize(self, *args) ‑> void resize(self, _newsize, x)

    _newsize: size_t x: compiled_binpat_t const &

    resize(self, _newsize)

    _newsize: size_t


  • size(self) ‑> size_t size(self) -> size_t


  • swap(self, r: compiled_binpat_vec_t) ‑> void swap(self, r)

    r: qvector< compiled_binpat_t > &


  • truncate(self) ‑> void truncate(self)


data_format_t(*args)

: Proxy of C++ data_format_t class.

Instance variables

  • hotkey: char const * hotkey


  • id: int __get_id(self) -> int


  • menu_name: char const * menu_name


  • name: char const * name


  • props: int props


  • text_width: int32 text_width


  • value_size: asize_t value_size


Methods

  • is_present_in_menus(self) ‑> bool is_present_in_menus(self) -> bool Should this format be shown in UI menus

    return: success


data_type_t(*args)

: Proxy of C++ data_type_t class.

Instance variables

  • asm_keyword: char const * asm_keyword


  • hotkey: char const * hotkey


  • id: int __get_id(self) -> int


  • menu_name: char const * menu_name


  • name: char const * name


  • props: int props


  • value_size: asize_t value_size


Methods

  • is_present_in_menus(self) ‑> bool is_present_in_menus(self) -> bool Should this type be shown in UI menus

    return: success


hidden_range_t()

: Proxy of C++ hidden_range_t class.

__init__(self) -> hidden_range_t

Ancestors (in MRO)

* ida_range.range_t

Instance variables

  • color: bgcolor_t color


  • description: char * description


  • footer: char * footer


  • header: char * header


  • visible: bool visible


octet_generator_t(_ea: ea_t)

: Proxy of C++ octet_generator_t class.

__init__(self, _ea) -> octet_generator_t

 _ea: ea_t

Instance variables

  • avail_bits: int avail_bits


  • ea: ea_t ea


  • high_byte_first: bool high_byte_first


  • value: uint64 value


Methods

  • invert_byte_order(self) ‑> void invert_byte_order(self)


Last updated