|
IDAPython 8.4
|
Structure type management (assembly level types)
Classes | |
| class | dyn_member_ref_array |
| Proxy of C++ dynamic_wrapped_array_t< member_t > class. More... | |
| class | member_t |
| Proxy of C++ member_t class. More... | |
| class | struc_t |
| Proxy of C++ struc_t class. More... | |
| class | struct_field_visitor_t |
| Proxy of C++ struct_field_visitor_t class. More... | |
| class | udm_visitor_t |
| Proxy of C++ udm_visitor_t class. More... | |
Functions | |
| "size_t" | get_struc_qty (*args) |
| get_struc_qty() -> size_t Get number of known structures. | |
| "uval_t" | get_first_struc_idx (*args) |
| get_first_struc_idx() -> uval_t Get index of first structure. | |
| "uval_t" | get_last_struc_idx (*args) |
| get_last_struc_idx() -> uval_t Get index of last structure. | |
| "uval_t" | get_prev_struc_idx (*args) |
| get_prev_struc_idx(idx) -> uval_t Get previous struct index. | |
| "uval_t" | get_next_struc_idx (*args) |
| get_next_struc_idx(idx) -> uval_t Get next struct index. | |
| "uval_t" | get_struc_idx (*args) |
| get_struc_idx(id) -> uval_t Get internal number of the structure. | |
| "tid_t" | get_struc_by_idx (*args) |
| get_struc_by_idx(idx) -> tid_t Get struct id by struct number. | |
| "struc_t *" | get_struc (*args) |
| get_struc(id) -> struc_t Get pointer to struct type info. | |
| "tid_t" | get_struc_id (*args) |
| get_struc_id(name) -> tid_t Get struct id by name. | |
| "qstring *" | get_struc_name (*args) |
| get_struc_name(id, flags=0) -> str | |
| "qstring *" | get_struc_cmt (*args) |
| get_struc_cmt(id, repeatable) -> str Get struct comment. | |
| "asize_t" | get_struc_size (*args) |
| get_struc_size(sptr) -> asize_t Get struct size (also see get_struc_size(const struc_t *)) | |
| "ea_t" | get_struc_prev_offset (*args) |
| get_struc_prev_offset(sptr, offset) -> ea_t Get offset of member with largest offset less than 'offset'. | |
| "ea_t" | get_struc_next_offset (*args) |
| get_struc_next_offset(sptr, offset) -> ea_t Get offset of member with smallest offset larger than 'offset'. | |
| "ea_t" | get_struc_last_offset (*args) |
| get_struc_last_offset(sptr) -> ea_t Get offset of last member. | |
| "ea_t" | get_struc_first_offset (*args) |
| get_struc_first_offset(sptr) -> ea_t Get offset of first member. | |
| "void" | unsync_and_delete_struc (*args) |
| unsync_and_delete_struc(sptr) Delete the structure but leave synced ltudt unchanged. | |
| "ea_t" | get_max_offset (*args) |
| get_max_offset(sptr) -> ea_t For unions: returns number of members, for structs: returns size of structure. | |
| "bool" | is_varstr (*args) |
| is_varstr(id) -> bool Is variable size structure? | |
| "bool" | is_union (*args) |
| is_union(id) -> bool Is a union? | |
| "struc_t *" | get_member_struc (*args) |
| get_member_struc(fullname) -> struc_t Get containing structure of member by its full name "struct.field". | |
| "struc_t *" | get_sptr (*args) |
| get_sptr(mptr) -> struc_t Get child struct if member is a struct. | |
| "member_t *" | get_member (*args) |
| get_member(sptr, offset) -> member_t Get member at given offset. | |
| "tid_t" | get_member_id (*args) |
| get_member_id(sptr, offset) -> tid_t Get member id at given offset. | |
| "member_t *" | get_member_by_name (*args) |
| get_member_by_name(sptr, membername) -> member_t Get a member by its name, like "field44". | |
| "struc_t **" | get_member_by_fullname (*args) |
| get_member_by_fullname(fullname) -> member_t Get a member by its fully qualified name, "struct.field". | |
| "qstring *" | get_member_fullname (*args) |
| get_member_fullname(mid) -> str Get a member's fully qualified name, "struct.field". | |
| "qstring *" | get_member_name (*args) |
| get_member_name(mid) -> str | |
| "qstring *" | get_member_cmt (*args) |
| get_member_cmt(mid, repeatable) -> str Get comment of structure member. | |
| "asize_t" | get_member_size (*args) |
| get_member_size(NONNULL_mptr) -> asize_t Get size of structure member. | |
| "bool" | is_varmember (*args) |
| is_varmember(mptr) -> bool Is variable size member? | |
| "member_t *" | get_best_fit_member (*args) |
| get_best_fit_member(sptr, offset) -> member_t Get member that is most likely referenced by the specified offset. | |
| "ssize_t" | get_next_member_idx (*args) |
| get_next_member_idx(sptr, off) -> ssize_t Get the next member idx, if it does not exist, return -1. | |
| "ssize_t" | get_prev_member_idx (*args) |
| get_prev_member_idx(sptr, off) -> ssize_t Get the prev member idx, if it does not exist, return -1. | |
| "tid_t" | add_struc (*args) |
| add_struc(idx, name, is_union=False) -> tid_t Create a structure type. | |
| "bool" | del_struc (*args) |
| del_struc(sptr) -> bool Delete a structure type This function deletes as well local type synced with the structure | |
| "bool" | set_struc_idx (*args) |
| set_struc_idx(sptr, idx) -> bool Set internal number of struct. | |
| "bool" | set_struc_align (*args) |
| set_struc_align(sptr, shift) -> bool Set structure alignment (SF_ALIGN) | |
| "bool" | set_struc_name (*args) |
| set_struc_name(id, name) -> bool Set structure name. | |
| "bool" | set_struc_cmt (*args) |
| set_struc_cmt(id, cmt, repeatable) -> bool Set structure comment. | |
| "struc_error_t" | add_struc_member (*args) |
| add_struc_member(sptr, fieldname, offset, flag, mt, nbytes) -> struc_error_t Add member to existing structure. | |
| "bool" | del_struc_member (*args) |
| del_struc_member(sptr, offset) -> bool Delete member at given offset. | |
| "int" | del_struc_members (*args) |
| del_struc_members(sptr, off1, off2) -> int Delete members which occupy range of offsets (off1..off2). | |
| "bool" | set_member_name (*args) |
| set_member_name(sptr, offset, name) -> bool Set name of member at given offset. | |
| "bool" | set_member_type (*args) |
| set_member_type(sptr, offset, flag, mt, nbytes) -> bool Set type of member at given offset (also see add_struc_member()) | |
| "bool" | set_member_cmt (*args) |
| set_member_cmt(mptr, cmt, repeatable) -> bool Set member comment. | |
| "bool" | expand_struc (*args) |
| expand_struc(sptr, offset, delta, recalc=True) -> bool Expand/Shrink structure type. | |
| "void" | save_struc (*args) |
| save_struc(sptr, may_update_ltypes=True) Update struct information in the database (internal function) | |
| "void" | set_struc_hidden (*args) |
| set_struc_hidden(sptr, is_hidden) Hide/unhide a struct type. | |
| "void" | set_struc_listed (*args) |
| set_struc_listed(sptr, is_listed) Add/remove a struct type from the struct list. | |
| "bool" | get_member_tinfo (*args) |
| get_member_tinfo(tif, mptr) -> bool Get tinfo for given member. | |
| "bool" | del_member_tinfo (*args) |
| del_member_tinfo(sptr, mptr) -> bool Delete tinfo for given member. | |
| "smt_code_t" | set_member_tinfo (*args) |
| set_member_tinfo(sptr, mptr, memoff, tif, flags) -> smt_code_t Set tinfo for given member. | |
| "bool" | get_or_guess_member_tinfo (*args) |
| get_or_guess_member_tinfo(tif, mptr) -> bool Try to get tinfo for given member - if failed, generate a tinfo using information about the member id from the disassembly | |
| "opinfo_t *" | retrieve_member_info (*args) |
| retrieve_member_info(buf, mptr) -> opinfo_t Get operand type info for member. | |
| "bool" | is_anonymous_member_name (*args) |
| is_anonymous_member_name(name) -> bool Is member name prefixed with "anonymous"? | |
| "bool" | is_dummy_member_name (*args) |
| is_dummy_member_name(name) -> bool Is member name an auto-generated name? | |
| "qstring *, struc_t **" | get_member_by_id (*args) |
| get_member_by_id(mid) -> member_t Check if the specified member id points to a struct member. | |
| "bool" | is_member_id (*args) |
| is_member_id(mid) -> bool Is a member id? | |
| "bool" | is_special_member (*args) |
| is_special_member(id) -> bool Is a special member with the name beginning with ' '? | |
| "adiff_t *" | visit_stroff_udms (*args) |
| visit_stroff_udms(sfv, path, disp, appzero) -> int Visit structure fields in a stroff expression or in a reference to a struct data variable. | |
| "bool" | stroff_as_size (*args) |
| stroff_as_size(plen, sptr, value) -> bool | |
| "adiff_t *" | visit_stroff_fields (*args) |
| visit_stroff_fields(sfv, path, disp, appzero) -> flags64_t | |
| "PyObject *" | get_innermost_member (*args) |
Variables | |
| STRUC_SEPARATOR = _ida_struct.STRUC_SEPARATOR | |
| MF_OK = _ida_struct.MF_OK | |
| MF_UNIMEM = _ida_struct.MF_UNIMEM | |
| MF_HASUNI = _ida_struct.MF_HASUNI | |
| MF_BYTIL = _ida_struct.MF_BYTIL | |
| MF_HASTI = _ida_struct.MF_HASTI | |
| MF_BASECLASS = _ida_struct.MF_BASECLASS | |
| MF_DTOR = _ida_struct.MF_DTOR | |
| MF_DUPNAME = _ida_struct.MF_DUPNAME | |
| SF_VAR = _ida_struct.SF_VAR | |
| SF_UNION = _ida_struct.SF_UNION | |
| SF_HASUNI = _ida_struct.SF_HASUNI | |
| SF_NOLIST = _ida_struct.SF_NOLIST | |
| SF_TYPLIB = _ida_struct.SF_TYPLIB | |
| SF_HIDDEN = _ida_struct.SF_HIDDEN | |
| SF_FRAME = _ida_struct.SF_FRAME | |
| SF_ALIGN = _ida_struct.SF_ALIGN | |
| SF_GHOST = _ida_struct.SF_GHOST | |
| SF_ASMTIL = _ida_struct.SF_ASMTIL | |
| STRNFL_REGEX = _ida_struct.STRNFL_REGEX | |
| STRUC_ERROR_MEMBER_OK = _ida_struct.STRUC_ERROR_MEMBER_OK | |
| STRUC_ERROR_MEMBER_NAME = _ida_struct.STRUC_ERROR_MEMBER_NAME | |
| STRUC_ERROR_MEMBER_OFFSET = _ida_struct.STRUC_ERROR_MEMBER_OFFSET | |
| STRUC_ERROR_MEMBER_SIZE = _ida_struct.STRUC_ERROR_MEMBER_SIZE | |
| STRUC_ERROR_MEMBER_TINFO = _ida_struct.STRUC_ERROR_MEMBER_TINFO | |
| STRUC_ERROR_MEMBER_STRUCT = _ida_struct.STRUC_ERROR_MEMBER_STRUCT | |
| STRUC_ERROR_MEMBER_UNIVAR = _ida_struct.STRUC_ERROR_MEMBER_UNIVAR | |
| STRUC_ERROR_MEMBER_VARLAST = _ida_struct.STRUC_ERROR_MEMBER_VARLAST | |
| STRUC_ERROR_MEMBER_NESTED = _ida_struct.STRUC_ERROR_MEMBER_NESTED | |
| STRUC_ERROR_MEMBER_LTUDT = _ida_struct.STRUC_ERROR_MEMBER_LTUDT | |
| SMT_BADARG = _ida_struct.SMT_BADARG | |
| SMT_NOCOMPAT = _ida_struct.SMT_NOCOMPAT | |
| SMT_WORSE = _ida_struct.SMT_WORSE | |
| SMT_SIZE = _ida_struct.SMT_SIZE | |
| SMT_ARRAY = _ida_struct.SMT_ARRAY | |
| SMT_OVERLAP = _ida_struct.SMT_OVERLAP | |
| SMT_FAILED = _ida_struct.SMT_FAILED | |
| SMT_OK = _ida_struct.SMT_OK | |
| SMT_KEEP = _ida_struct.SMT_KEEP | |
| SET_MEMTI_MAY_DESTROY = _ida_struct.SET_MEMTI_MAY_DESTROY | |
| SET_MEMTI_COMPATIBLE = _ida_struct.SET_MEMTI_COMPATIBLE | |
| SET_MEMTI_FUNCARG = _ida_struct.SET_MEMTI_FUNCARG | |
| SET_MEMTI_BYTIL = _ida_struct.SET_MEMTI_BYTIL | |
| SET_MEMTI_USERTI = _ida_struct.SET_MEMTI_USERTI | |
| "tid_t" add_struc | ( | * | args | ) |
if idx==BADADDR then add as the last idx. if name==nullptr then a name will be generated "struct_%d".
| idx | (C++: uval_t) |
| name | (C++: const char *) char const * |
| is_union | (C++: bool) |
| "struc_error_t" add_struc_member | ( | * | args | ) |
| sptr | (C++: struc_t *) structure to modify |
| fieldname | (C++: const char *) if nullptr, then "anonymous_#" name will be generated |
| offset | (C++: ea_t) BADADDR means add to the end of structure |
| flag | (C++: flags64_t) type + representation bits |
| mt | (C++: const opinfo_t *) additional info about member type. must be present for structs, offsets, enums, strings, struct offsets. |
| nbytes | (C++: asize_t) if == 0 then the structure will be a varstruct. in this case the member should be the last member in the structure |
| "bool" del_struc | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| "bool" del_struc_member | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| offset | (C++: ea_t) |
| "int" del_struc_members | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| off1 | (C++: ea_t) |
| off2 | (C++: ea_t) |
| "bool" expand_struc | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| offset | (C++: ea_t) |
| delta | (C++: adiff_t) |
| recalc | (C++: bool) |
| "member_t *" get_best_fit_member | ( | * | args | ) |
| "uval_t" get_first_struc_idx | ( | * | args | ) |
| "PyObject *" get_innermost_member | ( | * | args | ) |
get_innermost_member(sptr, offset) -> (member_t, struc_t, int) Get the innermost member at the given offset @param sptr: the starting structure @param offset: offset into the starting structure @return: - None on failure
| "uval_t" get_last_struc_idx | ( | * | args | ) |
| "ea_t" get_max_offset | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| "member_t *" get_member | ( | * | args | ) |
| "struc_t **" get_member_by_fullname | ( | * | args | ) |
| fullname | (C++: const char *) char const * |
| "qstring *, struc_t **" get_member_by_id | ( | * | args | ) |
convenience function.
| mid | (C++: tid_t) |
| "member_t *" get_member_by_name | ( | * | args | ) |
| "qstring *" get_member_cmt | ( | * | args | ) |
| mid | (C++: tid_t) |
| repeatable | (C++: bool) |
| "qstring *" get_member_fullname | ( | * | args | ) |
| mid | (C++: tid_t) |
| "tid_t" get_member_id | ( | * | args | ) |
| "qstring *" get_member_name | ( | * | args | ) |
| mid | tid_t |
| "asize_t" get_member_size | ( | * | args | ) |
May return 0 for the last member of varstruct. For union members, returns member_t.eoff.
| "struc_t *" get_member_struc | ( | * | args | ) |
| fullname | (C++: const char *) char const * |
| "bool" get_member_tinfo | ( | * | args | ) |
| "ssize_t" get_next_member_idx | ( | * | args | ) |
| "uval_t" get_next_struc_idx | ( | * | args | ) |
| idx | (C++: uval_t) |
| "bool" get_or_guess_member_tinfo | ( | * | args | ) |
| "ssize_t" get_prev_member_idx | ( | * | args | ) |
| "uval_t" get_prev_struc_idx | ( | * | args | ) |
| idx | (C++: uval_t) |
| "struc_t *" get_struc | ( | * | args | ) |
| id | (C++: tid_t) |
| "tid_t" get_struc_by_idx | ( | * | args | ) |
| idx | (C++: uval_t) |
| "qstring *" get_struc_cmt | ( | * | args | ) |
| id | (C++: tid_t) |
| repeatable | (C++: bool) |
| "ea_t" get_struc_first_offset | ( | * | args | ) |
| "tid_t" get_struc_id | ( | * | args | ) |
| name | (C++: const char *) char const * |
| "uval_t" get_struc_idx | ( | * | args | ) |
| id | (C++: tid_t) |
| "ea_t" get_struc_last_offset | ( | * | args | ) |
| "qstring *" get_struc_name | ( | * | args | ) |
| id | tid_t |
| flags | int |
| "ea_t" get_struc_next_offset | ( | * | args | ) |
| "ea_t" get_struc_prev_offset | ( | * | args | ) |
| "size_t" get_struc_qty | ( | * | args | ) |
| "asize_t" get_struc_size | ( | * | args | ) |
| "bool" is_anonymous_member_name | ( | * | args | ) |
| name | (C++: const char *) char const * |
| "bool" is_dummy_member_name | ( | * | args | ) |
| name | (C++: const char *) char const * |
| "bool" is_member_id | ( | * | args | ) |
| mid | (C++: tid_t) |
| "bool" is_special_member | ( | * | args | ) |
| id | (C++: tid_t) |
| "bool" is_union | ( | * | args | ) |
| id | (C++: tid_t) |
| "bool" is_varstr | ( | * | args | ) |
| id | (C++: tid_t) |
| "opinfo_t *" retrieve_member_info | ( | * | args | ) |
| "void" save_struc | ( | * | args | ) |
| "bool" set_member_cmt | ( | * | args | ) |
| mptr | (C++: member_t *) |
| cmt | (C++: const char *) char const * |
| repeatable | (C++: bool) |
| "bool" set_member_name | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| offset | (C++: ea_t) |
| name | (C++: const char *) char const * |
| "smt_code_t" set_member_tinfo | ( | * | args | ) |
| "bool" set_member_type | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| offset | (C++: ea_t) |
| flag | (C++: flags64_t) |
| mt | (C++: const opinfo_t *) opinfo_t const * |
| nbytes | (C++: asize_t) |
| "bool" set_struc_align | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| shift | (C++: int) |
| "bool" set_struc_cmt | ( | * | args | ) |
| id | (C++: tid_t) |
| cmt | (C++: const char *) char const * |
| repeatable | (C++: bool) |
| "void" set_struc_hidden | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| is_hidden | (C++: bool) |
| "bool" set_struc_idx | ( | * | args | ) |
Also see get_struc_idx(), get_struc_by_idx().
| "void" set_struc_listed | ( | * | args | ) |
| sptr | (C++: struc_t *) |
| is_listed | (C++: bool) |
| "bool" set_struc_name | ( | * | args | ) |
| id | (C++: tid_t) |
| name | (C++: const char *) char const * |
| "bool" stroff_as_size | ( | * | args | ) |
| plen | int |
| sptr | struc_t const * |
| value | asize_t |
stroff_as_size(plen, tif, value) -> bool
| plen | int |
| tif | tinfo_t const & |
| value | asize_t |
| "void" unsync_and_delete_struc | ( | * | args | ) |
Note del_struc() deletes both ASM struc and the corresponding local type
| sptr | (C++: struc_t *) |
| "adiff_t *" visit_stroff_fields | ( | * | args | ) |
| sfv | struct_field_visitor_t & |
| path | tid_t const * |
| disp | adiff_t * |
| appzero | bool |
| "adiff_t *" visit_stroff_udms | ( | * | args | ) |
This function can be used to enumerate all components of an expression like 'a.b.c'.
| sfv | (C++: udm_visitor_t &) visitor object |
| path | (C++: const tid_t *) struct path (path[0] contains the initial struct id) |
| disp | (C++: adiff_t *) offset into structure |
| appzero | (C++: bool) should visit field at offset zero? |
| MF_BASECLASS = _ida_struct.MF_BASECLASS |
| MF_BYTIL = _ida_struct.MF_BYTIL |
| MF_DTOR = _ida_struct.MF_DTOR |
| MF_DUPNAME = _ida_struct.MF_DUPNAME |
| MF_HASTI = _ida_struct.MF_HASTI |
| MF_HASUNI = _ida_struct.MF_HASUNI |
| MF_OK = _ida_struct.MF_OK |
| MF_UNIMEM = _ida_struct.MF_UNIMEM |
| SET_MEMTI_BYTIL = _ida_struct.SET_MEMTI_BYTIL |
| SET_MEMTI_COMPATIBLE = _ida_struct.SET_MEMTI_COMPATIBLE |
| SET_MEMTI_FUNCARG = _ida_struct.SET_MEMTI_FUNCARG |
| SET_MEMTI_MAY_DESTROY = _ida_struct.SET_MEMTI_MAY_DESTROY |
| SET_MEMTI_USERTI = _ida_struct.SET_MEMTI_USERTI |
| SF_ALIGN = _ida_struct.SF_ALIGN |
| SF_ASMTIL = _ida_struct.SF_ASMTIL |
| SF_FRAME = _ida_struct.SF_FRAME |
| SF_GHOST = _ida_struct.SF_GHOST |
| SF_HASUNI = _ida_struct.SF_HASUNI |
| SF_HIDDEN = _ida_struct.SF_HIDDEN |
| SF_NOLIST = _ida_struct.SF_NOLIST |
| SF_TYPLIB = _ida_struct.SF_TYPLIB |
| SF_UNION = _ida_struct.SF_UNION |
| SF_VAR = _ida_struct.SF_VAR |
| SMT_ARRAY = _ida_struct.SMT_ARRAY |
| SMT_BADARG = _ida_struct.SMT_BADARG |
| SMT_FAILED = _ida_struct.SMT_FAILED |
| SMT_KEEP = _ida_struct.SMT_KEEP |
| SMT_NOCOMPAT = _ida_struct.SMT_NOCOMPAT |
| SMT_OK = _ida_struct.SMT_OK |
| SMT_OVERLAP = _ida_struct.SMT_OVERLAP |
| SMT_SIZE = _ida_struct.SMT_SIZE |
| SMT_WORSE = _ida_struct.SMT_WORSE |
| STRNFL_REGEX = _ida_struct.STRNFL_REGEX |
| STRUC_ERROR_MEMBER_LTUDT = _ida_struct.STRUC_ERROR_MEMBER_LTUDT |
| STRUC_ERROR_MEMBER_NAME = _ida_struct.STRUC_ERROR_MEMBER_NAME |
| STRUC_ERROR_MEMBER_NESTED = _ida_struct.STRUC_ERROR_MEMBER_NESTED |
| STRUC_ERROR_MEMBER_OFFSET = _ida_struct.STRUC_ERROR_MEMBER_OFFSET |
| STRUC_ERROR_MEMBER_OK = _ida_struct.STRUC_ERROR_MEMBER_OK |
| STRUC_ERROR_MEMBER_SIZE = _ida_struct.STRUC_ERROR_MEMBER_SIZE |
| STRUC_ERROR_MEMBER_STRUCT = _ida_struct.STRUC_ERROR_MEMBER_STRUCT |
| STRUC_ERROR_MEMBER_TINFO = _ida_struct.STRUC_ERROR_MEMBER_TINFO |
| STRUC_ERROR_MEMBER_UNIVAR = _ida_struct.STRUC_ERROR_MEMBER_UNIVAR |
| STRUC_ERROR_MEMBER_VARLAST = _ida_struct.STRUC_ERROR_MEMBER_VARLAST |
| STRUC_SEPARATOR = _ida_struct.STRUC_SEPARATOR |