IDAPython 9.0
|
Public Member Functions | |
__init__ (self, *args, ordinal=None, name=None, tid=None, til=None) | |
None | clear (self) |
None | swap (self, 'tinfo_t' r) |
bool | get_named_type (self, *args) |
bool | get_numbered_type (self, *args) |
bool | detach (self) |
bool | is_correct (self) |
'type_t' | get_realtype (self, bool full=False) |
'type_t' | get_decltype (self) |
bool | empty (self) |
bool | present (self) |
'size_t' | get_size (self, 'uint32 *' p_effalign=None, int gts_code=0) |
'size_t' | get_unpadded_size (self) |
int | get_alignment (self) |
'type_sign_t' | get_sign (self) |
bool | is_signed (self) |
bool | is_unsigned (self) |
'uchar' | get_declalign (self) |
bool | is_typeref (self) |
bool | has_details (self) |
bool | get_type_name (self) |
bool | get_nice_type_name (self) |
'tinfo_code_t' | rename_type (self, str name, int ntf_flags=0) |
bool | get_final_type_name (self) |
bool | get_next_type_name (self) |
'tid_t' | get_tid (self) |
'tid_t' | force_tid (self) |
int | get_ordinal (self) |
int | get_final_ordinal (self) |
'til_t *' | get_til (self) |
bool | is_from_subtil (self) |
bool | is_forward_decl (self) |
'type_t' | get_forward_type (self) |
bool | is_forward_struct (self) |
bool | is_forward_union (self) |
bool | is_forward_enum (self) |
bool | is_typedef (self) |
int | get_type_cmt (self) |
bool | get_type_rptcmt (self) |
bool | is_decl_const (self) |
bool | is_decl_volatile (self) |
bool | is_decl_void (self) |
bool | is_decl_partial (self) |
bool | is_decl_unknown (self) |
bool | is_decl_last (self) |
bool | is_decl_ptr (self) |
bool | is_decl_array (self) |
bool | is_decl_func (self) |
bool | is_decl_complex (self) |
bool | is_decl_typedef (self) |
bool | is_decl_sue (self) |
bool | is_decl_struct (self) |
bool | is_decl_union (self) |
bool | is_decl_udt (self) |
bool | is_decl_enum (self) |
bool | is_decl_bitfield (self) |
bool | is_decl_int128 (self) |
bool | is_decl_int64 (self) |
bool | is_decl_int32 (self) |
bool | is_decl_int16 (self) |
bool | is_decl_int (self) |
bool | is_decl_char (self) |
bool | is_decl_uint (self) |
bool | is_decl_uchar (self) |
bool | is_decl_uint16 (self) |
bool | is_decl_uint32 (self) |
bool | is_decl_uint64 (self) |
bool | is_decl_uint128 (self) |
bool | is_decl_ldouble (self) |
bool | is_decl_double (self) |
bool | is_decl_float (self) |
bool | is_decl_tbyte (self) |
bool | is_decl_floating (self) |
bool | is_decl_bool (self) |
bool | is_decl_paf (self) |
bool | is_well_defined (self) |
(empty()) && !(is_decl_partial()) && !(is_punknown()) | |
bool | is_const (self) |
bool | is_volatile (self) |
bool | is_void (self) |
bool | is_partial (self) |
bool | is_unknown (self) |
bool | is_ptr (self) |
bool | is_array (self) |
bool | is_func (self) |
bool | is_complex (self) |
bool | is_struct (self) |
bool | is_union (self) |
bool | is_udt (self) |
bool | is_enum (self) |
bool | is_sue (self) |
bool | is_bitfield (self) |
bool | is_int128 (self) |
bool | is_int64 (self) |
bool | is_int32 (self) |
bool | is_int16 (self) |
bool | is_int (self) |
bool | is_char (self) |
bool | is_uint (self) |
bool | is_uchar (self) |
bool | is_uint16 (self) |
bool | is_uint32 (self) |
bool | is_uint64 (self) |
bool | is_uint128 (self) |
bool | is_ldouble (self) |
bool | is_double (self) |
bool | is_float (self) |
bool | is_tbyte (self) |
bool | is_bool (self) |
bool | is_paf (self) |
bool | is_ptr_or_array (self) |
bool | is_integral (self) |
bool | is_ext_integral (self) |
bool | is_floating (self) |
bool | is_arithmetic (self) |
bool | is_ext_arithmetic (self) |
bool | is_scalar (self) |
bool | get_ptr_details (self, 'ptr_type_data_t' pi) |
bool | get_array_details (self, 'array_type_data_t' ai) |
bool | get_enum_details (self, 'enum_type_data_t' ei) |
bool | get_bitfield_details (self, 'bitfield_type_data_t' bi) |
bool | get_udt_details (self, 'udt_type_data_t' udt, 'gtd_udt_t' gtd=GTD_CALC_LAYOUT) |
bool | get_func_details (self, 'func_type_data_t' fi, 'gtd_func_t' gtd=GTD_CALC_ARGLOCS) |
bool | is_funcptr (self) |
bool | is_shifted_ptr (self) |
bool | is_varstruct (self) |
bool | is_varmember (self) |
int | get_ptrarr_objsize (self) |
'tinfo_t' | get_ptrarr_object (self) |
'tinfo_t' | get_pointed_object (self) |
bool | is_pvoid (self) |
bool | is_punknown (self) |
'tinfo_t' | get_array_element (self) |
'tinfo_t' | get_final_element (self) |
int | get_array_nelems (self) |
'tinfo_t' | get_nth_arg (self, int n) |
'tinfo_t' | get_rettype (self) |
int | get_nargs (self) |
bool | is_user_cc (self) |
bool | is_vararg_cc (self) |
bool | is_purging_cc (self) |
int | calc_purged_bytes (self) |
bool | is_high_func (self) |
bool | get_methods (self, 'udtmembervec_t' methods) |
bool | get_bit_buckets (self, 'range64vec_t' buckets) |
int | find_udm (self, *args) |
Union[Tuple[int, 'udm_t'], Tuple[None, None]] | get_udm (self, *args) |
get_udm_by_offset (self, int offset) | |
int | get_udt_nmembers (self) |
bool | is_empty_udt (self) |
bool | is_small_udt (self) |
bool | requires_qualifier (self, str name, 'uint64' offset) |
bool | append_covered (self, 'rangeset_t' out, 'uint64' offset=0) |
bool | calc_gaps (self, 'rangeset_t' out) |
bool | is_one_fpval (self) |
bool | is_sse_type (self) |
bool | is_anonymous_udt (self) |
bool | is_vftable (self) |
bool | has_vftable (self) |
bool | has_union (self) |
'size_t' | get_enum_nmembers (self) |
bool | is_empty_enum (self) |
'type_t' | get_enum_base_type (self) |
bool | is_bitmask_enum (self) |
int | get_enum_radix (self) |
'tinfo_code_t' | get_enum_repr (self, 'value_repr_t' repr) |
int | get_enum_width (self) |
'uint64' | calc_enum_mask (self) |
Tuple[int, 'edm_t'] | get_edm_by_value (self, int value, int bmask=DEFMASK64, int serial=0) |
'tid_t' | get_edm_tid (self, 'size_t' idx) |
'tinfo_t' | get_onemember_type (self) |
'tinfo_t' | get_innermost_udm (self, 'uint64' bitoffset) |
'tinfo_t' | get_innermost_member_type (self, 'uint64' bitoffset) |
int | calc_score (self) |
str | dstr (self) |
bool | get_attrs (self, 'type_attrs_t' tav, bool all_attrs=False) |
bool | set_attrs (self, 'type_attrs_t' tav) |
bool | set_attr (self, 'type_attr_t' ta, bool may_overwrite=True) |
None | del_attrs (self) |
bool | del_attr (self, str key, bool make_copy=True) |
bool | create_simple_type (self, 'type_t' decl_type) |
bool | create_ptr (self, *args) |
bool | create_array (self, *args) |
None | create_typedef (self, *args) |
bool | create_bitfield (self, *args) |
bool | parse (self, str decl, 'til_t' til=None, int pt_flags=0) |
bool | create_udt (self, *args) |
bool | create_enum (self, *args) |
bool | create_func (self, *args) |
'ssize_t' | get_udm_by_tid (self, 'udm_t' udm, 'tid_t' tid) |
'ssize_t' | get_edm_by_tid (self, 'edm_t' edm, 'tid_t' tid) |
bool | get_type_by_tid (self, 'tid_t' tid) |
'ssize_t' | get_by_edm_name (self, str mname, 'til_t' til=None) |
'tinfo_code_t' | set_named_type (self, 'til_t' til, str name, int ntf_flags=0) |
'tinfo_code_t' | set_symbol_type (self, 'til_t' til, str name, int ntf_flags=0) |
'tinfo_code_t' | set_numbered_type (self, 'til_t' til, int ord, int ntf_flags=0, str name=None) |
'tinfo_code_t' | save_type (self, *args) |
'tinfo_code_t' | copy_type (self, *args) |
'tinfo_code_t' | create_forward_decl (self, 'til_t' til, 'type_t' decl_type, str name, int ntf_flags=0) |
bool | convert_array_to_ptr (self) |
bool | remove_ptr_or_array (self) |
'uint64' | read_bitfield_value (self, 'uint64' v, int bitoff) |
'uint64' | write_bitfield_value (self, 'uint64' dst, 'uint64' v, int bitoff) |
'type_t' | get_modifiers (self) |
None | set_modifiers (self, 'type_t' mod) |
None | set_const (self) |
None | set_volatile (self) |
None | clr_decl_const_volatile (self) |
bool | clr_const (self) |
bool | clr_volatile (self) |
bool | clr_const_volatile (self) |
'tinfo_code_t' | set_type_alignment (self, 'uchar' declalign, 'uint' etf_flags=0) |
bool | set_declalign (self, 'uchar' declalign) |
bool | change_sign (self, 'type_sign_t' sign) |
bool | calc_udt_aligns (self, int sudt_flags=4) |
bool | set_methods (self, 'udtmembervec_t' methods) |
'tinfo_code_t' | set_type_cmt (self, str cmt, bool is_regcmt=False, 'uint' etf_flags=0) |
int | get_alias_target (self) |
bool | is_aliased (self) |
bool | set_type_alias (self, int dest_ord) |
'tinfo_code_t' | set_udt_alignment (self, int sda, 'uint' etf_flags=0) |
'tinfo_code_t' | set_udt_pack (self, int pack, 'uint' etf_flags=0) |
'tid_t' | get_udm_tid (self, 'size_t' idx) |
add_udm (self, *args) | |
'tinfo_code_t' | del_udm (self, 'size_t' index, 'uint' etf_flags=0) |
'tinfo_code_t' | del_udms (self, 'size_t' idx1, 'size_t' idx2, 'uint' etf_flags=0) |
'tinfo_code_t' | rename_udm (self, 'size_t' index, str name, 'uint' etf_flags=0) |
'tinfo_code_t' | set_udm_type (self, 'size_t' index, 'tinfo_t' tif, 'uint' etf_flags=0, 'value_repr_t' repr=None) |
'tinfo_code_t' | set_udm_cmt (self, 'size_t' index, str cmt, bool is_regcmt=False, 'uint' etf_flags=0) |
'tinfo_code_t' | set_udm_repr (self, 'size_t' index, 'value_repr_t' repr, 'uint' etf_flags=0) |
bool | is_udm_by_til (self, 'size_t' idx) |
'tinfo_code_t' | set_udm_by_til (self, 'size_t' idx, bool on=True, 'uint' etf_flags=0) |
'tinfo_code_t' | set_fixed_struct (self, bool on=True) |
'tinfo_code_t' | set_struct_size (self, 'size_t' new_size) |
bool | is_fixed_struct (self) |
'tinfo_code_t' | expand_udt (self, 'size_t' idx, 'adiff_t' delta, 'uint' etf_flags=0) |
bool | get_func_frame (self, 'func_t const *' pfn) |
bool | is_frame (self) |
ida_idaapi.ea_t | get_frame_func (self) |
'tinfo_code_t' | set_enum_width (self, int nbytes, 'uint' etf_flags=0) |
'tinfo_code_t' | set_enum_sign (self, 'type_sign_t' sign, 'uint' etf_flags=0) |
'tinfo_code_t' | set_enum_is_bitmask (self, *args) |
'tinfo_code_t' | set_enum_repr (self, 'value_repr_t' repr, 'uint' etf_flags=0) |
'tinfo_code_t' | set_enum_radix (self, int radix, bool sign, 'uint' etf_flags=0) |
add_edm (self, *args) | |
'tinfo_code_t' | del_edms (self, 'size_t' idx1, 'size_t' idx2, 'uint' etf_flags=0) |
del_edm (self, *args) | |
del_edm_by_value (self, int value, int etf_flags=0, int bmask=DEFMASK64, int serial=0) | |
'tinfo_code_t' | rename_edm (self, 'size_t' idx, str name, 'uint' etf_flags=0) |
'tinfo_code_t' | set_edm_cmt (self, 'size_t' idx, str cmt, 'uint' etf_flags=0) |
'tinfo_code_t' | edit_edm (self, *args) |
'tinfo_code_t' | rename_funcarg (self, 'size_t' index, str name, 'uint' etf_flags=0) |
'tinfo_code_t' | set_funcarg_type (self, 'size_t' index, 'tinfo_t' tif, 'uint' etf_flags=0) |
'tinfo_code_t' | set_func_rettype (self, 'tinfo_t' tif, 'uint' etf_flags=0) |
'tinfo_code_t' | del_funcargs (self, 'size_t' idx1, 'size_t' idx2, 'uint' etf_flags=0) |
'tinfo_code_t' | del_funcarg (self, 'size_t' idx, 'uint' etf_flags=0) |
'tinfo_code_t' | add_funcarg (self, 'funcarg_t' farg, 'uint' etf_flags=0, 'ssize_t' idx=-1) |
'tinfo_code_t' | set_func_cc (self, 'cm_t' cc, 'uint' etf_flags=0) |
'tinfo_code_t' | set_funcarg_loc (self, 'size_t' index, 'argloc_t' argloc, 'uint' etf_flags=0) |
'tinfo_code_t' | set_func_retloc (self, 'argloc_t' argloc, 'uint' etf_flags=0) |
bool | __eq__ (self, 'tinfo_t' r) |
bool | __ne__ (self, 'tinfo_t' r) |
bool | __lt__ (self, 'tinfo_t' r) |
bool | __gt__ (self, 'tinfo_t' r) |
bool | __le__ (self, 'tinfo_t' r) |
bool | __ge__ (self, 'tinfo_t' r) |
int | compare (self, 'tinfo_t' r) |
bool | compare_with (self, 'tinfo_t' r, int tcflags=0) |
bool | equals_to (self, 'tinfo_t' r) |
bool | is_castable_to (self, 'tinfo_t' target) |
bool | is_manually_castable_to (self, 'tinfo_t' target) |
'PyObject *' | serialize (self, *args) |
bool | deserialize (self, *args) |
'ssize_t' | get_stkvar (self, 'insn_t const &' insn, 'op_t const ' x, int v) |
'tinfo_t' | copy (self) |
str | __str__ (self) |
'PyObject *' | get_attr (self, str key, bool all_attrs=True) |
Tuple[int, 'edm_t'] | get_edm (self, *args) |
'ssize_t' | find_edm (self, *args) |
__repr__ (self) | |
iter_struct (self) | |
iter_union (self) | |
iter_udt (self) | |
iter_enum (self) | |
iter_func (self) | |
Static Public Member Functions | |
'tinfo_t' | get_stock ('stock_type_id_t' id) |
Static Public Attributes | |
ENUMBM_OFF = _ida_typeinf.tinfo_t_ENUMBM_OFF | |
ENUMBM_ON = _ida_typeinf.tinfo_t_ENUMBM_ON | |
ENUMBM_AUTO = _ida_typeinf.tinfo_t_ENUMBM_AUTO | |
'ssize_t' | get_edm_by_name = get_by_edm_name |
Protected Member Functions | |
bool | _print (self, str name=None, int prtype_flags=0, int indent=0, int cmtindent=0, str prefix=None, str cmt=None) |
Properties | |
thisown | |
__init__ | ( | self, | |
* | args, | ||
ordinal = None, | |||
name = None, | |||
tid = None, | |||
til = None ) |
Create a type object with the provided argumens. This constructor has the following signatures: 1. tinfo_t(decl_type: type_t) 2. tinfo_t(decl: str, til: til_t = None, pt_flags: int = 0) The latter form will create the type object by parsing the type declaration Alternatively, you can use a form accepting the following keyword arguments: * ordinal: int * name: str * tid: int * til: til_t=None # `None` means `get_idati()` E.g., * tinfo_t(ordinal=3) * tinfo_t(ordinal=10, til=get_idati()) * tinfo_t(name="mytype_t") * tinfo_t(name="thattype_t", til=my_other_til) * tinfo_t(tid=ida_nalt.get_strid(some_address)) The constructor may raise an exception if data was invalid, or if parsing failed. @param decl_type A simple type @param decl A valid C declaration @param til A type library, or `None` to use the (`get_idati()`) default @param ordinal An ordinal in the type library @param name A valid type name @param pt_flags Parsing flags
bool __eq__ | ( | self, | |
'tinfo_t' | r ) |
bool __ge__ | ( | self, | |
'tinfo_t' | r ) |
bool __gt__ | ( | self, | |
'tinfo_t' | r ) |
bool __le__ | ( | self, | |
'tinfo_t' | r ) |
bool __lt__ | ( | self, | |
'tinfo_t' | r ) |
bool __ne__ | ( | self, | |
'tinfo_t' | r ) |
__repr__ | ( | self | ) |
str __str__ | ( | self | ) |
|
protected |
add_edm | ( | self, | |
* | args ) |
Add an enumerator to the current enumeration. When creating a new enumeration from scratch, you might want to first call `create_enum()` This method has the following signatures: 1. add_edm(edm: edm_t, bmask: int = -1, etf_flags: int = 0, idx: int = -1) 2. add_edm(name: str, value: int, bmask: int = -1, etf_flags: int = 0, idx: int = -1) If an input argument is incorrect, the constructor may raise an exception @param edm The member, fully initialized (1st form) @param name Enumerator name - must not be empty @param value Enumerator value @param bmask A bitmask to which the enumerator belongs @param etf_flags an OR'ed combination of ETF_ flags @param idx the index in the edm array where the new udm should be placed. If the specified index cannot be honored because it would spoil the edm sorting order, it is silently ignored.
'tinfo_code_t' add_funcarg | ( | self, | |
'funcarg_t' | farg, | ||
'uint' | etf_flags = 0, | ||
'ssize_t' | idx = -1 ) |
Add a function argument. @param farg: argument to add @param etf_flags: type changing flags flags @param idx: the index in the funcarg array where the new funcarg should be placed. if the specified index cannot be honored because it would spoil the funcarg sorting order, it is silently ignored.
add_udm | ( | self, | |
* | args ) |
Add a member to the current structure/union. When creating a new structure/union from scratch, you might want to first call `create_udt()` This method has the following signatures: 1. add_udm(udm: udm_t, etf_flags: int = 0, times: int = 1, idx: int = -1) 2. add_udm(name: str, type: type_t | tinfo_t | str, offset: int = 0, etf_flags: int = 0, times: int = 1, idx: int = -1) In the 2nd form, the 'type' descriptor, can be one of: * type_t: if the type is simple (integral/floating/bool). E.g., `BTF_INT` * tinfo_t: can handle more complex types (structures, pointers, arrays, ...) * str: a C type declaration If an input argument is incorrect, the constructor may raise an exception @param udm The member, fully initialized (1st form) @param name Member name - must not be empty @param type Member type @param offset the member offset in bits. It is the caller's responsibility to specify correct offsets. @param etf_flags an OR'ed combination of ETF_ flags @param times how many times to add the new member @param idx the index in the udm array where the new udm should be placed. If the specified index cannot be honored because it would spoil the udm sorting order, it is silently ignored.
bool append_covered | ( | self, | |
'rangeset_t' | out, | ||
'uint64' | offset = 0 ) |
Calculate set of covered bytes for the type @param out: pointer to the output buffer. covered bytes will be appended to it. @param offset: delta in bytes to add to all calculations. used internally during recurion.
'uint64' calc_enum_mask | ( | self | ) |
bool calc_gaps | ( | self, | |
'rangeset_t' | out ) |
Calculate set of padding bytes for the type @param out: pointer to the output buffer; old buffer contents will be lost.
int calc_purged_bytes | ( | self | ) |
BT_FUNC: Calculate number of purged bytes
int calc_score | ( | self | ) |
Calculate the type score (the higher - the nicer is the type)
bool calc_udt_aligns | ( | self, | |
int | sudt_flags = 4 ) |
Calculate the udt alignments using the field offsets/sizes and the total udt size This function does not work on typerefs
bool change_sign | ( | self, | |
'type_sign_t' | sign ) |
Change the type sign. Works only for the types that may have sign.
None clear | ( | self | ) |
Clear contents of this tinfo, and remove from the type system.
bool clr_const | ( | self | ) |
bool clr_const_volatile | ( | self | ) |
None clr_decl_const_volatile | ( | self | ) |
bool clr_volatile | ( | self | ) |
int compare | ( | self, | |
'tinfo_t' | r ) |
bool compare_with | ( | self, | |
'tinfo_t' | r, | ||
int | tcflags = 0 ) |
Compare two types, based on given flags (see tinfo_t comparison flags)
bool convert_array_to_ptr | ( | self | ) |
Convert an array into a pointer. type[] => type *
'tinfo_t' copy | ( | self | ) |
'tinfo_code_t' copy_type | ( | self, | |
* | args ) |
bool create_array | ( | self, | |
* | args ) |
bool create_bitfield | ( | self, | |
* | args ) |
bool create_enum | ( | self, | |
* | args ) |
Create an empty enum.
'tinfo_code_t' create_forward_decl | ( | self, | |
'til_t' | til, | ||
'type_t' | decl_type, | ||
str | name, | ||
int | ntf_flags = 0 ) |
Create a forward declaration. decl_type: BTF_STRUCT, BTF_UNION, or BTF_ENUM
bool create_func | ( | self, | |
* | args ) |
bool create_ptr | ( | self, | |
* | args ) |
bool create_simple_type | ( | self, | |
'type_t' | decl_type ) |
None create_typedef | ( | self, | |
* | args ) |
bool create_udt | ( | self, | |
* | args ) |
Create an empty structure/union.
bool del_attr | ( | self, | |
str | key, | ||
bool | make_copy = True ) |
Del a type attribute. typerefs cannot be modified by this function.
None del_attrs | ( | self | ) |
Del all type attributes. typerefs cannot be modified by this function.
del_edm | ( | self, | |
* | args ) |
Delete an enumerator with the specified name or the specified index, in the specified tinfo_t object. This method has the following signatures: 1. del_edm(name: str) -> int 2. del_edm(index: int) -> int @param name an enumerator name (1st form) @param index an enumerator index (2nd form) @return TERR_OK in case of success, or another TERR_* value in case of error
del_edm_by_value | ( | self, | |
int | value, | ||
int | etf_flags = 0, | ||
int | bmask = DEFMASK64, | ||
int | serial = 0 ) |
Delete an enumerator with the specified value, in the specified tinfo_t object. @param value the enumerator value @return TERR_OK in case of success, or another TERR_* value in case of error
'tinfo_code_t' del_edms | ( | self, | |
'size_t' | idx1, | ||
'size_t' | idx2, | ||
'uint' | etf_flags = 0 ) |
Delete enum members @param idx1: index in edmvec_t @param idx2: index in edmvec_t or size_t(-1) @param etf_flags: etf_flag_t Delete enum members in [idx1, idx2)
'tinfo_code_t' del_funcarg | ( | self, | |
'size_t' | idx, | ||
'uint' | etf_flags = 0 ) |
'tinfo_code_t' del_funcargs | ( | self, | |
'size_t' | idx1, | ||
'size_t' | idx2, | ||
'uint' | etf_flags = 0 ) |
Delete function arguments @param idx1: index in funcargvec_t @param idx2: index in funcargvec_t or size_t(-1) @param etf_flags: etf_flag_t Delete function arguments in [idx1, idx2)
'tinfo_code_t' del_udm | ( | self, | |
'size_t' | index, | ||
'uint' | etf_flags = 0 ) |
Delete a structure/union member.
'tinfo_code_t' del_udms | ( | self, | |
'size_t' | idx1, | ||
'size_t' | idx2, | ||
'uint' | etf_flags = 0 ) |
Delete structure/union members in the range [idx1, idx2)
bool deserialize | ( | self, | |
* | args ) |
This function has the following signatures: 0. deserialize(til: const til_t *, ptype: const type_t **, pfields: const p_list **=nullptr, pfldcmts: const p_list **=nullptr, cmt: str=nullptr) -> bool 1. deserialize(til: const til_t *, ptype: const qtype *, pfields: const qtype *=nullptr, pfldcmts: const qtype *=nullptr, cmt: str=nullptr) -> bool # 0: deserialize(til: const til_t *, ptype: const type_t **, pfields: const p_list **=nullptr, pfldcmts: const p_list **=nullptr, cmt: str=nullptr) -> bool Deserialize a type string into a tinfo_t object. # 1: deserialize(til: const til_t *, ptype: const qtype *, pfields: const qtype *=nullptr, pfldcmts: const qtype *=nullptr, cmt: str=nullptr) -> bool Deserialize a type string into a tinfo_t object.
bool detach | ( | self | ) |
Detach tinfo_t from the underlying type. After calling this finction, tinfo_t will lose its link to the underlying named or numbered type (if any) and will become a reference to a unique type. After that, any modifications to tinfo_t will affect only its type.
str dstr | ( | self | ) |
Function to facilitate debugging.
'tinfo_code_t' edit_edm | ( | self, | |
* | args ) |
Change constant value and/or bitmask @param idx: index in edmvec_t @param value: old or new value @param bmask: old or new bitmask @param etf_flags: etf_flag_t
bool empty | ( | self | ) |
Was tinfo_t initialized with some type info or not?
bool equals_to | ( | self, | |
'tinfo_t' | r ) |
'tinfo_code_t' expand_udt | ( | self, | |
'size_t' | idx, | ||
'adiff_t' | delta, | ||
'uint' | etf_flags = 0 ) |
Expand/shrink a structure by adding/removing a gap before the specified member. For regular structures, either the gap can be accommodated by aligning the next member with an alignment directive, or an explicit "gap" member will be inserted. Also note that it is impossible to add a gap at the end of a regular structure. When it comes to fixed-layout structures, there is no need to either add new "gap" members or align existing members, since all members have a fixed offset. It is possible to add a gap at the end of a fixed-layout structure, by passing `-1` as index. @param idx: index of the member @param delta: number of bytes to add or remove @param etf_flags: etf_flag_t
'ssize_t' find_edm | ( | self, | |
* | args ) |
int find_udm | ( | self, | |
* | args ) |
This function has the following signatures: 0. find_udm(udm: udm_t *, strmem_flags: int) -> int 1. find_udm(offset: uint64, strmem_flags: int=0) -> int 2. find_udm(name: str, strmem_flags: int=0) -> int # 0: find_udm(udm: udm_t *, strmem_flags: int) -> int BTF_STRUCT,BTF_UNION: Find a udt member. * at the specified offset (STRMEM_OFFSET) * with the specified index (STRMEM_INDEX) * with the specified type (STRMEM_TYPE) * with the specified name (STRMEM_NAME) @returns the index of the found member or -1 # 1: find_udm(offset: uint64, strmem_flags: int=0) -> int BTF_STRUCT,BTF_UNION: Find an udt member at the specified offset @returns the index of the found member or -1 # 2: find_udm(name: str, strmem_flags: int=0) -> int BTF_STRUCT,BTF_UNION: Find an udt member by name @returns the index of the found member or -1
'tid_t' force_tid | ( | self | ) |
Get the type tid. Create if it does not exist yet. If the type comes from a base til, the type will be copied to the local til and a new tid will be created for it. (if the type comes from a base til, it does not have a tid yet). If the type comes from the local til, this function is equivalent to get_tid() @returns tid or BADADDR
int get_alias_target | ( | self | ) |
Get type alias If the type has no alias, return 0.
int get_alignment | ( | self | ) |
Get type alignment This function returns the effective type alignment. Zero means error.
bool get_array_details | ( | self, | |
'array_type_data_t' | ai ) |
Get the array specific info.
'tinfo_t' get_array_element | ( | self | ) |
BT_ARRAY: get type of array element. See also get_ptrarr_object()
int get_array_nelems | ( | self | ) |
BT_ARRAY: get number of elements (-1 means error)
'PyObject *' get_attr | ( | self, | |
str | key, | ||
bool | all_attrs = True ) |
Get a type attribute.
bool get_attrs | ( | self, | |
'type_attrs_t' | tav, | ||
bool | all_attrs = False ) |
Get type attributes (all_attrs: include attributes of referenced types, if any)
bool get_bit_buckets | ( | self, | |
'range64vec_t' | buckets ) |
::BT_STRUCT: get bit buckets Bit buckets are used to layout bitfields @returns false if wrong type was passed
bool get_bitfield_details | ( | self, | |
'bitfield_type_data_t' | bi ) |
Get the bitfield specific info.
'ssize_t' get_by_edm_name | ( | self, | |
str | mname, | ||
'til_t' | til = None ) |
Retrieve enum tinfo using enum member name @param mname: enum type member name @param til: type library @returns member index, otherwise returns -1. If the function fails, THIS object becomes empty.
'uchar' get_declalign | ( | self | ) |
Get declared alignment of the type.
'type_t' get_decltype | ( | self | ) |
Get declared type (without resolving type references; they are returned as is). Obviously this is a very fast function and should be used instead of get_realtype() if possible. Please note that for typerefs this function will return BTF_TYPEDEF. To determine if a typeref is a typedef, use is_typedef()
Tuple[int, 'edm_t'] get_edm | ( | self, | |
* | args ) |
Retrieve an enumerator with either the specified name or the specified index, in the specified tinfo_t object. This function has the following signatures: 1. get_edm(index: int) 2. get_edm(name: str) @param index an enumerator index (1st form). @param name an enumerator name (2nd form). @return a tuple (int, edm_t), or (-1, None) if member not found
'ssize_t' get_edm_by_tid | ( | self, | |
'edm_t' | edm, | ||
'tid_t' | tid ) |
Retrieve an enumerator with the specified value, in the specified tinfo_t object. @param value the enumerator value @return a tuple (int, edm_t), or (-1, None) if member not found
'tid_t' get_edm_tid | ( | self, | |
'size_t' | idx ) |
Get enum member TID @param idx: enum member index @returns tid or BADADDR The tid is used to collect xrefs to the member, it can be passed to xref-related functions instead of the address.
'type_t' get_enum_base_type | ( | self | ) |
Get enum base type (convert enum to integer type) Returns BT_UNK if failed to convert
bool get_enum_details | ( | self, | |
'enum_type_data_t' | ei ) |
Get the enum specific info.
'size_t' get_enum_nmembers | ( | self | ) |
Get number of enum members. @returns BADSIZE if error
int get_enum_radix | ( | self | ) |
Get enum constant radix @returns radix or 1 for BTE_CHAR enum_type_data_t::get_enum_radix()
'tinfo_code_t' get_enum_repr | ( | self, | |
'value_repr_t' | repr ) |
Set the representation of enum members. @param repr: value_repr_t
int get_enum_width | ( | self | ) |
Get enum width @returns width of enum base type in bytes, 0 - unspecified, or -1 enum_type_data_t::calc_nbytes()
'tinfo_t' get_final_element | ( | self | ) |
repeat recursively: if an array, return the type of its element; else return the type itself.
int get_final_ordinal | ( | self | ) |
Get final type ordinal (0 if none)
bool get_final_type_name | ( | self | ) |
Use in the case of typedef chain (TYPE1 -> TYPE2 -> TYPE3...TYPEn). @returns the name of the last type in the chain (TYPEn). if there is no chain, returns TYPE1
'type_t' get_forward_type | ( | self | ) |
Get type of a forward declaration. For a forward declaration this function returns its base type. In other cases it returns BT_UNK
ida_idaapi.ea_t get_frame_func | ( | self | ) |
Get function address for the frame.
bool get_func_details | ( | self, | |
'func_type_data_t' | fi, | ||
'gtd_func_t' | gtd = GTD_CALC_ARGLOCS ) |
Get only the function specific info for this tinfo_t.
bool get_func_frame | ( | self, | |
'func_t const *' | pfn ) |
Create a tinfo_t object for the function frame @param pfn: function
'tinfo_t' get_innermost_member_type | ( | self, | |
'uint64' | bitoffset ) |
Get the innermost member type at the given offset @param bitoffset: bit offset into the structure @retval the: innermost member type
'tinfo_t' get_innermost_udm | ( | self, | |
'uint64' | bitoffset ) |
Get the innermost member at the given offset @param bitoffset: bit offset into the structure @retval udt: with the innermost member @retval empty: type if it is not a struct type or OFFSET could not be found
bool get_methods | ( | self, | |
'udtmembervec_t' | methods ) |
BT_COMPLEX: get a list of member functions declared in this udt. @returns false if no member functions exist
'type_t' get_modifiers | ( | self | ) |
bool get_named_type | ( | self, | |
* | args ) |
This function has the following signatures: 0. get_named_type(til: const til_t *, name: str, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true, try_ordinal: bool=true) -> bool 1. get_named_type(name: str, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true, try_ordinal: bool=true) -> bool # 0: get_named_type(til: const til_t *, name: str, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true, try_ordinal: bool=true) -> bool Create a tinfo_t object for an existing named type. # 1: get_named_type(name: str, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true, try_ordinal: bool=true) -> bool
int get_nargs | ( | self | ) |
BT_FUNC or BT_PTR BT_FUNC: Calculate number of arguments (-1 - error)
bool get_next_type_name | ( | self | ) |
Use In the case of typedef chain (TYPE1 -> TYPE2 -> TYPE3...TYPEn). @returns the name of the next type in the chain (TYPE2). if there is no chain, returns failure
bool get_nice_type_name | ( | self | ) |
Get the beautified type name. Get the referenced name and apply regular expressions from goodname.cfg to beautify the name
'tinfo_t' get_nth_arg | ( | self, | |
int | n ) |
BT_FUNC or BT_PTR BT_FUNC: Get type of n-th arg (-1 means return type, see get_rettype())
bool get_numbered_type | ( | self, | |
* | args ) |
This function has the following signatures: 0. get_numbered_type(til: const til_t *, ordinal: int, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true) -> bool 1. get_numbered_type(ordinal: int, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true) -> bool # 0: get_numbered_type(til: const til_t *, ordinal: int, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true) -> bool Create a tinfo_t object for an existing ordinal type. # 1: get_numbered_type(ordinal: int, decl_type: type_t=BTF_TYPEDEF, resolve: bool=true) -> bool
'tinfo_t' get_onemember_type | ( | self | ) |
For objects consisting of one member entirely: return type of the member.
int get_ordinal | ( | self | ) |
Get type ordinal (only if the type was created as a numbered type, 0 if none)
'tinfo_t' get_pointed_object | ( | self | ) |
BT_PTR: get type of pointed object. If the current type is not a pointer, return empty type info. See also get_ptrarr_object() and remove_pointer()
bool get_ptr_details | ( | self, | |
'ptr_type_data_t' | pi ) |
Get the pointer info.
'tinfo_t' get_ptrarr_object | ( | self | ) |
BT_PTR & BT_ARRAY: get the pointed object or array element. If the current type is not a pointer or array, return empty type info.
int get_ptrarr_objsize | ( | self | ) |
BT_PTR & BT_ARRAY: get size of pointed object or array element. On error returns -1
'type_t' get_realtype | ( | self, | |
bool | full = False ) |
Get the resolved base type. Deserialization options: * if full=true, the referenced type will be deserialized fully, this may not always be desirable (slows down things) * if full=false, we just return the base type, the referenced type will be resolved again later if necessary (this may lead to multiple resolvings of the same type) imho full=false is a better approach because it does not perform unnecessary actions just in case. however, in some cases the caller knows that it is very likely that full type info will be required. in those cases full=true makes sense
'tinfo_t' get_rettype | ( | self | ) |
BT_FUNC or BT_PTR BT_FUNC: Get the function's return type
'type_sign_t' get_sign | ( | self | ) |
Get type sign.
'size_t' get_size | ( | self, | |
'uint32 *' | p_effalign = None, | ||
int | gts_code = 0 ) |
Get the type size in bytes. @param p_effalign: buffer for the alignment value @param gts_code: combination of GTS_... constants @returns BADSIZE in case of problems
'ssize_t' get_stkvar | ( | self, | |
'insn_t const &' | insn, | ||
'op_t const' | x, | ||
int | v ) |
Retrieve frame tinfo for a stack variable @param insn: the instruction @param x: reference to instruction operand, may be nullptr @param v: immediate value in the operand (usually x.addr) @returns returns the member index, otherwise returns -1. if the function fails, THIS object becomes empty.
|
static |
Get stock type information. This function can be used to get tinfo_t for some common types. The same tinfo_t will be returned for the same id, thus saving memory and increasing the speed Please note that retrieving the STI_SIZE_T or STI_SSIZE_T stock type, will also have the side-effect of adding that type to the 'idati' TIL, under the well-known name 'size_t' or 'ssize_t' (respectively). The same is valid for STI_COMPLEX64 and STI_COMPLEX64 stock types with names 'complex64_t' and 'complex128_t' (respectively).
'tid_t' get_tid | ( | self | ) |
Get the type tid Each type in the local type library has a so-called `tid` associated with it. The tid is used to collect xrefs to the type. The tid is created when the type is created in the local type library and does not change afterwards. It can be passed to xref-related functions instead of the address. @returns tid or BADADDR
'til_t *' get_til | ( | self | ) |
Get the type library for tinfo_t.
bool get_type_by_tid | ( | self, | |
'tid_t' | tid ) |
int get_type_cmt | ( | self | ) |
Get type comment @returns 0-failed, 1-returned regular comment, 2-returned repeatable comment
bool get_type_name | ( | self | ) |
Does a type refer to a name?. If yes, fill the provided buffer with the type name and return true. Names are returned for numbered types too: either a user-defined nice name or, if a user-provided name does not exist, an ordinal name (like #xx, see create_numbered_type_name()).
bool get_type_rptcmt | ( | self | ) |
Get type comment only if it is repeatable.
Union[Tuple[int, 'udm_t'], Tuple[None, None]] get_udm | ( | self, | |
* | args ) |
Retrieve a structure/union member with either the specified name or the specified index, in the specified tinfo_t object. This function has the following signatures: 1. get_udm(index: int) 2. get_udm(name: str) @param index a member index (1st form) @param name a member name (2nd form) @return a tuple (int, udm_t), or (-1, None) if member not found
get_udm_by_offset | ( | self, | |
int | offset ) |
Retrieve a structure/union member with the specified offset, in the specified tinfo_t object. @param offset the member offset @return a tuple (int, udm_t), or (-1, None) if member not found
'ssize_t' get_udm_by_tid | ( | self, | |
'udm_t' | udm, | ||
'tid_t' | tid ) |
'tid_t' get_udm_tid | ( | self, | |
'size_t' | idx ) |
Get udt member TID @param idx: the index of udt the member @returns tid or BADADDR The tid is used to collect xrefs to the member, it can be passed to xref-related functions instead of the address.
bool get_udt_details | ( | self, | |
'udt_type_data_t' | udt, | ||
'gtd_udt_t' | gtd = GTD_CALC_LAYOUT ) |
Get the udt specific info.
int get_udt_nmembers | ( | self | ) |
Get number of udt members. -1-error.
'size_t' get_unpadded_size | ( | self | ) |
Get the type size in bytes without the final padding, in bytes. For some UDTs get_unpadded_size() != get_size()
bool has_details | ( | self | ) |
Does this type refer to a nontrivial type?
bool has_union | ( | self | ) |
Has a member of type "union"?
bool has_vftable | ( | self | ) |
Has a vftable?
bool is_aliased | ( | self | ) |
bool is_anonymous_udt | ( | self | ) |
Is an anonymous struct/union? We assume that types with names are anonymous if the name starts with $
bool is_arithmetic | ( | self | ) |
is_type_arithmetic(get_realtype())
bool is_array | ( | self | ) |
is_type_array(get_realtype())
bool is_bitfield | ( | self | ) |
is_type_bitfld(get_realtype())
bool is_bitmask_enum | ( | self | ) |
Is bitmask enum? @returns true for bitmask enum and false in other cases enum_type_data_t::is_bf()
bool is_bool | ( | self | ) |
is_type_bool(get_realtype())
bool is_castable_to | ( | self, | |
'tinfo_t' | target ) |
bool is_char | ( | self | ) |
is_type_char(get_realtype())
bool is_complex | ( | self | ) |
is_type_complex(get_realtype())
bool is_const | ( | self | ) |
is_type_const(get_realtype())
bool is_correct | ( | self | ) |
Is the type object correct?. It is possible to create incorrect types. For example, we can define a function that returns an enum and then delete the enum type. If this function returns false, the type should not be used in disassembly. Please note that this function does not verify all involved types: for example, pointers to undefined types are permitted.
bool is_decl_array | ( | self | ) |
is_type_array(get_decltype())
bool is_decl_bitfield | ( | self | ) |
is_type_bitfld(get_decltype())
bool is_decl_bool | ( | self | ) |
is_type_bool(get_decltype())
bool is_decl_char | ( | self | ) |
is_type_char(get_decltype())
bool is_decl_complex | ( | self | ) |
is_type_complex(get_decltype())
bool is_decl_const | ( | self | ) |
is_type_const(get_decltype())
bool is_decl_double | ( | self | ) |
is_type_double(get_decltype())
bool is_decl_enum | ( | self | ) |
is_type_enum(get_decltype())
bool is_decl_float | ( | self | ) |
is_type_float(get_decltype())
bool is_decl_floating | ( | self | ) |
is_type_floating(get_decltype())
bool is_decl_func | ( | self | ) |
is_type_func(get_decltype())
bool is_decl_int | ( | self | ) |
is_type_int(get_decltype())
bool is_decl_int128 | ( | self | ) |
is_type_int128(get_decltype())
bool is_decl_int16 | ( | self | ) |
is_type_int16(get_decltype())
bool is_decl_int32 | ( | self | ) |
is_type_int32(get_decltype())
bool is_decl_int64 | ( | self | ) |
is_type_int64(get_decltype())
bool is_decl_last | ( | self | ) |
is_typeid_last(get_decltype())
bool is_decl_ldouble | ( | self | ) |
is_type_ldouble(get_decltype())
bool is_decl_paf | ( | self | ) |
is_type_paf(get_decltype())
bool is_decl_partial | ( | self | ) |
is_type_partial(get_decltype())
bool is_decl_ptr | ( | self | ) |
is_type_ptr(get_decltype())
bool is_decl_struct | ( | self | ) |
is_type_struct(get_decltype())
bool is_decl_sue | ( | self | ) |
is_type_sue(get_decltype())
bool is_decl_tbyte | ( | self | ) |
is_type_tbyte(get_decltype())
bool is_decl_typedef | ( | self | ) |
is_type_typedef(get_decltype())
bool is_decl_uchar | ( | self | ) |
is_type_uchar(get_decltype())
bool is_decl_udt | ( | self | ) |
is_type_struni(get_decltype())
bool is_decl_uint | ( | self | ) |
is_type_uint(get_decltype())
bool is_decl_uint128 | ( | self | ) |
is_type_uint128(get_decltype())
bool is_decl_uint16 | ( | self | ) |
is_type_uint16(get_decltype())
bool is_decl_uint32 | ( | self | ) |
is_type_uint32(get_decltype())
bool is_decl_uint64 | ( | self | ) |
is_type_uint64(get_decltype())
bool is_decl_union | ( | self | ) |
is_type_union(get_decltype())
bool is_decl_unknown | ( | self | ) |
is_type_unknown(get_decltype())
bool is_decl_void | ( | self | ) |
is_type_void(get_decltype())
bool is_decl_volatile | ( | self | ) |
is_type_volatile(get_decltype())
bool is_double | ( | self | ) |
is_type_double(get_realtype())
bool is_empty_enum | ( | self | ) |
Is an empty enum? (has no constants)
bool is_empty_udt | ( | self | ) |
Is an empty struct/union? (has no fields)
bool is_enum | ( | self | ) |
is_type_enum(get_realtype())
bool is_ext_arithmetic | ( | self | ) |
is_type_ext_arithmetic(get_realtype())
bool is_ext_integral | ( | self | ) |
is_type_ext_integral(get_realtype())
bool is_fixed_struct | ( | self | ) |
Is a structure with fixed offsets?
bool is_float | ( | self | ) |
is_type_float(get_realtype())
bool is_floating | ( | self | ) |
is_type_floating(get_realtype())
bool is_forward_decl | ( | self | ) |
Is this a forward declaration?. Forward declarations are placeholders: the type definition does not exist
bool is_forward_enum | ( | self | ) |
bool is_forward_struct | ( | self | ) |
bool is_forward_union | ( | self | ) |
bool is_frame | ( | self | ) |
Is a function frame?
bool is_from_subtil | ( | self | ) |
Was the named type found in some base type library (not the top level type library)?. If yes, it usually means that the type comes from some loaded type library, not the local type library for the database
bool is_func | ( | self | ) |
is_type_func(get_realtype())
bool is_funcptr | ( | self | ) |
Is this pointer to a function?
bool is_high_func | ( | self | ) |
BT_FUNC: Is high level type?
bool is_int | ( | self | ) |
is_type_int(get_realtype())
bool is_int128 | ( | self | ) |
is_type_int128(get_realtype())
bool is_int16 | ( | self | ) |
is_type_int16(get_realtype())
bool is_int32 | ( | self | ) |
is_type_int32(get_realtype())
bool is_int64 | ( | self | ) |
is_type_int64(get_realtype())
bool is_integral | ( | self | ) |
is_type_integral(get_realtype())
bool is_ldouble | ( | self | ) |
is_type_ldouble(get_realtype())
bool is_manually_castable_to | ( | self, | |
'tinfo_t' | target ) |
bool is_one_fpval | ( | self | ) |
Floating value or an object consisting of one floating member entirely.
bool is_paf | ( | self | ) |
is_type_paf(get_realtype())
bool is_partial | ( | self | ) |
is_type_partial(get_realtype())
bool is_ptr | ( | self | ) |
is_type_ptr(get_realtype())
bool is_ptr_or_array | ( | self | ) |
is_type_ptr_or_array(get_realtype())
bool is_punknown | ( | self | ) |
Is "_UNKNOWN *"?. This function does not check the pointer attributes and type modifiers.
bool is_purging_cc | ( | self | ) |
is_purging_cc(get_cc())
bool is_pvoid | ( | self | ) |
Is "void *"?. This function does not check the pointer attributes and type modifiers.
bool is_scalar | ( | self | ) |
Does the type represent a single number?
bool is_shifted_ptr | ( | self | ) |
Is a shifted pointer?
bool is_signed | ( | self | ) |
Is this a signed type?
bool is_small_udt | ( | self | ) |
Is a small udt? (can fit a register or a pair of registers)
bool is_sse_type | ( | self | ) |
Is a SSE vector type?
bool is_struct | ( | self | ) |
is_type_struct(get_realtype())
bool is_sue | ( | self | ) |
is_type_sue(get_realtype())
bool is_tbyte | ( | self | ) |
is_type_tbyte(get_realtype())
bool is_typedef | ( | self | ) |
Is this a typedef?. This function will return true for a reference to a local type that is declared as a typedef.
bool is_typeref | ( | self | ) |
Is this type a type reference?.
bool is_uchar | ( | self | ) |
is_type_uchar(get_realtype())
bool is_udm_by_til | ( | self, | |
'size_t' | idx ) |
Was the member created due to the type system @param idx: index of the member
bool is_udt | ( | self | ) |
is_type_struni(get_realtype())
bool is_uint | ( | self | ) |
is_type_uint(get_realtype())
bool is_uint128 | ( | self | ) |
is_type_uint128(get_realtype())
bool is_uint16 | ( | self | ) |
is_type_uint16(get_realtype())
bool is_uint32 | ( | self | ) |
is_type_uint32(get_realtype())
bool is_uint64 | ( | self | ) |
is_type_uint64(get_realtype())
bool is_union | ( | self | ) |
is_type_union(get_realtype())
bool is_unknown | ( | self | ) |
is_type_unknown(get_realtype())
bool is_unsigned | ( | self | ) |
Is this an unsigned type?
bool is_user_cc | ( | self | ) |
is_user_cc(get_cc())
bool is_vararg_cc | ( | self | ) |
is_vararg_cc(get_cc())
bool is_varmember | ( | self | ) |
Can the type be of a variable struct member? This function checks for: is_array() && array.nelems==0 Such a member can be only the very last member of a structure
bool is_varstruct | ( | self | ) |
Is a variable-size structure?
bool is_vftable | ( | self | ) |
Is a vftable type?
bool is_void | ( | self | ) |
is_type_void(get_realtype())
bool is_volatile | ( | self | ) |
is_type_volatile(get_realtype())
bool is_well_defined | ( | self | ) |
iter_enum | ( | self | ) |
Iterate on the members composing this enumeration. Example: til = ida_typeinf.get_idati() tif = til.get_named_type("my_enum") for edm in tif.iter_enum(): print(f"{edm.name} = {edm.value}") Will raise an exception if this type is not an enumeration @return a edm_t-producing generator
iter_func | ( | self | ) |
Iterate on the arguments contained in this function prototype Example: address = ... func = ida_funcs.get_func(address) func_type = func.prototype for arg in func_type.iter_func(): print(f"{arg.name}, of type {arg.type}") Will raise an exception if this type is not a function @return a funcarg_t-producing generator
iter_struct | ( | self | ) |
Iterate on the members composing this structure. Example: til = ida_typeinf.get_idati() tif = til.get_named_type("my_struc") for udm in tif.iter_struct(): print(f"{udm.name} at bit offset {udm.offset}") Will raise an exception if this type is not a structure. @return a udm_t-producing generator
iter_udt | ( | self | ) |
Iterate on the members composing this structure, or union. Example: til = ida_typeinf.get_idati() tif = til.get_named_type("my_type") for udm in tif.iter_udt(): print(f"{udm.name} at bit offset {udm.offset} with type {udm.type}") Will raise an exception if this type is not a structure, or union @return a udm_t-producing generator
iter_union | ( | self | ) |
Iterate on the members composing this union. Example: til = ida_typeinf.get_idati() tif = til.get_named_type("my_union") for udm in tif.iter_union(): print(f"{udm.name}, with type {udm.type}") Will raise an exception if this type is not a union. @return a udm_t-producing generator
bool parse | ( | self, | |
str | decl, | ||
'til_t' | til = None, | ||
int | pt_flags = 0 ) |
Convenience function to parse a string with a type declaration @param decl: a type declaration @param til: type library to use @param pt_flags: combination of Type parsing flags bits
bool present | ( | self | ) |
Is the type really present? (not a reference to a missing type, for example)
'uint64' read_bitfield_value | ( | self, | |
'uint64' | v, | ||
int | bitoff ) |
bool remove_ptr_or_array | ( | self | ) |
Replace the current type with the ptr obj or array element. This function performs one of the following conversions: * type[] => type * type* => type If the conversion is performed successfully, return true
'tinfo_code_t' rename_edm | ( | self, | |
'size_t' | idx, | ||
str | name, | ||
'uint' | etf_flags = 0 ) |
Rename a enum member @param idx: index in edmvec_t @param name: new name @param etf_flags: etf_flag_t ETF_FORCENAME may be used in case of TERR_ALIEN_NAME
'tinfo_code_t' rename_funcarg | ( | self, | |
'size_t' | index, | ||
str | name, | ||
'uint' | etf_flags = 0 ) |
Rename a function argument. The new name must be unique. @param index: argument index in the function array @param name: new name @param etf_flags: etf_flag_t
'tinfo_code_t' rename_type | ( | self, | |
str | name, | ||
int | ntf_flags = 0 ) |
Rename a type @param name: new type name @param ntf_flags: Flags for named types
'tinfo_code_t' rename_udm | ( | self, | |
'size_t' | index, | ||
str | name, | ||
'uint' | etf_flags = 0 ) |
Rename a structure/union member. The new name must be unique.
bool requires_qualifier | ( | self, | |
str | name, | ||
'uint64' | offset ) |
Requires full qualifier? (name is not unique) @param name: field name @param offset: field offset in bits @returns if the name is not unique, returns true
'tinfo_code_t' save_type | ( | self, | |
* | args ) |
'PyObject *' serialize | ( | self, | |
* | args ) |
Serialize tinfo_t object into a type string.
bool set_attr | ( | self, | |
'type_attr_t' | ta, | ||
bool | may_overwrite = True ) |
Set a type attribute. If necessary, a new typid will be created.
bool set_attrs | ( | self, | |
'type_attrs_t' | tav ) |
Set type attributes. If necessary, a new typid will be created. this function modifies tav! (returns old attributes, if any) @returns false: bad attributes
None set_const | ( | self | ) |
bool set_declalign | ( | self, | |
'uchar' | declalign ) |
'tinfo_code_t' set_edm_cmt | ( | self, | |
'size_t' | idx, | ||
str | cmt, | ||
'uint' | etf_flags = 0 ) |
Set a comment for an enum member. Such comments are always considered as repeatable. @param idx: index in edmvec_t @param cmt: comment @param etf_flags: etf_flag_t
'tinfo_code_t' set_enum_is_bitmask | ( | self, | |
* | args ) |
'tinfo_code_t' set_enum_radix | ( | self, | |
int | radix, | ||
bool | sign, | ||
'uint' | etf_flags = 0 ) |
Set enum radix to display constants @param radix: radix 2, 4, 8, 16, with the special case 1 to display as character @param sign: display as signed or unsigned @param etf_flags: etf_flag_t
'tinfo_code_t' set_enum_repr | ( | self, | |
'value_repr_t' | repr, | ||
'uint' | etf_flags = 0 ) |
Set the representation of enum members. @param repr: value_repr_t @param etf_flags: etf_flag_t
'tinfo_code_t' set_enum_sign | ( | self, | |
'type_sign_t' | sign, | ||
'uint' | etf_flags = 0 ) |
Set enum sign @param sign: type_sign_t @param etf_flags: etf_flag_t
'tinfo_code_t' set_enum_width | ( | self, | |
int | nbytes, | ||
'uint' | etf_flags = 0 ) |
Set the width of enum base type @param nbytes: width of enum base type, allowed values: 0 (unspecified),1,2,4,8,16,32,64 @param etf_flags: etf_flag_t
'tinfo_code_t' set_fixed_struct | ( | self, | |
bool | on = True ) |
Declare struct member offsets as fixed. For such structures, IDA will not recalculate the member offsets. If a member does not fit into its place anymore, it will be deleted. This function works only with structures (not unions).
'tinfo_code_t' set_func_cc | ( | self, | |
'cm_t' | cc, | ||
'uint' | etf_flags = 0 ) |
Set function calling convention.
'tinfo_code_t' set_func_retloc | ( | self, | |
'argloc_t' | argloc, | ||
'uint' | etf_flags = 0 ) |
Set location of function return value. @param argloc: new location for the return value @param etf_flags: etf_flag_t @returns tinfo_code_t
'tinfo_code_t' set_func_rettype | ( | self, | |
'tinfo_t' | tif, | ||
'uint' | etf_flags = 0 ) |
Set function return type . @param tif: new type for the return type @param etf_flags: etf_flag_t @returns tinfo_code_t
'tinfo_code_t' set_funcarg_loc | ( | self, | |
'size_t' | index, | ||
'argloc_t' | argloc, | ||
'uint' | etf_flags = 0 ) |
Set location of a function argument. @param index: argument index in the function array @param argloc: new location for the argument @param etf_flags: etf_flag_t @returns tinfo_code_t
'tinfo_code_t' set_funcarg_type | ( | self, | |
'size_t' | index, | ||
'tinfo_t' | tif, | ||
'uint' | etf_flags = 0 ) |
Set type of a function argument. @param index: argument index in the function array @param tif: new type for the argument @param etf_flags: etf_flag_t @returns tinfo_code_t
bool set_methods | ( | self, | |
'udtmembervec_t' | methods ) |
BT_COMPLEX: set the list of member functions. This function consumes 'methods' (makes it empty). @returns false if this type is not a udt, or if the given list is empty
None set_modifiers | ( | self, | |
'type_t' | mod ) |
'tinfo_code_t' set_named_type | ( | self, | |
'til_t' | til, | ||
str | name, | ||
int | ntf_flags = 0 ) |
'tinfo_code_t' set_numbered_type | ( | self, | |
'til_t' | til, | ||
int | ord, | ||
int | ntf_flags = 0, | ||
str | name = None ) |
'tinfo_code_t' set_struct_size | ( | self, | |
'size_t' | new_size ) |
Explicitly specify the struct size. This function works only with fixed structures. The new struct size can be equal or higher the unpadded struct size (IOW, all existing members should fit into the specified size). @param new_size: new structure size in bytes
'tinfo_code_t' set_symbol_type | ( | self, | |
'til_t' | til, | ||
str | name, | ||
int | ntf_flags = 0 ) |
bool set_type_alias | ( | self, | |
int | dest_ord ) |
Set type alias Redirects all references to source type to the destination type. This is equivalent to instantaneous replacement all references to srctype by dsttype.
'tinfo_code_t' set_type_alignment | ( | self, | |
'uchar' | declalign, | ||
'uint' | etf_flags = 0 ) |
Set type alignment.
'tinfo_code_t' set_type_cmt | ( | self, | |
str | cmt, | ||
bool | is_regcmt = False, | ||
'uint' | etf_flags = 0 ) |
Set type comment This function works only for non-trivial types
'tinfo_code_t' set_udm_by_til | ( | self, | |
'size_t' | idx, | ||
bool | on = True, | ||
'uint' | etf_flags = 0 ) |
The member is created due to the type system @param idx: index of the member @param etf_flags: etf_flag_t
'tinfo_code_t' set_udm_cmt | ( | self, | |
'size_t' | index, | ||
str | cmt, | ||
bool | is_regcmt = False, | ||
'uint' | etf_flags = 0 ) |
Set a comment for a structure/union member. A member may have just one comment, and it is either repeatable or regular.
'tinfo_code_t' set_udm_repr | ( | self, | |
'size_t' | index, | ||
'value_repr_t' | repr, | ||
'uint' | etf_flags = 0 ) |
Set the representation of a structure/union member.
'tinfo_code_t' set_udm_type | ( | self, | |
'size_t' | index, | ||
'tinfo_t' | tif, | ||
'uint' | etf_flags = 0, | ||
'value_repr_t' | repr = None ) |
Set type of a structure/union member. @param index: member index in the udm array @param tif: new type for the member @param etf_flags: etf_flag_t @param repr: new representation for the member (optional) @returns tinfo_code_t
'tinfo_code_t' set_udt_alignment | ( | self, | |
int | sda, | ||
'uint' | etf_flags = 0 ) |
Set declared structure alignment (sda) This alignment supersedes the alignment returned by get_declalign() and is really used when calculating the struct layout. However, the effective structure alignment may differ from `sda` because of packing. The type editing functions (they accept etf_flags) may overwrite this attribute.
'tinfo_code_t' set_udt_pack | ( | self, | |
int | pack, | ||
'uint' | etf_flags = 0 ) |
Set structure packing. The value controls how little a structure member alignment can be. Example: if pack=1, then it is possible to align a double to a byte. __attribute__((aligned(1))) double x; However, if pack=3, a double will be aligned to 8 (2**3) even if requested to be aligned to a byte. pack==0 will have the same effect. The type editing functions (they accept etf_flags) may overwrite this attribute.
None set_volatile | ( | self | ) |
None swap | ( | self, | |
'tinfo_t' | r ) |
Assign this = r and r = this.
'uint64' write_bitfield_value | ( | self, | |
'uint64' | dst, | ||
'uint64' | v, | ||
int | bitoff ) |
|
static |
|
static |
|
static |
|
static |
|
static |