Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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))
Esempio n. 4
0
 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)))
Esempio n. 5
0
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
Esempio n. 6
0
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)
Esempio n. 7
0
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
Esempio n. 8
0
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
Esempio n. 9
0
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
Esempio n. 10
0
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
Esempio n. 11
0
def iterate():
    '''Yield the identifier of each defined enumeration'''
    for n in xrange(idaapi.get_enum_qty()):
        yield idaapi.getn_enum(n)
    return
Esempio n. 12
0
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
Esempio n. 13
0
 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)))