def by_index(index): '''Return the identifier for the enumeration at the specified `index`.''' res = idaapi.getn_enum(index) if res == idaapi.BADADDR: raise E.EnumerationNotFoundError( u"{:s}.by_index({:#x}) : Unable to locate enumeration by the index {:d}." .format(__name__, index, index)) return res
def by_index(index): '''Return an enum id at the specified ``index``.''' res = idaapi.getn_enum(index) if res == idaapi.BADADDR: raise LookupError( "{:s}.by_index({:x}) : Unable to locate enumeration.".format( __name__, index)) return res
def handle_enums(delta, segs): for idx in range(idaapi.get_enum_qty()): e = idaapi.getn_enum(idx) for cmt_type in (True, False): cmt = idaapi.get_enum_cmt(e, cmt_type) if cmt: new_cmt = rebase_comment(segs, delta, cmt) if new_cmt: idaapi.set_enum_cmt(e, new_cmt, cmt_type) idaapi.for_all_enum_members(e, enum_memb_visitor(segs, delta))
def __init__(self): #Is this the right way to iterate through enums? Holes? self.elts = [] for i in range(idaapi.get_enum_qty()): self.elts.append(enum_node(idaapi.getn_enum(i)))
def __iterate__(): '''Yield the identifier of each enumeration within the database.''' for item in range(idaapi.get_enum_qty()): yield idaapi.getn_enum(item) return
def _iter_enum_ids(): """Iterate the IDs of all enums in the IDB""" for index in xrange(idaapi.get_enum_qty()): yield idaapi.getn_enum(index)
def __iterate__(): '''Yield the identifier of each enumeration within the database.''' for n in six.moves.range(idaapi.get_enum_qty()): yield idaapi.getn_enum(n) return
def by_index(index): '''Return the identifier for the enumeration at the specified `index`.''' res = idaapi.getn_enum(index) if res == idaapi.BADADDR: raise E.EnumerationNotFoundError(u"{:s}.by_index({:#x}) : Unable to locate enumeration by the index {:d}.".format(__name__, index, index)) return res
def byIndex(index): '''Return an enum id by it's /index/''' res = idaapi.getn_enum(index) if res == idaapi.BADADDR: raise Exception, "enum.byIndex(%x):unable to locate enumeration"% index return res
def iterate(): '''Yield the identifier of each defined enumeration''' for n in xrange(idaapi.get_enum_qty()): yield idaapi.getn_enum(n) return
def __iterate__(): '''Iterate through all enumeration ids defined in the database.''' for n in __builtin__.range(idaapi.get_enum_qty()): yield idaapi.getn_enum(n) return