Spotted an interesting problem when trying to determine which type of structure (since isStruct(getFlags(ea))
returns True
) is defined at the given address in the DB. Reading through idc.py
didn't help much.
- Define a
struct
in the "structures" window. - It gets assigned a
struct
ID, so, it can be accessed from IDC/Python scripts. - Now, define a
struct
variable somewhere in e.g. the.data
section.
A solid example:
# Some Python code
strid = idaapi.get_struc_id('_s__RTTIClassHierarchyDescriptor')
size = idaapi.get_struc_size(strid)
idaapi.doStruct(ea, size, strid)
How, knowing the ea
, do I get the strid
value ?