Exemple #1
0
 def _each(enum):
     bmask = -1&mask(enum)
     res = idaapi.get_first_enum_member(enum, bmask)
     yield res
     while res != idaapi.get_last_enum_member(enum, bmask):
         res = idaapi.get_next_enum_member(enum, res, bmask)
         yield res
     return
Exemple #2
0
 def __iterate__(cls, eid):
     bmask = -1 & mask(eid)
     res = idaapi.get_first_enum_member(eid, bmask)
     if res == idaapi.BADADDR: return
     yield res
     while res != idaapi.get_last_enum_member(eid, bmask):
         res = idaapi.get_next_enum_member(eid, res, bmask)
         yield res
     return
Exemple #3
0
def _iter_enum_member_values(eid, bitmask):
    """Iterate member values with given bitmask inside the enum

    Note that 0xFFFFFFFF can either indicate end-of-values or a valid value.
    Iterate serials to tell apart.
    """
    value = idaapi.get_first_enum_member(eid, bitmask)

    yield value
    while value != 0xFFFFFFFF:
        value = idaapi.get_next_enum_member(eid, value, bitmask)
        yield value
Exemple #4
0
    def __iterate__(cls, eid):
        '''Iterate through all the members of the enumeration identified by `eid`.'''
        bmask = idaapi.BADADDR & mask(eid)

        res = idaapi.get_first_enum_member(eid, bmask)
        if res == idaapi.BADADDR: return

        yield res

        while res != idaapi.get_last_enum_member(eid, bmask):
            res = idaapi.get_next_enum_member(eid, res, bmask)
            yield res
        return
Exemple #5
0
    def __iterate__(cls, eid):
        '''Iterate through all the members of the enumeration identified by `eid`.'''
        bmask = idaapi.BADADDR & mask(eid)

        res = idaapi.get_first_enum_member(eid, bmask)
        if res == idaapi.BADADDR: return

        yield res

        while res != idaapi.get_last_enum_member(eid, bmask):
            res = idaapi.get_next_enum_member(eid, res, bmask)
            yield res
        return